summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2014-08-12 18:42:49 +0000
committerKirill Volinsky <mataes2007@gmail.com>2014-08-12 18:42:49 +0000
commit74e9b42783af6a0a9d51df6271bca169e3dcc81d (patch)
tree636b9ea671646559fd835766d482fd99b96bbd19 /plugins
parent4330c62d2fa5b2752036b43018044c7c01b10695 (diff)
extraicons registration moved to Load()
git-svn-id: http://svn.miranda-ng.org/main/trunk@10168 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AuthState/src/main.cpp6
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp16
-rw-r--r--plugins/BuddyExpectator/src/options.cpp1
-rw-r--r--plugins/BuddyExpectator/src/options.h1
-rw-r--r--plugins/CountryFlags/src/extraimg.cpp2
-rw-r--r--plugins/FingerprintNG/src/fingerprint.cpp6
-rw-r--r--plugins/IgnoreState/src/main.cpp5
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp6
-rw-r--r--plugins/MobileState/src/main.cpp7
-rw-r--r--plugins/New_GPG/src/init.cpp8
-rw-r--r--plugins/Rate/src/main.cpp7
-rw-r--r--plugins/SecureIM/src/main.cpp5
-rw-r--r--plugins/UserInfoEx/src/Flags/svc_flags.cpp20
-rw-r--r--plugins/UserInfoEx/src/svc_reminder.cpp7
14 files changed, 48 insertions, 49 deletions
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp
index b6af9e6668..be989b00e2 100644
--- a/plugins/AuthState/src/main.cpp
+++ b/plugins/AuthState/src/main.cpp
@@ -168,9 +168,6 @@ int onModulesLoaded(WPARAM, LPARAM)
// IcoLib support
Icon_Register(g_hInst, "Auth State", iconList, SIZEOF(iconList));
- // extra icons
- hExtraIcon = ExtraIcon_Register("authstate", LPGEN("Auth State"), "authgrant_icon");
-
// Set initial value for all contacts
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
onExtraImageApplying(hContact, 1);
@@ -214,6 +211,9 @@ extern "C" int __declspec(dllexport) Load(void)
hUserMenu = Menu_AddContactMenuItem(&mi);
}
+ // extra icons
+ hExtraIcon = ExtraIcon_Register("authstate", LPGEN("Auth State"), "authgrant_icon");
+
return 0;
}
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
index 1f30bcee9a..fa0dcb9876 100644
--- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
@@ -136,8 +136,7 @@ LRESULT CALLBACK MissYouPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
CallServiceSync("BuddyExpectator/actionMissYou", (WPARAM)PUGetContact(hWnd), 0);
if ( !db_get_b(PUGetContact(hWnd), MODULE_NAME, "MissYouNotifyAlways", 0)) {
db_set_b(PUGetContact(hWnd), MODULE_NAME, "MissYou", 0);
- if (options.MissYouIcon)
- ExtraIcon_Clear(hExtraIcon, PUGetContact(hWnd));
+ ExtraIcon_Clear(hExtraIcon, PUGetContact(hWnd));
}
PUDeletePopup(hWnd);
}
@@ -150,8 +149,7 @@ LRESULT CALLBACK MissYouPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
case UM_POPUPACTION:
if (wParam == 1) {
db_set_b(PUGetContact(hWnd), MODULE_NAME, "MissYou", 0);
- if (options.MissYouIcon)
- ExtraIcon_Clear(hExtraIcon, PUGetContact(hWnd));
+ ExtraIcon_Clear(hExtraIcon, PUGetContact(hWnd));
PUDeletePopup(hWnd);
}
break;
@@ -421,13 +419,11 @@ INT_PTR MenuMissYouClick(WPARAM hContact, LPARAM)
{
if (db_get_b(hContact, MODULE_NAME, "MissYou", 0)) {
db_set_b(hContact, MODULE_NAME, "MissYou", 0);
- if (options.MissYouIcon)
- ExtraIcon_Clear(hExtraIcon, hContact);
+ ExtraIcon_Clear(hExtraIcon, hContact);
}
else {
db_set_b(hContact, MODULE_NAME, "MissYou", 1);
- if (options.MissYouIcon)
- ExtraIcon_SetIcon(hExtraIcon, hContact, "enabled_icon");
+ ExtraIcon_SetIcon(hExtraIcon, hContact, "enabled_icon");
}
return 0;
@@ -615,8 +611,6 @@ int ModulesLoaded(WPARAM, LPARAM)
timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded2);
- if (options.MissYouIcon)
- hExtraIcon = ExtraIcon_Register("buddy_exp", LPGEN("Buddy Expectator"), "enabled_icon");
////////////////////////////////////////////////////////////////////////////
@@ -708,6 +702,8 @@ extern "C" int __declspec(dllexport) Load(void)
db_set_dw(hContact, MODULE_NAME, "CreationTime", current_time);
}
+ hExtraIcon = ExtraIcon_Register("buddy_exp", LPGEN("Buddy Expectator"), "enabled_icon");
+
return 0;
}
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp
index fc4a51d40e..e2915071ca 100644
--- a/plugins/BuddyExpectator/src/options.cpp
+++ b/plugins/BuddyExpectator/src/options.cpp
@@ -54,7 +54,6 @@ void LoadOptions()
options.notifyFirstOnline = db_get_b(NULL, MODULE_NAME, "bShowFirstSight", 0) ? true : false;
options.hideInactive = db_get_b(NULL, MODULE_NAME, "bHideInactive", 0) ? true : false;
options.enableMissYou = db_get_b(NULL, MODULE_NAME, "bMissYouEnabled", 1) ? true : false;
- options.MissYouIcon = db_get_b(NULL, MODULE_NAME, "bMissYouIcon", 0);
}
void SaveOptions()
diff --git a/plugins/BuddyExpectator/src/options.h b/plugins/BuddyExpectator/src/options.h
index 8534badb8e..dfc6a62e35 100644
--- a/plugins/BuddyExpectator/src/options.h
+++ b/plugins/BuddyExpectator/src/options.h
@@ -39,7 +39,6 @@ typedef struct {
bool notifyFirstOnline;
bool enableMissYou;
bool hideInactive;
- byte MissYouIcon;
int iAbsencePeriod2; // notify period for contacts that have remained away
int iShowPopup2;
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp
index 5d27b1bdbb..0e42d64b7e 100644
--- a/plugins/CountryFlags/src/extraimg.cpp
+++ b/plugins/CountryFlags/src/extraimg.cpp
@@ -200,7 +200,7 @@ void InitExtraImg(void)
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ExtraImgSettingChanged);
/* Extra Image */
- hExtraIcon = ExtraIcon_Register("flags_extra", LPGEN("Country flag"));
+ hExtraIcon = ExtraIcon_Register("flags_extra", LPGEN("Country flag"), "flags_0");
if (bShowExtraIcon)
EnsureExtraImages();
}
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp
index 0211663f8c..1e3572b07e 100644
--- a/plugins/FingerprintNG/src/fingerprint.cpp
+++ b/plugins/FingerprintNG/src/fingerprint.cpp
@@ -952,9 +952,6 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
RegisterIcons();
- hExtraIcon = ExtraIcon_Register("Client", LPGEN("Fingerprint"), "client_Miranda_Unknown",
- OnExtraIconListRebuild,OnExtraImageApply,OnExtraIconClick);
-
if (db_get_b(NULL, MODULENAME, "StatusBarIcon", 1)) {
StatusIconData sid = { sizeof(sid) };
sid.szModule = MODULENAME;
@@ -974,4 +971,7 @@ void InitFingerModule()
CreateServiceFunction(MS_FP_SAMECLIENTSW, ServiceSameClientsW);
CreateServiceFunction(MS_FP_GETCLIENTDESCRW, ServiceGetClientDescrW);
CreateServiceFunction(MS_FP_GETCLIENTICONW, ServiceGetClientIconW);
+
+ hExtraIcon = ExtraIcon_Register("Client", LPGEN("Fingerprint"), "client_Miranda_unknown",
+ OnExtraIconListRebuild, OnExtraImageApply, OnExtraIconClick);
}
diff --git a/plugins/IgnoreState/src/main.cpp b/plugins/IgnoreState/src/main.cpp
index 505dcfe9bf..d97e81254b 100644
--- a/plugins/IgnoreState/src/main.cpp
+++ b/plugins/IgnoreState/src/main.cpp
@@ -138,8 +138,6 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
fill_filter();
- hExtraIcon = ExtraIcon_Register("ignore", LPGEN("Ignore State"), "ignore_full");
-
// Set initial value for all contacts
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
applyExtraImage(hContact);
@@ -170,6 +168,9 @@ extern "C" int __declspec(dllexport) Load(void)
HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged);
+
+ hExtraIcon = ExtraIcon_Register("ignore", LPGEN("Ignore State"), "ignore_full");
+
return 0;
}
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index 6752828aef..7b9253b3ab 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -133,6 +133,9 @@ extern "C" int __declspec(dllexport) Load(void)
InitMusic();
InitOptions();
+ // Extra icon support
+ hExtraIcon = ExtraIcon_Register(MODULE_NAME "_icon", LPGEN("Listening to music"), "listening_to_icon");
+
return 0;
}
@@ -281,9 +284,6 @@ int ModulesLoaded(WPARAM, LPARAM)
// icons
Icon_Register(hInst, LPGEN("ListeningTo"), iconList, SIZEOF(iconList));
- // Extra icon support
- hExtraIcon = ExtraIcon_Register(MODULE_NAME "_icon", LPGEN("Listening to music"), "listening_to_icon");
-
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *proto = GetContactProto(hContact);
if (proto != NULL) {
diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp
index afc61158f9..467359d2ca 100644
--- a/plugins/MobileState/src/main.cpp
+++ b/plugins/MobileState/src/main.cpp
@@ -98,9 +98,6 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
// IcoLib support
Icon_Register(g_hInst, "Mobile State", &icon, 1);
- // Extra icons
- hExtraIcon = ExtraIcon_Register("mobilestate", LPGEN("Mobile State"), "mobile_icon");
-
// Set initial value for all contacts
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
ExtraIconsApply(hContact, 1);
@@ -115,6 +112,10 @@ extern "C" int __declspec(dllexport) Load(void)
HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged);
HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, ExtraIconsApply);
+
+ // Extra icons
+ hExtraIcon = ExtraIcon_Register("mobilestate", LPGEN("Mobile State"), "mobile_icon");
+
return 0;
}
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp
index 633411c44a..b84b2c5c15 100644
--- a/plugins/New_GPG/src/init.cpp
+++ b/plugins/New_GPG/src/init.cpp
@@ -65,6 +65,8 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l);
INT_PTR SendKey(WPARAM w, LPARAM l);
INT_PTR ExportGpGKeys(WPARAM w, LPARAM l);
INT_PTR ImportGpGKeys(WPARAM w, LPARAM l);
+int onExtraImageListRebuilding(WPARAM, LPARAM);
+int onExtraImageApplying(WPARAM wParam, LPARAM);
void init_vars()
{
@@ -112,8 +114,6 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
int GetJabberInterface(WPARAM w, LPARAM l);
int onWindowEvent(WPARAM wParam, LPARAM lParam);
int onIconPressed(WPARAM wParam, LPARAM lParam);
- int onExtraImageListRebuilding(WPARAM, LPARAM);
- int onExtraImageApplying(WPARAM wParam, LPARAM);
int onProtoAck(WPARAM, LPARAM);
INT_PTR onSendFile(WPARAM, LPARAM);
void InitIconLib();
@@ -155,8 +155,6 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
HookEvent(ME_MSG_WINDOWEVENT, onWindowEvent);
HookEvent(ME_MSG_ICONPRESSED, onIconPressed);
- g_hCLIcon = ExtraIcon_Register(szGPGModuleName, Translate("GPG encryption status"), "secured", (MIRANDAHOOK)onExtraImageListRebuilding, (MIRANDAHOOK)onExtraImageApplying);
-
PROTOCOLDESCRIPTOR pd = { sizeof(pd) };
pd.szName = szGPGModuleName;
pd.type = PROTOTYPE_ENCRYPTION;
@@ -226,6 +224,8 @@ extern "C" int __declspec(dllexport) Load()
mi.pszService="/ImportGPGKeys";
hImportGpgKeys = Menu_AddMainMenuItem(&mi);
+ g_hCLIcon = ExtraIcon_Register(szGPGModuleName, Translate("GPG encryption status"), "secured", onExtraImageListRebuilding, onExtraImageApplying);
+
return 0;
}
diff --git a/plugins/Rate/src/main.cpp b/plugins/Rate/src/main.cpp
index 9ebcba682d..4abd350ee4 100644
--- a/plugins/Rate/src/main.cpp
+++ b/plugins/Rate/src/main.cpp
@@ -102,9 +102,6 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
// IcoLib support
Icon_Register(g_hInst, LPGEN("Contact rate"), iconList, SIZEOF(iconList));
- // Extra icon support
- hExtraIcon = ExtraIcon_Register("contact_rate", LPGEN("Contact rate"), "rate_high");
-
// Set initial value for all contacts
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
setExtraIcon(hContact, -1, FALSE);
@@ -128,6 +125,10 @@ extern "C" int __declspec(dllexport) Load(void)
HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged);
+
+ // Extra icon support
+ hExtraIcon = ExtraIcon_Register("contact_rate", LPGEN("Contact rate"), "rate_high");
+
return 0;
}
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp
index ee1088ce09..c1e5af66e5 100644
--- a/plugins/SecureIM/src/main.cpp
+++ b/plugins/SecureIM/src/main.cpp
@@ -217,8 +217,6 @@ static int onModulesLoaded(WPARAM, LPARAM)
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onRebuildContactMenu);
- g_hCLIcon = ExtraIcon_Register(MODULENAME, LPGEN("SecureIM status"), "sim_cm_est", onExtraImageListRebuilding, onExtraImageApplying);
-
// hook init options
HookEvent(ME_OPT_INITIALISE, onRegisterOptions);
if (bPopupExists)
@@ -380,6 +378,9 @@ extern "C" __declspec(dllexport) int __cdecl Load(void)
CreateServiceFunction(MODULENAME"/MODE_PGP", Service_ModePGP);
CreateServiceFunction(MODULENAME"/MODE_GPG", Service_ModeGPG);
CreateServiceFunction(MODULENAME"/MODE_RSA", Service_ModeRSAAES);
+
+ g_hCLIcon = ExtraIcon_Register(MODULENAME, LPGEN("SecureIM status"), "sim_cm_est", onExtraImageListRebuilding, onExtraImageApplying);
+
return 0;
}
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);
+
}
/**