[GRASS-SVN] r29976 - in grass/trunk/gui/wxpython: . vdigit
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Feb 6 05:20:02 EST 2008
Author: martinl
Date: 2008-02-06 05:20:01 -0500 (Wed, 06 Feb 2008)
New Revision: 29976
Modified:
grass/trunk/gui/wxpython/vdigit/vertex.cpp
grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: fix broken menu
Modified: grass/trunk/gui/wxpython/vdigit/vertex.cpp
===================================================================
--- grass/trunk/gui/wxpython/vdigit/vertex.cpp 2008-02-06 08:52:37 UTC (rev 29975)
+++ grass/trunk/gui/wxpython/vdigit/vertex.cpp 2008-02-06 10:20:01 UTC (rev 29976)
@@ -29,7 +29,7 @@
\param snap snap mode (see vector/v.edit/lib/vedit.h)
\param thresh threshold value to identify vertex position
- \param 1 vertex added/removed
+ \param 1 vertex moved
\param 0 nothing changed
\param -1 error
*/
Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py 2008-02-06 08:52:37 UTC (rev 29975)
+++ grass/trunk/gui/wxpython/wxgui.py 2008-02-06 10:20:01 UTC (rev 29976)
@@ -406,15 +406,17 @@
except: # already list?
cmdlist = cmd
- # This section is not completed and breaks the menu. Uncomment when completed and tested
- #layer = self.curr_page.maptree.layer_selected
- #name = self.curr_page.maptree.GetPyData(layer)[0]['maplayer'].name
- #type = self.curr_page.maptree.GetPyData(layer)[0]['type']
- #if len(cmdlist) == 1: # only if no paramaters given
- # if type == 'raster' and cmdlist[0][0] == 'r' and cmdlist[0][1] != '3':
- # cmdlist.append(name) # TODO map/input=
- # elif type == 'vector' and cmdlist[0][0] == 'v':
- # cmdlist.append(name) # TODO map/input=
+ try:
+ layer = self.curr_page.maptree.layer_selected
+ name = self.curr_page.maptree.GetPyData(layer)[0]['maplayer'].name
+ type = self.curr_page.maptree.GetPyData(layer)[0]['type']
+ except:
+ layer = None
+ if layer and len(cmdlist) == 1: # only if no paramaters given
+ if type == 'raster' and cmdlist[0][0] == 'r' and cmdlist[0][1] != '3':
+ cmdlist.append(name) # TODO map/input=
+ elif type == 'vector' and cmdlist[0][0] == 'v':
+ cmdlist.append(name) # TODO map/input=
return cmdlist
More information about the grass-commit
mailing list