From 2e5bd082212534e4bde43cc5ea0144b93816afa3 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 11 Jan 2010 11:15:02 +0100 Subject: [PATCH] [zimio and I] warn user when quitting while file transfers are running. Fixes #2467 --- src/roster_window.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/roster_window.py b/src/roster_window.py index 6c95e94a3..e5df58aa0 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -2305,7 +2305,7 @@ class RosterWindow: get_msg = True break - def on_continue2(message, pep_dict): + def on_continue3(message, pep_dict): self.quit_on_next_offline = 0 accounts_to_disconnect = [] for acct in accounts: @@ -2320,6 +2320,24 @@ class RosterWindow: if not self.quit_on_next_offline: self.quit_gtkgui_interface() + def on_continue2(message, pep_dict): + # check if there is an active file transfer + files_props = gajim.interface.instances['file_transfers'].files_props + transfer_active = False + for x in files_props: + for y in files_props[x]: + if is_transfer_active(files_props[x][y]): + transfer_active = True + break + + if transfer_active: + dialogs.ConfirmationDialog(_('You have running file transfers'), + _('If you quit now, the file(s) being transfered will be ' + 'stopped. Do you still want to quit?'), + on_response_ok=(on_continue3, message, pep_dict)) + return + on_continue3(message, pep_dict) + def on_continue(message, pep_dict): if message is None: # user pressed Cancel to change status message dialog