Commit 0d99f3a2 authored by Daniel Brötzmann's avatar Daniel Brötzmann

[pgp] Update dialog GUI

parent 466a4e91
...@@ -11,9 +11,11 @@ ...@@ -11,9 +11,11 @@
</columns> </columns>
</object> </object>
<object class="GtkBox" id="box"> <object class="GtkBox" id="box">
<property name="width_request">500</property>
<property name="height_request">300</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</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="orientation">vertical</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
...@@ -62,7 +64,7 @@ ...@@ -62,7 +64,7 @@
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
</object> </object>
......
...@@ -18,6 +18,7 @@ from pathlib import Path ...@@ -18,6 +18,7 @@ from pathlib import Path
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import Gdk from gi.repository import Gdk
from gi.repository import GLib
from gajim.common import app from gajim.common import app
...@@ -64,6 +65,9 @@ class Page(Gtk.Box): ...@@ -64,6 +65,9 @@ class Page(Gtk.Box):
self._plugin = plugin self._plugin = plugin
self._label = Gtk.Label() self._label = Gtk.Label()
self._button = Gtk.Button(label=_('Assign Key')) 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._button.connect('clicked', self._on_assign)
self._load_key() self._load_key()
...@@ -101,4 +105,5 @@ class Page(Gtk.Box): ...@@ -101,4 +105,5 @@ class Page(Gtk.Box):
self._label.set_text(_('No key assigned')) self._label.set_text(_('No key assigned'))
else: else:
key_id, key_user = key_data 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 @@ ...@@ -3,8 +3,6 @@
<interface> <interface>
<requires lib="gtk+" version="3.20"/> <requires lib="gtk+" version="3.20"/>
<object class="GtkBox" id="config_box"> <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="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="spacing">12</property> <property name="spacing">12</property>
...@@ -22,8 +20,12 @@ ...@@ -22,8 +20,12 @@
</child> </child>
<child> <child>
<object class="GtkStack" id="stack"> <object class="GtkStack" id="stack">
<property name="width_request">400</property>
<property name="height_request">350</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="border_width">18</property>
<property name="transition_type">crossfade</property> <property name="transition_type">crossfade</property>
<child> <child>
<placeholder/> <placeholder/>
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
from pathlib import Path from pathlib import Path
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import GLib
from gajim.common import app from gajim.common import app
from gajim.plugins.plugins_i18n import _ from gajim.plugins.plugins_i18n import _
...@@ -30,7 +31,7 @@ class KeyDialog(Gtk.Dialog): ...@@ -30,7 +31,7 @@ class KeyDialog(Gtk.Dialog):
self.set_transient_for(transient) self.set_transient_for(transient)
self.set_resizable(True) self.set_resizable(True)
self.set_default_size(500, 300) self.set_default_size(450, -1)
self._plugin = plugin self._plugin = plugin
self._jid = jid self._jid = jid
...@@ -38,10 +39,14 @@ class KeyDialog(Gtk.Dialog): ...@@ -38,10 +39,14 @@ class KeyDialog(Gtk.Dialog):
self._label = Gtk.Label() 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) self._assign_button.connect('clicked', self._choose_key)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.set_border_width(18)
box.add(self._label) box.add(self._label)
box.add(self._assign_button) box.add(self._assign_button)
...@@ -82,7 +87,8 @@ class KeyDialog(Gtk.Dialog): ...@@ -82,7 +87,8 @@ class KeyDialog(Gtk.Dialog):
self._label.set_text(_('No key assigned')) self._label.set_text(_('No key assigned'))
else: else:
key_id, key_user = key_data 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): class ChooseGPGKeyDialog(Gtk.Dialog):
...@@ -97,8 +103,8 @@ class ChooseGPGKeyDialog(Gtk.Dialog): ...@@ -97,8 +103,8 @@ class ChooseGPGKeyDialog(Gtk.Dialog):
self.set_resizable(True) self.set_resizable(True)
self.set_default_size(500, 300) self.set_default_size(500, 300)
self.add_button(_('OK'), Gtk.ResponseType.OK)
self.add_button(_('Cancel'), Gtk.ResponseType.CANCEL) self.add_button(_('Cancel'), Gtk.ResponseType.CANCEL)
self.add_button(_('OK'), Gtk.ResponseType.OK)
self._selected_key = None self._selected_key = None
......
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