diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-25 23:34:47 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-25 23:34:47 +0000 |
commit | be489c4e6f4c1ab4b4d7f84e35a73e34e1b0b331 (patch) | |
tree | 233968040ec6bff10b0726de4e7a69313bb78266 /protocols | |
parent | c055d21f01423462fa8d468f7c33bde55e595773 (diff) |
- Menu_EnableItem & Menu_SetChecked - more suitable helpers to set flags;
- fix for checks in frame menus;
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@14389 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/FacebookRM/src/proto.h | 2 | ||||
-rw-r--r-- | protocols/FacebookRM/src/theme.cpp | 9 | ||||
-rw-r--r-- | protocols/IRCG/src/commandmonitor.cpp | 6 | ||||
-rw-r--r-- | protocols/IRCG/src/options.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_menu.cpp | 25 | ||||
-rw-r--r-- | protocols/Tlen/src/tlen_thread.cpp | 4 | ||||
-rw-r--r-- | protocols/WhatsApp/src/proto.h | 2 | ||||
-rw-r--r-- | protocols/WhatsApp/src/theme.cpp | 7 |
8 files changed, 27 insertions, 30 deletions
diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h index a43953e728..33cdd19bfe 100644 --- a/protocols/FacebookRM/src/proto.h +++ b/protocols/FacebookRM/src/proto.h @@ -224,7 +224,7 @@ public: std::tstring GetAvatarFolder(); bool GetDbAvatarInfo(PROTO_AVATAR_INFORMATION &ai, std::string *url); void CheckAvatarChange(MCONTACT hContact, const std::string &image_url); - void ToggleStatusMenuItems(BOOL bEnable); + void ToggleStatusMenuItems(bool bEnable); void StickerAsSmiley(std::string stickerId, const std::string &url, MCONTACT hContact); void SaveName(MCONTACT hContact, const facebook_user *fbu); std::string PrepareUrl(std::string url); diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index 922c065db7..934dc808a9 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -292,10 +292,9 @@ int FacebookProto::OnBuildStatusMenu(WPARAM, LPARAM) return 0;
}
-void FacebookProto::ToggleStatusMenuItems(BOOL bEnable)
+void FacebookProto::ToggleStatusMenuItems(bool bEnable)
{
- int flags = (bEnable) ? 0 : CMIF_GRAYED;
- Menu_ModifyItem(m_hMenuRoot, NULL, INVALID_HANDLE_VALUE, flags);
- Menu_ModifyItem(m_hStatusMind, NULL, INVALID_HANDLE_VALUE, flags);
- Menu_ModifyItem(m_hMenuServicesRoot, NULL, INVALID_HANDLE_VALUE, flags);
+ Menu_EnableItem(m_hMenuRoot, bEnable);
+ Menu_EnableItem(m_hStatusMind, bEnable);
+ Menu_EnableItem(m_hMenuServicesRoot, bEnable);
}
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 4567f48602..90ccf333b0 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -2298,9 +2298,9 @@ void CIrcProto::OnIrcDisconnected() memcpy(m_nick, m_pNick, sizeof(m_nick));
setTString("Nick", m_pNick);
- Menu_ModifyItem(hMenuJoin, NULL, INVALID_HANDLE_VALUE, CMIF_GRAYED);
- Menu_ModifyItem(hMenuList, NULL, INVALID_HANDLE_VALUE, CMIF_GRAYED);
- Menu_ModifyItem(hMenuNick, NULL, INVALID_HANDLE_VALUE, CMIF_GRAYED);
+ Menu_EnableItem(hMenuJoin, false);
+ Menu_EnableItem(hMenuList, false);
+ Menu_EnableItem(hMenuNick, false);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index f741aa9525..19033eabdc 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -730,7 +730,7 @@ void CConnectPrefsDlg::OnApply() m_proto->m_oldStyleModes = m_oldStyle.GetState();
m_proto->m_useServer = m_useServer.GetState();
- Menu_ModifyItem(m_proto->hMenuServer, NULL, INVALID_HANDLE_VALUE, (m_proto->m_useServer) ? 0 : CMIF_GRAYED);
+ Menu_EnableItem(m_proto->hMenuServer, m_proto->m_useServer != 0);
m_proto->m_joinOnInvite = m_autoJoin.GetState();
m_proto->m_hideServerWindow = !m_showServer.GetState();
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 999ace6c06..53414f2e6c 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -904,19 +904,18 @@ void CJabberProto::EnableMenuItems(BOOL bEnable) void CJabberProto::CheckMenuItems()
{
- int flags = (m_menuItemsStatus) ? 0 : CMIF_GRAYED;
-
- Menu_ModifyItem(m_hMenuChangePassword, NULL, INVALID_HANDLE_VALUE, flags);
- Menu_ModifyItem(m_hMenuGroupchat, NULL, INVALID_HANDLE_VALUE, flags);
-
- Menu_ModifyItem(m_hMenuPrivacyLists, NULL, INVALID_HANDLE_VALUE, flags);
- Menu_ModifyItem(m_hMenuRosterControl, NULL, INVALID_HANDLE_VALUE, flags);
- Menu_ModifyItem(m_hMenuServiceDiscovery, NULL, INVALID_HANDLE_VALUE, flags);
- Menu_ModifyItem(m_hMenuSDMyTransports, NULL, INVALID_HANDLE_VALUE, flags);
- Menu_ModifyItem(m_hMenuSDTransports, NULL, INVALID_HANDLE_VALUE, flags);
- Menu_ModifyItem(m_hMenuSDConferences, NULL, INVALID_HANDLE_VALUE, flags);
-
- bool bEnabled = m_ThreadInfo && (m_ThreadInfo->jabberServerCaps & JABBER_CAPS_PRIVATE_STORAGE);
+ bool bEnabled = (m_menuItemsStatus != 0);
+ Menu_EnableItem(m_hMenuChangePassword, bEnabled);
+ Menu_EnableItem(m_hMenuGroupchat, bEnabled);
+
+ Menu_EnableItem(m_hMenuPrivacyLists, bEnabled);
+ Menu_EnableItem(m_hMenuRosterControl, bEnabled);
+ Menu_EnableItem(m_hMenuServiceDiscovery, bEnabled);
+ Menu_EnableItem(m_hMenuSDMyTransports, bEnabled);
+ Menu_EnableItem(m_hMenuSDTransports, bEnabled);
+ Menu_EnableItem(m_hMenuSDConferences, bEnabled);
+
+ bEnabled = m_ThreadInfo && (m_ThreadInfo->jabberServerCaps & JABBER_CAPS_PRIVATE_STORAGE);
Menu_ShowItem(m_hMenuNotes, bEnabled);
Menu_ShowItem(m_hMenuBookmarks, bEnabled);
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp index 0e87420ca3..7b0b5ae460 100644 --- a/protocols/Tlen/src/tlen_thread.cpp +++ b/protocols/Tlen/src/tlen_thread.cpp @@ -340,9 +340,9 @@ void __cdecl TlenServerThread(ThreadData *info) info->proto->isOnline = FALSE;
info->proto->isConnected = FALSE;
- Menu_ModifyItem(info->proto->hMenuMUC, NULL, INVALID_HANDLE_VALUE, CMIF_GRAYED);
+ Menu_EnableItem(info->proto->hMenuMUC, false);
if (info->proto->hMenuChats != NULL)
- Menu_ModifyItem(info->proto->hMenuChats, NULL, INVALID_HANDLE_VALUE, CMIF_GRAYED);
+ Menu_EnableItem(info->proto->hMenuChats, false);
// Set status to offline
char *szProto = info->proto->m_szModuleName;
diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h index cc6d787b7f..5a3cf8cac9 100644 --- a/protocols/WhatsApp/src/proto.h +++ b/protocols/WhatsApp/src/proto.h @@ -125,7 +125,7 @@ private: { return ::_InterlockedIncrement(&m_iSerial);
}
- void ToggleStatusMenuItems(BOOL bEnable);
+ void ToggleStatusMenuItems(bool bEnable);
/// Avatars //////////////////////////////////////////////////////////////////////////
diff --git a/protocols/WhatsApp/src/theme.cpp b/protocols/WhatsApp/src/theme.cpp index 9ced4f036d..2d75c8908d 100644 --- a/protocols/WhatsApp/src/theme.cpp +++ b/protocols/WhatsApp/src/theme.cpp @@ -83,9 +83,8 @@ int WhatsAppProto::OnBuildStatusMenu(WPARAM wParam, LPARAM lParam) return 0;
}
-void WhatsAppProto::ToggleStatusMenuItems(BOOL bEnable)
+void WhatsAppProto::ToggleStatusMenuItems(bool bEnable)
{
- int flags = (bEnable) ? 0 : CMIF_GRAYED;
- Menu_ModifyItem(m_hMenuRoot, NULL, INVALID_HANDLE_VALUE, flags);
- Menu_ModifyItem(m_hMenuCreateGroup, NULL, INVALID_HANDLE_VALUE, flags);
+ Menu_EnableItem(m_hMenuRoot, bEnable);
+ Menu_EnableItem(m_hMenuCreateGroup, bEnable);
}
|