close passphrases dialog when we are disconnected. Fixes #4702

This commit is contained in:
Yann Leboulanger 2009-03-14 11:30:09 +00:00
parent 4b3206f043
commit 92ee243829
1 changed files with 9 additions and 1 deletions

View File

@ -410,8 +410,13 @@ class PassphraseRequest:
self.keyid = keyid self.keyid = keyid
self.callbacks = [] self.callbacks = []
self.dialog_created = False self.dialog_created = False
self.dialog = None
self.completed = False self.completed = False
def interrupt(self):
self.dialog.window.destroy()
self.callbacks = []
def run_callback(self, account, callback): def run_callback(self, account, callback):
gajim.connections[account].gpg_passphrase(self.passphrase) gajim.connections[account].gpg_passphrase(self.passphrase)
callback() callback()
@ -467,7 +472,7 @@ class PassphraseRequest:
# user failed 3 times, continue without GPG # user failed 3 times, continue without GPG
self.complete(None) self.complete(None)
dialogs.PassphraseDialog(title, second, ok_handler=(_ok, 1), self.dialog = dialogs.PassphraseDialog(title, second, ok_handler=(_ok, 1),
cancel_handler=_cancel) cancel_handler=_cancel)
self.dialog_created = True self.dialog_created = True
@ -609,6 +614,9 @@ class Interface:
# iteration error # iteration error
self.instances[account]['online_dialog'][name].destroy() self.instances[account]['online_dialog'][name].destroy()
del self.instances[account]['online_dialog'][name] del self.instances[account]['online_dialog'][name]
for request in self.gpg_passphrase.values():
if request:
request.interrupt()
if status == 'offline': if status == 'offline':
# sensitivity for this menuitem # sensitivity for this menuitem
if gajim.get_number_of_connected_accounts() == 0: if gajim.get_number_of_connected_accounts() == 0: