summaryrefslogtreecommitdiff
path: root/plugins/SMS/src/SMS_svc.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-05 23:13:56 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-05 23:13:56 +0000
commit4810d4b1b7a47701b8e6c45490fb2643ea425123 (patch)
treefb94dd5889fdd0558605ffe738f0b2d6d2f08ca2 /plugins/SMS/src/SMS_svc.cpp
parent007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (diff)
rest of menu cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@4325 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SMS/src/SMS_svc.cpp')
-rw-r--r--plugins/SMS/src/SMS_svc.cpp94
1 files changed, 25 insertions, 69 deletions
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp
index cff9a72946..14df262de2 100644
--- a/plugins/SMS/src/SMS_svc.cpp
+++ b/plugins/SMS/src/SMS_svc.cpp
@@ -19,105 +19,61 @@ int LoadServices(void)
int LoadModules(void)
{
- ssSMSSettings.hHookOptInitialize=HookEvent(ME_OPT_INITIALISE,OptInitialise);
- ssSMSSettings.hHookRebuildCMenu=HookEvent(ME_CLIST_PREBUILDCONTACTMENU,SmsRebuildContactMenu);
- ssSMSSettings.hHookProtoAck=HookEvent(ME_PROTO_ACK,handleAckSMS);
- ssSMSSettings.hHookDbAdd=HookEvent(ME_DB_EVENT_ADDED,handleNewMessage);
- ssSMSSettings.hHookAccListChanged=HookEvent(ME_PROTO_ACCLISTCHANGED,RefreshAccountList);
-
-
- CLISTMENUITEM mi={0};
- CHAR szServiceFunction[MAX_PATH];
+ HookEvent(ME_OPT_INITIALISE,OptInitialise);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU,SmsRebuildContactMenu);
+ HookEvent(ME_PROTO_ACK,handleAckSMS);
+ HookEvent(ME_DB_EVENT_ADDED,handleNewMessage);
+ HookEvent(ME_PROTO_ACCLISTCHANGED,RefreshAccountList);
+ CHAR szServiceFunction[MAX_PATH];
mir_snprintf(szServiceFunction,sizeof(szServiceFunction),"%s%s",PROTOCOL_NAMEA,SMS_SEND);
- mi.cbSize=sizeof(mi);
- mi.position=300050000;
- mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_SMS);
- mi.ptszName=SMS_SEND_STR;
- mi.pszService=szServiceFunction;
- mi.flags=CMIF_TCHAR;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.position = 300050000;
+ mi.hIcon = LoadSkinnedIcon(SKINICON_OTHER_SMS);
+ mi.ptszName = SMS_SEND_STR;
+ mi.pszService = szServiceFunction;
+ mi.flags = CMIF_TCHAR;
Menu_AddMainMenuItem(&mi);
- mi.position=-2000070000;
- mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_SMS);
- mi.ptszName=SMS_SEND_CM_STR;
- mi.pszService=szServiceFunction;
- mi.flags=CMIF_TCHAR;
- ssSMSSettings.hContactMenuItems[0]=Menu_AddContactMenuItem(&mi);
+ mi.position = -2000070000;
+ mi.hIcon = LoadSkinnedIcon(SKINICON_OTHER_SMS);
+ mi.ptszName = SMS_SEND_CM_STR;
+ mi.pszService = szServiceFunction;
+ mi.flags = CMIF_TCHAR;
+ ssSMSSettings.hContactMenuItems[0] = Menu_AddContactMenuItem(&mi);
SkinAddNewSoundEx("RecvSMSMsg",PROTOCOL_NAMEA,LPGEN("Incoming SMS Message"));
SkinAddNewSoundEx("RecvSMSConfirmation",PROTOCOL_NAMEA,LPGEN("Incoming SMS Confirmation"));
-
RefreshAccountList(NULL,NULL);
RestoreUnreadMessageAlerts();
-
return 0;
}
-
-void UnloadModules()
-{
- // Main menu destroy
- //CListDestroyMenu(gdiMenuItems,SIZEOF(gdiMenuItems));
- //ZeroMemory(masMraSettings.hMainMenuItems,sizeof(masMraSettings.hMainMenuItems));
-
- // Contact menu destroy
- //CListDestroyMenu(gdiContactMenuItems,(SIZEOF(gdiContactMenuItems) - ((masMraSettings.heNudgeReceived==NULL)? 0:1)));
- //ZeroMemory(masMraSettings.hContactMenuItems,sizeof(masMraSettings.hContactMenuItems));
-
- if (ssSMSSettings.hHookAccListChanged) {UnhookEvent(ssSMSSettings.hHookAccListChanged); ssSMSSettings.hHookAccListChanged=NULL;}
- if (ssSMSSettings.hHookDbAdd) {UnhookEvent(ssSMSSettings.hHookDbAdd); ssSMSSettings.hHookDbAdd=NULL;}
- if (ssSMSSettings.hHookProtoAck) {UnhookEvent(ssSMSSettings.hHookProtoAck); ssSMSSettings.hHookProtoAck=NULL;}
- if (ssSMSSettings.hHookRebuildCMenu) {UnhookEvent(ssSMSSettings.hHookRebuildCMenu); ssSMSSettings.hHookRebuildCMenu=NULL;}
- if (ssSMSSettings.hHookOptInitialize) {UnhookEvent(ssSMSSettings.hHookOptInitialize); ssSMSSettings.hHookOptInitialize=NULL;}
-
- //IconsUnLoad();
-
-}
-
-
-void UnloadServices()
-{
- CHAR szServiceFunction[MAX_PATH],*pszServiceFunctionName;
-
- CopyMemory(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
- pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
-
- // destroy plugin services
- for (SIZE_T i=0;i<SIZEOF(siPluginServices);i++)
- {
- CopyMemory(pszServiceFunctionName,siPluginServices[i].lpszName,(lstrlenA(siPluginServices[i].lpszName)+1));
- DestroyServiceFunction(szServiceFunction);
- }
-}
-
-
-
int SmsRebuildContactMenu(WPARAM wParam,LPARAM lParam)
{
Menu_ShowItem(ssSMSSettings.hContactMenuItems[0], GetContactPhonesCount((HANDLE)wParam));
return 0;
}
-
//This function called when user clicked Menu.
int SendSMSMenuCommand(WPARAM wParam,LPARAM lParam)
{
HWND hwndSendSms;
- if (wParam)
- {// user clicked on the "SMS Message" on one of the users
- hwndSendSms=SendSMSWindowIsOtherInstanceHContact((HANDLE)wParam);
+ // user clicked on the "SMS Message" on one of the users
+ if (wParam) {
+ hwndSendSms = SendSMSWindowIsOtherInstanceHContact((HANDLE)wParam);
if (hwndSendSms)
SetFocus(hwndSendSms);
else
- hwndSendSms=SendSMSWindowAdd((HANDLE)wParam);
+ hwndSendSms = SendSMSWindowAdd((HANDLE)wParam);
}
- else{// user clicked on the "SMS Send" in the Main Menu
- hwndSendSms=SendSMSWindowAdd(NULL);
+ // user clicked on the "SMS Send" in the Main Menu
+ else{
+ hwndSendSms = SendSMSWindowAdd(NULL);
EnableWindow(GetDlgItem(hwndSendSms,IDC_NAME),TRUE);
EnableWindow(GetDlgItem(hwndSendSms,IDC_SAVENUMBER),FALSE);