[GRASS-SVN] r41375 - in grass/branches/develbranch_6/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 9 06:19:51 EST 2010


Author: martinl
Date: 2010-03-09 06:19:43 -0500 (Tue, 09 Mar 2010)
New Revision: 41375

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/georect.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
Log:
wxGUI: fix zoomback in georect
(merge r41374 from trunk)    


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/georect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/georect.py	2010-03-09 11:01:34 UTC (rev 41374)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/georect.py	2010-03-09 11:19:43 UTC (rev 41375)
@@ -194,6 +194,7 @@
             self.xy_mapdisp.SetTitle(_("GRASS GIS Map Display: 1" +
                                        " - Location: " + self.newlocation +
                                        " (source location)"))
+            self.xy_mapdisp.GetWindow().ResetZoomHistory()
             
             self.gcpmgr.SetMapDisplay(self.xy_mapdisp)
             

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py	2010-03-09 11:01:34 UTC (rev 41374)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py	2010-03-09 11:19:43 UTC (rev 41375)
@@ -2544,8 +2544,7 @@
             self.redrawAll = True
 
     def ZoomBack(self):
-        """!
-        Zoom to previous extents in zoomhistory list
+        """!Zoom to previous extents in zoomhistory list
         """
         zoom = list()
         
@@ -2553,8 +2552,14 @@
             self.zoomhistory.pop()
             zoom = self.zoomhistory[-1]
         
+        # disable tool if stack is empty
         if len(self.zoomhistory) < 2: # disable tool
-            self.parent.toolbars['map'].Enable('zoomback', enable = False)
+            if self.parent.GetName() == 'MapWindow':
+                toolbar = self.parent.toolbars['map']
+            elif self.parent.GetName() == 'GRMapWindow':
+                toolbar = self.parent.toolbars['georect']
+            
+            toolbar.Enable('zoomback', enable = False)
         
         # zoom to selected region
         self.Map.GetRegion(n = zoom[0], s = zoom[1],

Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-03-09 11:01:34 UTC (rev 41374)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-03-09 11:19:43 UTC (rev 41375)
@@ -167,7 +167,7 @@
         self.Show()
 
         # load workspace file if requested
-        if (self.workspaceFile):
+        if self.workspaceFile:
             # load given workspace file
             if self.LoadWorkspaceFile(self.workspaceFile):
                 self.SetTitle(self.baseTitle + " - " +  os.path.basename(self.workspaceFile))



More information about the grass-commit mailing list