diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-22 14:11:54 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-22 14:11:54 +0000 |
commit | ca410fe247243f87ac3234f526f708111f227c74 (patch) | |
tree | 53900a832c06219ff6fbc1e5a63dbe4d1b450785 /protocols | |
parent | b3506557a58f53ed0fc3a96c4ec4a3b8098a542d (diff) |
various menu definition quirks
git-svn-id: http://svn.miranda-ng.org/main/trunk@14326 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/AimOscar/src/proto.cpp | 3 | ||||
-rw-r--r-- | protocols/AimOscar/src/proto.h | 5 | ||||
-rw-r--r-- | protocols/AimOscar/src/theme.cpp | 22 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_menu.cpp | 2 | ||||
-rw-r--r-- | protocols/Tlen/src/tlen.cpp | 3 |
5 files changed, 8 insertions, 27 deletions
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index 5eb4e8d814..6083632b48 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -67,9 +67,6 @@ CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) : CAimProto::~CAimProto()
{
- RemoveMainMenus();
- RemoveContactMenus();
-
if (hServerConn)
Netlib_CloseHandle(hServerConn);
if (hAvatarConn && hAvatarConn != (HANDLE)1)
diff --git a/protocols/AimOscar/src/proto.h b/protocols/AimOscar/src/proto.h index fc4b9b9c37..5ee46474c8 100644 --- a/protocols/AimOscar/src/proto.h +++ b/protocols/AimOscar/src/proto.h @@ -136,7 +136,6 @@ struct CAimProto : public PROTO<CAimProto> HGENMENU hMenuRoot;
HGENMENU hHTMLAwayContextMenuItem;
HGENMENU hAddToServerListContextMenuItem;
- HGENMENU hReadProfileMenuItem;
HGENMENU hBlockContextMenuItem;
HGENMENU hMainMenu[3];
@@ -387,9 +386,7 @@ struct CAimProto : public PROTO<CAimProto> void InitMainMenus(void);
void InitContactMenus(void);
- void RemoveMainMenus(void);
- void RemoveContactMenus(void);
-
+
//////////////////////////////////////////////////////////////////////////////////////
// thread.cpp
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp index 71b3a3b620..c8b6ab7fd0 100644 --- a/protocols/AimOscar/src/theme.cpp +++ b/protocols/AimOscar/src/theme.cpp @@ -231,8 +231,10 @@ void CAimProto::InitMainMenus(void) hRoot = hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else {
- RemoveMainMenus();
- hMenuRoot = NULL;
+ if (hMenuRoot) {
+ CallService(MO_REMOVEMENUITEM, (WPARAM)hMenuRoot, 0);
+ hMenuRoot = NULL;
+ }
}
mi.pszService = service_name;
@@ -284,7 +286,7 @@ void CAimProto::InitContactMenus(void) mi.icolibItem = GetIconHandle("profile");
mi.pszName = LPGEN("Read Profile");
mi.flags = CMIF_NOTOFFLINE;
- hReadProfileMenuItem = Menu_AddContactMenuItem(&mi);
+ Menu_AddContactMenuItem(&mi);
mir_snprintf(service_name, _countof(service_name), "%s%s", m_szModuleName, "/AddToServerList");
CreateProtoService("/AddToServerList", &CAimProto::AddToServerList);
@@ -302,17 +304,3 @@ void CAimProto::InitContactMenus(void) mi.flags = CMIF_HIDDEN;
hBlockContextMenuItem = Menu_AddContactMenuItem(&mi);
}
-
-void CAimProto::RemoveMainMenus(void)
-{
- if (hMenuRoot)
- CallService(MO_REMOVEMENUITEM, (WPARAM)hMenuRoot, 0);
-}
-
-void CAimProto::RemoveContactMenus(void)
-{
- CallService(MO_REMOVEMENUITEM, (WPARAM)hHTMLAwayContextMenuItem, 0);
- CallService(MO_REMOVEMENUITEM, (WPARAM)hReadProfileMenuItem, 0);
- CallService(MO_REMOVEMENUITEM, (WPARAM)hAddToServerListContextMenuItem, 0);
- CallService(MO_REMOVEMENUITEM, (WPARAM)hBlockContextMenuItem, 0);
-}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 0f5f9633db..7282a96457 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -282,7 +282,7 @@ void g_MenuInit(void) mi.pszService = "Jabber/DirectPresenceDummySvc";
mi.pszName = LPGEN("Send Presence");
mi.position = -1999901011;
- mi.pszPopupName = (char *)-1;
+ mi.hParentMenu = HGENMENU_ROOT;
mi.icolibItem = g_GetIconHandle(IDI_NOTES);
g_hMenuDirectPresence[0] = Menu_AddContactMenuItem(&mi);
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp index 66e1d9c6ee..c0acd7d49d 100644 --- a/protocols/Tlen/src/tlen.cpp +++ b/protocols/Tlen/src/tlen.cpp @@ -264,7 +264,7 @@ void TlenProtocol::initMenuItems() strncpy_s(text, sizeof(text), m_szModuleName, _TRUNCATE);
char *pSvcName = text + mir_strlen(text);
- CLISTMENUITEM mi = { 0 }, clmi = { sizeof(clmi) };
+ CLISTMENUITEM mi = { 0 }, clmi = { 0 };
clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
mi.pszContactOwner = m_szModuleName;
@@ -280,7 +280,6 @@ void TlenProtocol::initMenuItems() hMenuRoot = Menu_AddMainMenuItem(&mi);
mi.flags = CMIF_CHILDPOPUP;
- //mi.pszPopupName = (char *)hMenuRoot;
mi.hParentMenu = (HGENMENU)hMenuRoot;
hMenuChats = NULL;
|