From 74e9b42783af6a0a9d51df6271bca169e3dcc81d Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Tue, 12 Aug 2014 18:42:49 +0000 Subject: extraicons registration moved to Load() git-svn-id: http://svn.miranda-ng.org/main/trunk@10168 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/UserInfoEx/src/Flags/svc_flags.cpp | 20 ++++++++++---------- plugins/UserInfoEx/src/svc_reminder.cpp | 7 ++++--- 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'plugins/UserInfoEx') diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index 75da95834c..637c6472a4 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -212,6 +212,16 @@ void SvcFlagsLoadModule() g_bShowStatusIconFlag = db_get_b(NULL, MODNAMEFLAGS, "ShowStatusIconFlag", SETTING_SHOWSTATUSICONFLAG_DEFAULT) != 0; HookEvent(ME_SKIN2_ICONSCHANGED, OnStatusIconsChanged); + + // get local langID for descIcon (try to use user local Flag as icon) + DWORD langid = 0; + int r = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ICOUNTRY | LOCALE_RETURN_NUMBER, (LPTSTR)&langid, sizeof(langid) / sizeof(TCHAR)); + if (!CallService(MS_UTILS_GETCOUNTRYBYNUMBER, langid, 0)) + langid = 1; + + char szId[20]; + mir_snprintf(szId, SIZEOF(szId), (langid == 0xFFFF) ? "%s_0x%X" : "%s_%i", "flags", langid); /* buffer safe */ + hExtraIconSvc = ExtraIcon_Register("Flags", LPGEN("Flags (uinfoex)"), szId); } /** @@ -224,16 +234,6 @@ void SvcFlagsLoadModule() void SvcFlagsOnModulesLoaded() { - // get local langID for descIcon (try to use user local Flag as icon) - DWORD langid = 0; - int r = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ICOUNTRY | LOCALE_RETURN_NUMBER, (LPTSTR)&langid, sizeof(langid) / sizeof(TCHAR)); - if (!CallService(MS_UTILS_GETCOUNTRYBYNUMBER, langid, 0)) - langid = 1; - - char szId[20]; - mir_snprintf(szId, SIZEOF(szId), (langid == 0xFFFF) ? "%s_0x%X" : "%s_%i", "flags", langid); /* buffer safe */ - hExtraIconSvc = ExtraIcon_Register("Flags", LPGEN("Flags (uinfoex)"), szId); - /* Status Icon */ StatusIconData sid = { sizeof(sid) }; sid.szModule = MODNAMEFLAGS; diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index b5808aa64c..7651ec6d09 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -844,9 +844,6 @@ static void UpdateTimer(BYTE bStartup) void SvcReminderEnable(BYTE bEnable) { if (bEnable) { // Reminder is on - if (ExtraIcon == INVALID_HANDLE_VALUE) - ExtraIcon = ExtraIcon_Register("Reminder", LPGEN("Reminder (uinfoex)"), ICO_COMMON_ANNIVERSARY); - // init hooks if (!ghCListIA) ghCListIA = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcon); @@ -932,6 +929,10 @@ void SvcReminderLoadModule(void) hk.pszDescription = LPGEN("Check anniversaries"); hk.pszService = MS_USERINFO_REMINDER_CHECK; Hotkey_Register(&hk); + + if (db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED) != REMIND_OFF && ExtraIcon == INVALID_HANDLE_VALUE) + ExtraIcon = ExtraIcon_Register("Reminder", LPGEN("Reminder (uinfoex)"), ICO_COMMON_ANNIVERSARY); + } /** -- cgit v1.2.3