diff options
author | George Hazan <george.hazan@gmail.com> | 2015-07-02 13:15:30 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-07-02 13:15:30 +0000 |
commit | 9238c4e3aa9df5d0726cf3a03e632bc3d3969711 (patch) | |
tree | e5d95695014b33a99e19c4b19472e9dc69db7c5d /protocols/JabberG | |
parent | 2481102c6541df37a773569dd4d67b579f04d819 (diff) |
two new flags of TMO_MenuItem:
- CMIF_SYSTEM: filters a menu item out of options' editor;
- CMIF_UNMOVABLE: denies attempts to change the item's position;
- CMIF_SYSTEM applied to frames' menu;
- CMIF_UNMOVABLE applied to Jabber protocol menu items;
git-svn-id: http://svn.miranda-ng.org/main/trunk@14468 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG')
-rw-r--r-- | protocols/JabberG/src/jabber_menu.cpp | 14 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_privacy.cpp | 6 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_xstatus.cpp | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index e241a5200c..ba19e2ef1e 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -200,6 +200,7 @@ void g_MenuInit(void) // Contact menu initialization
CMenuItem mi;
+ mi.flags = CMIF_UNMOVABLE;
// "Request authorization"
mi.name.a = LPGEN("Request authorization");
@@ -434,17 +435,15 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) if (i < item->arResources.getCount()) {
pResourceStatus r(item->arResources[i]);
- int flags = 0;
HICON hIcon = (HICON)INVALID_HANDLE_VALUE;
- if (item->resourceMode == RSMODE_MANUAL && item->m_pManualResource == r)
- flags |= CMIF_CHECKED;
+ Menu_SetChecked(m_phMenuResourceItems[i], item->resourceMode == RSMODE_MANUAL && item->m_pManualResource == r);
if (ServiceExists(MS_FP_GETCLIENTICONT)) {
FormatMirVer(r, szTmp);
hIcon = Finger_GetClientIcon(szTmp, 0);
}
szTmp.Format(_T("%s [%s, %d]"), r->m_tszResourceName, pcli->pfnGetStatusModeDescription(r->m_iStatus, 0), r->m_iPriority);
- Menu_ModifyItem(m_phMenuResourceItems[i], szTmp, hIcon, flags);
+ Menu_ModifyItem(m_phMenuResourceItems[i], szTmp, hIcon);
DestroyIcon(hIcon);
}
else Menu_ShowItem(m_phMenuResourceItems[i], FALSE);
@@ -581,6 +580,7 @@ void CJabberProto::MenuInit() {
CMenuItem mi;
mi.root = m_hMenuRoot = Menu_GetProtocolRoot(this);
+ mi.flags = CMIF_UNMOVABLE;
// "Bookmarks..."
mi.pszService = "/Bookmarks";
@@ -679,7 +679,7 @@ void CJabberProto::MenuInit() mi.position = 200006;
mi.root = m_hMenuRoot;
mi.name.a = LPGEN("Resource priority");
- mi.flags = CMIF_HIDDEN;
+ mi.flags = CMIF_UNMOVABLE | CMIF_HIDDEN;
m_hMenuPriorityRoot = Menu_AddProtoMenuItem(&mi);
TCHAR szName[128];
@@ -687,7 +687,7 @@ void CJabberProto::MenuInit() mi.pszService = srvFce;
mi.name.t = szName;
mi.position = 2000040000;
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.root = m_hMenuPriorityRoot;
mir_snprintf(srvFce, _countof(srvFce), "/menuSetPriority/%d", 0);
@@ -767,7 +767,7 @@ void CJabberProto::GlobalMenuInit() // Account chooser menu
CMenuItem mi;
- mi.flags = CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.position = iChooserMenuPos++;
mi.name.t = m_tszUserName;
m_hChooseMenuItem = Menu_AddItem(hChooserMenu, &mi, this);
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index f70aa8741e..5264a5b250 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -2093,7 +2093,7 @@ void CJabberProto::BuildPrivacyMenu() CMenuItem mi;
mi.position = 200005;
mi.hIcolibItem = GetIconHandle(IDI_AGENTS);
- mi.flags = CMIF_HIDDEN;
+ mi.flags = CMIF_UNMOVABLE | CMIF_HIDDEN;
mi.name.a = LPGEN("Privacy Lists");
mi.root = m_hMenuRoot;
m_hPrivacyMenuRoot = Menu_AddProtoMenuItem(&mi);
@@ -2101,7 +2101,7 @@ void CJabberProto::BuildPrivacyMenu() mi.pszService = "/PrivacyLists";
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandlePrivacyLists);
mi.position = 3000040000;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR;
mi.hIcolibItem = GetIconHandle(IDI_PRIVACY_LISTS);
mi.name.t = LPGENT("List Editor...");
mi.root = m_hPrivacyMenuRoot;
@@ -2122,7 +2122,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) CMenuItem mi;
mi.position = 2000040000;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR;
mi.root = m_hPrivacyMenuRoot;
mi.pszService = srvFce;
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index ddde385b99..5e532fb7c5 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -469,7 +469,7 @@ void CPepGuiService::RebuildMenu() mi.root = hJabberRoot;
mi.pszService = szService;
mi.position = 200010;
- mi.flags = CMIF_TCHAR | CMIF_HIDDEN;
+ mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_HIDDEN;
mi.hIcolibItem = m_hIcolibItem;
mi.name.t = m_szText ? m_szText : _T("<advanced status slot>");
m_hMenuItem = Menu_AddProtoMenuItem(&mi, m_proto->m_szModuleName);
|