Skip to content

Commit

Permalink
setup: Enhance engine search function
Browse files Browse the repository at this point in the history
ibus-setup can search both the language names and input method names
in the top language list but when you search a language keyword
in the language list and move to the input method list after click
the hit language name, any input methods could not be shown because
the language didn't hit in any input method names.

In this enhancement, ibus-setup can show the input methods to hit
the language names.
  • Loading branch information
fujiwarat committed Jul 16, 2021
1 parent b952d30 commit a4939f6
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions setup/enginedialog.py
Expand Up @@ -120,12 +120,26 @@ def __list_filter(self, row, data):
return True
if word in row.untrans.lower():
return True
if row.lang_info and row.name in self.__engines_for_lang:
for row_e in self.__engines_for_lang[row.name]:
if word in row_e.name.lower():
return True
if word in row_e.untrans.lower():
return True
# Search engine name in language list
if row.lang_info:
if row.name in self.__engines_for_lang.keys():
for row_l in self.__engines_for_lang[row.name]:
if word in row_l.name.lower():
return True
if word in row_l.untrans.lower():
return True
# Search language name in engine list
if not row.lang_info:
for l in self.__engines_for_lang.keys():
if word in l.lower():
for row_l in self.__engines_for_lang[l]:
if row.name == row_l.name:
return True
for (trans, untrans) in self.__untrans_for_lang.items():
if word in untrans.lower():
for row_l in self.__engines_for_lang[trans]:
if row.name == row_l.name:
return True
return False


Expand Down

0 comments on commit a4939f6

Please sign in to comment.