From 31b191bc8ddb639e488ab8306f71ac1dbabf16f0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 3 Nov 2012 17:32:37 +0000 Subject: removing built-in Clist Modern extra icons part I git-svn-id: http://svn.miranda-ng.org/main/trunk@2167 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/UserInfoEx/src/svc_reminder.cpp | 84 +++++++++++---------------------- 1 file changed, 28 insertions(+), 56 deletions(-) (limited to 'plugins/UserInfoEx/src/svc_reminder.cpp') diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index c26e2027e6..bfde666a9b 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -268,58 +268,32 @@ static HANDLE GetCListExtraIcon(const CEvent &evt) **/ static VOID NotifyWithExtraIcon(HANDLE hContact, const CEvent &evt) { - if (myGlobals.HaveCListExtraIcons && gRemindOpts.bCListExtraIcon) - { - if (!myGlobals.ExtraIconsServiceExist) - { - IconExtraColumn iec; + if (gRemindOpts.bCListExtraIcon) { + CHAR szIcon[MAXSETTING]; - iec.cbSize = sizeof(IconExtraColumn); - iec.ColumnType = gRemindOpts.bCListExtraIcon; - iec.hImage = GetCListExtraIcon(evt); - CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&iec); - } - else - { - CHAR szIcon[MAXSETTING]; - EXTRAICON ico; + EXTRAICON ico = { sizeof(ico) }; + ico.hContact = hContact; + ico.hExtraIcon = ExtraIcon; + switch (evt._eType) { + case CEvent::BIRTHDAY: + if (evt._wDaysLeft > 9) + ico.icoName = ICO_RMD_DTAX; + else { + mir_snprintf(szIcon, SIZEOF(szIcon), MODNAME"_rmd_dtb%u", evt._wDaysLeft); + ico.icoName = szIcon; + } + break; - ico.cbSize=sizeof(ico); - ico.hContact=hContact; - ico.hExtraIcon=ExtraIcon; - switch (evt._eType) - { - case CEvent::BIRTHDAY: - { - if (evt._wDaysLeft > 9) - { - ico.icoName=ICO_RMD_DTAX; - } - else - { - mir_snprintf(szIcon, SIZEOF(szIcon), MODNAME"_rmd_dtb%u", evt._wDaysLeft); - ico.icoName=szIcon; - } - break; - } - case CEvent::ANNIVERSARY: - { - if (evt._wDaysLeft > 9) - { - ico.icoName=ICO_RMD_DTAX; - } - else - { - mir_snprintf(szIcon, SIZEOF(szIcon), MODNAME"_rmd_dta%u", evt._wDaysLeft); - ico.icoName=szIcon; - } - break; - } - default: - ico.icoName=(char *)0; + case CEvent::ANNIVERSARY: + if (evt._wDaysLeft > 9) + ico.icoName = ICO_RMD_DTAX; + else { + mir_snprintf(szIcon, SIZEOF(szIcon), MODNAME"_rmd_dta%u", evt._wDaysLeft); + ico.icoName = szIcon; } - CallService(MS_EXTRAICON_SET_ICON, (WPARAM)&ico, 0); + break; } + CallService(MS_EXTRAICON_SET_ICON, (WPARAM)&ico, 0); } } @@ -1081,15 +1055,13 @@ VOID SvcReminderEnable(BOOLEAN bEnable) { if (bEnable) // Reminder is on { - if (myGlobals.ExtraIconsServiceExist && (ExtraIcon == INVALID_HANDLE_VALUE)) - { - EXTRAICON_INFO ico = {0}; + if (ExtraIcon == INVALID_HANDLE_VALUE) { + EXTRAICON_INFO ico = { sizeof(ico) }; ico.type = EXTRAICON_TYPE_ICOLIB; - ico.cbSize=sizeof(ico); - ico.name="Reminder"; - ico.description="Reminder (uinfoex)"; - ico.descIcon=ICO_COMMON_ANNIVERSARY; - ExtraIcon=(HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0); + ico.name = "Reminder"; + ico.description = "Reminder (uinfoex)"; + ico.descIcon = ICO_COMMON_ANNIVERSARY; + ExtraIcon = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0); ZeroMemory(&ico,sizeof(ico)); } // init hooks -- cgit v1.2.3