[GRASS-SVN] r45643 - in grass/trunk/gui/wxpython: . docs xml
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Mar 12 11:55:37 EST 2011
Author: martinl
Date: 2011-03-12 08:55:37 -0800 (Sat, 12 Mar 2011)
New Revision: 45643
Modified:
grass/trunk/gui/wxpython/docs/wxGUI.html
grass/trunk/gui/wxpython/wxgui.py
grass/trunk/gui/wxpython/xml/menudata.xml
Log:
#1296 (wx gui close shortcuts)
Modified: grass/trunk/gui/wxpython/docs/wxGUI.html
===================================================================
--- grass/trunk/gui/wxpython/docs/wxGUI.html 2011-03-12 15:49:37 UTC (rev 45642)
+++ grass/trunk/gui/wxpython/docs/wxGUI.html 2011-03-12 16:55:37 UTC (rev 45643)
@@ -303,8 +303,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>
@@ -313,20 +320,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/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py 2011-03-12 15:49:37 UTC (rev 45642)
+++ grass/trunk/gui/wxpython/wxgui.py 2011-03-12 16:55:37 UTC (rev 45643)
@@ -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.
@@ -928,6 +928,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)
@@ -935,12 +951,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
@@ -1442,10 +1452,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/trunk/gui/wxpython/xml/menudata.xml
===================================================================
--- grass/trunk/gui/wxpython/xml/menudata.xml 2011-03-12 15:49:37 UTC (rev 45642)
+++ grass/trunk/gui/wxpython/xml/menudata.xml 2011-03-12 16:55:37 UTC (rev 45643)
@@ -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>
@@ -694,7 +728,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