[GRASS-SVN] r63761 - in grass/trunk/gui/wxpython: mapdisp mapwin
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Dec 25 08:32:43 PST 2014
Author: annakrat
Date: 2014-12-25 08:32:43 -0800 (Thu, 25 Dec 2014)
New Revision: 63761
Modified:
grass/trunk/gui/wxpython/mapdisp/frame.py
grass/trunk/gui/wxpython/mapwin/decorations.py
Log:
wxGUI/legend: avoid opening legend window when entering command from gui command line and fix after renaming parameters
Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py 2014-12-25 15:57:13 UTC (rev 63760)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py 2014-12-25 16:32:43 UTC (rev 63761)
@@ -1181,14 +1181,14 @@
continue
param, val = param_val
if param == 'raster':
- self.legend.cmd[idx] = 'rast={rast}'.format(rast=layer.maplayer.name)
+ self.legend.cmd[idx] = 'raster={rast}'.format(rast=layer.maplayer.name)
isMap = True
elif param in ('use', 'range'):
# clear range or use to avoid problems
del self.legend.cmd[idx]
if not isMap: # for the first time
- self.legend.cmd.append('rast=%s' % layer.maplayer.name)
+ self.legend.cmd.append('raster=%s' % layer.maplayer.name)
break
if not showDialog and self.legend.CmdIsValid():
Modified: grass/trunk/gui/wxpython/mapwin/decorations.py
===================================================================
--- grass/trunk/gui/wxpython/mapwin/decorations.py 2014-12-25 15:57:13 UTC (rev 63760)
+++ grass/trunk/gui/wxpython/mapwin/decorations.py 2014-12-25 16:32:43 UTC (rev 63761)
@@ -232,14 +232,17 @@
def CmdIsValid(self):
inputs = 0
- for param in self._cmd:
+ for param in self._cmd[1:]:
param = param.split('=')
- if param[0] == 'raster' and len(param) == 2:
+ if len(param) == 1:
inputs += 1
- elif param[0] == 'raster_3d' and len(param) == 2:
- inputs += 1
- if inputs == 1:
- return True
+ else:
+ if param[0] == 'raster' and len(param) == 2:
+ inputs += 1
+ elif param[0] == 'raster_3d' and len(param) == 2:
+ inputs += 1
+ if inputs == 1:
+ return True
return False
def ResizeLegend(self, begin, end, screenSize):
More information about the grass-commit
mailing list