Browse Source

wxGUI: fix zoomback in georect

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41374 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 năm trước cách đây
mục cha
commit
7f5b142e23

+ 1 - 0
gui/wxpython/gui_modules/georect.py

@@ -194,6 +194,7 @@ class GeorectWizard(object):
             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)
             

+ 8 - 3
gui/wxpython/gui_modules/mapdisp_window.py

@@ -2544,8 +2544,7 @@ class BufferedWindow(MapWindow, wx.Window):
             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 @@ class BufferedWindow(MapWindow, wx.Window):
             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],

+ 1 - 1
gui/wxpython/wxgui.py

@@ -167,7 +167,7 @@ class GMFrame(wx.Frame):
         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))