diff options
author | George Hazan <george.hazan@gmail.com> | 2013-12-16 16:07:54 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-12-16 16:07:54 +0000 |
commit | 3abd733254c02e2ca2c9bcc7fbbd1417c4a8ff74 (patch) | |
tree | f797b88d7a3c6993d447ac35b240a20fee4186b7 /protocols/Gadu-Gadu/src | |
parent | caf5e0116248d00c0b6beaed6e4e7817a0158fbb (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 'protocols/Gadu-Gadu/src')
-rw-r--r-- | protocols/Gadu-Gadu/src/gg.cpp | 10 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/gg.h | 1 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/links.cpp | 36 |
3 files changed, 8 insertions, 39 deletions
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 0930378b6d..1b70719699 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -195,15 +195,6 @@ static int gg_modulesloaded(WPARAM wParam, LPARAM lParam) }
//////////////////////////////////////////////////////////
-// When Miranda starting shutdown sequence
-static int gg_preshutdown(WPARAM wParam, LPARAM lParam)
-{
- gg_links_destroy();
-
- return 0;
-}
-
-//////////////////////////////////////////////////////////
// Gets protocol instance associated with a contact
static GGPROTO* gg_getprotoinstance(HANDLE hContact)
{
@@ -349,7 +340,6 @@ extern "C" int __declspec(dllexport) Load(void) // Hook system events
hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, gg_modulesloaded);
- hHookPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, gg_preshutdown);
// Prepare protocol name
PROTOCOLDESCRIPTOR pd = { sizeof(pd) };
diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h index d89d6d43e8..2acf921ec1 100644 --- a/protocols/Gadu-Gadu/src/gg.h +++ b/protocols/Gadu-Gadu/src/gg.h @@ -337,7 +337,6 @@ void WindowFreeIcon(HWND hWnd); /* URI parser functions */
void gg_links_instancemenu_init();
void gg_links_init();
-void gg_links_destroy();
#define UIN2IDA(uin,id) _itoa(uin,id,10)
#define UIN2IDT(uin,id) _itot(uin,id,10)
diff --git a/protocols/Gadu-Gadu/src/links.cpp b/protocols/Gadu-Gadu/src/links.cpp index fafaf05c48..2e6238a963 100644 --- a/protocols/Gadu-Gadu/src/links.cpp +++ b/protocols/Gadu-Gadu/src/links.cpp @@ -24,12 +24,10 @@ //////////////////////////////////////////////////////////
// File Association Manager support
-#define GGS_PARSELINK "%s/ParseLink"
-#define GGS_MENUCHOOSE "%s/MenuChoose"
+#define GGS_PARSELINK "GG/ParseLink"
+#define GGS_MENUCHOOSE "GG/MenuChoose"
static HANDLE hInstanceMenu;
-static HANDLE hServiceMenuChoose;
-static HANDLE hServiceParseLink;
static INT_PTR gg_menuchoose(WPARAM wParam, LPARAM lParam)
{
@@ -111,17 +109,10 @@ static INT_PTR gg_parselink(WPARAM wParam, LPARAM lParam) void gg_links_instancemenu_init()
{
- char service[MAXMODULELABELLENGTH];
- TMenuParam mnu = {0};
- TMO_MenuItem tmi = {0};
-
- mir_snprintf(service, sizeof(service), GGS_MENUCHOOSE, GGDEF_PROTO);
- hServiceMenuChoose = CreateServiceFunction(service, gg_menuchoose);
- mnu.cbSize = sizeof(mnu);
- mnu.name = "GGAccountChooser";
- mnu.ExecService = service;
- hInstanceMenu = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, 0, (LPARAM)&mnu);
+ CreateServiceFunction(GGS_MENUCHOOSE, gg_menuchoose);
+ hInstanceMenu = MO_CreateMenuObject("GGAccountChooser", LPGEN("Gadu-Gadu account chooser"), 0, GGS_MENUCHOOSE);
+ TMO_MenuItem tmi = {0};
tmi.cbSize = sizeof(tmi);
tmi.pszName = "Cancel";
tmi.position = 9999999;
@@ -131,23 +122,12 @@ void gg_links_instancemenu_init() void gg_links_init()
{
- if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE))
- {
- char service[MAXMODULELABELLENGTH];
-
- mir_snprintf(service, sizeof(service), GGS_PARSELINK, GGDEF_PROTO);
- hServiceParseLink = CreateServiceFunction(service, gg_parselink);
- AssocMgr_AddNewUrlType("gg:", Translate("Gadu-Gadu Link Protocol"), hInstance, IDI_GG, service, 0);
+ if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE)) {
+ CreateServiceFunction(GGS_PARSELINK, gg_parselink);
+ AssocMgr_AddNewUrlType("gg:", Translate("Gadu-Gadu Link Protocol"), hInstance, IDI_GG, GGS_PARSELINK, 0);
}
}
-void gg_links_destroy()
-{
- DestroyServiceFunction(hServiceMenuChoose);
- if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE))
- DestroyServiceFunction(hServiceParseLink);
-}
-
void GGPROTO::links_instance_init()
{
if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE)) {
|