diff options
Diffstat (limited to 'protocols')
-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 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_menu.cpp | 3 | ||||
-rw-r--r-- | protocols/Skype/src/skype_menus.cpp | 4 |
5 files changed, 11 insertions, 43 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)) {
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index e409f419b2..43025b38f8 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -183,8 +183,7 @@ void g_MenuInit(void) CreateServiceFunction("Jabber/MenuChoose", JabberMenuChooseService);
- TMenuParam mnu = { sizeof(mnu), "JabberAccountChooser", 0, "Jabber/MenuChoose" };
- hChooserMenu = (HANDLE)CallService(MO_CREATENEWMENUOBJECT, 0, (LPARAM)&mnu);
+ hChooserMenu = MO_CreateMenuObject("JabberAccountChooser", LPGEN("Jabber account chooser"), 0, "Jabber/MenuChoose");
TMO_MenuItem tmi = { sizeof(tmi) };
tmi.pszName = "Cancel";
diff --git a/protocols/Skype/src/skype_menus.cpp b/protocols/Skype/src/skype_menus.cpp index 69e4acce52..3553b0b5ce 100644 --- a/protocols/Skype/src/skype_menus.cpp +++ b/protocols/Skype/src/skype_menus.cpp @@ -1,6 +1,6 @@ #include "skype.h"
-HGENMENU CSkypeProto::hChooserMenu;
+HANDLE CSkypeProto::hChooserMenu;
HGENMENU CSkypeProto::contactMenuItems[CMI_MAX];
INT_PTR CSkypeProto::MenuChooseService(WPARAM wParam, LPARAM lParam)
@@ -122,7 +122,7 @@ void CSkypeProto::InitMenus() mnu.cbSize = sizeof(mnu);
mnu.name = "SkypeAccountChooser";
mnu.ExecService = "Skype/MenuChoose";
- hChooserMenu = (HGENMENU)::CallService(MO_CREATENEWMENUOBJECT, 0, (LPARAM)&mnu);
+ hChooserMenu = MO_CreateMenuObject(LPGEN("Skype menu chooser"), &mnu);
//////////////////////////////////////////////////////////////////////////////////////
// Contact menu initialization
|