[GRASS-SVN] r67305 - in grass/branches/releasebranch_7_0/gui/wxpython: gui_core vnet

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Dec 21 07:05:45 PST 2015


Author: annakrat
Date: 2015-12-21 07:05:45 -0800 (Mon, 21 Dec 2015)
New Revision: 67305

Modified:
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/mapdisp.py
   grass/branches/releasebranch_7_0/gui/wxpython/gui_core/toolbars.py
   grass/branches/releasebranch_7_0/gui/wxpython/vnet/toolbars.py
Log:
wxGUI/vnet: fix adding points because of unregistered handler (author: turek) r66434 merged from trunk, revert r66578 in releasebranch

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/mapdisp.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/mapdisp.py	2015-12-21 14:27:33 UTC (rev 67304)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/mapdisp.py	2015-12-21 15:05:45 UTC (rev 67305)
@@ -119,8 +119,9 @@
         Map.region = Map.GetRegion() # g.region -upgc
         # self.Map.SetRegion() # adjust region to match display window
 
-    def _onToggleTool(self):
-        self.GetWindow().UnregisterAllHandlers()
+    def _onToggleTool(self, id):
+        if self._toolSwitcher.IsToolInGroup(id, 'mouseUse'):
+            self.GetWindow().UnregisterAllHandlers()
 
     def OnSize(self, event):
         """Adjust statusbar on changing size"""
@@ -482,9 +483,10 @@
         self.GetFirstWindow().Bind(wx.EVT_ENTER_WINDOW, self.ActivateFirstMap)
         self.GetSecondWindow().Bind(wx.EVT_ENTER_WINDOW, self.ActivateSecondMap)
     
-    def _onToggleTool(self):
-        self.GetFirstWindow().UnregisterAllHandlers()
-        self.GetSecondWindow().UnregisterAllHandlers()
+    def _onToggleTool(self, id): 
+        if self._toolSwitcher.IsToolInGroup(id, 'mouseUse'):
+            self.GetFirstWindow().UnregisterAllHandlers()
+            self.GetSecondWindow().UnregisterAllHandlers()
 
     def GetFirstMap(self):
         """Returns first Map instance

Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/toolbars.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/toolbars.py	2015-12-21 14:27:33 UTC (rev 67304)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/toolbars.py	2015-12-21 15:05:45 UTC (rev 67305)
@@ -332,7 +332,11 @@
         """
         for group in self._toolsGroups[tool]:
             for tb in self._groups[group]:
-                if tb.FindById(tool):
+                if tb == 'custom':
+                    for bid, handler in self._groups[group][tb]:
+                        if tool == bid:
+                            return True
+                elif tb.FindById(tool):
                     return True
         return False
 

Modified: grass/branches/releasebranch_7_0/gui/wxpython/vnet/toolbars.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/vnet/toolbars.py	2015-12-21 14:27:33 UTC (rev 67304)
+++ grass/branches/releasebranch_7_0/gui/wxpython/vnet/toolbars.py	2015-12-21 15:05:45 UTC (rev 67305)
@@ -89,18 +89,6 @@
         pt_id = self.vnet_pts_mgr.GetSelected()
         self.vnet_pts_mgr.DeletePoint(pt_id)
 
-    def OnTool(self, event):
-        """Tool selected - overriden BaseToolbar method to avoid calling UnregisterAllHandlers 
-            through toggleToolChanged signal for certain buttons in the toolbar
-            It is temporary HACK before r66434 will be backported.
-        """
-        id = event.GetId()
-        if self.toolSwitcher:
-            
-            if  self.toolSwitcher.IsToolInGroup(id, 'mouseUse'):
-                self.toolSwitcher.ToolChanged(event.GetId())
-        
-        event.Skip()
 
 class MainToolbar(BaseToolbar):
     """Main toolbar



More information about the grass-commit mailing list