</packing>
</child>
<child>
- <object class="GtkComboBoxEntry" id="SelectKeys">
+ <object class="GtkComboBox" id="SelectKeys">
<property name="visible">True</property>
<property name="model">liststoreSelectionKeys</property>
<property name="button_sensitivity">on</property>
</columns>
<data>
<row>
- <col id="0" translatable="no">1234567890</col>
+ <col id="0">1234567890</col>
</row>
<row>
- <col id="0" translatable="no">asdfghjkl;</col>
+ <col id="0">asdfghjkl;</col>
</row>
<row>
- <col id="0" translatable="no">1qaz2wsxed</col>
+ <col id="0">1qaz2wsxed</col>
</row>
<row>
- <col id="0" translatable="no">asdfzxcvgb</col>
+ <col id="0">asdfzxcvgb</col>
</row>
<row>
- <col id="0" translatable="no">1234qweras</col>
+ <col id="0">1234qweras</col>
</row>
<row>
- <col id="0" translatable="no">aoeu;qjkix</col>
+ <col id="0">aoeu;qjkix</col>
+ </row>
+ <row>
+ <col id="0">aoeuhtnsid</col>
+ </row>
+ <row>
+ <col id="0">aoeuidhtns</col>
+ </row>
+ <row>
+ <col id="0">qweasdzxcr</col>
</row>
</data>
</object>
# 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")
# 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))
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")
L'ˊ', L'ˇ', L'ˋ', L'˙',
};
+const static gchar * bopomofo_select_keys[] = {
+ "1234567890",
+ "asdfghjkl;",
+ "1qaz2wsxed",
+ "asdfzxcvgb",
+ "1234qweras",
+ "aoeu;qjkix",
+ "aoeuhtnsid",
+ "aoeuidhtns",
+ "qweasdzxcr"
+};
+
#endif /* __PY_BOPOMOFO_H_ */
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;
{
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);
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);
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)
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; }
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;