Browse Source

wxGUI: fix quit end modal issue
(merge https://trac.osgeo.org/grass/changeset/67338 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@67339 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 9 years ago
parent
commit
14a576da2e
2 changed files with 5 additions and 9 deletions
  1. 1 4
      gui/wxpython/gui_core/dialogs.py
  2. 4 5
      gui/wxpython/lmgr/frame.py

+ 1 - 4
gui/wxpython/gui_core/dialogs.py

@@ -2836,11 +2836,8 @@ class QuitDialog(wx.Dialog):
         self.Layout()
         
     def OnClose(self, event):
-        self.Close()
         self.EndModal(wx.ID_NO)
-        event.Skip()
 
     def OnQuit(self, event):
-        self.Close()
         self.EndModal(wx.ID_YES)
-        event.Skip()
+        

+ 4 - 5
gui/wxpython/lmgr/frame.py

@@ -2190,7 +2190,7 @@ class GMFrame(wx.Frame):
 
     def OnCloseWindow(self, event):
         """Cleanup when wxGUI is quitted"""
-        self._closeWindow()
+        self._closeWindow(event)
 
     def OnCloseWindowOrExit(self, event):
         """Cleanup when wxGUI is quitted
@@ -2201,11 +2201,11 @@ class GMFrame(wx.Frame):
         ret = dlg.ShowModal()
         dlg.Destroy()
         if ret != wx.ID_CANCEL:
-            self._closeWindow()
+            self._closeWindow(event)
             if ret == wx.ID_YES:
                 self._quitGRASS()
         
-    def _closeWindow(self):
+    def _closeWindow(self, event):
         """Close wxGUI"""
         # save command protocol if actived
         if self.goutput.btnCmdProtocol.GetValue():
@@ -2234,6 +2234,7 @@ class GMFrame(wx.Frame):
                                        style = wx.YES_NO | wx.YES_DEFAULT |
                                        wx.CANCEL | wx.ICON_QUESTION | wx.CENTRE)
                 ret = dlg.ShowModal()
+                dlg.Destroy()
                 if ret == wx.ID_YES:
                     if not self.workspaceFile:
                         self.OnWorkspaceSaveAs()
@@ -2243,9 +2244,7 @@ class GMFrame(wx.Frame):
                     # when called from menu, it gets CommandEvent and not CloseEvent
                     if hasattr(event, 'Veto'):
                         event.Veto()
-                    dlg.Destroy()
                     return
-                dlg.Destroy()
         
         # don't ask any more...
         UserSettings.Set(group = 'manager', key = 'askOnQuit', subkey = 'enabled',