add dynamic adjust option
authorPeng Wu <alexepico@gmail.com>
Wed, 8 Aug 2012 06:34:50 +0000 (14:34 +0800)
committerPeng Wu <alexepico@gmail.com>
Wed, 8 Aug 2012 06:40:22 +0000 (14:40 +0800)
setup/main2.py
src/PYConfig.cc
src/PYLibPinyin.cc
src/PYPConfig.cc

index 65d10d1..5bb52b5 100644 (file)
@@ -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()))
index 63b6633..5d3145b 100644 (file)
@@ -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;
 }
 
index 33ccd4a..44dcaf2 100644 (file)
@@ -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;
 }
index 9758ece..200b8fe 100644 (file)
@@ -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