From f12d8b56f2894e94491bd7424d69f595d285f01f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 3 Nov 2012 20:16:42 +0000 Subject: no more MS_CLIST_EXTRA_ADD_ICON in the application code git-svn-id: http://svn.miranda-ng.org/main/trunk@2175 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/New_GPG/src/clist.cpp | 15 +++------------ plugins/New_GPG/src/icons.cpp | 21 ++++----------------- plugins/New_GPG/src/init.cpp | 5 +---- 3 files changed, 8 insertions(+), 33 deletions(-) (limited to 'plugins/New_GPG') diff --git a/plugins/New_GPG/src/clist.cpp b/plugins/New_GPG/src/clist.cpp index c64fb17798..4533a464c2 100755 --- a/plugins/New_GPG/src/clist.cpp +++ b/plugins/New_GPG/src/clist.cpp @@ -16,26 +16,17 @@ #include "commonheaders.h" -extern HANDLE g_hCLIcon; void RefreshContactListIcons(void); +void setClistIcon(HANDLE); int onExtraImageListRebuilding(WPARAM, LPARAM) { - if(g_hCLIcon && ServiceExists(MS_CLIST_EXTRA_ADD_ICON) ) - RefreshContactListIcons(); + RefreshContactListIcons(); return 0; } - int onExtraImageApplying(WPARAM wParam, LPARAM) { - void setClistIcon(HANDLE); - if(g_hCLIcon && ServiceExists(MS_CLIST_EXTRA_SET_ICON)) - { -// IconExtraColumn iec = {0}; //need to init this - if( g_hCLIcon ) - setClistIcon((HANDLE)wParam); -// ExtraIcon_SetIcon(g_hCLIcon, (HANDLE)wParam, iec.hImage); - } + setClistIcon((HANDLE)wParam); return 0; } diff --git a/plugins/New_GPG/src/icons.cpp b/plugins/New_GPG/src/icons.cpp index ec307666d1..90ad051b75 100755 --- a/plugins/New_GPG/src/icons.cpp +++ b/plugins/New_GPG/src/icons.cpp @@ -77,22 +77,10 @@ void setClistIcon(HANDLE hContact) hMC = metaGetContact(hContact); else if(metaIsProtoMetaContacts(hContact)) hMC = metaGetContact(hContact); - if(g_hCLIcon && enabled) - { - HICON icon = IconLibGetIcon("secured"); - IconExtraColumn iec = {0}; - iec.cbSize = sizeof(iec); - iec.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)icon, 0); - ExtraIcon_SetIcon(g_hCLIcon, hContact, iec.hImage); - if(hMC) - ExtraIcon_SetIcon(g_hCLIcon, hMC, iec.hImage); - } - else - { - ExtraIcon_SetIcon(g_hCLIcon, hContact, (HANDLE)0); // is it right ? hmm.., at least working.... - if(hMC) - ExtraIcon_SetIcon(g_hCLIcon, hMC, (HANDLE)0); - } + const char *szIconId = (enabled) ? "secured" : NULL; + ExtraIcon_SetIcon(g_hCLIcon, hContact, szIconId); + if(hMC) + ExtraIcon_SetIcon(g_hCLIcon, hMC, szIconId); } void setSrmmIcon(HANDLE h) @@ -130,7 +118,6 @@ void setSrmmIcon(HANDLE h) void RefreshContactListIcons() { - extern HANDLE g_hCLIcon; CallService(MS_CLUI_LISTBEGINREBUILD,0,0); HANDLE hContact = db_find_first(); while (hContact) diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index 6d8956b219..8413f9734d 100755 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -228,10 +228,7 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) HookEvent(ME_MSG_WINDOWEVENT, onWindowEvent); HookEvent(ME_MSG_ICONPRESSED, onIconPressed); - if(ServiceExists(MS_EXTRAICON_REGISTER)) - g_hCLIcon = ExtraIcon_Register(szGPGModuleName, Translate("GPG encryption status"), "secured", (MIRANDAHOOK)onExtraImageListRebuilding, (MIRANDAHOOK)onExtraImageApplying); - - + g_hCLIcon = ExtraIcon_Register(szGPGModuleName, Translate("GPG encryption status"), "secured", (MIRANDAHOOK)onExtraImageListRebuilding, (MIRANDAHOOK)onExtraImageApplying); PROTOCOLDESCRIPTOR pd = {0}; pd.cbSize=sizeof(PROTOCOLDESCRIPTOR); -- cgit v1.2.3