瀏覽代碼

wxGUI/command line: force autogenerated GUI dialogs by '--ui' flag

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54604 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 年之前
父節點
當前提交
26d957d826
共有 2 個文件被更改,包括 8 次插入5 次删除
  1. 3 3
      gui/wxpython/core/gconsole.py
  2. 5 2
      gui/wxpython/lmgr/frame.py

+ 3 - 3
gui/wxpython/core/gconsole.py

@@ -474,11 +474,11 @@ class GConsole(wx.EvtHandler):
 
             if self._ignoredCmdPattern and \
               re.compile(self._ignoredCmdPattern).search(' '.join(command)) and \
-              '--help' not in command:
+              '--help' not in command and '--ui' not in command:
                 event = gIgnoredCmdRun(cmd=command)
                 wx.PostEvent(self, event)
                 return
-
+            
             else:
                 # other GRASS commands (r|v|g|...)
                 try:
@@ -654,4 +654,4 @@ class GConsole(wx.EvtHandler):
         event.Skip()
 
     def OnProcessPendingOutputWindowEvents(self, event):
-        wx.GetApp().ProcessPendingEvents()
+        wx.GetApp().ProcessPendingEvents()

+ 5 - 2
gui/wxpython/lmgr/frame.py

@@ -267,7 +267,7 @@ class GMFrame(wx.Frame):
         
         # create 'command output' text area
         self._gconsole = GConsole(guiparent = self, giface = self._giface,
-                                  ignoredCmdPattern = '^d\..*|^r[3]?\.mapcalc$')
+                                  ignoredCmdPattern = '^d\..*|^r[3]?\.mapcalc$|^i.group')
         self.goutput = GConsoleWindow(parent = self, gconsole = self._gconsole,
                                       gcstyle = GC_SEARCH | GC_PROMPT)
         self.notebook.AddPage(page = self.goutput, text = _("Command console"), name = 'output')
@@ -574,12 +574,15 @@ class GMFrame(wx.Frame):
             self.Raise()
 
     def RunSpecialCmd(self, command):
+        """!Run command from command line, check for GUI wrappers"""
         if re.compile('^d\..*').search(command[0]):
             self.RunDisplayCmd(command)
         elif re.compile('r[3]?\.mapcalc').search(command[0]):
             self.OnMapCalculator(event = None, cmd = command)
+        elif command[0] == 'i.group':
+            self.OnEditImageryGroups(event = None, cmd = command)
         else:
-            raise ValueError('Layer Manger special command (%s)'
+            raise ValueError('Layer Manager special command (%s)'
                              ' not supported.' % ' '.join(command))
 
     def RunDisplayCmd(self, command):