#: ../setup/ibus-pinyin-preferences.ui.h:70
msgid "http://ibus.googlecode.com"
msgstr "http://ibus.googlecode.com"
+
+msgid "Feature of Enter key:"
+msgstr "Enter 鍵功能:"
+
+msgid "<b>Other</b>"
+msgstr "<b>其他</b>"
+
+msgid "Commit original text"
+msgstr "輸出原本的英文字"
+
+msgid "Commit first candidate"
+msgstr "輸出第一個候選詞"
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkFrame" id="frame10">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment16">
+ <property name="visible">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkVBox" id="vbox16">
+ <property name="visible">True</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="LabelEnter">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Feature of Enter key:</property>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="CommitFirstCandidate">
+ <property name="label" translatable="yes">Commit first candidate</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">CommitOriginalText</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="CommitOriginalText">
+ <property name="label" translatable="yes">Commit original text</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="labelOther">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Other</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
</child>
</object>
self.__auxiliary_select_key_f = self.__builder.get_object("AuxiliarySelectKey_F")
self.__auxiliary_select_key_kp = self.__builder.get_object("AuxiliarySelectKey_KP")
+ # other
+ self.__enter_key = self.__builder.get_object("CommitFirstCandidate")
+
# read value
self.__bopomofo_keyboard_mapping.set_active(self.__get_value("BopomofoKeyboardMapping", 0))
self.__incomplete_bopomofo.set_active(self.__get_value("IncompletePinyin", False))
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))
+ self.__enter_key.set_active(self.__get_value("EnterKey", True))
# connect signals
def __bopomofo_keyboard_mapping_changed_cb(widget):
self.__guide_key.connect("toggled", self.__toggled_cb, "GuideKey")
self.__auxiliary_select_key_f.connect("toggled", self.__toggled_cb, "AuxiliarySelectKey_F")
self.__auxiliary_select_key_kp.connect("toggled", self.__toggled_cb, "AuxiliarySelectKey_KP")
+ self.__enter_key.connect("toggled", self.__toggled_cb, "EnterKey")
def __init_input_custom(self):
# others
m_buffer.clear ();
- if (m_select_mode) {
+ if (!m_select_mode && m_config.enterKey ()) {
+ m_phrase_editor.selectCandidate(0);
+ }
+
+
+ if (m_select_mode || m_config.enterKey ()) {
m_buffer << m_phrase_editor.selectedString ();
const gchar *p;
const gchar * const CONFIG_GUIDE_KEY = "GuideKey";
const gchar * const CONFIG_AUXILIARY_SELECT_KEY_F = "AuxiliarySelectKey_F";
const gchar * const CONFIG_AUXILIARY_SELECT_KEY_KP = "AuxiliarySelectKey_KP";
+const gchar * const CONFIG_ENTER_KEY = "EnterKey";
std::unique_ptr<PinyinConfig> PinyinConfig::m_instance;
std::unique_ptr<BopomofoConfig> BopomofoConfig::m_instance;
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);
+ m_enter_key = read (CONFIG_ENTER_KEY, true);
}
gboolean
m_auxiliary_select_key_f = normalizeGValue (value, true);
else if (CONFIG_AUXILIARY_SELECT_KEY_KP == name)
m_auxiliary_select_key_kp = normalizeGValue (value, true);
+ else if (CONFIG_ENTER_KEY == name)
+ m_enter_key = normalizeGValue (value, true);
else
return FALSE;
return TRUE;
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 enterKey (void) const { return m_enter_key; }
protected:
bool read (const gchar * name, bool defval);
gboolean m_guide_key;
gboolean m_auxiliary_select_key_f;
gboolean m_auxiliary_select_key_kp;
+
+ gboolean m_enter_key;
};
/* PinyinConfig */