Commit 5afe6e47 authored by nkour's avatar nkour

choose_gpg_key_dialog is HIG and code changes title and prompt label

parent 08cb9a71
......@@ -1377,7 +1377,7 @@ _('To change the account name, it must be disconnected.')).get_response()
_('There was a problem retrieving your GPG secret keys.')).get_response()
return
secret_keys['None'] = 'None'
w = dialogs.choose_gpg_key_dialog(secret_keys)
w = dialogs.ChooseGPGKeyDialog(_('Passphrase'), _('Choose your OpenPGP key'), secret_keys)
keyID = w.run()
if keyID == -1:
return
......@@ -1403,13 +1403,13 @@ _('There was a problem retrieving your GPG secret keys.')).get_response()
w.set_text('')
def on_gpg_save_password_checkbutton_toggled(self, widget):
self.on_checkbutton_toggled_and_clear(widget, [\
self.on_checkbutton_toggled_and_clear(widget, [
self.xml.get_widget('gpg_password_entry')])
def on_save_password_checkbutton_toggled(self, widget):
if self.xml.get_widget('new_account_checkbutton').get_active():
return
self.on_checkbutton_toggled_and_clear(widget, \
self.on_checkbutton_toggled_and_clear(widget,
[self.xml.get_widget('password_entry')])
self.xml.get_widget('password_entry').grab_focus()
......
......@@ -148,7 +148,7 @@ class Passphrase_dialog:
self.xml.signal_autoconnect(self)
self.window.show_all()
class choose_gpg_key_dialog:
class ChooseGPGKeyDialog:
'''Class for GPG key dialog'''
def run(self):
'''Wait for Ok button to be pressed and return the selected key'''
......@@ -170,11 +170,14 @@ class choose_gpg_key_dialog:
path = model.get_path(iter)
self.keys_treeview.set_cursor(path)
def __init__(self, secret_keys, selected = None):
def __init__(self, title_text, prompt_text, secret_keys, selected = None):
#list : {keyID: userName, ...}
xml = gtk.glade.XML(GTKGUI_GLADE, 'choose_gpg_key_dialog', APP)
self.window = xml.get_widget('choose_gpg_key_dialog')
self.window.set_title(title_text)
self.keys_treeview = xml.get_widget('keys_treeview')
prompt_label = xml.get_widget('prompt_label')
prompt_label.set_text(prompt_text)
model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
self.keys_treeview.set_model(model)
#columns
......
......@@ -9310,7 +9310,7 @@ Custom</property>
<widget class="GtkDialog" id="choose_gpg_key_dialog">
<property name="border_width">6</property>
<property name="title" translatable="yes">Passphrase</property>
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
......@@ -9380,9 +9380,9 @@ Custom</property>
<property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="label251">
<widget class="GtkLabel" id="prompt_label">
<property name="visible">True</property>
<property name="label" translatable="yes">Choose your OpenPGP key</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
......
......@@ -475,7 +475,8 @@ class Roster_window:
keyID = attached_keys[2*i+1]
public_keys = gajim.connections[account].ask_gpg_keys()
public_keys['None'] = 'None'
w = dialogs.choose_gpg_key_dialog(public_keys, keyID)
w = dialogs.ChooseGPGKeyDialog(_('Assign PGP Key'), _('Select a key to apply to the contact'),
public_keys, keyID)
keyID = w.run()
if keyID == -1:
return
......
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