[GRASS-SVN] r67338 - in grass/trunk/gui/wxpython: gui_core lmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 23 03:37:29 PST 2015


Author: martinl
Date: 2015-12-23 03:37:29 -0800 (Wed, 23 Dec 2015)
New Revision: 67338

Modified:
   grass/trunk/gui/wxpython/gui_core/dialogs.py
   grass/trunk/gui/wxpython/lmgr/frame.py
Log:
wxGUI: fix quit end modal issue


Modified: grass/trunk/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/dialogs.py	2015-12-23 11:15:03 UTC (rev 67337)
+++ grass/trunk/gui/wxpython/gui_core/dialogs.py	2015-12-23 11:37:29 UTC (rev 67338)
@@ -2146,11 +2146,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/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py	2015-12-23 11:15:03 UTC (rev 67337)
+++ grass/trunk/gui/wxpython/lmgr/frame.py	2015-12-23 11:37:29 UTC (rev 67338)
@@ -2203,7 +2203,7 @@
 
     def OnCloseWindow(self, event):
         """Cleanup when wxGUI is quitted"""
-        self._closeWindow()
+        self._closeWindow(event)
 
     def OnCloseWindowOrExit(self, event):
         """Cleanup when wxGUI is quitted
@@ -2214,11 +2214,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():
@@ -2247,6 +2247,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()
@@ -2256,9 +2257,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