Remove useless import and fix GPG private key dialog.

Do not fail when no key is selected.
This commit is contained in:
Stephan Erb 2007-12-28 15:13:41 +00:00
parent a03009d1e2
commit 2e59feab3b
2 changed files with 4 additions and 6 deletions

View File

@ -1362,8 +1362,6 @@ class AccountsWindow:
self.accounts_treeview = self.xml.get_widget('accounts_treeview') self.accounts_treeview = self.xml.get_widget('accounts_treeview')
self.remove_button = self.xml.get_widget('remove_button') self.remove_button = self.xml.get_widget('remove_button')
self.rename_button = self.xml.get_widget('rename_button') self.rename_button = self.xml.get_widget('rename_button')
#FIXME: I don't understand why this import is necessary
import os
path_to_kbd_input_img = os.path.join(gajim.DATA_DIR, 'pixmaps', path_to_kbd_input_img = os.path.join(gajim.DATA_DIR, 'pixmaps',
'kbd_input.png') 'kbd_input.png')
img = self.xml.get_widget('rename_image') img = self.xml.get_widget('rename_image')

View File

@ -351,9 +351,9 @@ class ChooseGPGKeyDialog:
def run(self): def run(self):
rep = self.window.run() rep = self.window.run()
if rep == gtk.RESPONSE_OK:
selection = self.keys_treeview.get_selection() selection = self.keys_treeview.get_selection()
(model, iter) = selection.get_selected() (model, iter) = selection.get_selected()
if iter and rep == gtk.RESPONSE_OK:
keyID = [ model[iter][0].decode('utf-8'), keyID = [ model[iter][0].decode('utf-8'),
model[iter][1].decode('utf-8') ] model[iter][1].decode('utf-8') ]
else: else: