[omemo] Add Blind Trust Before Verification

Fixes #310
This commit is contained in:
lovetox
2020-06-24 21:08:50 +02:00
parent 50db85fad3
commit 77452756cb
6 changed files with 133 additions and 13 deletions

View File

@@ -47,7 +47,10 @@ TRUST_DATA = {
'warning-color'),
Trust.VERIFIED: ('security-high-symbolic',
_('Verified'),
'encrypted-color')
'encrypted-color'),
Trust.BLIND: ('security-medium-symbolic',
_('Blind Trust'),
'encrypted-color')
}
@@ -352,11 +355,7 @@ class TrustPopver(Gtk.Popover):
self._row = row
self._listbox = Gtk.ListBox()
self._listbox.set_selection_mode(Gtk.SelectionMode.NONE)
if row.trust != Trust.VERIFIED:
self._listbox.add(VerifiedOption())
if row.trust != Trust.UNTRUSTED:
self._listbox.add(NotTrustedOption())
self._listbox.add(DeleteOption())
self.update()
self.add(self._listbox)
self._listbox.show_all()
self._listbox.connect('row-activated', self._activated)
@@ -376,6 +375,8 @@ class TrustPopver(Gtk.Popover):
self._listbox.foreach(self._listbox.remove)
if self._row.trust != Trust.VERIFIED:
self._listbox.add(VerifiedOption())
if self._row.trust != Trust.BLIND:
self._listbox.add(BlindOption())
if self._row.trust != Trust.UNTRUSTED:
self._listbox.add(NotTrustedOption())
self._listbox.add(DeleteOption())
@@ -398,6 +399,17 @@ class MenuOption(Gtk.ListBoxRow):
self.show_all()
class BlindOption(MenuOption):
type_ = Trust.BLIND
icon = 'security-medium-symbolic'
label = _('Blind Trust')
color = 'encrypted-color'
def __init__(self):
MenuOption.__init__(self)
class VerifiedOption(MenuOption):
type_ = Trust.VERIFIED