[GRASS-SVN] r41374 - in grass/trunk/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 9 06:01:56 EST 2010


Author: martinl
Date: 2010-03-09 06:01:34 -0500 (Tue, 09 Mar 2010)
New Revision: 41374

Modified:
   grass/trunk/gui/wxpython/gui_modules/georect.py
   grass/trunk/gui/wxpython/gui_modules/mapdisp_window.py
   grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: fix zoomback in georect


Modified: grass/trunk/gui/wxpython/gui_modules/georect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/georect.py	2010-03-09 07:10:30 UTC (rev 41373)
+++ grass/trunk/gui/wxpython/gui_modules/georect.py	2010-03-09 11:01:34 UTC (rev 41374)
@@ -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/trunk/gui/wxpython/gui_modules/mapdisp_window.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp_window.py	2010-03-09 07:10:30 UTC (rev 41373)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp_window.py	2010-03-09 11:01:34 UTC (rev 41374)
@@ -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/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py	2010-03-09 07:10:30 UTC (rev 41373)
+++ grass/trunk/gui/wxpython/wxgui.py	2010-03-09 11:01:34 UTC (rev 41374)
@@ -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