[GRASS-SVN] r39672 - in grass/branches/develbranch_6/gui/wxpython: . xml

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Nov 3 07:08:40 EST 2009


Author: martinl
Date: 2009-11-03 07:08:39 -0500 (Tue, 03 Nov 2009)
New Revision: 39672

Modified:
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
   grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml
Log:
quit wxGUI/GRASS


Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2009-11-03 10:59:55 UTC (rev 39671)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2009-11-03 12:08:39 UTC (rev 39672)
@@ -27,6 +27,7 @@
 import string
 import getopt
 import platform
+import signal
 
 ### XML 
 try:
@@ -1501,6 +1502,19 @@
                 self.OnAddVector(None)
         
         event.Skip()
+
+    def OnQuit(self, event):
+        """!Quit GRASS"""
+        # quit wxGUI session
+        self.OnCloseWindow(event)
+
+        # quit GRASS shell
+        try:
+            pid = os.environ['GRASS_SHELL_PID']
+        except KeyError:
+            return
+
+        os.kill(int(pid), signal.SIGQUIT)
         
     def OnCloseWindow(self, event):
         """!Cleanup when wxGUI is quit"""

Modified: grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml	2009-11-03 10:59:55 UTC (rev 39671)
+++ grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml	2009-11-03 12:08:39 UTC (rev 39672)
@@ -644,9 +644,14 @@
 	</menuitem>
 	<separator />
 	<menuitem>
-	  <label>E&amp;xit</label>
-	  <help>Quit GUI</help>
+	  <label>Quit GUI</label>
+	  <help>Quit wxGUI session</help>
 	  <handler>self.OnCloseWindow</handler>
+	</menuitem>
+	<menuitem>
+	  <label>Quit GRASS GIS</label>
+	  <help>Quit GRASS session including wxGUI</help>
+	  <handler>self.OnQuit</handler>
 	  <shortcut>Ctrl+Q</shortcut>
 	</menuitem>
       </items>



More information about the grass-commit mailing list