- Timestamp:
- Oct 9, 2018 2:03:41 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r74585 r74719 1989 1989 { 1990 1990 /* Determine whether Machine or Group menu should be shown at all: */ 1991 const bool fGlobalMenuShown = m_pWidget->isGlobalItemSelected(); 1992 const bool fMachineMenuShown = !isSingleGroupSelected(); 1991 const bool fGlobalMenuShown = m_pWidget->isGlobalItemSelected(); 1992 const bool fMachineMenuShown = m_pWidget->isMachineItemSelected() && !isSingleGroupSelected(); 1993 const bool fGroupMenuShown = m_pWidget->isGroupItemSelected() && isSingleGroupSelected(); 1993 1994 m_pMachineMenuAction->setVisible(fMachineMenuShown); 1994 m_pGroupMenuAction->setVisible( !fMachineMenuShown);1995 1996 /* Determine whether Media actionsshould be visible: */1995 m_pGroupMenuAction->setVisible(fGroupMenuShown); 1996 1997 /* Determine whether Media menu should be visible: */ 1997 1998 const bool fMediumMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == ToolTypeGlobal_Media; 1998 const bool fMediumActionsShown = fMediumMenuShown || !m_pWidget->isToolOpened(ToolTypeGlobal_Media);1999 1999 m_pVirtualMediaManagerMenuAction->setVisible(fMediumMenuShown); 2000 2000 2001 /* Determine whether Network actionsshould be visible: */2001 /* Determine whether Network menu should be visible: */ 2002 2002 const bool fNetworkMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == ToolTypeGlobal_Network; 2003 const bool fNetworkActionsShown = fNetworkMenuShown || !m_pWidget->isToolOpened(ToolTypeGlobal_Network);2004 2003 m_pHostNetworkManagerMenuAction->setVisible(fNetworkMenuShown); 2005 2004 2006 /* Determine whether Snapshots actions should be visible: */ 2007 const bool fSnapshotMenuShown = m_pWidget->currentMachineTool() == ToolTypeMachine_Snapshots; 2005 /* Determine whether Snapshots menu should be visible: */ 2006 const bool fSnapshotMenuShown = (fMachineMenuShown || fGroupMenuShown) && 2007 m_pWidget->currentMachineTool() == ToolTypeMachine_Snapshots; 2008 2008 m_pSnapshotMenuAction->setVisible(fSnapshotMenuShown); 2009 2009 2010 /* Determine whether Logs actionsshould be visible: */2011 const bool fLogViewerMenuShown = m_pWidget->currentMachineTool() == ToolTypeMachine_Logs;2012 const bool fLogViewerActionsShown = fLogViewerMenuShown || !m_pWidget->isToolOpened(ToolTypeMachine_Logs);2010 /* Determine whether Logs menu should be visible: */ 2011 const bool fLogViewerMenuShown = (fMachineMenuShown || fGroupMenuShown) && 2012 m_pWidget->currentMachineTool() == ToolTypeMachine_Logs; 2013 2013 m_pLogViewerMenuAction->setVisible(fLogViewerMenuShown); 2014 2014 … … 2020 2020 foreach (UIAction *pAction, m_groupActions) 2021 2021 pAction->hideShortcut(); 2022 2023 /* Update actions visibility: */2024 foreach (UIAction *pAction, m_virtualMediaManagerActions)2025 pAction->setVisible(fMediumActionsShown);2026 foreach (UIAction *pAction, m_hostNetworkManagerActions)2027 pAction->setVisible(fNetworkActionsShown);2028 foreach (UIAction *pAction, m_snapshotActions)2029 pAction->setVisible(fSnapshotMenuShown);2030 foreach (UIAction *pAction, m_logViewerActions)2031 pAction->setVisible(fLogViewerActionsShown);2032 2022 2033 2023 /* Show action shortcuts: */
Note:
See TracChangeset
for help on using the changeset viewer.