Explorar o código

wxGUI/menu: don't disable non-grass commands in menu, motivation is creating toolboxes from non-grass commands such as Isis (merge from trunk, https://trac.osgeo.org/grass/changeset/60313)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@60754 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová %!s(int64=11) %!d(string=hai) anos
pai
achega
8ff41b32aa
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  1. 5 3
      gui/wxpython/gui_core/menu.py

+ 5 - 3
gui/wxpython/gui_core/menu.py

@@ -18,7 +18,7 @@ This program is free software under the GNU General Public License
 @author Robert Szczepanek (menu customization)
 @author Vaclav Petras <wenzeslaus gmail.com> (menu customization)
 """
-
+import re
 import wx
 
 from core              import globalvar
@@ -90,8 +90,10 @@ class Menu(wx.MenuBar):
             try: 
                 cmd = utils.split(str(command)) 
             except UnicodeError: 
-                cmd = utils.split(EncodeString((command))) 
-            if cmd and cmd[0] not in globalvar.grassCmd: 
+                cmd = utils.split(EncodeString((command)))
+            # disable only grass commands which are not present (e.g. r.in.lidar)
+            if cmd and cmd[0] not in globalvar.grassCmd and \
+               re.match('[rvdipmgt][3bs]?\.([a-z0-9\.])+', cmd[0]):
                 menuItem.Enable(False)
 
         rhandler = eval('self.parent.' + handler)