summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-04 18:51:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-04 18:51:53 +0000
commitecb177cadbcff850a16c4b9e306beb15f61ac6f9 (patch)
treeda36e3107747a5f37dbd078197d584054057609f /plugins/UserInfoEx/src
parent808f3b5e0fefeb560ce5393bf8311927d0927411 (diff)
kernel extraicons, part II
git-svn-id: http://svn.miranda-ng.org/main/trunk@2188 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/src')
-rw-r--r--plugins/UserInfoEx/src/Flags/svc_flags.cpp18
-rw-r--r--plugins/UserInfoEx/src/Flags/svc_flags.h6
-rw-r--r--plugins/UserInfoEx/src/commonheaders.h3
-rw-r--r--plugins/UserInfoEx/src/init.cpp3
-rw-r--r--plugins/UserInfoEx/src/psp_options.cpp24
-rw-r--r--plugins/UserInfoEx/src/svc_email.cpp81
-rw-r--r--plugins/UserInfoEx/src/svc_gender.cpp73
-rw-r--r--plugins/UserInfoEx/src/svc_homepage.cpp70
-rw-r--r--plugins/UserInfoEx/src/svc_phone.cpp78
-rw-r--r--plugins/UserInfoEx/src/svc_reminder.cpp12
10 files changed, 144 insertions, 224 deletions
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp
index ed43e04161..cd682e9b1f 100644
--- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp
+++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp
@@ -2,10 +2,10 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
part of this code based on:
-Miranda IM Country Flags Plugin Copyright ©2006-2007 H. Herkenrath
+Miranda IM Country Flags Plugin Copyright �2006-2007 H. Herkenrath
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -319,10 +319,8 @@ static int OnExtraIconSvcChanged(WPARAM wParam,LPARAM lParam)
VOID SvcFlagsEnableExtraIcons(BYTE bColumn, BOOLEAN bUpdateDB)
{
gFlagsOpts.bShowExtraImgFlag = (bColumn!=((BYTE)-1));
- if (bUpdateDB) {
- if(gFlagsOpts.bShowExtraImgFlag) DB::Setting::WriteByte(MODNAMEFLAGS,"ExtraImgFlagColumn", bColumn);
+ if (bUpdateDB)
DB::Setting::WriteByte(MODNAMEFLAGS,"ShowExtraImgFlag", bColumn!=(BYTE)-1);
- }
// Flags is on
if (gFlagsOpts.bShowExtraImgFlag) {
@@ -545,8 +543,7 @@ static int OnContactSettingChanged(WPARAM wParam,LPARAM lParam) {
!lstrcmpA(dbcws->szSetting,SET_CONTACT_COMPANY_COUNTRY))
{
/* Extra Image */
- if(myGlobals.HaveCListExtraIcons)
- CallFunctionBuffered(SetExtraImage,(LPARAM)wParam,TRUE,EXTRAIMAGE_REFRESHDELAY);
+ CallFunctionBuffered(SetExtraImage,(LPARAM)wParam,TRUE,EXTRAIMAGE_REFRESHDELAY);
/* Status Icon */
if(hMsgWndEventHook) {
int i = gMsgWndList.getIndex((MsgWndData*)&wParam);
@@ -581,10 +578,9 @@ void SvcFlagsLoadModule()
//InitIpToCountry(); /* not implementet */
CreateServiceFunction(MS_FLAGS_DETECTCONTACTORIGINCOUNTRY,ServiceDetectContactOriginCountry);
//init settings
- gFlagsOpts.bShowExtraImgFlag = DB::Setting::GetByte(MODNAMEFLAGS,"ShowExtraImgFlag", SETTING_SHOWEXTRAIMGFLAG_DEFAULT);
- gFlagsOpts.bUseUnknownFlag = DB::Setting::GetByte(MODNAMEFLAGS,"UseUnknownFlag", SETTING_USEUNKNOWNFLAG_DEFAULT);
- gFlagsOpts.idExtraColumn = DB::Setting::GetByte(MODNAMEFLAGS,"ExtraImgFlagColumn", SETTING_EXTRAIMGFLAGCOLUMN_DEFAULT);
- gFlagsOpts.bShowStatusIconFlag = DB::Setting::GetByte(MODNAMEFLAGS,"ShowStatusIconFlag", SETTING_SHOWSTATUSICONFLAG_DEFAULT);
+ gFlagsOpts.bShowExtraImgFlag = DB::Setting::GetByte(MODNAMEFLAGS,"ShowExtraImgFlag", SETTING_SHOWEXTRAIMGFLAG_DEFAULT);
+ gFlagsOpts.bUseUnknownFlag = DB::Setting::GetByte(MODNAMEFLAGS,"UseUnknownFlag", SETTING_USEUNKNOWNFLAG_DEFAULT);
+ gFlagsOpts.bShowStatusIconFlag = DB::Setting::GetByte(MODNAMEFLAGS,"ShowStatusIconFlag", SETTING_SHOWSTATUSICONFLAG_DEFAULT);
hOptInitHook = HookEvent(ME_OPT_INITIALISE,ExtraImgOptInit);
hIconsChangedHook = HookEvent(ME_SKIN2_ICONSCHANGED,OnStatusIconsChanged);
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.h b/plugins/UserInfoEx/src/Flags/svc_flags.h
index a597f67e8a..3aaa7f884f 100644
--- a/plugins/UserInfoEx/src/Flags/svc_flags.h
+++ b/plugins/UserInfoEx/src/Flags/svc_flags.h
@@ -2,10 +2,10 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
part of this code based on:
-Miranda IM Country Flags Plugin Copyright ©2006-2007 H. Herkenrath
+Miranda IM Country Flags Plugin Copyright �2006-2007 H. Herkenrath
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -40,8 +40,6 @@ typedef struct _FLAGSOPTIONS
{
BYTE bShowExtraImgFlag;
BYTE bUseUnknownFlag;
- BYTE idExtraColumn;
-// BYTE bUseIpToCountry;
BYTE bShowStatusIconFlag;
} FLAGSOPTIONS, *LPFLAGSOPTIONS;
diff --git a/plugins/UserInfoEx/src/commonheaders.h b/plugins/UserInfoEx/src/commonheaders.h
index 30597a9f48..6755bc352d 100644
--- a/plugins/UserInfoEx/src/commonheaders.h
+++ b/plugins/UserInfoEx/src/commonheaders.h
@@ -2,7 +2,7 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -159,7 +159,6 @@ typedef struct _MGLOBAL
{
DWORD mirandaVersion; // mirandaVersion
BOOLEAN CanChangeDetails : 1; // is service to upload own contact information for icq present?
- BOOLEAN HaveCListExtraIcons : 1; // are extra icons supported by current clist
BOOLEAN MsgAddIconExist : 1; // Messsage Window support status Icon
BOOLEAN TzIndexExist : 1; // Win Reg has Timzone Index Info
BOOLEAN PopUpActionsExist : 1; // Popup++ or MS_POPUP_REGISTERACTIONS exist
diff --git a/plugins/UserInfoEx/src/init.cpp b/plugins/UserInfoEx/src/init.cpp
index 2762e67a32..9e27902f10 100644
--- a/plugins/UserInfoEx/src/init.cpp
+++ b/plugins/UserInfoEx/src/init.cpp
@@ -2,7 +2,7 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -103,7 +103,6 @@ static INT OnTopToolBarLoaded(WPARAM wParam, LPARAM lParam)
**/
static INT OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- myGlobals.HaveCListExtraIcons = ServiceExists(MS_CLIST_EXTRA_SET_ICON);
myGlobals.PopUpActionsExist = ServiceExists(MS_POPUP_REGISTERACTIONS);
myGlobals.MsgAddIconExist = ServiceExists(MS_MSG_ADDICON);
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp
index c8c9ada146..12f3616d69 100644
--- a/plugins/UserInfoEx/src/psp_options.cpp
+++ b/plugins/UserInfoEx/src/psp_options.cpp
@@ -67,29 +67,6 @@ static FORCEINLINE VOID NotifyParentOfChange(HWND hDlg)
}
/**
- * This function clears all CList extra icons from the given column.
- *
- * @param ExtraIconColumnType - the clist column to clear
- *
- * @return nothing
- **/
-static VOID ClearAllExtraIcons(INT ExtraIconColumnType)
-{
- IconExtraColumn iec;
- HANDLE hContact;
-
- iec.cbSize = sizeof(IconExtraColumn);
- iec.hImage = INVALID_HANDLE_VALUE;
- iec.ColumnType = ExtraIconColumnType;
-
- //walk through all the contacts stored in the DB
- for (hContact = DB::Contact::FindFirst(); hContact != NULL; hContact = DB::Contact::FindNext(hContact))
- {
- CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&iec);
- }
-}
-
-/**
* Sends a PSN_INFOCHANGED notify to the handle.
*
* @param hWnd - the dialog's window handle
@@ -897,7 +874,6 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam
};
EnableControls(hDlg, idCtrl, SIZEOF(idCtrl), bEnabled);
- bEnabled &= myGlobals.HaveCListExtraIcons;
}
}
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp
index 27b7532551..5b886b72a3 100644
--- a/plugins/UserInfoEx/src/svc_email.cpp
+++ b/plugins/UserInfoEx/src/svc_email.cpp
@@ -2,7 +2,7 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -277,55 +277,42 @@ VOID SvcEMailApplyCListIcons()
**/
VOID SvcEMailEnableExtraIcons(BOOLEAN bEnable, BOOLEAN bUpdateDB)
{
- if (myGlobals.HaveCListExtraIcons)
- {
- if (bUpdateDB)
- {
- DB::Setting::WriteByte(SET_CLIST_EXTRAICON_EMAIL, bEnable);
+ if (bUpdateDB)
+ DB::Setting::WriteByte(SET_CLIST_EXTRAICON_EMAIL, bEnable);
+
+ if (bEnable) { // E-mail checkt
+ // hook events
+ if (hChangedHook == NULL)
+ hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
+
+ if (hApplyIconHook == NULL)
+ hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
+
+ if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
+ EXTRAICON_INFO ico = { sizeof(ico) };
+ ico.type = EXTRAICON_TYPE_ICOLIB;
+ ico.name = "email"; //must be the same as the group name in extraicon
+ ico.description= "E-mail (uinfoex)";
+ ico.descIcon = ICO_BTN_EMAIL;
+ ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
+ ZeroMemory(&ico,sizeof(ico));
}
-
- if (bEnable) // E-mail checkt
- {
- // hook events
- if (hChangedHook == NULL)
- {
- hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
- }
- if (hApplyIconHook == NULL)
- {
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
- }
-
- if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
- EXTRAICON_INFO ico = { sizeof(ico) };
- ico.type = EXTRAICON_TYPE_ICOLIB;
- ico.name = "email"; //must be the same as the group name in extraicon
- ico.description= "E-mail (uinfoex)";
- ico.descIcon = ICO_BTN_EMAIL;
- ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
- ZeroMemory(&ico,sizeof(ico));
- }
- }
- else // E-mail uncheckt
- {
- if (hChangedHook)
- {
- UnhookEvent(hChangedHook);
- hChangedHook = NULL;
- }
- if (hApplyIconHook)
- {
- UnhookEvent(hApplyIconHook);
- hApplyIconHook = NULL;
- }
- if (hRebuildIconsHook)
- {
- UnhookEvent(hRebuildIconsHook);
- hRebuildIconsHook = NULL;
- }
+ }
+ else { // E-mail uncheckt
+ if (hChangedHook) {
+ UnhookEvent(hChangedHook);
+ hChangedHook = NULL;
+ }
+ if (hApplyIconHook) {
+ UnhookEvent(hApplyIconHook);
+ hApplyIconHook = NULL;
+ }
+ if (hRebuildIconsHook) {
+ UnhookEvent(hRebuildIconsHook);
+ hRebuildIconsHook = NULL;
}
- SvcEMailApplyCListIcons();
}
+ SvcEMailApplyCListIcons();
}
/**
diff --git a/plugins/UserInfoEx/src/svc_gender.cpp b/plugins/UserInfoEx/src/svc_gender.cpp
index d8f542b374..6ac632e6af 100644
--- a/plugins/UserInfoEx/src/svc_gender.cpp
+++ b/plugins/UserInfoEx/src/svc_gender.cpp
@@ -2,7 +2,7 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -144,49 +144,42 @@ VOID SvcGenderApplyCListIcons()
VOID SvcGenderEnableExtraIcons(BYTE bColumn, BOOLEAN bUpdateDB)
{
bool bEnable = (bColumn!=((BYTE)-1));
- if (myGlobals.HaveCListExtraIcons)
- {
- if (bUpdateDB)
- DB::Setting::WriteByte(SET_CLIST_EXTRAICON_GENDER2, bColumn);
- if (bEnable) // Gender checkt or dropdown select
- {
- if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
- EXTRAICON_INFO ico = { sizeof(ico) };
- ico.type = EXTRAICON_TYPE_ICOLIB;
- ico.name = "gender"; //must be the same as the group name in extraicon
- ico.description="Gender (uinfoex)";
- ico.descIcon = ICO_COMMON_MALE;
- ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
- }
-
- // hook events
- if (hChangedHook == NULL)
- hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
-
- if (hApplyIconHook == NULL)
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
+ if (bUpdateDB)
+ DB::Setting::WriteByte(SET_CLIST_EXTRAICON_GENDER2, bColumn);
+
+ if (bEnable) { // Gender checkt or dropdown select
+ if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
+ EXTRAICON_INFO ico = { sizeof(ico) };
+ ico.type = EXTRAICON_TYPE_ICOLIB;
+ ico.name = "gender"; //must be the same as the group name in extraicon
+ ico.description="Gender (uinfoex)";
+ ico.descIcon = ICO_COMMON_MALE;
+ ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
}
- else
- {
- if (hChangedHook)
- {
- UnhookEvent(hChangedHook);
- hChangedHook = NULL;
- }
- if (hApplyIconHook)
- {
- UnhookEvent(hApplyIconHook);
- hApplyIconHook = NULL;
- }
- if (hRebuildIconsHook)
- {
- UnhookEvent(hRebuildIconsHook);
- hRebuildIconsHook = NULL;
- }
+
+ // hook events
+ if (hChangedHook == NULL)
+ hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
+
+ if (hApplyIconHook == NULL)
+ hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
+ }
+ else {
+ if (hChangedHook) {
+ UnhookEvent(hChangedHook);
+ hChangedHook = NULL;
+ }
+ if (hApplyIconHook) {
+ UnhookEvent(hApplyIconHook);
+ hApplyIconHook = NULL;
+ }
+ if (hRebuildIconsHook) {
+ UnhookEvent(hRebuildIconsHook);
+ hRebuildIconsHook = NULL;
}
- SvcGenderApplyCListIcons();
}
+ SvcGenderApplyCListIcons();
}
/**
diff --git a/plugins/UserInfoEx/src/svc_homepage.cpp b/plugins/UserInfoEx/src/svc_homepage.cpp
index cb9533ada2..b6a6f9ee46 100644
--- a/plugins/UserInfoEx/src/svc_homepage.cpp
+++ b/plugins/UserInfoEx/src/svc_homepage.cpp
@@ -2,7 +2,7 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -223,51 +223,41 @@ VOID SvcHomepageApplyCListIcons()
**/
VOID SvcHomepageEnableExtraIcons(BOOLEAN bEnable, BOOLEAN bUpdateDB)
{
- if (myGlobals.HaveCListExtraIcons)
- {
- if (bUpdateDB)
- {
- DB::Setting::WriteByte(SET_CLIST_EXTRAICON_HOMEPAGE, bEnable);
- }
+ if (bUpdateDB)
+ DB::Setting::WriteByte(SET_CLIST_EXTRAICON_HOMEPAGE, bEnable);
- if (bEnable)
- {
- // hook events
- if (hChangedHook == NULL)
- hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
+ if (bEnable) {
+ // hook events
+ if (hChangedHook == NULL)
+ hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
- if (hApplyIconHook == NULL)
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
+ if (hApplyIconHook == NULL)
+ hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
- if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
- EXTRAICON_INFO ico = { sizeof(ico) };
- ico.type = EXTRAICON_TYPE_ICOLIB;
- ico.name = "homepage"; //must be the same as the group name in extraicon
- ico.description = "Homepage (uinfoex)";
- ico.descIcon = ICO_BTN_GOTO;
- ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
- }
+ if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
+ EXTRAICON_INFO ico = { sizeof(ico) };
+ ico.type = EXTRAICON_TYPE_ICOLIB;
+ ico.name = "homepage"; //must be the same as the group name in extraicon
+ ico.description = "Homepage (uinfoex)";
+ ico.descIcon = ICO_BTN_GOTO;
+ ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
}
- else
- {
- if (hChangedHook)
- {
- UnhookEvent(hChangedHook);
- hChangedHook = NULL;
- }
- if (hApplyIconHook)
- {
- UnhookEvent(hApplyIconHook);
- hApplyIconHook = NULL;
- }
- if (hRebuildIconsHook)
- {
- UnhookEvent(hRebuildIconsHook);
- hRebuildIconsHook = NULL;
- }
+ }
+ else {
+ if (hChangedHook) {
+ UnhookEvent(hChangedHook);
+ hChangedHook = NULL;
+ }
+ if (hApplyIconHook) {
+ UnhookEvent(hApplyIconHook);
+ hApplyIconHook = NULL;
+ }
+ if (hRebuildIconsHook) {
+ UnhookEvent(hRebuildIconsHook);
+ hRebuildIconsHook = NULL;
}
- SvcHomepageApplyCListIcons();
}
+ SvcHomepageApplyCListIcons();
}
/**
diff --git a/plugins/UserInfoEx/src/svc_phone.cpp b/plugins/UserInfoEx/src/svc_phone.cpp
index 7ccdc576b4..5d4e2f13d1 100644
--- a/plugins/UserInfoEx/src/svc_phone.cpp
+++ b/plugins/UserInfoEx/src/svc_phone.cpp
@@ -2,7 +2,7 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -169,52 +169,42 @@ VOID SvcPhoneApplyCListIcons()
**/
VOID SvcPhoneEnableExtraIcons(BOOLEAN bEnable, BOOLEAN bUpdateDB)
{
- if (myGlobals.HaveCListExtraIcons)
- {
- if (bUpdateDB)
- {
- DB::Setting::WriteByte(SET_CLIST_EXTRAICON_PHONE, bEnable);
- }
-
- // force module enabled, if extraicon plugin was found
- if (bEnable)
- {
- // hook events
- if (hChangedHook == NULL)
- hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
-
- if (hApplyIconHook == NULL)
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
-
- if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
- EXTRAICON_INFO ico = { sizeof(ico) };
- ico.type = EXTRAICON_TYPE_ICOLIB;
- ico.name = "sms"; //must be the same as the group name in extraicon
- ico.description = "(uinfoex)";
- ico.descIcon = ICO_BTN_CELLULAR;
- ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
- }
+ if (bUpdateDB)
+ DB::Setting::WriteByte(SET_CLIST_EXTRAICON_PHONE, bEnable);
+
+ // force module enabled, if extraicon plugin was found
+ if (bEnable) {
+ // hook events
+ if (hChangedHook == NULL)
+ hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
+
+ if (hApplyIconHook == NULL)
+ hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
+
+ if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
+ EXTRAICON_INFO ico = { sizeof(ico) };
+ ico.type = EXTRAICON_TYPE_ICOLIB;
+ ico.name = "sms"; //must be the same as the group name in extraicon
+ ico.description = "(uinfoex)";
+ ico.descIcon = ICO_BTN_CELLULAR;
+ ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
}
- else
- {
- if (hChangedHook)
- {
- UnhookEvent(hChangedHook);
- hChangedHook = NULL;
- }
- if (hApplyIconHook)
- {
- UnhookEvent(hApplyIconHook);
- hApplyIconHook = NULL;
- }
- if (hRebuildIconsHook)
- {
- UnhookEvent(hRebuildIconsHook);
- hRebuildIconsHook = NULL;
- }
+ }
+ else {
+ if (hChangedHook) {
+ UnhookEvent(hChangedHook);
+ hChangedHook = NULL;
+ }
+ if (hApplyIconHook) {
+ UnhookEvent(hApplyIconHook);
+ hApplyIconHook = NULL;
+ }
+ if (hRebuildIconsHook) {
+ UnhookEvent(hRebuildIconsHook);
+ hRebuildIconsHook = NULL;
}
- SvcPhoneApplyCListIcons();
}
+ SvcPhoneApplyCListIcons();
}
/**
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp
index ae7de9fb81..3781145d11 100644
--- a/plugins/UserInfoEx/src/svc_reminder.cpp
+++ b/plugins/UserInfoEx/src/svc_reminder.cpp
@@ -2,7 +2,7 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -983,19 +983,11 @@ VOID SvcReminderEnable(BOOLEAN bEnable)
ZeroMemory(&ico,sizeof(ico));
}
// init hooks
- if (!ghCListIR)
- {
- ghCListIR = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, (MIRANDAHOOK)OnCListRebuildIcons);
- }
-
if (!ghCListIA)
- {
ghCListIA = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcon);
- }
+
if (!ghSettingsChanged && !myGlobals.UseDbxTree)
- {
ghSettingsChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
- }
// reinit reminder options
gRemindOpts.RemindState = DB::Setting::GetByte(SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED);