From: BYVoid Date: Fri, 4 Jun 2010 07:07:13 +0000 (+0800) Subject: Disabled Custom of SelectKey X-Git-Tag: 1.3.10~79 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a23fe6b8b4f5028887d797db25ad2aac13d8747;p=platform%2Fupstream%2Fibus-libpinyin.git Disabled Custom of SelectKey --- diff --git a/setup/ibus-pinyin-preferences.ui b/setup/ibus-pinyin-preferences.ui index 876afe3..2686191 100644 --- a/setup/ibus-pinyin-preferences.ui +++ b/setup/ibus-pinyin-preferences.ui @@ -848,7 +848,7 @@ - + True liststoreSelectionKeys on @@ -1695,22 +1695,31 @@ koterpilla, Zerng07 - 1234567890 + 1234567890 - asdfghjkl; + asdfghjkl; - 1qaz2wsxed + 1qaz2wsxed - asdfzxcvgb + asdfzxcvgb - 1234qweras + 1234qweras - aoeu;qjkix + aoeu;qjkix + + + aoeuhtnsid + + + aoeuidhtns + + + qweasdzxcr diff --git a/setup/main.py b/setup/main.py index 7ffb4f3..e3166c1 100644 --- a/setup/main.py +++ b/setup/main.py @@ -190,7 +190,8 @@ class PreferencesDialog: # selection mode self.__select_keys = self.__builder.get_object("SelectKeys") - self.__select_keys.set_text_column(0) + self.__select_keys.pack_start(renderer) + self.__select_keys.set_attributes(renderer, text=0) self.__guide_key = self.__builder.get_object("GuideKey") self.__auxiliary_select_key_f = self.__builder.get_object("AuxiliarySelectKey_F") self.__auxiliary_select_key_kp = self.__builder.get_object("AuxiliarySelectKey_KP") @@ -198,7 +199,7 @@ class PreferencesDialog: # read value self.__bopomofo_keyboard_mapping.set_active(self.__get_value("BopomofoKeyboardMapping", 0)) self.__incomplete_bopomofo.set_active(self.__get_value("IncompletePinyin", False)) - self.__select_keys.get_child().set_text(self.__get_value("SelectKeys", "1234567890")) + self.__select_keys.set_active(self.__get_value("SelectKeys", 0)) self.__guide_key.set_active(self.__get_value("GuideKey", 1)) self.__auxiliary_select_key_f.set_active(self.__get_value("AuxiliarySelectKey_F", 1)) self.__auxiliary_select_key_kp.set_active(self.__get_value("AuxiliarySelectKey_KP", 1)) @@ -207,7 +208,7 @@ class PreferencesDialog: def __bopomofo_keyboard_mapping_changed_cb(widget): self.__set_value("BopomofoKeyboardMapping", widget.get_active()) def __select_keys_changed_cb(widget): - self.__set_value("SelectKeys", widget.get_active_text()) + self.__set_value("SelectKeys", widget.get_active()) self.__bopomofo_keyboard_mapping.connect("changed", __bopomofo_keyboard_mapping_changed_cb) self.__incomplete_bopomofo.connect("toggled", self.__toggled_cb, "IncompletePinyin") diff --git a/src/Bopomofo.h b/src/Bopomofo.h index abd9813..ef278c3 100644 --- a/src/Bopomofo.h +++ b/src/Bopomofo.h @@ -77,4 +77,16 @@ const static wchar_t bopomofo_char[] = { L'ˊ', L'ˇ', L'ˋ', L'˙', }; +const static gchar * bopomofo_select_keys[] = { + "1234567890", + "asdfghjkl;", + "1qaz2wsxed", + "asdfzxcvgb", + "1234qweras", + "aoeu;qjkix", + "aoeuhtnsid", + "aoeuidhtns", + "qweasdzxcr" +}; + #endif /* __PY_BOPOMOFO_H_ */ diff --git a/src/BopomofoEditor.cc b/src/BopomofoEditor.cc index 83cd2d5..621cfd4 100644 --- a/src/BopomofoEditor.cc +++ b/src/BopomofoEditor.cc @@ -291,13 +291,13 @@ BopomofoEditor::processSelectKey (guint keyval, guint keycode, guint modifiers) if (G_LIKELY (!m_select_mode && ((modifiers & IBUS_MOD1_MASK) == 0))) return FALSE; - const gchar * pos = strchr (m_config.selectKeys (), keyval); + const gchar * pos = strchr (bopomofo_select_keys[m_config.selectKeys ()], keyval); if (pos == NULL) return FALSE; m_select_mode = TRUE; - guint i = pos - m_config.selectKeys (); + guint i = pos - bopomofo_select_keys[m_config.selectKeys ()]; selectCandidateInPage (i); return TRUE; @@ -559,9 +559,9 @@ BopomofoEditor::updateLookupTableLabel () { String str_label; guint color = m_select_mode ? 0x000000 : 0xBBBBBB; - for (const gchar *p = m_config.selectKeys (); *p; p++) + for (const gchar *p = bopomofo_select_keys[m_config.selectKeys ()]; *p; p++) { - guint i = p - m_config.selectKeys (); + guint i = p - bopomofo_select_keys[m_config.selectKeys ()]; if (i >= m_config.pageSize ()) break; str_label.printf ("%c.",*p); diff --git a/src/Config.cc b/src/Config.cc index 2de2216..dbeffd8 100644 --- a/src/Config.cc +++ b/src/Config.cc @@ -453,7 +453,7 @@ BopomofoConfig::readDefaultValues (void) m_bopomofo_keyboard_mapping = read (CONFIG_BOPOMOFO_KEYBOARD_MAPPING, 0); - m_select_keys = read (CONFIG_SELECT_KEYS, "1234567890"); + m_select_keys = read (CONFIG_SELECT_KEYS, 0); m_guide_key = read (CONFIG_GUIDE_KEY, true); m_auxiliary_select_key_f = read (CONFIG_AUXILIARY_SELECT_KEY_F, true); m_auxiliary_select_key_kp = read (CONFIG_AUXILIARY_SELECT_KEY_KP, true); @@ -484,7 +484,7 @@ BopomofoConfig::valueChanged (const std::string & section, else if (CONFIG_BOPOMOFO_KEYBOARD_MAPPING == name) m_bopomofo_keyboard_mapping = normalizeGValue (value, 0); else if (CONFIG_SELECT_KEYS == name) - m_select_keys = normalizeGValue (value, "1234567890"); + m_select_keys = normalizeGValue (value, 0); else if (CONFIG_GUIDE_KEY == name) m_guide_key = normalizeGValue (value, true); else if (CONFIG_AUXILIARY_SELECT_KEY_F == name) diff --git a/src/Config.h b/src/Config.h index 080041a..0d2c4ed 100644 --- a/src/Config.h +++ b/src/Config.h @@ -52,7 +52,7 @@ public: gboolean initSimpChinese (void) const { return m_init_simp_chinese; } gboolean specialPhrases (void) const { return m_special_phrases; } gint bopomofoKeyboardMapping (void) const { return m_bopomofo_keyboard_mapping; } - const gchar * selectKeys (void) const { return m_select_keys.c_str (); } + gint selectKeys (void) const { return m_select_keys; } gboolean guideKey (void) const { return m_guide_key; } gboolean auxiliarySelectKeyF (void) const { return m_auxiliary_select_key_f; } gboolean auxiliarySelectKeyKP (void) const { return m_auxiliary_select_key_kp; } @@ -97,7 +97,7 @@ protected: gboolean m_special_phrases; gint m_bopomofo_keyboard_mapping; - std::string m_select_keys; + gint m_select_keys; gboolean m_guide_key; gboolean m_auxiliary_select_key_f; gboolean m_auxiliary_select_key_kp;