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.remove_button = self.xml.get_widget('remove_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',
'kbd_input.png')
img = self.xml.get_widget('rename_image')

View File

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