summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-12-31 10:43:58 +0800
committerPeng Wu <alexepico@gmail.com>2012-12-31 10:43:58 +0800
commit477e9add7c6a009cc7a03077eddace878832b172 (patch)
tree4ffc4e510d40f0b9d3153fadf9b50fd0738b6b4f
parentac92c9c2ebe039af25391e4f115cc690ddd28eea (diff)
downloadibus-libpinyin-477e9add7c6a009cc7a03077eddace878832b172.tar.gz
ibus-libpinyin-477e9add7c6a009cc7a03077eddace878832b172.tar.xz
ibus-libpinyin-477e9add7c6a009cc7a03077eddace878832b172.zip
add ctrl switch to config
-rw-r--r--src/PYConfig.cc1
-rw-r--r--src/PYConfig.h2
-rw-r--r--src/PYPConfig.cc8
3 files changed, 9 insertions, 2 deletions
diff --git a/src/PYConfig.cc b/src/PYConfig.cc
index 9db78da..c9fd251 100644
--- a/src/PYConfig.cc
+++ b/src/PYConfig.cc
@@ -46,6 +46,7 @@ Config::initDefaultValues (void)
{
m_orientation = IBUS_ORIENTATION_HORIZONTAL;
m_page_size = 5;
+ m_ctrl_switch = FALSE;
m_shift_select_candidate = FALSE;
m_minus_equal_page = TRUE;
m_comma_period_page = TRUE;
diff --git a/src/PYConfig.h b/src/PYConfig.h
index 560e852..8cfc148 100644
--- a/src/PYConfig.h
+++ b/src/PYConfig.h
@@ -44,6 +44,7 @@ public:
guint option (void) const { return m_option & m_option_mask; }
guint orientation (void) const { return m_orientation; }
guint pageSize (void) const { return m_page_size; }
+ gboolean ctrlSwitch(void) const { return m_ctrl_switch; }
gboolean shiftSelectCandidate (void) const { return m_shift_select_candidate; }
gboolean minusEqualPage (void) const { return m_minus_equal_page; }
gboolean commaPeriodPage (void) const { return m_comma_period_page; }
@@ -88,6 +89,7 @@ protected:
gint m_orientation;
guint m_page_size;
+ gboolean m_ctrl_switch;
gboolean m_shift_select_candidate;
gboolean m_minus_equal_page;
gboolean m_comma_period_page;
diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc
index a670d59..216d1cf 100644
--- a/src/PYPConfig.cc
+++ b/src/PYPConfig.cc
@@ -30,6 +30,7 @@ const gchar * const CONFIG_CORRECT_PINYIN = "CorrectPinyin";
const gchar * const CONFIG_FUZZY_PINYIN = "FuzzyPinyin";
const gchar * const CONFIG_ORIENTATION = "LookupTableOrientation";
const gchar * const CONFIG_PAGE_SIZE = "LookupTablePageSize";
+const gchar * const CONFIG_CTRL_SWITCH = "CtrlSwitch";
const gchar * const CONFIG_SHIFT_SELECT_CANDIDATE = "ShiftSelectCandidate";
const gchar * const CONFIG_MINUS_EQUAL_PAGE = "MinusEqualPage";
const gchar * const CONFIG_COMMA_PERIOD_PAGE = "CommaPeriodPage";
@@ -81,6 +82,7 @@ LibPinyinConfig::initDefaultValues (void)
m_orientation = IBUS_ORIENTATION_HORIZONTAL;
m_page_size = 5;
+ m_ctrl_switch = FALSE;
m_shift_select_candidate = FALSE;
m_minus_equal_page = TRUE;
m_comma_period_page = TRUE;
@@ -152,6 +154,7 @@ LibPinyinConfig::readDefaultValues (void)
m_page_size = 5;
g_warn_if_reached ();
}
+ m_ctrl_switch = read(CONFIG_CTRL_SWITCH, FALSE);
m_dictionaries = read (CONFIG_DICTIONARIES, std::string("2"));
/* fuzzy pinyin */
@@ -221,8 +224,9 @@ LibPinyinConfig::valueChanged (const std::string &section,
m_page_size = 5;
g_warn_if_reached ();
}
- }
- else if (CONFIG_DICTIONARIES == name) {
+ } else if (CONFIG_CTRL_SWITCH == name) {
+ m_ctrl_switch = normalizeGVariant (value, FALSE);
+ } else if (CONFIG_DICTIONARIES == name) {
m_dictionaries = normalizeGVariant (value, std::string("2"));
}
/* fuzzy pinyin */