diff options
| author | Peng Wu <alexepico@gmail.com> | 2025-01-09 15:17:22 +0800 |
|---|---|---|
| committer | Peng Wu <alexepico@gmail.com> | 2025-01-09 15:32:37 +0800 |
| commit | 0619e3261c6627f5e23f298ebb8d6fd8bcf52035 (patch) | |
| tree | a7a97b423fc94519f9bf0a0a1ee57ebfa3ba2a33 | |
| parent | 2c247e278a91bac283472e5ec6d42176768c26f7 (diff) | |
| download | ibus-libpinyin-0619e3261c6627f5e23f298ebb8d6fd8bcf52035.tar.gz ibus-libpinyin-0619e3261c6627f5e23f298ebb8d6fd8bcf52035.tar.xz ibus-libpinyin-0619e3261c6627f5e23f298ebb8d6fd8bcf52035.zip | |
Fix PinyinProperties::propertyActivate method
| -rw-r--r-- | src/PYPinyinProperties.cc | 25 | ||||
| -rw-r--r-- | src/PYProperty.h | 5 |
2 files changed, 23 insertions, 7 deletions
diff --git a/src/PYPinyinProperties.cc b/src/PYPinyinProperties.cc index 455a509..34840c4 100644 --- a/src/PYPinyinProperties.cc +++ b/src/PYPinyinProperties.cc @@ -237,13 +237,24 @@ PinyinProperties::propertyActivate (const gchar *prop_name, guint prop_state) { } const int len = strlen("LuaConverter."); - if (0 == strncmp (prop_name, "LuaConverter.", len) && - prop_state == PROP_STATE_CHECKED) { - std::string name = prop_name + len; - if (name == "None") - m_config.luaConverter (""); - else - m_config.luaConverter (name); + if (0 == strncmp (prop_name, "LuaConverter.", len)) { + if (prop_state == PROP_STATE_CHECKED) { + std::string name = prop_name + len; + if (name == "None") + m_config.luaConverter (""); + else + m_config.luaConverter (name); + } + + for (auto iter = m_props_lua_converter_vec.begin (); + iter != m_props_lua_converter_vec.end (); ++iter) { + Property *prop = *iter; + if (0 == g_strcmp0 (prop->getKey (), prop_name)) { + prop->setState ((IBusPropState) prop_state); + updateProperty (*prop); + } + } + return TRUE; } diff --git a/src/PYProperty.h b/src/PYProperty.h index 9a1d381..24923e4 100644 --- a/src/PYProperty.h +++ b/src/PYProperty.h @@ -39,6 +39,11 @@ public: IBusPropList *props = NULL) : Object (ibus_property_new (key, type, label, icon, tooltip, sensitive, visible, state, props)) { } + const gchar * getKey (void) + { + return ibus_property_get_key (get<IBusProperty> ()); + } + void setLabel (IBusText *text) { ibus_property_set_label (get<IBusProperty> (), text); |
