Changeset 10181

Show
Ignore:
Timestamp:
08/11/08 10:38:35 (3 months ago)
Author:
asterix
Message:

make ad-hoc cancel warning dialog non-blocking. It was the last blocking dialog ! Fixes #4147

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/adhoc_commands.py

    r10081 r10181  
    5555                self.sessionid = None 
    5656                self.dataform = None 
     57                self.allow_stage3_close = False 
    5758 
    5859                # retrieving widgets from xml 
     
    248249                        return False 
    249250 
    250                 dialog = dialogs.HigDialog(self.window, gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_MODAL, 
    251                         gtk.BUTTONS_YES_NO, _('Cancel confirmation'), 
    252                         _('You are in process of executing command. Do you really want to cancel it?')) 
     251                if self.allow_stage3_close: 
     252                        return False 
     253 
     254                def on_yes(button): 
     255                        self.send_cancel() 
     256                        self.allow_stage3_close = True 
     257                        self.window.destroy() 
     258 
     259                dialog = dialogs.HigDialog(self.window, gtk.DIALOG_DESTROY_WITH_PARENT | \ 
     260                        gtk.DIALOG_MODAL, gtk.BUTTONS_YES_NO, _('Cancel confirmation'), 
     261                        _('You are in process of executing command. Do you really want to ' 
     262                        'cancel it?'), on_response_yes=on_yes) 
    253263                dialog.popup() 
    254                 if dialog.get_response()==gtk.RESPONSE_YES: 
    255                         self.send_cancel() 
    256                         if widget==self.window: 
    257                                 return False 
    258                         else: 
    259                                 self.window.destroy() 
    260                         return False 
    261                 return True 
     264                return True # Block event, don't close window 
    262265 
    263266        def stage3_back_button_clicked(self, widget):