[GRASS-SVN] r56436 - in grass/trunk/gui/wxpython: lmgr mapdisp wxplot
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon May 27 07:17:29 PDT 2013
Author: martinl
Date: 2013-05-27 07:17:29 -0700 (Mon, 27 May 2013)
New Revision: 56436
Modified:
grass/trunk/gui/wxpython/lmgr/layertree.py
grass/trunk/gui/wxpython/mapdisp/frame.py
grass/trunk/gui/wxpython/wxplot/histogram.py
Log:
wxGUI/histogram(pyplot): avoid dialog for selecting raster when launching tool for context menu or from map display
Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/layertree.py 2013-05-27 14:11:18 UTC (rev 56435)
+++ grass/trunk/gui/wxpython/lmgr/layertree.py 2013-05-27 14:17:29 UTC (rev 56436)
@@ -677,8 +677,7 @@
win.CentreOnScreen()
win.Show()
- win.OnSelectRaster(None)
-
+
def OnUnivariateStats(self, event):
"""!Univariate raster statistics"""
name = self.GetLayerInfo(self.layer_selected, key = 'maplayer').GetName()
Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py 2013-05-27 14:11:18 UTC (rev 56435)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py 2013-05-27 14:17:29 UTC (rev 56436)
@@ -1026,9 +1026,6 @@
win = HistogramPlotFrame(parent = self, rasterList = raster)
win.CentreOnParent()
win.Show()
- # Open raster select dialog to make sure that a raster (and the desired raster)
- # is selected to be histogrammed
- win.OnSelectRaster(None)
def OnScatterplot(self, event):
"""!Init PyPlot scatterplot display canvas and tools
Modified: grass/trunk/gui/wxpython/wxplot/histogram.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/histogram.py 2013-05-27 14:11:18 UTC (rev 56435)
+++ grass/trunk/gui/wxpython/wxplot/histogram.py 2013-05-27 14:17:29 UTC (rev 56436)
@@ -57,7 +57,8 @@
self._initOpts()
if len(self.rasterList) > 0: # set raster name(s) from layer manager if a map is selected
- self.InitRasterOpts(self.rasterList, self.plottype)
+ self.raster = self.InitRasterOpts(self.rasterList, self.plottype)
+ wx.CallAfter(self.OnCreateHist, None)
else:
self.raster = {}
@@ -85,7 +86,7 @@
"""!Select raster map(s) to profile
"""
dlg = HistRasterDialog(parent = self)
-
+
if dlg.ShowModal() == wx.ID_OK:
self.rasterList = dlg.rasterList
self.group = dlg.group
@@ -97,7 +98,7 @@
# plot histogram
if len(self.rasterList) > 0:
self.OnCreateHist(event = None)
-
+
dlg.Destroy()
def SetupHistogram(self):
More information about the grass-commit
mailing list