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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Mar 12 11:58:57 EST 2011


Author: martinl
Date: 2011-03-12 08:58:57 -0800 (Sat, 12 Mar 2011)
New Revision: 45644

Modified:
   grass/branches/develbranch_6/gui/wxpython/docs/wxGUI.html
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
   grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml
Log:
#1296 (wx gui close shortcuts)
(merge r45643 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/docs/wxGUI.html
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/docs/wxGUI.html	2011-03-12 16:55:37 UTC (rev 45643)
+++ grass/branches/develbranch_6/gui/wxpython/docs/wxGUI.html	2011-03-12 16:58:57 UTC (rev 45644)
@@ -293,8 +293,15 @@
 
 <h4>Key shortcuts</h4>
 
-<b>Menu</b>
 <dl>
+  <dt>Ctrl+Tab</dt>
+  <dd>Switch 'Map layers' and 'Command output' tab</dd>
+  <dt>Ctrl+Q</dt>
+  <dd>Exit GUI</dd>
+</dl>
+
+<b>Worspace</b>
+<dl>
   <dt>Ctrl+N</dt>
   <dd>Create new workspace</dd>
   <dt>Ctrl+O</dt>
@@ -303,20 +310,12 @@
   <dd>Close workspace</dd>
   <dt>Ctrl+L</dt>
   <dd>Load map layers</dd>
-  <dt>Ctrl+W</dt>
-  <dd>Exit GUI</dd>
-  <dt>Ctrl+Q</dt>
-  <dd>Quit GRASS</dd>
-</dl>
-
-<b>Global</b>
-<dl>
-  <dt>Ctrl+Tab</dt>
-  <dd>Switch 'Map layers' and 'Command output' tab</dd>
   <dt>Ctrl+R</dt>
   <dd>Add raster map layer</dd>
   <dt>Ctrl+V</dt>
   <dd>Add vector map layer</dd>
+  <dt>Ctrl+W</dt>
+  <dd>Close current map display</dd>
 </dl>
 
 <b>Command line prompt</b>

Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2011-03-12 16:55:37 UTC (rev 45643)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2011-03-12 16:58:57 UTC (rev 45644)
@@ -9,7 +9,7 @@
  - GMFrame
  - GMApp
 
-(C) 2006-2010 by the GRASS Development Team
+(C) 2006-2011 by the GRASS Development Team
 This program is free software under the GNU General Public
 License (>=v2). Read the file COPYING that comes with GRASS
 for details.
@@ -927,6 +927,22 @@
         """
         Debug.msg(4, "GMFrame.OnWorkspaceClose(): file=%s" % self.workspaceFile)
         
+        self.OnDisplayCloseAll()
+        self.workspaceFile = None
+        self.workspaceChanged = False
+        self.SetTitle(self.baseTitle)
+        self.disp_idx = 0
+        self.curr_page = None
+        
+    def OnDisplayClose(self, event = None):
+        """!Close current map display window
+        """
+        if self.curr_page and self.curr_page.maptree.mapdisplay:
+            self.curr_page.maptree.mapdisplay.OnCloseWindow(event)
+        
+    def OnDisplayCloseAll(self, event = None):
+        """!Close all open map display windows
+        """
         displays = list()
         for page in range(0, self.gm_cb.GetPageCount()):
             displays.append(self.gm_cb.GetPage(page).maptree.mapdisplay)
@@ -934,12 +950,6 @@
         for display in displays:
             display.OnCloseWindow(event)
         
-        self.workspaceFile = None
-        self.workspaceChanged = False
-        self.SetTitle(self.baseTitle)
-        self.disp_idx = 0
-        self.curr_page = None
-        
     def RulesCmd(self, event):
         """!Launches dialog for commands that need rules input and
         processes rules
@@ -1494,10 +1504,9 @@
         # don't ask any more...
         UserSettings.Set(group = 'manager', key = 'askOnQuit', subkey = 'enabled',
                          value = False)
-
-        for page in range(self.gm_cb.GetPageCount()):
-            self.gm_cb.GetPage(0).maptree.mapdisplay.OnCloseWindow(event)
-
+        
+        self.OnDisplayCloseAll()
+        
         self.gm_cb.DeleteAllPages()
         
         self._auimgr.UnInit()

Modified: grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml	2011-03-12 16:55:37 UTC (rev 45643)
+++ grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml	2011-03-12 16:58:57 UTC (rev 45644)
@@ -49,6 +49,40 @@
 	    </menuitem>
 	  </items>
 	</menu>
+	<menu>
+	  <label>Map display</label>
+	  <items>
+	    <menuitem>
+	      <label>New</label>
+	      <help>Open new map display window</help>
+	      <handler>OnNewDisplay</handler>
+	    </menuitem>
+	    <menuitem>
+	      <label>Close current</label>
+	      <help>Close current map display window</help>
+	      <handler>OnDisplayClose</handler>
+	      <shortcut>Ctrl+W</shortcut>
+	    </menuitem>
+	    <menuitem>
+	      <label>Close all</label>
+	      <help>Close all open map display windows</help>
+	      <handler>OnDisplayCloseAll</handler>
+	    </menuitem>
+	    <separator />
+	    <menuitem>
+	      <label>Add raster</label>
+	      <help>Add raster map layer to current display</help>
+	      <handler>OnAddRaster</handler>
+	      <shortcut>Ctrl+R</shortcut>
+	    </menuitem>
+	    <menuitem>
+	      <label>Add vector</label>
+	      <help>Add vector map layer to current display</help>
+	      <handler>OnAddVector</handler>
+	      <shortcut>Ctrl+V</shortcut>
+	    </menuitem>
+	  </items>
+	</menu>
 	<separator />
 	<menu>
 	  <label>Import raster data</label>
@@ -672,7 +706,7 @@
 	  <label>Exit GUI</label>
 	  <help>Quit wxGUI session</help>
 	  <handler>OnCloseWindow</handler>
-	  <shortcut>Ctrl+W</shortcut>
+	  <shortcut>Ctrl+Q</shortcut>
 	</menuitem>
       </items>
     </menu>



More information about the grass-commit mailing list