summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2018-06-14 15:53:43 +0800
committerPeng Wu <alexepico@gmail.com>2018-06-14 15:53:43 +0800
commit7216bcd03777defa253f2c70eeda364f345970dc (patch)
tree444433ba617bee7b2eecbcf2e3ad6a6441642c90
parent94e9584b8b81cdcb4bce15ab58e83001bd085192 (diff)
downloadibus-libpinyin-7216bcd03777defa253f2c70eeda364f345970dc.tar.gz
ibus-libpinyin-7216bcd03777defa253f2c70eeda364f345970dc.tar.xz
ibus-libpinyin-7216bcd03777defa253f2c70eeda364f345970dc.zip
add option show suggestion
-rw-r--r--src/PYConfig.cc1
-rw-r--r--src/PYConfig.h2
-rw-r--r--src/PYPConfig.cc6
3 files changed, 9 insertions, 0 deletions
diff --git a/src/PYConfig.cc b/src/PYConfig.cc
index f10a1f9..9f47cb7 100644
--- a/src/PYConfig.cc
+++ b/src/PYConfig.cc
@@ -44,6 +44,7 @@ Config::initDefaultValues (void)
m_page_size = 5;
m_remember_every_input = FALSE;
m_sort_option = SORT_BY_PHRASE_LENGTH_AND_PINYIN_LENGTH_AND_FREQUENCY;
+ m_show_suggestion = TRUE;
m_shift_select_candidate = FALSE;
m_minus_equal_page = TRUE;
diff --git a/src/PYConfig.h b/src/PYConfig.h
index c982ec5..3a01762 100644
--- a/src/PYConfig.h
+++ b/src/PYConfig.h
@@ -47,6 +47,7 @@ public:
guint pageSize (void) const { return m_page_size; }
gboolean rememberEveryInput (void) const { return m_remember_every_input; }
sort_option_t sortOption (void) const { return m_sort_option; }
+ gboolean showSuggestion (void) const { return m_show_suggestion; }
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; }
@@ -96,6 +97,7 @@ protected:
guint m_page_size;
gboolean m_remember_every_input;
sort_option_t m_sort_option;
+ gboolean m_show_suggestion;
gboolean m_shift_select_candidate;
gboolean m_minus_equal_page;
diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc
index aa13f6c..2253b00 100644
--- a/src/PYPConfig.cc
+++ b/src/PYPConfig.cc
@@ -35,6 +35,7 @@ const gchar * const CONFIG_ORIENTATION = "lookup-table-orientation
const gchar * const CONFIG_PAGE_SIZE = "lookup-table-page-size";
const gchar * const CONFIG_REMEMBER_EVERY_INPUT = "remember-every-input";
const gchar * const CONFIG_SORT_OPTION = "sort-candidate-option";
+const gchar * const CONFIG_SHOW_SUGGESTION = "show-suggestion";
const gchar * const CONFIG_SHIFT_SELECT_CANDIDATE = "shift-select-candidate";
const gchar * const CONFIG_MINUS_EQUAL_PAGE = "minus-equal-page";
const gchar * const CONFIG_COMMA_PERIOD_PAGE = "comma-period-page";
@@ -98,6 +99,7 @@ LibPinyinConfig::initDefaultValues (void)
m_page_size = 5;
m_remember_every_input = FALSE;
m_sort_option = SORT_BY_PHRASE_LENGTH_AND_PINYIN_LENGTH_AND_FREQUENCY;
+ m_show_suggestion = TRUE;
m_shift_select_candidate = FALSE;
m_minus_equal_page = TRUE;
@@ -204,6 +206,8 @@ LibPinyinConfig::readDefaultValues (void)
}
}
+ m_show_suggestion = read (CONFIG_SHOW_SUGGESTION, true);
+
m_dictionaries = read (CONFIG_DICTIONARIES, "");
m_main_switch = read (CONFIG_MAIN_SWITCH, "<Shift>");
@@ -265,6 +269,8 @@ LibPinyinConfig::valueChanged (const std::string &schema_id,
m_sort_option = sort_options[i].sort_option;
}
}
+ } else if (CONFIG_SHOW_SUGGESTION == name) {
+ m_show_suggestion = normalizeGVariant (value, true);
} else if (CONFIG_DICTIONARIES == name) {
m_dictionaries = normalizeGVariant (value, std::string (""));
} else if (CONFIG_MAIN_SWITCH == name) {