diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-11 07:08:40 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-11 07:08:40 +0000 |
commit | bd820972afe24409e6b570adbc45f5dc0fa2385d (patch) | |
tree | e600bf39409083219c7928e10ec2b61002529641 /plugins/SpellChecker/src | |
parent | 6029165c364f93a84ab7e98ef71d3a711b0f588c (diff) |
SRMM icons to be unloaded automatically
git-svn-id: http://svn.miranda-ng.org/main/trunk@4418 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SpellChecker/src')
-rw-r--r-- | plugins/SpellChecker/src/spellchecker.cpp | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index ef633af616..4e4782d740 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -98,12 +98,6 @@ static int IconsChanged(WPARAM wParam, LPARAM lParam) static int PreShutdown(WPARAM wParam, LPARAM lParam) { - if (ServiceExists(MS_MSG_REMOVEICON)) { - StatusIconData sid = { sizeof(sid) }; - sid.szModule = MODULE_NAME; - CallService(MS_MSG_REMOVEICON, 0, (LPARAM) &sid); - } - mir_free(dictionariesFolder); mir_free(customDictionariesFolder); mir_free(flagsDllFolder); @@ -211,30 +205,27 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) CreateServiceFunction(MS_SPELLCHECKER_REMOVE_RICHEDIT, RemoveContactTextBoxService); CreateServiceFunction(MS_SPELLCHECKER_SHOW_POPUP_MENU, ShowPopupMenuService); - if (ServiceExists(MS_MSG_ADDICON)) { - StatusIconData sid = { sizeof(sid) }; - sid.szModule = MODULE_NAME; - sid.hIconDisabled = Skin_GetIcon("spellchecker_disabled"); - sid.flags = MBF_HIDDEN; + StatusIconData sid = { sizeof(sid) }; + sid.szModule = MODULE_NAME; + sid.hIconDisabled = Skin_GetIcon("spellchecker_disabled"); + sid.flags = MBF_HIDDEN; - for (int i = 0; i < languages.getCount(); i++) { - sid.dwId = i; + for (int i = 0; i < languages.getCount(); i++) { + sid.dwId = i; - char tmp[128]; - mir_snprintf(tmp, SIZEOF(tmp), "%s - %S", - Translate("Spell Checker"), languages[i]->full_name); - sid.szTooltip = tmp; + char tmp[128]; + mir_snprintf(tmp, SIZEOF(tmp), "%s - %S", + Translate("Spell Checker"), languages[i]->full_name); + sid.szTooltip = tmp; - HICON hIcon = (opts.use_flags) ? Skin_GetIconByHandle(languages[i]->hIcolib) : Skin_GetIcon("spellchecker_enabled"); - sid.hIcon = CopyIcon(hIcon); - Skin_ReleaseIcon(hIcon); + HICON hIcon = (opts.use_flags) ? Skin_GetIconByHandle(languages[i]->hIcolib) : Skin_GetIcon("spellchecker_enabled"); + sid.hIcon = CopyIcon(hIcon); + Skin_ReleaseIcon(hIcon); - CallService(MS_MSG_ADDICON, 0, (LPARAM) &sid); - } + Srmm_AddIcon(&sid); } - HOTKEYDESC hkd = {0}; - hkd.cbSize = sizeof(hkd); + HOTKEYDESC hkd = { sizeof(hkd) }; hkd.pszName = "Spell Checker/Toggle"; hkd.pszSection = LPGEN("Spell Checker"); hkd.pszDescription = LPGEN("Enable/disable spell checker"); |