浏览代码

wxGUI/prompt: minor fixes

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@37426 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 16 年之前
父节点
当前提交
23d316afae
共有 2 个文件被更改,包括 15 次插入5 次删除
  1. 8 4
      gui/wxpython/gui_modules/goutput.py
  2. 7 1
      gui/wxpython/gui_modules/prompt.py

+ 8 - 4
gui/wxpython/gui_modules/goutput.py

@@ -101,9 +101,10 @@ class CmdThread(threading.Thread):
                               time = requestTime,
                               pid = requestId,
                               onDone = onDone)
-            
-            wx.PostEvent(self.parent, event)
 
+            # send event
+            wx.PostEvent(self.parent, event)
+            
     def abort(self):
         self.requestCmd.abort()
     
@@ -517,8 +518,11 @@ class GMConsole(wx.Panel):
 
         self.cmd_output_timer.Stop()
 
-        # updated command dialog
-        if hasattr(self.parent.parent, "btn_run"):
+        # set focus on prompt
+        if self.parent.GetName() == "LayerManager":
+            self.parent.cmdinput.SetFocus()
+        else:
+            # updated command dialog
             dialog = self.parent.parent
 
             if hasattr(self.parent.parent, "btn_abort"):

+ 7 - 1
gui/wxpython/gui_modules/prompt.py

@@ -396,7 +396,13 @@ class TextCtrlAutoComplete(wx.TextCtrl, listmix.ColumnSorterMixin):
             self.dropdownlistbox.Select(self.dropdownlistbox.GetFirstSelected(), False)
             if self._hideOnNoMatch:
                 self._showDropDown(False)
-        
+            
+            if self._module and cmd[-1][-2] == '=':
+                optType = self._module.get_param(cmd[-1][:-2])['prompt']
+                if optType in ('raster', 'vector'):
+                    # -> raster/vector map
+                    self.SetChoices(self._choicesMap[optType], optType)
+                                            
         self._listItemVisible()
         
         event.Skip()