summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-08-08 14:34:50 +0800
committerPeng Wu <alexepico@gmail.com>2012-08-08 14:40:22 +0800
commit1699997011a77354b7698fd9da2e8ee992785aff (patch)
tree8063ff8d2bda39cb4de4ff44021c3961894110be
parent068cd92477704ac43454e723a1c34e438280a592 (diff)
downloadibus-libpinyin-1699997011a77354b7698fd9da2e8ee992785aff.tar.gz
add dynamic adjust option
-rw-r--r--setup/main2.py5
-rw-r--r--src/PYConfig.cc1
-rw-r--r--src/PYLibPinyin.cc4
-rw-r--r--src/PYPConfig.cc2
4 files changed, 8 insertions, 4 deletions
diff --git a/setup/main2.py b/setup/main2.py
index 65d10d1..5bb52b5 100644
--- a/setup/main2.py
+++ b/setup/main2.py
@@ -102,7 +102,8 @@ class PreferencesDialog:
self.__init_full_punct = self.__builder.get_object("InitFullPunct")
self.__init_half_punct = self.__builder.get_object("InitHalfPunct")
self.__init_simp = self.__builder.get_object("InitSimplifiedChinese")
- self.__init_trad = self.__builder.get_object("IniTraditionalChinese")
+ #self.__init_trad = self.__builder.get_object("IniTraditionalChinese")
+ self.__dynamic_adjust = self.__builder.get_object("DynamicAdjust")
# UI
self.__lookup_table_page_size = self.__builder.get_object("LookupTablePageSize")
@@ -113,6 +114,7 @@ class PreferencesDialog:
self.__init_full.set_active(self.__get_value("InitFull", False))
self.__init_full_punct.set_active(self.__get_value("InitFullPunct", True))
self.__init_simp.set_active(self.__get_value("InitSimplifiedChinese", True))
+ self.__dynamic_adjust.set_active(self.__get_value("DynamicAdjust", True))
self.__lookup_table_orientation.set_active(self.__get_value("LookupTableOrientation", 0))
self.__lookup_table_page_size.set_value(self.__get_value("LookupTablePageSize", 5))
@@ -121,6 +123,7 @@ class PreferencesDialog:
self.__init_full.connect("toggled", self.__toggled_cb, "InitFull")
self.__init_full_punct.connect("toggled", self.__toggled_cb, "InitFullPunct")
self.__init_simp.connect("toggled", self.__toggled_cb, "InitSimplifiedChinese")
+ self.__dynamic_adjust.connect("toggled", self.__toggled_cb, "DynamicAdjust")
def __lookup_table_page_size_changed_cb(adjustment):
self.__set_value("LookupTablePageSize", int(adjustment.get_value()))
diff --git a/src/PYConfig.cc b/src/PYConfig.cc
index 63b6633..5d3145b 100644
--- a/src/PYConfig.cc
+++ b/src/PYConfig.cc
@@ -59,7 +59,6 @@ Config::initDefaultValues (void)
m_init_full = FALSE;
m_init_full_punct = TRUE;
m_init_simp_chinese = TRUE;
- m_dynamic_adjust = TRUE;
m_special_phrases = TRUE;
}
diff --git a/src/PYLibPinyin.cc b/src/PYLibPinyin.cc
index 33ccd4a..44dcaf2 100644
--- a/src/PYLibPinyin.cc
+++ b/src/PYLibPinyin.cc
@@ -144,7 +144,7 @@ LibPinyinBackEnd::setPinyinOptions (Config *config)
}
pinyin_option_t options = config->option()
- | USE_RESPLIT_TABLE | USE_DIVIDED_TABLE | DYNAMIC_ADJUST;
+ | USE_RESPLIT_TABLE | USE_DIVIDED_TABLE;
pinyin_set_options (m_pinyin_context, options);
return TRUE;
}
@@ -176,7 +176,7 @@ LibPinyinBackEnd::setChewingOptions (Config *config)
}
}
- pinyin_option_t options = config->option() | USE_TONE |DYNAMIC_ADJUST;
+ pinyin_option_t options = config->option() | USE_TONE;
pinyin_set_options(m_chewing_context, options);
return TRUE;
}
diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc
index 9758ece..200b8fe 100644
--- a/src/PYPConfig.cc
+++ b/src/PYPConfig.cc
@@ -112,6 +112,8 @@ static const struct {
{ "FuzzyPinyin_AN_ANG", PINYIN_AMB_AN_ANG },
{ "FuzzyPinyin_EN_ENG", PINYIN_AMB_EN_ENG },
{ "FuzzyPinyin_IN_ING", PINYIN_AMB_IN_ING },
+ /* dynamic adjust */
+ { "DynamicAdjust", DYNAMIC_ADJUST },
};
void