Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/adhoc_commands.py')
-rw-r--r--src/adhoc_commands.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/adhoc_commands.py b/src/adhoc_commands.py
index ca63f785d..f728eb18d 100644
--- a/src/adhoc_commands.py
+++ b/src/adhoc_commands.py
@@ -54,6 +54,7 @@ class CommandWindow:
self.commandnode = None
self.sessionid = None
self.dataform = None
+ self.allow_stage3_close = False
# retrieving widgets from xml
self.xml = gtkgui_helpers.get_glade('adhoc_commands_window.glade')
@@ -247,18 +248,20 @@ class CommandWindow:
self.window.destroy()
return False
- dialog = dialogs.HigDialog(self.window, gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_MODAL,
- gtk.BUTTONS_YES_NO, _('Cancel confirmation'),
- _('You are in process of executing command. Do you really want to cancel it?'))
- dialog.popup()
- if dialog.get_response()==gtk.RESPONSE_YES:
- self.send_cancel()
- if widget==self.window:
- return False
- else:
- self.window.destroy()
+ if self.allow_stage3_close:
return False
- return True
+
+ def on_yes(button):
+ self.send_cancel()
+ self.allow_stage3_close = True
+ self.window.destroy()
+
+ dialog = dialogs.HigDialog(self.window, gtk.DIALOG_DESTROY_WITH_PARENT | \
+ gtk.DIALOG_MODAL, gtk.BUTTONS_YES_NO, _('Cancel confirmation'),
+ _('You are in process of executing command. Do you really want to '
+ 'cancel it?'), on_response_yes=on_yes)
+ dialog.popup()
+ return True # Block event, don't close window
def stage3_back_button_clicked(self, widget):
self.stage3_submit_form('prev')
@@ -517,4 +520,4 @@ class CommandWindow:
# then send cancel; for now we do nothing
pass
-# vim: se ts=3: \ No newline at end of file
+# vim: se ts=3: