summaryrefslogtreecommitdiff
path: root/plugins/MirOTR
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-12-16 16:07:54 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-12-16 16:07:54 +0000
commit3abd733254c02e2ca2c9bcc7fbbd1417c4a8ff74 (patch)
treef797b88d7a3c6993d447ac35b240a20fee4186b7 /plugins/MirOTR
parentcaf5e0116248d00c0b6beaed6e4e7817a0158fbb (diff)
- new menu object helpers (MO_CreateMenuObject, MO_SetMenuObjectParam);
- menu item display names are now translatable; - old nasty pieces of junk removed in CLUIFrames/cluiframes.cpp git-svn-id: http://svn.miranda-ng.org/main/trunk@7247 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR')
-rw-r--r--plugins/MirOTR/MirOTR/src/mirotrmenu.cpp28
1 files changed, 6 insertions, 22 deletions
diff --git a/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp
index dfd28d741f..f886cd14e6 100644
--- a/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp
+++ b/plugins/MirOTR/MirOTR/src/mirotrmenu.cpp
@@ -200,36 +200,20 @@ void InitMirOTRMenu(void)
CreateServiceFunction("MirOTRMenuExecService",MirOTRMenuExecService);
CreateServiceFunction("MirOTRMenuCheckService",MirOTRMenuCheckService);
- //free services
+ // menu object
CreateServiceFunction("MIROTRMENUS/FreeOwnerDataMirOTRMenu",FreeOwnerDataMirOTRMenu);
CreateServiceFunction("MIROTRMENUS/OnAddMenuItemMirOTRMenu",OnAddMenuItemMirOTRMenu);
CreateServiceFunction(MS_MIROTR_ADDMIROTRMENUITEM,AddMirOTRMenuItem);
CreateServiceFunction(MS_MIROTR_MENUBUILDMIROTR,BuildMirOTRMenu);
CreateServiceFunction(MS_MIROTR_REMOVEMIROTRMENUITEM,RemoveMirOTRMenuItem);
- {
- TMenuParam tmp = { 0 };
- tmp.cbSize=sizeof(tmp);
- tmp.CheckService="MirOTRMenuCheckService";
- tmp.ExecService="MirOTRMenuExecService";
- tmp.name="MirOTRMenu";
- hMirOTRMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
- }
-
- OptParam params;
- params.Handle = hMirOTRMenuObject;
- params.Setting = OPT_USERDEFINEDITEMS;
- params.Value = FALSE;
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&params);
-
- params.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE;
- params.Value = (INT_PTR)"MIROTRMENUS/FreeOwnerDataMirOTRMenu";
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&params);
- params.Setting = OPT_MENUOBJECT_SET_ONADD_SERVICE;
- params.Value = (INT_PTR)"MIROTRMENUS/OnAddMenuItemMirOTRMenu";
- CallService(MO_SETOPTIONSMENUOBJECT, 0, (LPARAM)&params);
+ hMirOTRMenuObject = MO_CreateMenuObject("MirOTRMenu", LPGEN("MirOTR menu"), "MirOTRMenuCheckService", "MirOTRMenuExecService");
+ MO_SetMenuObjectParam(hMirOTRMenuObject, OPT_USERDEFINEDITEMS, FALSE);
+ MO_SetMenuObjectParam(hMirOTRMenuObject, OPT_MENUOBJECT_SET_FREE_SERVICE, "MIROTRMENUS/FreeOwnerDataMirOTRMenu");
+ MO_SetMenuObjectParam(hMirOTRMenuObject, OPT_MENUOBJECT_SET_ONADD_SERVICE, "MIROTRMENUS/OnAddMenuItemMirOTRMenu");
+ // menu items
MIROTRMENUITEM mi = {0};
mi.cbSize = sizeof(mi);