summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2019-01-04 14:34:03 +0800
committerPeng Wu <alexepico@gmail.com>2019-01-04 14:43:22 +0800
commit1178b397112ce25fef459a7db8e2c880a936f10b (patch)
treedaaf8dcc32d8b03cbcda2a8972fb631295e8f629
parent7302fce6194506e7233efcdf89ee6ee97158d03f (diff)
downloadibus-libzhuyin-1178b397112ce25fef459a7db8e2c880a936f10b.zip
ibus-libzhuyin-1178b397112ce25fef459a7db8e2c880a936f10b.tar.gz
ibus-libzhuyin-1178b397112ce25fef459a7db8e2c880a936f10b.tar.xz
update main.py
-rw-r--r--setup/main.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/setup/main.py b/setup/main.py
index 91e8446..79ac9a2 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -144,7 +144,6 @@ class PreferencesWindow:
self.__candidate_num = self.__builder.get_object("candidate_num")
# read value
- self.__keyboard_layout.set_active(self.__get_value("keyboard-layout"))
self.__need_tone.set_active(self.__get_value("need-tone"))
self.__candidate_keys_entry.set_text(self.__get_value("candidate-keys"))
self.__candidate_num.set_value(self.__get_value("candidate-num"))
@@ -155,9 +154,17 @@ class PreferencesWindow:
self.__candidate_keys_entry.connect("changed", self.__candidate_keys_entry_cb, "candidate-keys")
self.__candidate_num.connect("value-changed", self.__candidate_num_cb, "candidate-num")
+ # update need_tone state
+ self.__keyboard_layout.set_active(self.__get_value("keyboard-layout"))
+
def __keyboard_layout_cb(self, widget, name):
self.__set_value(name, widget.get_active())
+ tree_iter = widget.get_active_iter()
+ if tree_iter is not None:
+ model = widget.get_model()
+ self.__need_tone.set_active(model[tree_iter][1])
+ self.__need_tone.set_sensitive(model[tree_iter][2])
def __candidate_keys_entry_cb(self, widget, name):