Prechádzať zdrojové kódy

wxGUI: fix search module engine

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@42231 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 rokov pred
rodič
commit
d834ed93df

+ 7 - 3
gui/wxpython/gui_modules/ghelp.py

@@ -157,12 +157,16 @@ class SearchModuleWindow(wx.Panel):
         iFound = 0
         for module, data in self.cmdPrompt.moduleDesc.iteritems():
             found = False
-            if self.searchBy.GetSelection() == 0: # -> description
+            sel = self.searchBy.GetSelection()
+            if sel == 0: # -> description
                 if text in data['desc']:
                     found = True
-            else: # -> keywords
+            elif sel == 1: # keywords
                 if self.cmdPrompt.CheckKey(text, data['keywords']):
                     found = True
+            else: # command
+                if text in module:
+                    found = True
             
             if found:
                 iFound += 1
@@ -176,9 +180,9 @@ class SearchModuleWindow(wx.Panel):
                 modules[group].append(name)
         
         self.cmdPrompt.SetFilter(modules)
+        self.searchChoice.SetItems(self.cmdPrompt.GetCommandItems())
         if self.showTip:
             self.searchTip.SetLabel(_("%d modules found") % iFound)
-        self.searchChoice.SetItems(self.cmdPrompt.GetCommandItems())
         
         event.Skip()
         

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

@@ -556,7 +556,7 @@ class GPrompt(object):
         """!Get list of available commands"""
         items = list()
         
-        if self.autoCompFilter:
+        if self.autoCompFilter is not None:
             mList = self.autoCompFilter
         else:
             mList = self.moduleList