summaryrefslogtreecommitdiff
path: root/plugins/Nudge
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-14 15:51:34 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-14 15:51:34 +0000
commite58823d961a630eb62e60d2ccb443761ba5f1704 (patch)
tree62d071be480d57af2a53f154a1468abe0b9449ff /plugins/Nudge
parent721aea0764451e985d575236205808bbef298244 (diff)
- 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
Diffstat (limited to 'plugins/Nudge')
-rw-r--r--plugins/Nudge/headers.h1
-rw-r--r--plugins/Nudge/main.cpp64
2 files changed, 29 insertions, 36 deletions
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 <m_metacontacts.h>
#include <m_updater.h>
#include <m_icolib.h>
+#include <win2k.h>
#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)