[GRASS-SVN] r70223 - grass/trunk/gui/wxpython/lmgr
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jan 3 11:42:04 PST 2017
Author: martinl
Date: 2017-01-03 11:42:04 -0800 (Tue, 03 Jan 2017)
New Revision: 70223
Modified:
grass/trunk/gui/wxpython/lmgr/layertree.py
Log:
wxGUI/lmgr: reorder items (zooms together)
Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/layertree.py 2017-01-03 19:34:38 UTC (rev 70222)
+++ grass/trunk/gui/wxpython/lmgr/layertree.py 2017-01-03 19:42:04 UTC (rev 70223)
@@ -466,6 +466,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()
@@ -516,6 +521,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'],
@@ -527,12 +541,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()
@@ -699,14 +707,6 @@
# raster layers (specific items)
elif mltype and mltype == "raster":
- if 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'])
-
self.popupMenu.AppendSeparator()
if numSelected == 1:
More information about the grass-commit
mailing list