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:
authorYann Leboulanger <asterix@lagaule.org>2008-08-11 12:38:35 +0400
committerYann Leboulanger <asterix@lagaule.org>2008-08-11 12:38:35 +0400
commit3184cb24d045d975b78065e0780afa9e999ee9cf (patch)
treea4429ad7c2c4cbdccf2f1700af78e44f2c34aea9
parentdb9440c7c36027fd87a5fd324d140ef2cba07407 (diff)
make ad-hoc cancel warning dialog non-blocking. It was the last blocking dialog ! Fixes #4147
-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: