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/AimOscar/src | |
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/AimOscar/src')
-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 |
3 files changed, 6 insertions, 24 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);
-}
|