[GRASS-SVN] r57101 - in grass/trunk/gui/wxpython: gui_core mapdisp

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jul 14 02:33:10 PDT 2013


Author: wenzeslaus
Date: 2013-07-14 02:33:10 -0700 (Sun, 14 Jul 2013)
New Revision: 57101

Modified:
   grass/trunk/gui/wxpython/gui_core/mapdisp.py
   grass/trunk/gui/wxpython/gui_core/toolbars.py
   grass/trunk/gui/wxpython/mapdisp/frame.py
   grass/trunk/gui/wxpython/mapdisp/mapwindow.py
Log:
wxGUI/mapwindow: removing direct StatusbarUpdate calls from mapwindow, replaced by zoomChanged signal (statusbar text partialy broken, temporarily)

Modified: grass/trunk/gui/wxpython/gui_core/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/mapdisp.py	2013-07-14 09:22:09 UTC (rev 57100)
+++ grass/trunk/gui/wxpython/gui_core/mapdisp.py	2013-07-14 09:33:10 UTC (rev 57101)
@@ -242,6 +242,7 @@
        
     def StatusbarUpdate(self):
         """!Update statusbar content"""
+        Debug.msg(5, "MapFrameBase.StatusbarUpdate()")
         self.statusbarManager.Update()
         
     def IsAutoRendered(self):

Modified: grass/trunk/gui/wxpython/gui_core/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/toolbars.py	2013-07-14 09:22:09 UTC (rev 57100)
+++ grass/trunk/gui/wxpython/gui_core/toolbars.py	2013-07-14 09:33:10 UTC (rev 57101)
@@ -205,6 +205,7 @@
         try:
             id = getattr(self, tool)
         except AttributeError:
+            # this should raise an error
             return
         
         self.EnableTool(id, enable)

Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py	2013-07-14 09:22:09 UTC (rev 57100)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py	2013-07-14 09:33:10 UTC (rev 57101)
@@ -165,6 +165,7 @@
         self.MapWindow2D.mouseHandlerUnregistered.connect(self.ResetPointer)
 
         self.MapWindow2D.InitZoomHistory()
+        self.MapWindow2D.zoomChanged.connect(self.StatusbarUpdate)
 
         self._giface.updateMap.connect(self.MapWindow2D.UpdateMap)
         # default is 2D display mode
@@ -1352,4 +1353,6 @@
         bar = self.statusbarManager.GetProgressBar()
         bar.SetRange(range)
         bar.SetValue(value)
-        self.SetStatusText(text)
+        # minimalize the damage in the status bar text
+        if text:
+            self.SetStatusText(text)

Modified: grass/trunk/gui/wxpython/mapdisp/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/mapwindow.py	2013-07-14 09:22:09 UTC (rev 57100)
+++ grass/trunk/gui/wxpython/mapdisp/mapwindow.py	2013-07-14 09:33:10 UTC (rev 57101)
@@ -1072,10 +1072,7 @@
         
         # redraw map
         self.UpdateMap()
-        
-        # update statusbar
-        self.frame.StatusbarUpdate()
-        
+
         self.Refresh()
         self.processMouse = True
         
@@ -1186,10 +1183,7 @@
 
             # redraw map
             self.UpdateMap(render = True)
-            
-            # update statusbar
-            self.frame.StatusbarUpdate()
-            
+
         elif self.mouse["use"] == "query":
             self.mapQueried.emit(x=self.mouse['end'][0], y=self.mouse['end'][1])
 
@@ -1324,10 +1318,7 @@
         
         # redraw map
         self.UpdateMap(render = True)
-        
-        # update statusbar
-        self.frame.StatusbarUpdate()
-        
+
     def OnMouseEnter(self, event):
         """!Mouse entered window and no mouse buttons were pressed
         """
@@ -1527,9 +1518,6 @@
                            update = True)
         # update map
         self.UpdateMap()
-        
-        # update statusbar
-        self.frame.StatusbarUpdate()
 
         self.zoomChanged.emit()
 
@@ -1540,6 +1528,10 @@
         Emits zoomHistoryAvailable signal when stack is not empty.
         Emits zoomHistoryUnavailable signal when stack is empty.
 
+        All methods which are changing zoom should call this method
+        to make a record in the history. The signal zoomChanged will be
+        then emitted automatically.
+
         @param n,s,e,w north, south, east, west
 
         @return removed history item if exists (or None)
@@ -1637,9 +1629,7 @@
         
         if render:
             self.UpdateMap()
-        
-        self.frame.StatusbarUpdate()
-        
+
     def ZoomToWind(self):
         """!Set display geometry to match computational region
         settings (set with g.region)
@@ -1650,8 +1640,6 @@
                          self.Map.region['e'], self.Map.region['w'])
         
         self.UpdateMap()
-        
-        self.frame.StatusbarUpdate()
 
     def ZoomToDefault(self):
         """!Set display geometry to match default region settings
@@ -1663,10 +1651,7 @@
                          self.Map.region['e'], self.Map.region['w'])
         
         self.UpdateMap()
-        
-        self.frame.StatusbarUpdate()
-    
-    
+
     def GoTo(self, e, n):
         region = self.Map.GetCurrentRegion()
 



More information about the grass-commit mailing list