diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-14 15:51:34 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-14 15:51:34 +0000 |
commit | e58823d961a630eb62e60d2ccb443761ba5f1704 (patch) | |
tree | 62d071be480d57af2a53f154a1468abe0b9449ff /plugins/SecureIM | |
parent | 721aea0764451e985d575236205808bbef298244 (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/SecureIM')
-rw-r--r-- | plugins/SecureIM/main.cpp | 39 | ||||
-rw-r--r-- | plugins/SecureIM/options.cpp | 7 |
2 files changed, 19 insertions, 27 deletions
diff --git a/plugins/SecureIM/main.cpp b/plugins/SecureIM/main.cpp index 926f68512a..24950bbacf 100644 --- a/plugins/SecureIM/main.cpp +++ b/plugins/SecureIM/main.cpp @@ -50,10 +50,9 @@ void AddHookFunction(LPCSTR eventName, MIRANDAHOOK hookFunction) { }
-HANDLE AddMenuItem(LPCSTR name,int pos,HICON hicon,LPCSTR service,int flags=0,WPARAM wParam=0) {
-
- CLISTMENUITEM mi;
- memset(&mi,0,sizeof(mi));
+HANDLE AddMenuItem(LPCSTR name,int pos,HICON hicon,LPCSTR service,int flags=0,WPARAM wParam=0)
+{
+ CLISTMENUITEM mi = { 0 };
mi.cbSize=sizeof(mi);
mi.flags=flags | CMIF_HIDDEN;
mi.position=pos;
@@ -61,23 +60,23 @@ HANDLE AddMenuItem(LPCSTR name,int pos,HICON hicon,LPCSTR service,int flags=0,WP mi.pszName= (char*)name;
mi.pszPopupName=(char*)-1;
mi.pszService=(char*)service;
- return((HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,wParam,(LPARAM)&mi));
+ return Menu_AddContactMenuItem(&mi);
}
-HANDLE AddSubItem(HANDLE rootid,LPCSTR name,int pos,int poppos,LPCSTR service,WPARAM wParam=0) {
-
- CLISTMENUITEM mi;
- memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.flags=CMIF_CHILDPOPUP | CMIF_HIDDEN;
- mi.position=pos;
- mi.popupPosition=poppos;
- mi.hIcon=NULL;
- mi.pszName=(char*)name;
- mi.pszPopupName=(char*)rootid;
- mi.pszService=(char*)service;
- return((HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,wParam,(LPARAM)&mi));
+HANDLE AddSubItem(HANDLE rootid,LPCSTR name,int pos,int poppos,LPCSTR service,WPARAM wParam=0)
+{
+ CLISTMENUITEM mi = { 0 };
+ memset(&mi,0,sizeof(mi));
+ mi.cbSize=sizeof(mi);
+ mi.flags=CMIF_CHILDPOPUP | CMIF_HIDDEN;
+ mi.position=pos;
+ mi.popupPosition=poppos;
+ mi.hIcon=NULL;
+ mi.pszName=(char*)name;
+ mi.pszPopupName=(char*)rootid;
+ mi.pszService=(char*)service;
+ return Menu_AddContactMenuItem(&mi);
}
@@ -416,7 +415,7 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) { g_hMenu[0] = AddMenuItem(sim301,110000,g_hICO[ICO_CM_EST],MODULENAME"/SIM_EST",CMIF_NOTOFFLINE);
g_hMenu[1] = AddMenuItem(sim302,110001,g_hICO[ICO_CM_DIS],MODULENAME"/SIM_DIS",CMIF_NOTOFFLINE);
- if(ServiceExists(MS_CLIST_ADDSUBGROUPMENUITEM)) {
+ if(ServiceExists(MS_CLIST_MENUBUILDSUBGROUP)) {
g_hMenu[2] = AddMenuItem(sim312[0],110002,NULL,NULL,CMIF_ROOTPOPUP);
g_hMenu[3] = AddSubItem(g_hMenu[2],sim232[0],110003,110002,MODULENAME"/SIM_ST_DIS");
g_hMenu[4] = AddSubItem(g_hMenu[2],sim232[1],110004,110002,MODULENAME"/SIM_ST_ENA");
@@ -450,7 +449,7 @@ int __cdecl onModulesLoaded(WPARAM wParam,LPARAM lParam) { #if defined(_DEBUG) || defined(NETLIB_LOG)
Sent_NetLog("create Mode menu");
#endif
- if(ServiceExists(MS_CLIST_ADDSUBGROUPMENUITEM)) {
+ if(ServiceExists(MS_CLIST_MENUBUILDSUBGROUP)) {
g_hMenu[10] = AddMenuItem(sim311[0],110010,NULL,NULL,CMIF_ROOTPOPUP);
g_hMenu[11] = AddSubItem(g_hMenu[10],sim231[0],110011,110010,MODULENAME"/MODE_NAT");
g_hMenu[12] = AddSubItem(g_hMenu[10],sim231[1],110012,110010,MODULENAME"/MODE_PGP");
diff --git a/plugins/SecureIM/options.cpp b/plugins/SecureIM/options.cpp index fa61e021b4..3f84c98b10 100644 --- a/plugins/SecureIM/options.cpp +++ b/plugins/SecureIM/options.cpp @@ -1131,13 +1131,6 @@ void RefreshGeneralDlg(HWND hDlg, BOOL iInit) { SendMessage(GetDlgItem(hDlg,IDC_AAK),BM_SETCHECK,(bAAK)?BST_CHECKED:BST_UNCHECKED,0L);
SendMessage(GetDlgItem(hDlg,IDC_MCM),BM_SETCHECK,(bMCM)?BST_CHECKED:BST_UNCHECKED,0L);
-/* // CList_classic
- if (!ServiceExists(MS_CLIST_ADDSUBGROUPMENUITEM)) {
- EnableWindow(GetDlgItem(hDlg,IDC_ASI),FALSE);
- for(i=2;i<ADV_CNT;i++)
- EnableWindow(GetDlgItem(hDlg,IDC_ADV1+i),FALSE);
- }
-*/
// Advanced
SendMessage(GetDlgItem(hDlg, IDC_ADVICON), CB_SETCURSEL, bADV, 0);
if ( g_hCLIcon ) {
|