From e58823d961a630eb62e60d2ccb443761ba5f1704 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 14 Jun 2012 15:51:34 +0000 Subject: - all MS_CLIST_ADD*ITEM services replaced with Menu_Add*Item stubs. - massive cleanup of the menu-related code git-svn-id: http://svn.miranda-ng.org/main/trunk@410 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Nudge/headers.h | 1 + plugins/Nudge/main.cpp | 64 ++++++++++++++++++++++--------------------------- 2 files changed, 29 insertions(+), 36 deletions(-) (limited to 'plugins/Nudge') diff --git a/plugins/Nudge/headers.h b/plugins/Nudge/headers.h index 810edc6242..062bc8ee77 100644 --- a/plugins/Nudge/headers.h +++ b/plugins/Nudge/headers.h @@ -48,6 +48,7 @@ #include #include #include +#include #include "resource.h" #include "m_nudge.h" diff --git a/plugins/Nudge/main.cpp b/plugins/Nudge/main.cpp index fb4575b50e..5500451eff 100644 --- a/plugins/Nudge/main.cpp +++ b/plugins/Nudge/main.cpp @@ -795,44 +795,36 @@ void Nudge_AddAccount(PROTOACCOUNT *proto) newNudge->next = NudgeList; NudgeList = newNudge; - if(ServiceExists(MS_SKIN2_ADDICON)) - { - SKINICONDESC sid = {0}; - TCHAR szFilename[MAX_PATH]; - char iconName[MAXMODULELABELLENGTH + 10]; - TCHAR iconDesc[MAXMODULELABELLENGTH + 10]; - GetModuleFileName(hInst,szFilename,MAX_PATH); - - sid.cbSize = SKINICONDESC_SIZE; - sid.flags = SIDF_ALL_TCHAR; - sid.ptszSection = LPGENT("Nudge"); - sid.ptszDefaultFile = szFilename; - mir_snprintf(iconName,sizeof(iconName),"Nudge_%s",proto->szModuleName); - sid.pszName = iconName; - mir_sntprintf(iconDesc,sizeof(iconDesc),TranslateT("Nudge for %s"),proto->tszAccountName); - sid.ptszDescription = iconDesc; - sid.iDefaultIndex = -IDI_NUDGE; - sid.hDefaultIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_NUDGE)); - newNudge->item.hIcoLibItem = (HANDLE) CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); - } + char iconName[MAXMODULELABELLENGTH + 10]; + mir_snprintf(iconName,sizeof(iconName),"Nudge_%s",proto->szModuleName); + + TCHAR szFilename[MAX_PATH], iconDesc[MAXMODULELABELLENGTH + 10]; + GetModuleFileName(hInst,szFilename,MAX_PATH); + mir_sntprintf(iconDesc, SIZEOF(iconDesc), TranslateT("Nudge for %s"), proto->tszAccountName); + + SKINICONDESC sid = {0}; + sid.cbSize = SKINICONDESC_SIZE; + sid.flags = SIDF_ALL_TCHAR; + sid.ptszSection = LPGENT("Nudge"); + sid.ptszDefaultFile = szFilename; + sid.pszName = iconName; + sid.ptszDescription = iconDesc; + sid.iDefaultIndex = -IDI_NUDGE; + sid.hDefaultIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_NUDGE)); + newNudge->item.hIcoLibItem = (HANDLE) CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); //Add contact menu entry - if(ServiceExists(MS_CLIST_ADDCONTACTMENUITEM)) - { - //Add contact menu entry - CLISTMENUITEM mi = {0}; - mi.cbSize = sizeof(mi); - - mi.popupPosition = 500085000; - mi.pszContactOwner = proto->szModuleName; - mi.pszPopupName = proto->szModuleName; - mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR | CMIF_ICONFROMICOLIB; - mi.position = -500050004; - mi.icolibItem = newNudge->item.hIcoLibItem; - mi.ptszName = LPGENT( "Send &Nudge" ); - mi.pszService = MS_NUDGE_SEND; - newNudge->item.hContactMenu = (HANDLE) CallService( MS_CLIST_ADDCONTACTMENUITEM, 0, ( LPARAM )&mi ); - } + CLISTMENUITEM mi = {0}; + mi.cbSize = sizeof(mi); + mi.popupPosition = 500085000; + mi.pszContactOwner = proto->szModuleName; + mi.pszPopupName = proto->szModuleName; + mi.flags = CMIF_NOTOFFLINE | CMIF_TCHAR | CMIF_ICONFROMICOLIB; + mi.position = -500050004; + mi.icolibItem = newNudge->item.hIcoLibItem; + mi.ptszName = LPGENT( "Send &Nudge" ); + mi.pszService = MS_NUDGE_SEND; + newNudge->item.hContactMenu = Menu_AddContactMenuItem(&mi); } void AutoResendNudge(void *wParam) -- cgit v1.2.3