diff options
-rw-r--r-- | setup/main.py | 2 | ||||
-rw-r--r-- | src/ZYConfig.cc | 2 | ||||
-rw-r--r-- | src/ZYConfig.h | 3 | ||||
-rw-r--r-- | src/ZYZConfig.cc | 24 |
4 files changed, 22 insertions, 9 deletions
diff --git a/setup/main.py b/setup/main.py index 111b1f9..ed2037f 100644 --- a/setup/main.py +++ b/setup/main.py @@ -93,7 +93,7 @@ class PreferencesWindow: self.__full_half_english.set_active(self.__get_value("fullhalfenglish", False)) self.__full_half_punct.set_active(self.__get_value("fullhalfpunct", True)) self.__traditional_chinese.set_active(self.__get_value("traditionalchinese", True)) - self.__always_input_num.set_active(self.__get_value("alwaysinputnum", True)) + self.__always_input_num.set_active(self.__get_value("alwaysinputnum", False)) # connect signals self.__chinese_mode.connect("toggled", self.__toggled_cb, "chinesemode") diff --git a/src/ZYConfig.cc b/src/ZYConfig.cc index 204c4f6..a963c6b 100644 --- a/src/ZYConfig.cc +++ b/src/ZYConfig.cc @@ -52,6 +52,8 @@ Config::initDefaultValues (void) m_init_full_english = FALSE; m_init_full_punct = TRUE; m_init_trad_chinese = TRUE; + + m_always_input_numbers = FALSE; } diff --git a/src/ZYConfig.h b/src/ZYConfig.h index 2754bd8..c1c9375 100644 --- a/src/ZYConfig.h +++ b/src/ZYConfig.h @@ -49,6 +49,7 @@ public: gboolean initFullEnglish (void) const { return m_init_full_english; } gboolean initFullPunct (void) const { return m_init_full_punct; } gboolean initTradChinese (void) const { return m_init_trad_chinese; } + gboolean alwaysInputNumbers (void) const { return m_always_input_numbers; } std::string candidateKeys (void) const { return m_candidate_keys; } protected: @@ -83,6 +84,8 @@ protected: gboolean m_init_full_punct; gboolean m_init_trad_chinese; + gboolean m_always_input_numbers; + std::string m_candidate_keys; }; diff --git a/src/ZYZConfig.cc b/src/ZYZConfig.cc index 2141eb3..52b7754 100644 --- a/src/ZYZConfig.cc +++ b/src/ZYZConfig.cc @@ -29,11 +29,13 @@ const gchar * const CONFIG_FUZZY_ZHUYIN = "fuzzyzhuyin"; const gchar * const CONFIG_ORIENTATION = "LookupTableOrientation"; const gchar * const CONFIG_PAGE_SIZE = "candidatenum"; -const gchar * const CONFIG_KEYBOARD_LAYOUT = "keyboardlayout"; const gchar * const CONFIG_INIT_CHINESE = "chinesemode"; const gchar * const CONFIG_INIT_FULL_ENGLISH = "fullhalfenglish"; const gchar * const CONFIG_INIT_FULL_PUNCT = "fullhalfpunct"; const gchar * const CONFIG_INIT_TRAD_CHINESE = "traditionalchinese"; +const gchar * const CONFIG_ALWAYS_INPUT_NUMBERS = "alwaysinputnum"; + +const gchar * const CONFIG_KEYBOARD_LAYOUT = "keyboardlayout"; const gchar * const CONFIG_CANDIDATE_KEYS = "candidatekeys"; const zhuyin_option_t ZHUYIN_DEFAULT_OPTION = @@ -84,6 +86,8 @@ ZhuyinConfig::initDefaultValues (void) m_init_full_punct = TRUE; m_init_trad_chinese = TRUE; + m_always_input_numbers = FALSE; + m_candidate_keys = "1234567890"; } @@ -157,6 +161,14 @@ ZhuyinConfig::readDefaultValues (void) g_warn_if_reached (); } + /* init states */ + m_init_chinese = read (CONFIG_INIT_CHINESE, true); + m_init_full_english = read (CONFIG_INIT_FULL_ENGLISH, false); + m_init_full_punct = read (CONFIG_INIT_FULL_PUNCT, true); + m_init_trad_chinese = read (CONFIG_INIT_TRAD_CHINESE, true); + + m_always_input_numbers = read (CONFIG_ALWAYS_INPUT_NUMBERS, false); + gint layout = read (CONFIG_KEYBOARD_LAYOUT, 0); m_keyboard_layout = CHEWING_DEFAULT; @@ -166,12 +178,6 @@ ZhuyinConfig::readDefaultValues (void) } } - /* init states */ - m_init_chinese = read (CONFIG_INIT_CHINESE, true); - m_init_full_english = read (CONFIG_INIT_FULL_ENGLISH, false); - m_init_full_punct = read (CONFIG_INIT_FULL_PUNCT, true); - m_init_trad_chinese = read (CONFIG_INIT_TRAD_CHINESE, true); - m_candidate_keys = read (CONFIG_CANDIDATE_KEYS, std::string ("1234567890")); /* fuzzy zhuyin */ @@ -208,11 +214,13 @@ ZhuyinConfig::valueChanged (const std::string §ion, if (CONFIG_INIT_CHINESE == name) m_init_chinese = normalizeGVariant (value, true); else if (CONFIG_INIT_FULL_ENGLISH == name) - m_init_full_english = normalizeGVariant (value, true); + m_init_full_english = normalizeGVariant (value, false); else if (CONFIG_INIT_FULL_PUNCT == name) m_init_full_punct = normalizeGVariant (value, true); else if (CONFIG_INIT_TRAD_CHINESE == name) m_init_trad_chinese = normalizeGVariant (value, true); + else if (CONFIG_ALWAYS_INPUT_NUMBERS == name) + m_always_input_numbers = normalizeGVariant (value, false); else if (CONFIG_KEYBOARD_LAYOUT == name) { gint layout = normalizeGVariant (value, 0); m_keyboard_layout = CHEWING_DEFAULT; |