VirtualBox

Ignore:
Timestamp:
Oct 1, 2018 4:46:39 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9241: VirtualBox Manager: Few fixes for Machine/Group actions availability validation.

File:
1 edited

Legend:

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

    r74556 r74559  
    473473    /* Get selected items: */
    474474    QList<UIVirtualMachineItem*> items = currentItems();
    475     AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    476475
    477476    /* Populate the list of VM names: */
     
    19881987    /* Determine whether Machine or Group menu should be shown at all: */
    19891988    const bool fGlobalMenuShown = m_pWidget->isGlobalItemSelected();
    1990     const bool fMachineOrGroupMenuShown = m_pWidget->isMachineItemSelected() || m_pWidget->isGroupItemSelected();
    19911989    const bool fMachineMenuShown = !isSingleGroupSelected();
    1992     m_pMachineMenuAction->setVisible(fMachineOrGroupMenuShown && fMachineMenuShown);
    1993     m_pGroupMenuAction->setVisible(fMachineOrGroupMenuShown && !fMachineMenuShown);
     1990    m_pMachineMenuAction->setVisible(fMachineMenuShown);
     1991    m_pGroupMenuAction->setVisible(!fMachineMenuShown);
    19941992
    19951993    /* Determine whether Media actions should be visible: */
     
    20042002
    20052003    /* Determine whether Snapshots actions should be visible: */
    2006     const bool fSnapshotMenuShown = fMachineOrGroupMenuShown && m_pWidget->currentMachineTool() == ToolTypeMachine_Snapshots;
     2004    const bool fSnapshotMenuShown = m_pWidget->currentMachineTool() == ToolTypeMachine_Snapshots;
    20072005    m_pSnapshotMenuAction->setVisible(fSnapshotMenuShown);
    20082006
    20092007    /* Determine whether Logs actions should be visible: */
    2010     const bool fLogViewerMenuShown = fMachineOrGroupMenuShown && m_pWidget->currentMachineTool() == ToolTypeMachine_Logs;
     2008    const bool fLogViewerMenuShown = m_pWidget->currentMachineTool() == ToolTypeMachine_Logs;
    20112009    const bool fLogViewerActionsShown = fLogViewerMenuShown || !m_pWidget->isToolOpened(ToolTypeMachine_Logs);
    20122010    m_pLogViewerMenuAction->setVisible(fLogViewerMenuShown);
     
    20212019
    20222020    /* Update actions visibility: */
    2023     foreach (UIAction *pAction, m_machineActions)
    2024         pAction->setVisible(fMachineOrGroupMenuShown);
    2025     foreach (UIAction *pAction, m_groupActions)
    2026         pAction->setVisible(fMachineOrGroupMenuShown);
     2021    foreach (UIAction *pAction, m_virtualMediaManagerActions)
     2022        pAction->setVisible(fMediumActionsShown);
     2023    foreach (UIAction *pAction, m_hostNetworkManagerActions)
     2024        pAction->setVisible(fNetworkActionsShown);
    20272025    foreach (UIAction *pAction, m_snapshotActions)
    20282026        pAction->setVisible(fSnapshotMenuShown);
    20292027    foreach (UIAction *pAction, m_logViewerActions)
    20302028        pAction->setVisible(fLogViewerActionsShown);
    2031     foreach (UIAction *pAction, m_virtualMediaManagerActions)
    2032         pAction->setVisible(fMediumActionsShown);
    2033     foreach (UIAction *pAction, m_hostNetworkManagerActions)
    2034         pAction->setVisible(fNetworkActionsShown);
    20352029
    20362030    /* 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