[GRASS-SVN] r58609 - in grass/trunk/gui/wxpython: mapdisp mapwin

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jan 4 13:47:43 PST 2014


Author: annakrat
Date: 2014-01-04 13:47:43 -0800 (Sat, 04 Jan 2014)
New Revision: 58609

Modified:
   grass/trunk/gui/wxpython/mapdisp/frame.py
   grass/trunk/gui/wxpython/mapwin/analysis.py
Log:
wxGUI: fix ending measuring on display

Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py	2014-01-04 17:27:31 UTC (rev 58608)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py	2014-01-04 21:47:43 UTC (rev 58609)
@@ -858,6 +858,7 @@
         if not self.measureDistController:
             self.measureDistController = MeasureDistanceController(self._giface,
                                                                    mapWindow=self.GetMapWindow())
+            self._toolSwitcher.toggleToolChanged.connect(lambda: self.measureDistController.Stop())
         self.measureDistController.Start()
 
     def OnProfile(self, event):

Modified: grass/trunk/gui/wxpython/mapwin/analysis.py
===================================================================
--- grass/trunk/gui/wxpython/mapwin/analysis.py	2014-01-04 17:27:31 UTC (rev 58608)
+++ grass/trunk/gui/wxpython/mapwin/analysis.py	2014-01-04 21:47:43 UTC (rev 58609)
@@ -205,6 +205,8 @@
         return wx.Pen(colour='green', width=2, style=wx.SHORT_DASH)
 
     def Stop(self, restore=True):
+        if not self.IsActive():
+            return
         AnalysisControllerBase.Stop(self, restore=restore)
 
         self._giface.WriteCmdLog(_('Measuring finished'))
@@ -213,6 +215,8 @@
         """!Init measurement routine that calculates map distance
         along transect drawn on map display
         """
+        if self.IsActive():
+            return
         AnalysisControllerBase.Start(self)
         self._totaldist = 0.0  # total measured distance
 



More information about the grass-commit mailing list