From be489c4e6f4c1ab4b4d7f84e35a73e34e1b0b331 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 25 Jun 2015 23:34:47 +0000 Subject: - 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 --- protocols/JabberG/src/jabber_menu.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'protocols/JabberG') 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); -- cgit v1.2.3