VirtualBox

Ignore:
Timestamp:
Apr 10, 2020 5:37:18 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137163
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Adjust action availability for New VM action depending on chosen group node type.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager
Files:
8 edited

Legend:

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

    r83608 r83674  
    16161616}
    16171617
     1618bool UIVirtualBoxManager::isSingleLocalGroupSelected() const
     1619{
     1620    return m_pWidget->isSingleLocalGroupSelected();
     1621}
     1622
     1623bool UIVirtualBoxManager::isSingleCloudProfileGroupSelected() const
     1624{
     1625    return m_pWidget->isSingleCloudProfileGroupSelected();
     1626}
     1627
    16181628void UIVirtualBoxManager::performStartOrShowVirtualMachines(const QList<UIVirtualMachineItem*> &items, UICommon::LaunchMode enmLaunchMode)
    16191629{
     
    18931903        {
    18941904            return !isGroupSavingInProgress() &&
    1895                    isSingleGroupSelected();
     1905                   (isSingleLocalGroupSelected() ||
     1906                    isSingleCloudProfileGroupSelected());
    18961907        }
    18971908        case UIActionIndexST_M_Group_S_Add:
     
    19131924        case UIActionIndexST_M_Machine_S_Add:
    19141925        {
    1915             return !isGroupSavingInProgress() &&
    1916                    isItemsLocal(items);
     1926            return !isGroupSavingInProgress();
    19171927        }
    19181928        case UIActionIndexST_M_Machine_S_Settings:
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h

    r83290 r83674  
    297297        /** Returns whether single group is selected. */
    298298        bool isSingleGroupSelected() const;
     299        /** Returns whether single local group is selected. */
     300        bool isSingleLocalGroupSelected() const;
     301        /** Returns whether single cloud profile group is selected. */
     302        bool isSingleCloudProfileGroupSelected() const;
    299303    /** @} */
    300304
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp

    r83616 r83674  
    9898{
    9999    return m_pPaneChooser->isSingleGroupSelected();
     100}
     101
     102bool UIVirtualBoxManagerWidget::isSingleLocalGroupSelected() const
     103{
     104    return m_pPaneChooser->isSingleLocalGroupSelected();
     105}
     106
     107bool UIVirtualBoxManagerWidget::isSingleCloudProfileGroupSelected() const
     108{
     109    return m_pPaneChooser->isSingleCloudProfileGroupSelected();
    100110}
    101111
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h

    r83290 r83674  
    9898        /** Returns whether single group is selected. */
    9999        bool isSingleGroupSelected() const;
     100        /** Returns whether single local group is selected. */
     101        bool isSingleLocalGroupSelected() const;
     102        /** Returns whether single cloud profile group is selected. */
     103        bool isSingleCloudProfileGroupSelected() const;
    100104
    101105        /** Defines tools @a enmType. */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.cpp

    r83064 r83674  
    7979}
    8080
     81bool UIChooser::isSingleLocalGroupSelected() const
     82{
     83    return m_pChooserModel->isSingleLocalGroupSelected();
     84}
     85
     86bool UIChooser::isSingleCloudProfileGroupSelected() const
     87{
     88    return m_pChooserModel->isSingleCloudProfileGroupSelected();
     89}
     90
    8191bool UIChooser::isAllItemsOfOneGroupSelected() const
    8292{
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h

    r83290 r83674  
    108108        /** Returns whether single group is selected. */
    109109        bool isSingleGroupSelected() const;
     110        /** Returns whether single local group is selected. */
     111        bool isSingleLocalGroupSelected() const;
     112        /** Returns whether single cloud profile group is selected. */
     113        bool isSingleCloudProfileGroupSelected() const;
    110114        /** Returns whether all machine items of one group is selected. */
    111115        bool isAllItemsOfOneGroupSelected() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r83673 r83674  
    334334    return    selectedItems().size() == 1
    335335           && firstSelectedItem()->type() == UIChooserNodeType_Group;
     336}
     337
     338bool UIChooserModel::isSingleLocalGroupSelected() const
     339{
     340    return    isSingleGroupSelected()
     341           && firstSelectedItem()->node()->toGroupNode()->groupType() == UIChooserNodeGroupType_Local;
     342}
     343
     344bool UIChooserModel::isSingleCloudProfileGroupSelected() const
     345{
     346    return    isSingleGroupSelected()
     347           && firstSelectedItem()->node()->toGroupNode()->groupType() == UIChooserNodeGroupType_Profile;
    336348}
    337349
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h

    r83671 r83674  
    153153        /** Returns whether single group is selected. */
    154154        bool isSingleGroupSelected() const;
     155        /** Returns whether single local group is selected. */
     156        bool isSingleLocalGroupSelected() const;
     157        /** Returns whether single cloud profile group is selected. */
     158        bool isSingleCloudProfileGroupSelected() const;
    155159        /** Returns whether all machine items of one group is selected. */
    156160        bool isAllItemsOfOneGroupSelected() const;
Note: See TracChangeset for help on using the changeset viewer.

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