Browse Source

cmbarton: Another fix to allow a 'dummy command' to be run from the menu in order to launch a module not associated with a GRASS bin or script file.
(merge from devbr6, https://trac.osgeo.org/grass/changeset/33079)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@33082 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 years ago
parent
commit
1861753ff1
1 changed files with 9 additions and 1 deletions
  1. 9 1
      gui/wxpython/wxgui.py

+ 9 - 1
gui/wxpython/wxgui.py

@@ -424,11 +424,19 @@ class GMFrame(wx.Frame):
         """Get GRASS command from menu item
 
         Return command as a list"""
+        layer = None
+        
         cmd = self.menucmd[event.GetId()]
+        
         try:
             cmdlist = cmd.split(' ')
         except: # already list?
             cmdlist = cmd
+            
+        # check list of dummy commands for GUI modules that do not have GRASS
+        # bin modules or scripts. 
+        if cmd in ['vcolors']:
+            return cmdlist
 
         try:
             layer = self.curr_page.maptree.layer_selected
@@ -877,7 +885,7 @@ class GMFrame(wx.Frame):
         input and processes rules
         """
         command = self.GetMenuCmd(event)
-        
+                
         if command[0] == 'r.colors' or command[0] == 'vcolors':
             ctable = colorrules.ColorTable(self, cmd=command[0])
             ctable.Show()