[pgp] Update dialog GUI
This commit is contained in:
@@ -11,9 +11,11 @@
|
||||
</columns>
|
||||
</object>
|
||||
<object class="GtkBox" id="box">
|
||||
<property name="width_request">500</property>
|
||||
<property name="height_request">300</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="border_width">18</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
@@ -62,7 +64,7 @@
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -18,6 +18,7 @@ from pathlib import Path
|
||||
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import Gdk
|
||||
from gi.repository import GLib
|
||||
|
||||
from gajim.common import app
|
||||
|
||||
@@ -64,6 +65,9 @@ class Page(Gtk.Box):
|
||||
self._plugin = plugin
|
||||
self._label = Gtk.Label()
|
||||
self._button = Gtk.Button(label=_('Assign Key'))
|
||||
self._button.get_style_context().add_class('suggested-action')
|
||||
self._button.set_halign(Gtk.Align.CENTER)
|
||||
self._button.set_margin_top(18)
|
||||
self._button.connect('clicked', self._on_assign)
|
||||
|
||||
self._load_key()
|
||||
@@ -101,4 +105,5 @@ class Page(Gtk.Box):
|
||||
self._label.set_text(_('No key assigned'))
|
||||
else:
|
||||
key_id, key_user = key_data
|
||||
self._label.set_text('%s %s' % (key_id, key_user))
|
||||
self._label.set_markup('<b><tt>%s</tt> %s</b>' % \
|
||||
(key_id, GLib.markup_escape_text(key_user)))
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<object class="GtkBox" id="config_box">
|
||||
<property name="width_request">500</property>
|
||||
<property name="height_request">400</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">12</property>
|
||||
@@ -22,8 +20,12 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
<property name="width_request">400</property>
|
||||
<property name="height_request">350</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="border_width">18</property>
|
||||
<property name="transition_type">crossfade</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
from pathlib import Path
|
||||
|
||||
from gi.repository import Gtk
|
||||
from gi.repository import GLib
|
||||
|
||||
from gajim.common import app
|
||||
from gajim.plugins.plugins_i18n import _
|
||||
@@ -30,7 +31,7 @@ class KeyDialog(Gtk.Dialog):
|
||||
|
||||
self.set_transient_for(transient)
|
||||
self.set_resizable(True)
|
||||
self.set_default_size(500, 300)
|
||||
self.set_default_size(450, -1)
|
||||
|
||||
self._plugin = plugin
|
||||
self._jid = jid
|
||||
@@ -38,10 +39,14 @@ class KeyDialog(Gtk.Dialog):
|
||||
|
||||
self._label = Gtk.Label()
|
||||
|
||||
self._assign_button = Gtk.Button(label='assign')
|
||||
self._assign_button = Gtk.Button(label=_('Assign Key'))
|
||||
self._assign_button.get_style_context().add_class('suggested-action')
|
||||
self._assign_button.set_halign(Gtk.Align.CENTER)
|
||||
self._assign_button.set_margin_top(18)
|
||||
self._assign_button.connect('clicked', self._choose_key)
|
||||
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
box.set_border_width(18)
|
||||
box.add(self._label)
|
||||
box.add(self._assign_button)
|
||||
|
||||
@@ -82,7 +87,8 @@ class KeyDialog(Gtk.Dialog):
|
||||
self._label.set_text(_('No key assigned'))
|
||||
else:
|
||||
key_id, key_user = key_data
|
||||
self._label.set_text('%s %s' % (key_id, key_user))
|
||||
self._label.set_markup('<b><tt>%s</tt> %s</b>' % \
|
||||
(key_id, GLib.markup_escape_text(key_user)))
|
||||
|
||||
|
||||
class ChooseGPGKeyDialog(Gtk.Dialog):
|
||||
@@ -97,8 +103,8 @@ class ChooseGPGKeyDialog(Gtk.Dialog):
|
||||
self.set_resizable(True)
|
||||
self.set_default_size(500, 300)
|
||||
|
||||
self.add_button(_('OK'), Gtk.ResponseType.OK)
|
||||
self.add_button(_('Cancel'), Gtk.ResponseType.CANCEL)
|
||||
self.add_button(_('OK'), Gtk.ResponseType.OK)
|
||||
|
||||
self._selected_key = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user