From 5253c3180b8835491181096965c09ad9edc1c9d3 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 30 Jul 2013 12:44:02 +0800 Subject: [PATCH] Update the symbol of the ibus indicator --- ibus-libpinyin-1.7.x-head.patch | 80 +++++++++++++++++++++++++++++++++ ibus-libpinyin.spec | 7 ++- 2 files changed, 85 insertions(+), 2 deletions(-) diff --git a/ibus-libpinyin-1.7.x-head.patch b/ibus-libpinyin-1.7.x-head.patch index e69de29..5f14656 100644 --- a/ibus-libpinyin-1.7.x-head.patch +++ b/ibus-libpinyin-1.7.x-head.patch @@ -0,0 +1,80 @@ +From 9ef836117508d9c0c938f57a5ffa5ffca7eb2e7b Mon Sep 17 00:00:00 2001 +From: Peng Wu +Date: Fri, 26 Jul 2013 13:03:44 +0800 +Subject: [PATCH] Update the symbol of the ibus indicator + +--- + src/PYPinyinProperties.cc | 14 +++++++++++++- + src/PYProperty.h | 10 ++++++++++ + 2 files changed, 23 insertions(+), 1 deletion(-) + +diff --git a/src/PYPinyinProperties.cc b/src/PYPinyinProperties.cc +index 0a77163..66205de 100644 +--- a/src/PYPinyinProperties.cc ++++ b/src/PYPinyinProperties.cc +@@ -26,6 +26,7 @@ + namespace PY { + + #define _(text) (dgettext (GETTEXT_PACKAGE, text)) ++#define N_(text) text + + PinyinProperties::PinyinProperties (Config & config) + : m_config (config), +@@ -33,7 +34,7 @@ PinyinProperties::PinyinProperties (Config & config) + m_mode_full (m_config.initFull ()), + m_mode_full_punct (m_config.initFullPunct ()), + m_mode_simp (m_config.initSimpChinese ()), +- m_prop_chinese ("mode.chinese", ++ m_prop_chinese ("InputMode", + PROP_TYPE_NORMAL, + StaticText (m_mode_chinese ? + _("Chinese") : +@@ -83,6 +84,11 @@ PinyinProperties::PinyinProperties (Config & config) + "ibus-setup", + StaticText (_("Preferences"))) + { ++ if (m_mode_chinese) ++ m_prop_chinese.setSymbol(N_("中")); ++ else ++ m_prop_chinese.setSymbol(N_("英")); ++ + m_props.append (m_prop_chinese); + m_props.append (m_prop_full); + m_props.append (m_prop_full_punct); +@@ -98,6 +104,12 @@ PinyinProperties::toggleModeChinese (void) + m_prop_chinese.setLabel (m_mode_chinese ? + _("Chinese") : + _("English")); ++ ++ if (m_mode_chinese) ++ m_prop_chinese.setSymbol(N_("中")); ++ else ++ m_prop_chinese.setSymbol(N_("英")); ++ + m_prop_chinese.setIcon (m_mode_chinese ? + PKGDATADIR"/icons/chinese.svg" : + PKGDATADIR"/icons/english.svg"); +diff --git a/src/PYProperty.h b/src/PYProperty.h +index 70c0808..13b9340 100644 +--- a/src/PYProperty.h ++++ b/src/PYProperty.h +@@ -55,6 +55,16 @@ public: + ibus_property_set_icon (get (), icon); + } + ++ void setSymbol (IBusText *text) ++ { ++ ibus_property_set_symbol (get (), text); ++ } ++ ++ void setSymbol (const gchar *text) ++ { ++ setSymbol (Text (text)); ++ } ++ + void setSensitive (gboolean sensitive) + { + ibus_property_set_sensitive (get (), sensitive); +-- +1.8.3.1 + diff --git a/ibus-libpinyin.spec b/ibus-libpinyin.spec index c439f54..7a38794 100644 --- a/ibus-libpinyin.spec +++ b/ibus-libpinyin.spec @@ -1,8 +1,8 @@ -%global snapshot 0 +%global snapshot 1 Name: ibus-libpinyin Version: 1.6.91 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Intelligent Pinyin engine based on libpinyin for IBus License: GPLv2+ Group: System Environment/Libraries @@ -78,6 +78,9 @@ make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" %{_datadir}/ibus/component/* %changelog +* Tue Jul 30 2013 Peng Wu - 1.6.91-2 +- Update the symbol of the ibus indicator + * Sun Apr 28 2013 Peng Wu - 1.6.91-1 - Update to 1.6.91