[GRASS-SVN] r70224 - grass/branches/releasebranch_7_2/gui/wxpython/lmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 3 11:44:38 PST 2017


Author: martinl
Date: 2017-01-03 11:44:38 -0800 (Tue, 03 Jan 2017)
New Revision: 70224

Modified:
   grass/branches/releasebranch_7_2/gui/wxpython/lmgr/layertree.py
Log:
wxGUI/lmgr: reorder items (zooms together) (merge r70223 from trunk)

Modified: grass/branches/releasebranch_7_2/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/lmgr/layertree.py	2017-01-03 19:42:04 UTC (rev 70223)
+++ grass/branches/releasebranch_7_2/gui/wxpython/lmgr/layertree.py	2017-01-03 19:44:38 UTC (rev 70224)
@@ -465,6 +465,11 @@
                 break
 
         # map layer items
+        try:
+            mltype = self.GetLayerInfo(self.layer_selected, key='type')
+        except:
+            mltype = None
+
         if ltype not in ("group", "command"):
             if numSelected == 1:
                 self.popupMenu.AppendSeparator()
@@ -515,6 +520,15 @@
                     self.mapdisplay.OnZoomToMap,
                     id=self.popupID['zoom'])
 
+                # raster-specific zoom
+                if mltype and mltype == "raster" and same:
+                    self.popupMenu.Append(
+                        self.popupID['zoom1'], _("Zoom to selected map(s) (ignore NULLs)"))
+                    self.Bind(
+                        wx.EVT_MENU,
+                        self.mapdisplay.OnZoomToRaster,
+                        id=self.popupID['zoom1'])
+
                 item = wx.MenuItem(
                     self.popupMenu,
                     id=self.popupID['region'],
@@ -526,12 +540,6 @@
                     self.OnSetCompRegFromMap,
                     id=self.popupID['region'])
 
-        # specific items
-        try:
-            mltype = self.GetLayerInfo(self.layer_selected, key='type')
-        except:
-            mltype = None
-
         # vector layers (specific items)
         if mltype and mltype == "vector" and numSelected == 1:
             self.popupMenu.AppendSeparator()
@@ -702,15 +710,6 @@
 
         # raster layers (specific items)
         elif mltype and mltype == "raster":
-            if same:
-                self.popupMenu.Append(
-                    self.popupID['zoom1'],
-                    text=_("Zoom to selected map(s) (ignore NULLs)"))
-                self.Bind(
-                    wx.EVT_MENU,
-                    self.mapdisplay.OnZoomToRaster,
-                    id=self.popupID['zoom1'])
-
             self.popupMenu.AppendSeparator()
 
             if numSelected == 1:



More information about the grass-commit mailing list