summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2022-04-11 15:30:38 +0800
committerPeng Wu <alexepico@gmail.com>2022-04-11 15:30:38 +0800
commiteb8a420dbe6f5589d89ea8c50d218a625a3de406 (patch)
treeac715ebe03a26b87abe47830ceec975dcc99fb4b
parent701dbb101164f608b86354960a5e4d258eed390b (diff)
downloadibus-libpinyin-eb8a420dbe6f5589d89ea8c50d218a625a3de406.tar.gz
ibus-libpinyin-eb8a420dbe6f5589d89ea8c50d218a625a3de406.tar.xz
ibus-libpinyin-eb8a420dbe6f5589d89ea8c50d218a625a3de406.zip
Rename show-suggestion option to suggestion-candidate option
-rw-r--r--src/PYConfig.cc2
-rw-r--r--src/PYConfig.h4
-rw-r--r--src/PYPBopomofoEngine.cc2
-rw-r--r--src/PYPConfig.cc11
-rw-r--r--src/PYPPinyinEngine.cc2
5 files changed, 10 insertions, 11 deletions
diff --git a/src/PYConfig.cc b/src/PYConfig.cc
index 4238b95..b5badca 100644
--- a/src/PYConfig.cc
+++ b/src/PYConfig.cc
@@ -44,7 +44,6 @@ Config::initDefaultValues (void)
m_display_style = DISPLAY_STYLE_TRADITIONAL;
m_remember_every_input = FALSE;
m_sort_option = SORT_BY_PHRASE_LENGTH_AND_PINYIN_LENGTH_AND_FREQUENCY;
- m_show_suggestion = FALSE;
m_shift_select_candidate = FALSE;
m_minus_equal_page = TRUE;
@@ -77,6 +76,7 @@ Config::initDefaultValues (void)
m_use_custom_table = FALSE;
m_emoji_candidate = TRUE;
m_english_candidate = TRUE;
+ m_suggestion_candidate = FALSE;
m_network_dictionary_start_timestamp = 0;
m_network_dictionary_end_timestamp = 0;
diff --git a/src/PYConfig.h b/src/PYConfig.h
index 9a69ceb..1ee509e 100644
--- a/src/PYConfig.h
+++ b/src/PYConfig.h
@@ -59,7 +59,6 @@ public:
DisplayStyle displayStyle (void) const { return m_display_style; }
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; }
@@ -82,6 +81,7 @@ public:
gboolean useCustomTable (void) const { return m_use_custom_table; }
gboolean emojiCandidate (void) const { return m_emoji_candidate; }
gboolean englishCandidate (void) const { return m_english_candidate; }
+ gboolean suggestionCandidate (void) const { return m_suggestion_candidate; }
std::string mainSwitch (void) const { return m_main_switch; }
std::string letterSwitch (void) const { return m_letter_switch; }
@@ -144,7 +144,6 @@ protected:
DisplayStyle m_display_style;
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;
@@ -173,6 +172,7 @@ protected:
gboolean m_use_custom_table;
gboolean m_emoji_candidate;
gboolean m_english_candidate;
+ gboolean m_suggestion_candidate;
std::string m_main_switch;
std::string m_letter_switch;
diff --git a/src/PYPBopomofoEngine.cc b/src/PYPBopomofoEngine.cc
index e58ffa0..c6e0627 100644
--- a/src/PYPBopomofoEngine.cc
+++ b/src/PYPBopomofoEngine.cc
@@ -315,7 +315,7 @@ BopomofoEngine::commitText (Text & text)
if (m_input_mode != MODE_INIT && m_input_mode != MODE_SUGGESTION) {
m_input_mode = MODE_INIT;
- } else if (BopomofoConfig::instance ().showSuggestion ()) {
+ } else if (BopomofoConfig::instance ().suggestionCandidate ()) {
m_input_mode = MODE_SUGGESTION;
m_editors[m_input_mode]->setText (text.text (), 0);
m_need_update = TRUE;
diff --git a/src/PYPConfig.cc b/src/PYPConfig.cc
index b608022..ed8138c 100644
--- a/src/PYPConfig.cc
+++ b/src/PYPConfig.cc
@@ -36,7 +36,6 @@ const gchar * const CONFIG_PAGE_SIZE = "lookup-table-page-size";
const gchar * const CONFIG_DISPLAY_STYLE = "display-style";
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";
@@ -62,6 +61,7 @@ const gchar * const CONFIG_TABLE_INPUT_MODE = "table-input-mode";
const gchar * const CONFIG_USE_CUSTOM_TABLE = "use-custom-table";
const gchar * const CONFIG_EMOJI_CANDIDATE = "emoji-candidate";
const gchar * const CONFIG_ENGLISH_CANDIDATE = "english-candidate";
+const gchar * const CONFIG_SUGGESTION_CANDIDATE = "suggestion-candidate";
const gchar * const CONFIG_IMPORT_CUSTOM_TABLE = "import-custom-table";
const gchar * const CONFIG_EXPORT_CUSTOM_TABLE = "export-custom-table";
const gchar * const CONFIG_CLEAR_CUSTOM_TABLE = "clear-custom-table";
@@ -132,10 +132,10 @@ LibPinyinConfig::initDefaultValues (void)
m_display_style = DISPLAY_STYLE_TRADITIONAL;
m_remember_every_input = FALSE;
m_sort_option = SORT_BY_PHRASE_LENGTH_AND_PINYIN_LENGTH_AND_FREQUENCY;
- m_show_suggestion = FALSE;
m_emoji_candidate = TRUE;
m_english_candidate = TRUE;
+ m_suggestion_candidate = FALSE;
m_shift_select_candidate = FALSE;
m_minus_equal_page = TRUE;
@@ -297,10 +297,9 @@ LibPinyinConfig::readDefaultValues (void)
}
}
- m_show_suggestion = read (CONFIG_SHOW_SUGGESTION, false);
-
m_emoji_candidate = read (CONFIG_EMOJI_CANDIDATE, true);
m_english_candidate = read (CONFIG_ENGLISH_CANDIDATE, true);
+ m_suggestion_candidate = read (CONFIG_SUGGESTION_CANDIDATE, false);
m_dictionaries = read (CONFIG_DICTIONARIES, "");
m_opencc_config = read (CONFIG_OPENCC_CONFIG, "s2t.json");
@@ -400,12 +399,12 @@ 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, false);
} else if (CONFIG_EMOJI_CANDIDATE == name) {
m_emoji_candidate = normalizeGVariant (value, true);
} else if (CONFIG_ENGLISH_CANDIDATE == name) {
m_english_candidate = normalizeGVariant (value, true);
+ } else if (CONFIG_SUGGESTION_CANDIDATE == name) {
+ m_suggestion_candidate = normalizeGVariant (value, false);
} else if (CONFIG_DICTIONARIES == name) {
m_dictionaries = normalizeGVariant (value, std::string (""));
} else if (CONFIG_OPENCC_CONFIG == name) {
diff --git a/src/PYPPinyinEngine.cc b/src/PYPPinyinEngine.cc
index a10229b..786f2f3 100644
--- a/src/PYPPinyinEngine.cc
+++ b/src/PYPPinyinEngine.cc
@@ -531,7 +531,7 @@ PinyinEngine::commitText (Text & text)
if (m_input_mode != MODE_INIT && m_input_mode != MODE_SUGGESTION) {
m_input_mode = MODE_INIT;
- } else if (PinyinConfig::instance ().showSuggestion ()) {
+ } else if (PinyinConfig::instance ().suggestionCandidate ()) {
m_input_mode = MODE_SUGGESTION;
m_editors[m_input_mode]->setText (text.text (), 0);
m_need_update = TRUE;