summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--setup/ibus-libzhuyin-preferences.ui3
-rw-r--r--setup/main.py35
2 files changed, 36 insertions, 2 deletions
diff --git a/setup/ibus-libzhuyin-preferences.ui b/setup/ibus-libzhuyin-preferences.ui
index 7e78cd8..c7253df 100644
--- a/setup/ibus-libzhuyin-preferences.ui
+++ b/setup/ibus-libzhuyin-preferences.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.0 on Thu Jan 16 14:16:06 2014 -->
+<!-- Generated with glade 3.16.0 on Fri Jan 17 15:48:05 2014 -->
<interface>
<!-- interface-requires gtk+ 3.10 -->
<object class="GtkAdjustment" id="adjustmentCandidate">
@@ -398,6 +398,7 @@
<property name="valign">center</property>
<property name="margin_left">10</property>
<property name="xalign">0</property>
+ <property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
diff --git a/setup/main.py b/setup/main.py
index 1c2beb9..3e62922 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -115,7 +115,40 @@ class PreferencesWindow:
def __init_fuzzy_zhuyin(self):
- pass
+ # page Fuzzy Zhuyin
+ self.__page_fuzzy_zhuyin.show()
+
+ # fuzzy zhuyin
+ self.__fuzzy_zhuyin = self.__builder.get_object("fuzzyzhuyin")
+ self.__fuzzy_zhuyin_widgets = [
+ ("fuzzyzhuyin_c_ch", True),
+ ("fuzzyzhuyin_z_zh", True),
+ ("fuzzyzhuyin_s_sh", True),
+ ("fuzzyzhuyin_l_n", True),
+ ("fuzzyzhuyin_f_h", True),
+ ("fuzzyzhuyin_l_r", False),
+ ("fuzzyzhuyin_g_k", False),
+ ("fuzzyzhuyin_an_ang", True),
+ ("fuzzyzhuyin_en_eng", True),
+ ("fuzzyzhuyin_in_ing", True),
+ ]
+
+ def __fuzzy_zhuyin_toggled_cb(widget):
+ val = widget.get_active()
+ map(lambda w: self.__builder.get_object(w[0]).set_sensitive(val),
+ self.__fuzzy_zhuyin_widgets)
+ self.__fuzzy_zhuyin.connect("toggled", __fuzzy_zhuyin_toggled_cb)
+
+ # init value
+ self.__fuzzy_zhuyin.set_active(self.__get_value("fuzzyzhuyin", False))
+ for name, defval in self.__fuzzy_zhuyin_widgets:
+ widget = self.__builder.get_object(name)
+ widget.set_active(self.__get_value(name, defval))
+
+ self.__fuzzy_zhuyin.connect("toggled", self.__toggled_cb, "fuzzyzhuyin")
+ for name, defval in self.__fuzzy_zhuyin_widgets:
+ widget = self.__builder.get_object(name)
+ widget.connect("toggled", self.__toggled_cb, name)
def __init_user_phrases(self):