summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfujiwarat <takao.fujiwara1@gmail.com>2017-05-26 13:17:52 +0900
committerfujiwarat <takao.fujiwara1@gmail.com>2017-05-26 13:17:52 +0900
commitbba0f3888cbe5fa7a7b5e7d8e5344390c5a4a4df (patch)
treee807d83b8fb8555e96e7b9196452a9e105ef1d07
parent6e2f9494e83eb945cb7c24d1114309ceb29bdd6e (diff)
downloadibus-anthy-bba0f3888cbe5fa7a7b5e7d8e5344390c5a4a4df.tar.gz
Fixed circle_typing_method
-rw-r--r--engine/python2/engine.py13
-rw-r--r--engine/python3/engine.py13
2 files changed, 24 insertions, 2 deletions
diff --git a/engine/python2/engine.py b/engine/python2/engine.py
index 8f8de95..b0c98b7 100644
--- a/engine/python2/engine.py
+++ b/engine/python2/engine.py
@@ -828,6 +828,8 @@ class Engine(IBus.EngineSimple):
elif prop_name == 'setup-dict-kasumi-word':
self.__start_add_word()
else:
+ if prop_name not in self.__prop_dict.keys():
+ return
self.__prop_dict[prop_name].set_state(state)
if prop_name == 'DictMode':
sub_name = self.__dict_mode_get_prop_name(self.__dict_mode)
@@ -837,6 +839,9 @@ 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, 'ア'),
@@ -865,6 +870,9 @@ class Engine(IBus.EngineSimple):
self.__invalidate()
def __typing_mode_activate(self, prop_name, state):
+ if u'TypingMode' not in self.__prop_dict.keys():
+ # Disable to show typing mode with ibus-set-anthy
+ return
typing_modes = {
u'TypingMode.Romaji' : (jastring.TYPING_MODE_ROMAJI, 'R'),
u'TypingMode.Kana' : (jastring.TYPING_MODE_KANA, 'か'),
@@ -894,8 +902,8 @@ class Engine(IBus.EngineSimple):
def __refresh_typing_mode_property(self):
if u'TypingMode' not in self.__prop_dict:
+ # Disable to show typing mode with ibus-set-anthy
return
-
prop = self.__prop_dict[u'TypingMode']
modes = {
jastring.TYPING_MODE_ROMAJI : (u'TypingMode.Romaji', 'R'),
@@ -915,6 +923,9 @@ class Engine(IBus.EngineSimple):
self.update_property(prop)
def __segment_mode_activate(self, prop_name, state):
+ if u'SegmentMode' not in self.__prop_dict.keys():
+ # Disable to show segment mode with ibus-set-anthy
+ return
segment_modes = {
u'SegmentMode.Multi' : (SEGMENT_DEFAULT, '連'),
u'SegmentMode.Single' : (SEGMENT_SINGLE, '単'),
diff --git a/engine/python3/engine.py b/engine/python3/engine.py
index c7f9a0b..39370a6 100644
--- a/engine/python3/engine.py
+++ b/engine/python3/engine.py
@@ -823,6 +823,8 @@ class Engine(IBus.EngineSimple):
elif prop_name == 'setup-dict-kasumi-word':
self.__start_add_word()
else:
+ if prop_name not in self.__prop_dict.keys():
+ return
self.__prop_dict[prop_name].set_state(state)
if prop_name == 'DictMode':
sub_name = self.__dict_mode_get_prop_name(self.__dict_mode)
@@ -832,6 +834,9 @@ 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, 'ア'),
@@ -860,6 +865,9 @@ class Engine(IBus.EngineSimple):
self.__invalidate()
def __typing_mode_activate(self, prop_name, state):
+ if 'TypingMode' not in self.__prop_dict.keys():
+ # Disable to show typing mode with ibus-set-anthy
+ return
typing_modes = {
'TypingMode.Romaji' : (jastring.TYPING_MODE_ROMAJI, 'R'),
'TypingMode.Kana' : (jastring.TYPING_MODE_KANA, 'か'),
@@ -889,8 +897,8 @@ class Engine(IBus.EngineSimple):
def __refresh_typing_mode_property(self):
if 'TypingMode' not in self.__prop_dict:
+ # Disable to show typing mode with ibus-set-anthy
return
-
prop = self.__prop_dict['TypingMode']
modes = {
jastring.TYPING_MODE_ROMAJI : ('TypingMode.Romaji', 'R'),
@@ -910,6 +918,9 @@ class Engine(IBus.EngineSimple):
self.update_property(prop)
def __segment_mode_activate(self, prop_name, state):
+ if 'SegmentMode' not in self.__prop_dict.keys():
+ # Disable to show segment mode with ibus-set-anthy
+ return
segment_modes = {
'SegmentMode.Multi' : (SEGMENT_DEFAULT, '連'),
'SegmentMode.Single' : (SEGMENT_SINGLE, '単'),