void HangulFactory::reload_config(const ConfigPointer &config) { if (config.null()) return; m_show_candidate_comment = config->read(String(SCIM_CONFIG_SHOW_CANDIDATE_COMMENT), m_show_candidate_comment); m_keyboard_layout = config->read(String(SCIM_CONFIG_LAYOUT), String("2")); m_use_ascii_mode = config->read(String(SCIM_CONFIG_USE_ASCII_MODE), false); m_commit_by_word = config->read(String(SCIM_CONFIG_COMMIT_BY_WORD), false); m_hanja_mode = config->read(String(SCIM_CONFIG_HANJA_MODE), false); String str; str = config->read(String(SCIM_CONFIG_HANGUL_KEY), String("Hangul,Shift+space")); scim_string_to_key_list(m_hangul_keys, str); str = config->read(String (SCIM_CONFIG_HANJA_KEY), String ("Hangul_Hanja,F9")); scim_string_to_key_list(m_hanja_keys, str); str = config->read(String (SCIM_CONFIG_HANJA_MODE_KEY), String ("")); scim_string_to_key_list(m_hanja_mode_keys, str); m_lookup_table_vertical = config->read(String(SCIM_CONFIG_PANEL_LOOKUP_TABLE_VERTICAL), false); }
void FrontEndHotkeyMatcher::load_hotkeys (const ConfigPointer &config) { clear (); if (config.null () || !config->valid ()) return; KeyEventList keys; // Load the least important hotkeys first. for (int i = SCIM_FRONTEND_HOTKEY_SHOW_FACTORY_MENU; i >= SCIM_FRONTEND_HOTKEY_TRIGGER; --i) { if (scim_string_to_key_list (keys, config->read (String (__scim_frontend_hotkey_config_paths [i]), String (__scim_frontend_hotkey_defaults [i])))) m_impl->m_matcher.add_hotkeys (keys, i); } }
void IMEngineHotkeyMatcher::load_hotkeys (const ConfigPointer &config) { clear (); if (config.null () || !config->valid ()) return; std::vector <String> uuids; scim_split_string_list (uuids, config->read (String (SCIM_CONFIG_HOTKEYS_IMENGINE_LIST), String (""))); std::sort (uuids.begin (), uuids.end ()); uuids.erase (std::unique (uuids.begin (), uuids.end ()), uuids.end ()); if (uuids.size ()) { KeyEventList keys; for (std::vector <String>::iterator uit = uuids.begin (); uit != uuids.end (); ++uit) { if (scim_string_to_key_list (keys, config->read (String (SCIM_CONFIG_HOTKEYS_IMENGINE "/") + *uit, String ("")))) { m_impl->m_matcher.add_hotkeys (keys, (int) m_impl->m_uuids.size ()); m_impl->m_uuids.push_back (*uit); } } } }