From ca8ae66acf7a0eba65c4e9500b3bb00f6199a481 Mon Sep 17 00:00:00 2001 From: Li Zhang Date: Fri, 31 May 2013 20:14:24 +0800 Subject: [PATCH] Hide candidate in NUMBERONLY layout Change-Id: I0866022f99c09d9812bf423c2f66b4b8c9755f54 --- ChangeLog | 4 ++++ configure.ac | 2 +- packaging/ise-engine-tables.spec | 4 ++-- src/scim_table_imengine.cpp | 25 ++++++++++--------------- src/scim_table_imengine.h | 2 -- 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index c536640..b546719 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-05-31 20:10 li2012.zhang@samsung.com + + * Hide candidate in NUMBERONLY layout + 2013-01-28 15:21 li2012.zhang@samsung.com * Disable AUTO_COMMIT and SELECT_KEYS for ZhuYin-Big diff --git a/configure.ac b/configure.ac index dca0000..2d67633 100755 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # Process this file with autoconf to produce a configure script. #AC_INIT(scim-tables, 0.5.10, suzhe@tsinghua.org.cn) #do not forget to edit skim/configure.in.in to change the version -AC_INIT(ise-engine-tables-zh, 0.0.0228, li2012.zhang@samsung.com) +AC_INIT(ise-engine-tables-zh, 0.0.0331, li2012.zhang@samsung.com) AC_CONFIG_SRCDIR([src/scim_table_imengine.h]) ISF_VERSION=1.0.0 diff --git a/packaging/ise-engine-tables.spec b/packaging/ise-engine-tables.spec index 4b54600..b4c3d31 100644 --- a/packaging/ise-engine-tables.spec +++ b/packaging/ise-engine-tables.spec @@ -1,7 +1,7 @@ %define nam ise-engine-tables -%define ver 0.0.0228 +%define ver 0.0.0331 %define skim 0 -%define rel 3 +%define rel 1 %define isf_version 1.0.0 %define build_scim_setup 0 %define ENABLE_JA 0 diff --git a/src/scim_table_imengine.cpp b/src/scim_table_imengine.cpp index a93cd12..64c50a1 100755 --- a/src/scim_table_imengine.cpp +++ b/src/scim_table_imengine.cpp @@ -461,7 +461,6 @@ TableInstance::TableInstance (TableFactory *factory, m_single_quotation_state (false), m_forward (false), m_focused (false), - m_lookup_table_always_on (false), m_inputing_caret (0), m_inputing_key (0), m_iconv (encoding) @@ -788,8 +787,8 @@ TableInstance::reset () m_inputing_key = 0; m_iconv.set_encoding (get_encoding ()); - if (m_lookup_table_always_on) { - refresh_lookup_table (true, false); + if (!m_forward) { + refresh_lookup_table (true, true); } else { hide_lookup_table(); } @@ -849,16 +848,13 @@ TableInstance::set_layout (unsigned int layout) case ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER: case ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL: case ECORE_IMF_INPUT_PANEL_LAYOUT_URL: - refresh_lookup_table (true, false); - m_lookup_table_always_on = true; + refresh_lookup_table(true,false); + show_lookup_table (); + m_forward = false; break; - case ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER: - case ECORE_IMF_INPUT_PANEL_LAYOUT_IP: - case ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH: - case ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY: + default: hide_lookup_table (); - m_lookup_table_always_on = false; - break; + m_forward = true; } } @@ -1719,7 +1715,6 @@ TableInstance::refresh_lookup_table (bool show, bool refresh) } } } - if (show) { if (m_lookup_table.number_of_candidates () && (m_factory->m_table.is_always_show_lookup () || @@ -1727,8 +1722,9 @@ TableInstance::refresh_lookup_table (bool show, bool refresh) m_inputing_caret < m_inputted_keys [m_inputing_key].length () || m_converted_strings.size () < m_inputted_keys.size () - 1)) { update_lookup_table (m_lookup_table); - } else { - if(m_inputted_keys.size ()) + } else { + if (m_inputted_keys.size () && + (m_inputing_caret || m_lookup_table.number_of_candidates ())) { m_lookup_table.clear (); update_lookup_table (m_lookup_table); @@ -1736,7 +1732,6 @@ TableInstance::refresh_lookup_table (bool show, bool refresh) else update_lookup_table (m_common_lookup_table); } - show_lookup_table (); } } diff --git a/src/scim_table_imengine.h b/src/scim_table_imengine.h index 8d0fbda..0346234 100755 --- a/src/scim_table_imengine.h +++ b/src/scim_table_imengine.h @@ -123,8 +123,6 @@ class TableInstance : public IMEngineInstanceBase bool m_forward; bool m_focused; - bool m_lookup_table_always_on; - std::vector m_inputted_keys; std::vector m_converted_strings; std::vector m_converted_indexes; -- 2.7.4