Commit a587ff70 authored by Daniel Brötzmann's avatar Daniel Brötzmann Committed by Philipp Hörist

[omemo] Add infobar in fingerprints dialog

parent e271f3f9
......@@ -78,6 +78,13 @@ class KeyDialog(Gtk.Dialog):
path = self._plugin.local_file_path('gtk/key.ui')
self._ui = get_builder(path)
markup = '<a href="%s">%s</a>' % (
'https://dev.gajim.org/gajim/gajim-plugins/-/'
'wikis/omemogajimplugin', _('Read more about blind trust.'))
self._ui.btbv_link.set_markup(markup)
self._ui.infobar.set_revealed(
self._plugin.config['SHOW_HELP_FINGERPRINTS'])
self._ui.header.set_text(_('Fingerprints for %s') % self._contact.jid)
omemo_img_path = self._plugin.local_file_path('omemo.png')
......@@ -90,7 +97,7 @@ class KeyDialog(Gtk.Dialog):
ownfpr_format = get_fingerprint(self._identity_key, formatted=True)
self._ui.own_fingerprint.set_text(ownfpr_format)
self.get_content_area().add(self._ui.grid)
self.get_content_area().add(self._ui.box)
self.update()
self._load_qrcode()
......@@ -98,6 +105,11 @@ class KeyDialog(Gtk.Dialog):
self.connect('destroy', self._on_destroy)
self.show_all()
def _on_infobar_response(self, _widget, response):
if response == Gtk.ResponseType.CLOSE:
self._ui.infobar.set_revealed(False)
self._plugin.config['SHOW_HELP_FINGERPRINTS'] = False
def _filter_func(self, row, _user_data):
search_text = self._ui.search.get_text()
if search_text and search_text.lower() not in str(row.jid):
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<!-- Generated with glade 3.36.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="gtk+" version="3.22"/>
<object class="GtkPopover" id="popover">
<property name="can_focus">False</property>
<property name="constrain_to">none</property>
......@@ -9,10 +9,7 @@
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">12</property>
<property name="margin_right">12</property>
<property name="margin_top">12</property>
<property name="margin_bottom">12</property>
<property name="border_width">12</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
......@@ -34,7 +31,6 @@
<object class="GtkImage" id="qrcode">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
<packing>
<property name="expand">False</property>
......@@ -75,156 +71,261 @@ you have to install python-qrcode</property>
</object>
</child>
</object>
<object class="GtkGrid" id="grid">
<object class="GtkBox" id="box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">12</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkScrolledWindow">
<object class="GtkInfoBar" id="infobar">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="vexpand">True</property>
<property name="hscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<property name="min_content_height">270</property>
<property name="overlay_scrolling">False</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="homogeneous">True</property>
<property name="show_close_button">True</property>
<property name="revealed">False</property>
<signal name="response" handler="_on_infobar_response" swapped="no"/>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child internal-child="content_area">
<object class="GtkBox">
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkListBox" id="list">
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="selection_mode">none</property>
<property name="icon_name">dialog-information-symbolic</property>
<property name="icon_size">3</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Click the shield icon to manage trust for each fingerprint.</property>
<property name="wrap">True</property>
<property name="max_width_chars">46</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="btbv_link">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Read more on blind trust.</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">2</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="spacing">11</property>
<property name="border_width">18</property>
<property name="row_spacing">12</property>
<child>
<object class="GtkImage" id="omemo_image">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
<property name="halign">start</property>
<property name="spacing">11</property>
<child>
<object class="GtkImage" id="omemo_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="header">
<property name="visible">True</property>
<property name="can_focus">False</property>
<style>
<class name="dim-label"/>
<class name="bold"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="header">
<object class="GtkMenuButton">
<property name="visible">True</property>
<property name="can_focus">False</property>
<style>
<class name="dim-label"/>
<class name="bold"/>
</style>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="popover">search_popover</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">edit-find-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkMenuButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="direction">up</property>
<property name="popover">popover</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Own Fingerprint</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="spacing">12</property>
<child>
<object class="GtkSwitch">
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<signal name="notify::active" handler="_on_show_inactive" swapped="no"/>
<property name="vexpand">True</property>
<property name="hscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<property name="min_content_height">270</property>
<property name="overlay_scrolling">False</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkListBox" id="list">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="selection_mode">none</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkMenuButton">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Show inactive</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="direction">up</property>
<property name="popover">popover</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Own Fingerprint</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkMenuButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="popover">search_popover</property>
<child>
<object class="GtkImage">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">edit-find-symbolic</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="spacing">12</property>
<child>
<object class="GtkSwitch">
<property name="visible">True</property>
<property name="can_focus">True</property>
<signal name="notify::active" handler="_on_show_inactive" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Show inactive</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
......
......@@ -7,8 +7,6 @@
.omemo-last-seen { font-size: 11px; }
.omemo-key-dialog > box { margin: 18px; }
.omemo-key-dialog scrolledwindow row {
border-bottom: 1px solid;
border-color: @unfocused_borders;
......
......@@ -116,7 +116,8 @@ class OmemoPlugin(GajimPlugin):
self.config_default_values = {
'DISABLED_ACCOUNTS': ([], ''),
'BLIND_TRUST': (True, '')
'BLIND_TRUST': (True, ''),
'SHOW_HELP_FINGERPRINTS': (True, ''),
}
for account in self.config['DISABLED_ACCOUNTS']:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment