display verified status on snap list and snap info screen
This commit is contained in:
parent
2587b6dd02
commit
7982a35433
|
@ -26,6 +26,7 @@ class SnapInfo:
|
||||||
name = attr.ib()
|
name = attr.ib()
|
||||||
summary = attr.ib()
|
summary = attr.ib()
|
||||||
publisher = attr.ib()
|
publisher = attr.ib()
|
||||||
|
verified = attr.ib()
|
||||||
description = attr.ib()
|
description = attr.ib()
|
||||||
confinement = attr.ib()
|
confinement = attr.ib()
|
||||||
channels = attr.ib(default=attr.Factory(list))
|
channels = attr.ib(default=attr.Factory(list))
|
||||||
|
@ -63,6 +64,7 @@ class SnapListModel:
|
||||||
name=s['name'],
|
name=s['name'],
|
||||||
summary=s['summary'],
|
summary=s['summary'],
|
||||||
publisher=s['developer'],
|
publisher=s['developer'],
|
||||||
|
verified=s['publisher']['validation'] == "verified",
|
||||||
description=s['description'],
|
description=s['description'],
|
||||||
confinement=s['confinement'],
|
confinement=s['confinement'],
|
||||||
)
|
)
|
||||||
|
|
|
@ -61,6 +61,9 @@ STYLES = [
|
||||||
('progress_complete', 'fg', 'neutral'),
|
('progress_complete', 'fg', 'neutral'),
|
||||||
('scrollbar', 'brand', 'bg'),
|
('scrollbar', 'brand', 'bg'),
|
||||||
('scrollbar focus', 'gray', 'bg'),
|
('scrollbar focus', 'gray', 'bg'),
|
||||||
|
|
||||||
|
('verified', 'good', 'bg'),
|
||||||
|
('verified focus', 'good', 'gray'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ import os
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from urwid import (
|
from urwid import (
|
||||||
|
AttrMap,
|
||||||
CheckBox,
|
CheckBox,
|
||||||
LineBox,
|
LineBox,
|
||||||
ListBox as UrwidListBox,
|
ListBox as UrwidListBox,
|
||||||
|
@ -106,11 +107,13 @@ class SnapInfoView(WidgetWrap):
|
||||||
|
|
||||||
self.lb_channels = NoTabCyclingTableListBox(self.channels)
|
self.lb_channels = NoTabCyclingTableListBox(self.channels)
|
||||||
|
|
||||||
|
publisher = _("Publisher: {}").format(snap.publisher)
|
||||||
|
if snap.verified:
|
||||||
|
publisher = [publisher, ('verified', '\N{check mark}')]
|
||||||
|
|
||||||
title = Columns([
|
title = Columns([
|
||||||
Text(snap.name),
|
Text(snap.name),
|
||||||
('pack', Text(
|
('pack', Text(publisher, align='right')),
|
||||||
_("Publisher: {}").format(snap.publisher),
|
|
||||||
align='right')),
|
|
||||||
], dividechars=1)
|
], dividechars=1)
|
||||||
|
|
||||||
contents = [
|
contents = [
|
||||||
|
@ -378,12 +381,19 @@ class SnapListView(BaseView):
|
||||||
log.debug("not offering preseeded snap %r", snap.name)
|
log.debug("not offering preseeded snap %r", snap.name)
|
||||||
continue
|
continue
|
||||||
box = self.snap_boxes[snap.name] = SnapCheckBox(self, snap)
|
box = self.snap_boxes[snap.name] = SnapCheckBox(self, snap)
|
||||||
|
publisher = snap.publisher
|
||||||
|
if snap.verified:
|
||||||
|
publisher = [publisher, ('verified', '\N{check mark}')]
|
||||||
row = [
|
row = [
|
||||||
box,
|
box,
|
||||||
Text(snap.publisher),
|
Text(publisher),
|
||||||
Text(snap.summary, wrap='clip'),
|
Text(snap.summary, wrap='clip'),
|
||||||
]
|
]
|
||||||
body.append(Color.menu_button(TableRow(row)))
|
body.append(AttrMap(
|
||||||
|
TableRow(row),
|
||||||
|
'menu_button',
|
||||||
|
{None: 'menu_button focus', 'verified': 'verified focus'},
|
||||||
|
))
|
||||||
table = NoTabCyclingTableListBox(
|
table = NoTabCyclingTableListBox(
|
||||||
body,
|
body,
|
||||||
colspecs={
|
colspecs={
|
||||||
|
|
Loading…
Reference in New Issue