[GRASS-SVN] r67339 - in grass/branches/releasebranch_7_0/gui/wxpython: gui_core lmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 23 03:43:50 PST 2015


Author: martinl
Date: 2015-12-23 03:43:49 -0800 (Wed, 23 Dec 2015)
New Revision: 67339

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py
   grass/branches/releasebranch_7_0/gui/wxpython/lmgr/frame.py
Log:
wxGUI: fix quit end modal issue
       (merge r67338 from trunk)


Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py	2015-12-23 11:37:29 UTC (rev 67338)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py	2015-12-23 11:43:49 UTC (rev 67339)
@@ -2836,11 +2836,8 @@
         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()
+        

Modified: grass/branches/releasebranch_7_0/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/lmgr/frame.py	2015-12-23 11:37:29 UTC (rev 67338)
+++ grass/branches/releasebranch_7_0/gui/wxpython/lmgr/frame.py	2015-12-23 11:43:49 UTC (rev 67339)
@@ -2190,7 +2190,7 @@
 
     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 @@
         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 @@
                                        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 @@
                     # 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',



More information about the grass-commit mailing list