diff options
author | fujiwarat <takao.fujiwara1@gmail.com> | 2018-06-29 17:51:57 +0900 |
---|---|---|
committer | fujiwarat <takao.fujiwara1@gmail.com> | 2019-03-11 16:33:57 +0900 |
commit | b388ab256718e1208c5e97048fd11bf65c52f9cb (patch) | |
tree | afc3b93173471ceeb253649d084e16e81436086a /engine | |
parent | cb4b5458b3b021786d9ee9ebc5e065d7eeda359e (diff) | |
download | ibus-anthy-b388ab256718e1208c5e97048fd11bf65c52f9cb.tar.gz |
engine: input mode should be changed even if the mode is hidden
BUS=https://github.com/ibus/ibus/issues/2018
Diffstat (limited to 'engine')
-rw-r--r-- | engine/python2/engine.py | 11 | ||||
-rw-r--r-- | engine/python3/engine.py | 11 |
2 files changed, 12 insertions, 10 deletions
diff --git a/engine/python2/engine.py b/engine/python2/engine.py index 344ccce..733382a 100644 --- a/engine/python2/engine.py +++ b/engine/python2/engine.py @@ -865,9 +865,6 @@ class Engine(IBus.EngineSimple): IBus.PropState.CHECKED) def __input_mode_activate(self, prop_name, state): - if u'InputMode' not in self.__prop_dict.keys(): - # Disable to show input mode with ibus-set-anthy - return input_modes = { u'InputMode.Hiragana' : (INPUT_MODE_HIRAGANA, 'あ'), u'InputMode.Katakana' : (INPUT_MODE_KATAKANA, 'ア'), @@ -879,11 +876,15 @@ class Engine(IBus.EngineSimple): if prop_name not in input_modes: printerr('Unknown prop_name = %s' % prop_name) return + mode, symbol = input_modes[prop_name] + if u'InputMode' not in self.__prop_dict.keys(): + # Disable to show input mode with ibus-set-anthy + Engine.__input_mode = mode + return + self.__prop_dict[prop_name].set_state(state) self.update_property(self.__prop_dict[prop_name]) - mode, symbol = input_modes[prop_name] - label = _("%(description)s (%(symbol)s)") % \ { 'description' : _("Input mode"), 'symbol' : symbol } Engine.__input_mode = mode diff --git a/engine/python3/engine.py b/engine/python3/engine.py index 443cda8..1779e3f 100644 --- a/engine/python3/engine.py +++ b/engine/python3/engine.py @@ -860,9 +860,6 @@ class Engine(IBus.EngineSimple): IBus.PropState.CHECKED) def __input_mode_activate(self, prop_name, state): - if 'InputMode' not in self.__prop_dict.keys(): - # Disable to show input mode with ibus-set-anthy - return input_modes = { 'InputMode.Hiragana' : (INPUT_MODE_HIRAGANA, 'あ'), 'InputMode.Katakana' : (INPUT_MODE_KATAKANA, 'ア'), @@ -874,11 +871,15 @@ class Engine(IBus.EngineSimple): if prop_name not in input_modes: printerr('Unknown prop_name = %s' % prop_name) return + mode, symbol = input_modes[prop_name] + if 'InputMode' not in self.__prop_dict.keys(): + # Disable to show input mode with ibus-set-anthy + Engine.__input_mode = mode + return + self.__prop_dict[prop_name].set_state(state) self.update_property(self.__prop_dict[prop_name]) - mode, symbol = input_modes[prop_name] - label = _("%(description)s (%(symbol)s)") % \ { 'description' : _("Input mode"), 'symbol' : symbol } Engine.__input_mode = mode |