瀏覽代碼

wxGUI/search: fix finding next match on Mac - workaround for Enter resulting in EVT_TEXT (merge from trunk, https://trac.osgeo.org/grass/changeset/61554)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@61555 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 10 年之前
父節點
當前提交
ecd6e2eaf3
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      gui/wxpython/gui_core/widgets.py

+ 6 - 0
gui/wxpython/gui_core/widgets.py

@@ -843,6 +843,7 @@ class SearchModuleWidget(wx.Panel):
         self._results = [] # list of found nodes
         self._resultIndex = -1
         self._searchKeys = ['description', 'keywords', 'command']
+        self._oldValue = ''
         
         self.moduleSelected = Signal('SearchModuleWidget.moduleSelected')
         self.showSearchResult = Signal('SearchModuleWidget.showSearchResult')
@@ -913,6 +914,11 @@ class SearchModuleWidget(wx.Panel):
     def OnSearchModule(self, event):
         """!Search module by keywords or description"""
         value = self._search.GetValue()
+        if value == self._oldValue:
+            event.Skip()
+            return
+        self._oldValue = value
+
         if len(value) <= 2:
             if len(value) == 0: # reset
                 commands = self._searchModule(keys=['command'], value='')