VirtualBox

Changeset 74719 in vbox for trunk


Ignore:
Timestamp:
Oct 9, 2018 2:03:41 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9241: VirtualBox Manager: Update menu/action visibility rules.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r74585 r74719  
    19891989{
    19901990    /* 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();
    19931994    m_pMachineMenuAction->setVisible(fMachineMenuShown);
    1994     m_pGroupMenuAction->setVisible(!fMachineMenuShown);
    1995 
    1996     /* Determine whether Media actions should be visible: */
     1995    m_pGroupMenuAction->setVisible(fGroupMenuShown);
     1996
     1997    /* Determine whether Media menu should be visible: */
    19971998    const bool fMediumMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == ToolTypeGlobal_Media;
    1998     const bool fMediumActionsShown = fMediumMenuShown || !m_pWidget->isToolOpened(ToolTypeGlobal_Media);
    19991999    m_pVirtualMediaManagerMenuAction->setVisible(fMediumMenuShown);
    20002000
    2001     /* Determine whether Network actions should be visible: */
     2001    /* Determine whether Network menu should be visible: */
    20022002    const bool fNetworkMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == ToolTypeGlobal_Network;
    2003     const bool fNetworkActionsShown = fNetworkMenuShown || !m_pWidget->isToolOpened(ToolTypeGlobal_Network);
    20042003    m_pHostNetworkManagerMenuAction->setVisible(fNetworkMenuShown);
    20052004
    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;
    20082008    m_pSnapshotMenuAction->setVisible(fSnapshotMenuShown);
    20092009
    2010     /* Determine whether Logs actions should 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;
    20132013    m_pLogViewerMenuAction->setVisible(fLogViewerMenuShown);
    20142014
     
    20202020        foreach (UIAction *pAction, m_groupActions)
    20212021            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);
    20322022
    20332023    /* Show action shortcuts: */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette