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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 6 09:35:44 PST 2017


Author: martinl
Date: 2017-01-06 09:35:44 -0800 (Fri, 06 Jan 2017)
New Revision: 70279

Modified:
   grass/branches/releasebranch_7_2/gui/wxpython/lmgr/layertree.py
Log:
wxGUI: set color table interactively only when one raster is selected
wxGUI/lmgr: skip raster specific items on different types
       (merge r70277,r70278 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-06 17:32:10 UTC (rev 70278)
+++ grass/branches/releasebranch_7_2/gui/wxpython/lmgr/layertree.py	2017-01-06 17:35:44 UTC (rev 70279)
@@ -704,7 +704,7 @@
             self.Bind(wx.EVT_MENU, self.OnMetadata, id=self.popupID['meta'])
 
         # raster layers (specific items)
-        elif ltype and ltype == "raster":
+        elif same and ltype and ltype == "raster":
             self.popupMenu.AppendSeparator()
 
             if numSelected == 1:
@@ -756,13 +756,14 @@
                 wx.EVT_MENU,
                 self.OnRasterColorTable,
                 id=self.popupID['color'])
-            self.popupMenu.Append(
-                self.popupID['colori'],
-                _("Set color table interactively"))
-            self.Bind(
-                wx.EVT_MENU,
-                self.lmgr.OnRasterRules,
-                id=self.popupID['colori'])
+            if len(selected) < 2:
+                self.popupMenu.Append(
+                    self.popupID['colori'],
+                    _("Set color table interactively"))
+                self.Bind(
+                    wx.EVT_MENU,
+                    self.lmgr.OnRasterRules,
+                    id=self.popupID['colori'])
 
             item = wx.MenuItem(
                 self.popupMenu,



More information about the grass-commit mailing list