summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2019-01-15 09:49:52 +0800
committerPeng Wu <alexepico@gmail.com>2019-01-15 09:49:52 +0800
commitad731ced123c254a19a33fadc994922982b1239c (patch)
tree1fa768c2559d719d0cb1624210970e5e4a5df3c9
parent1178b397112ce25fef459a7db8e2c880a936f10b (diff)
downloadibus-libzhuyin-ad731ced123c254a19a33fadc994922982b1239c.zip
ibus-libzhuyin-ad731ced123c254a19a33fadc994922982b1239c.tar.gz
ibus-libzhuyin-ad731ced123c254a19a33fadc994922982b1239c.tar.xz
fixes setup dialog
-rw-r--r--setup/main.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/setup/main.py b/setup/main.py
index 79ac9a2..b3ebaba 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -144,7 +144,13 @@ 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"))
+ tree_iter = self.__keyboard_layout.get_active_iter()
+ if tree_iter is not None:
+ model = self.__keyboard_layout.get_model()
+ self.__need_tone.set_sensitive(model[tree_iter][2])
+
self.__candidate_keys_entry.set_text(self.__get_value("candidate-keys"))
self.__candidate_num.set_value(self.__get_value("candidate-num"))
@@ -154,9 +160,6 @@ 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())