From 5afe6e4796db41cc0e5224d67e13b572608c5298 Mon Sep 17 00:00:00 2001
From: Nikos Kouremenos <kourem@gmail.com>
Date: Wed, 8 Jun 2005 13:45:30 +0000
Subject: [PATCH] choose_gpg_key_dialog is HIG and code changes title and
 prompt label

---
 src/config.py        | 6 +++---
 src/dialogs.py       | 7 +++++--
 src/gtkgui.glade     | 6 +++---
 src/roster_window.py | 3 ++-
 4 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/config.py b/src/config.py
index b3dd3b7c33..fe0999a93e 100644
--- a/src/config.py
+++ b/src/config.py
@@ -1377,7 +1377,7 @@ def on_gpg_choose_button_clicked(self, widget, data = None):
 _('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 @@ def on_checkbutton_toggled_and_clear(self, widget, widgets):
 				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()
 
diff --git a/src/dialogs.py b/src/dialogs.py
index c3daee468f..a7846ae5b7 100644
--- a/src/dialogs.py
+++ b/src/dialogs.py
@@ -148,7 +148,7 @@ def __init__(self, titletext, labeltext, checkbuttontext):
 		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 @@ def fill_tree(self, list, selected):
 				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
diff --git a/src/gtkgui.glade b/src/gtkgui.glade
index 97a720b192..c2c87fcca0 100644
--- a/src/gtkgui.glade
+++ b/src/gtkgui.glade
@@ -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>
diff --git a/src/roster_window.py b/src/roster_window.py
index b688569ff6..501ec13a7b 100644
--- a/src/roster_window.py
+++ b/src/roster_window.py
@@ -475,7 +475,8 @@ def on_assign_pgp_key(self, widget, user, account):
 				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
-- 
GitLab