[GRASS-SVN] r48648 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Oct 5 14:06:04 EDT 2011
Author: cmbarton
Date: 2011-10-05 11:06:04 -0700 (Wed, 05 Oct 2011)
New Revision: 48648
Modified:
grass/trunk/gui/wxpython/gui_modules/wxplot.py
grass/trunk/gui/wxpython/gui_modules/wxplot_dialogs.py
Log:
wxgui: update to fix situation when scatterplot is launched with one map displayed
Modified: grass/trunk/gui/wxpython/gui_modules/wxplot.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxplot.py 2011-10-05 17:41:45 UTC (rev 48647)
+++ grass/trunk/gui/wxpython/gui_modules/wxplot.py 2011-10-05 18:06:04 UTC (rev 48648)
@@ -1052,7 +1052,7 @@
"aqua", "grey", "orange", "brown", "purple", "violet", \
"indigo"]
- if len(self.rasterList) > 0: # set raster name(s) from layer manager if a map is selected
+ if len(self.rasterList) > 1: # set raster name(s) from layer manager if a map is selected
self.InitRasterOpts(self.rasterList, 'scatter')
self._initOpts()
@@ -1080,7 +1080,10 @@
if dlg.ShowModal() == wx.ID_OK:
rlist = dlg.rasterList
- if rlist < 2: return # need at least 2 rasters for scatterplot
+ if rlist < 2:
+ dlg.Destroy()
+ return # need at least 2 rasters for scatterplot
+
self.bins = dlg.bins # bins for r.stats with float and dcell maps
self.scattertype = dlg.scattertype # scatterplot or bubbleplot
self.rasterList = self.CreatePairs(rlist) # list of raster pairs (tuples)
Modified: grass/trunk/gui/wxpython/gui_modules/wxplot_dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxplot_dialogs.py 2011-10-05 17:41:45 UTC (rev 48647)
+++ grass/trunk/gui/wxpython/gui_modules/wxplot_dialogs.py 2011-10-05 18:06:04 UTC (rev 48648)
@@ -138,7 +138,10 @@
rastText = ''
if len(self.rasterList) > 0:
for r in self.rasterList:
- rastText += '%s,%s,' % r
+ if isinstance(r, tuple):
+ rastText += '%s,%s,' % r
+ else:
+ rastText += '%s,' % r
rastText = rastText.rstrip(',')
# select rasters
@@ -1140,5 +1143,4 @@
def OnCancel(self, event):
"""!Button 'Cancel' pressed"""
self.Close()
-
-#### merge with generic options dialog
+
More information about the grass-commit
mailing list