From 4810d4b1b7a47701b8e6c45490fb2643ea425123 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 5 Apr 2013 23:13:56 +0000 Subject: rest of menu cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@4325 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SMS/src/SMSConstans.h | 9 ++--- plugins/SMS/src/SMS_svc.cpp | 94 ++++++++++++------------------------------- plugins/SMS/src/common.h | 10 ----- plugins/SMS/src/main.cpp | 26 +++--------- 4 files changed, 34 insertions(+), 105 deletions(-) (limited to 'plugins/SMS') diff --git a/plugins/SMS/src/SMSConstans.h b/plugins/SMS/src/SMSConstans.h index 06ae75a3ff..d20ce5dc1d 100644 --- a/plugins/SMS/src/SMSConstans.h +++ b/plugins/SMS/src/SMSConstans.h @@ -78,12 +78,9 @@ struct SERVICE_ITEM static const SERVICE_ITEM siPluginServices[] = { - { SMS_READ, ReadMsgSMS }, - { SMS_READ_ACK, ReadAckSMS }, - { SMS_SEND, SendSMSMenuCommand }, + { SMS_READ, ReadMsgSMS }, + { SMS_READ_ACK, ReadAckSMS }, + { SMS_SEND, SendSMSMenuCommand }, }; - - - #endif // !defined(AFX_SMS_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_) 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