Przeglądaj źródła

quit wxGUI/GRASS
(merge https://trac.osgeo.org/grass/changeset/39672 from devbr6)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@39673 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 15 lat temu
rodzic
commit
3c7dbc72dd
2 zmienionych plików z 21 dodań i 2 usunięć
  1. 14 0
      gui/wxpython/wxgui.py
  2. 7 2
      gui/wxpython/xml/menudata.xml

+ 14 - 0
gui/wxpython/wxgui.py

@@ -27,6 +27,7 @@ import re
 import string
 import getopt
 import platform
+import signal
 
 ### XML 
 try:
@@ -1456,6 +1457,19 @@ class GMFrame(wx.Frame):
                 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"""

+ 7 - 2
gui/wxpython/xml/menudata.xml

@@ -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>