From c961463f1075faee7a2e214cfb6629e009e7d76b Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 4 Oct 2010 21:46:39 +0200 Subject: [PATCH] don't close all GPG passphrase request dialogs when an account goes offline. Fixes #5938 --- src/gui_interface.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui_interface.py b/src/gui_interface.py index 0a75be9ce..e85571cf1 100644 --- a/src/gui_interface.py +++ b/src/gui_interface.py @@ -225,7 +225,7 @@ class Interface: del self.instances[account]['online_dialog'][name] for request in self.gpg_passphrase.values(): if request: - request.interrupt() + request.interrupt(account=account) if account in self.pass_dialog: self.pass_dialog[account].window.destroy() if show == 'offline': @@ -3373,9 +3373,15 @@ class PassphraseRequest: self.passphrase = None self.completed = False - def interrupt(self): - self.dialog.window.destroy() - self.callbacks = [] + def interrupt(self, account=None): + if account: + for (acct, cb) in self.callbacks: + if acct == account: + self.callbacks.remove((acct, cb)) + else: + self.callbacks = [] + if not len(self.callbacks): + self.dialog.window.destroy() def run_callback(self, account, callback): gajim.connections[account].gpg_passphrase(self.passphrase)