VirtualBox

Changeset 86923 in vbox


Ignore:
Timestamp:
Nov 19, 2020 5:37:32 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
141405
Message:

FE/Qt: bugref:9866: VirtualBox Manager: Chooser pane: Update toolbar while switching between local and cloud machines and groups.

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

Legend:

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

    r86771 r86923  
    8787}
    8888
     89bool UIVirtualBoxManagerWidget::isLocalMachineItemSelected() const
     90{
     91    return m_pPaneChooser->isLocalMachineItemSelected();
     92}
     93
     94bool UIVirtualBoxManagerWidget::isCloudMachineItemSelected() const
     95{
     96    return m_pPaneChooser->isCloudMachineItemSelected();
     97}
     98
    8999bool UIVirtualBoxManagerWidget::isSingleGroupSelected() const
    90100{
     
    95105{
    96106    return m_pPaneChooser->isSingleLocalGroupSelected();
     107}
     108
     109bool UIVirtualBoxManagerWidget::isSingleCloudProviderGroupSelected() const
     110{
     111    return m_pPaneChooser->isSingleCloudProviderGroupSelected();
    97112}
    98113
     
    338353
    339354    /* Calculate selection type: */
    340     const SelectionType enmSelectedItemType = isSingleGroupSelected()
    341                                             ? SelectionType_SingleGroupItem
     355    const SelectionType enmSelectedItemType = isSingleLocalGroupSelected()
     356                                            ? SelectionType_SingleLocalGroupItem
     357                                            : isSingleCloudProviderGroupSelected() || isSingleCloudProfileGroupSelected()
     358                                            ? SelectionType_SingleCloudGroupItem
    342359                                            : isGlobalItemSelected()
    343360                                            ? SelectionType_FirstIsGlobalItem
    344                                             : isMachineItemSelected()
    345                                             ? SelectionType_FirstIsMachineItem
     361                                            : isLocalMachineItemSelected()
     362                                            ? SelectionType_FirstIsLocalMachineItem
     363                                            : isCloudMachineItemSelected()
     364                                            ? SelectionType_FirstIsCloudMachineItem
    346365                                            : SelectionType_Invalid;
    347366    /* Acquire current item: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h

    r86734 r86923  
    5151    {
    5252        SelectionType_Invalid,
    53         SelectionType_SingleGroupItem,
     53        SelectionType_SingleLocalGroupItem,
     54        SelectionType_SingleCloudGroupItem,
    5455        SelectionType_FirstIsGlobalItem,
    55         SelectionType_FirstIsMachineItem
     56        SelectionType_FirstIsLocalMachineItem,
     57        SelectionType_FirstIsCloudMachineItem
    5658    };
    5759
     
    126128        /** Returns whether machine item is selected. */
    127129        bool isMachineItemSelected() const;
     130        /** Returns whether local machine item is selected. */
     131        bool isLocalMachineItemSelected() const;
     132        /** Returns whether cloud machine item is selected. */
     133        bool isCloudMachineItemSelected() const;
    128134
    129135        /** Returns whether single group is selected. */
     
    131137        /** Returns whether single local group is selected. */
    132138        bool isSingleLocalGroupSelected() const;
     139        /** Returns whether single cloud provider group is selected. */
     140        bool isSingleCloudProviderGroupSelected() const;
    133141        /** Returns whether single cloud profile group is selected. */
    134142        bool isSingleCloudProfileGroupSelected() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.cpp

    r86734 r86923  
    8282}
    8383
     84bool UIChooser::isLocalMachineItemSelected() const
     85{
     86    AssertPtrReturn(model(), false);
     87    return model()->isLocalMachineItemSelected();
     88}
     89
     90bool UIChooser::isCloudMachineItemSelected() const
     91{
     92    AssertPtrReturn(model(), false);
     93    return model()->isCloudMachineItemSelected();
     94}
     95
    8496bool UIChooser::isSingleGroupSelected() const
    8597{
     
    92104    AssertPtrReturn(model(), false);
    93105    return model()->isSingleLocalGroupSelected();
     106}
     107
     108bool UIChooser::isSingleCloudProviderGroupSelected() const
     109{
     110    AssertPtrReturn(model(), false);
     111    return model()->isSingleCloudProviderGroupSelected();
    94112}
    95113
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h

    r86734 r86923  
    130130        /** Returns whether machine item is selected. */
    131131        bool isMachineItemSelected() const;
     132        /** Returns whether local machine item is selected. */
     133        bool isLocalMachineItemSelected() const;
     134        /** Returns whether cloud machine item is selected. */
     135        bool isCloudMachineItemSelected() const;
    132136
    133137        /** Returns whether single group is selected. */
     
    135139        /** Returns whether single local group is selected. */
    136140        bool isSingleLocalGroupSelected() const;
     141        /** Returns whether single cloud provider group is selected. */
     142        bool isSingleCloudProviderGroupSelected() const;
    137143        /** Returns whether single cloud profile group is selected. */
    138144        bool isSingleCloudProfileGroupSelected() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r86922 r86923  
    293293}
    294294
     295bool UIChooserModel::isLocalMachineItemSelected() const
     296{
     297    return    isMachineItemSelected()
     298           && firstSelectedItem()->toMachineItem()->cacheType() == UIVirtualMachineItemType_Local;
     299}
     300
     301bool UIChooserModel::isCloudMachineItemSelected() const
     302{
     303    return    isMachineItemSelected()
     304           && firstSelectedItem()->toMachineItem()->cacheType() == UIVirtualMachineItemType_CloudReal;
     305}
     306
    295307bool UIChooserModel::isSingleGroupSelected() const
    296308{
     
    303315    return    isSingleGroupSelected()
    304316           && firstSelectedItem()->toGroupItem()->groupType() == UIChooserNodeGroupType_Local;
     317}
     318
     319bool UIChooserModel::isSingleCloudProviderGroupSelected() const
     320{
     321    return    isSingleGroupSelected()
     322           && firstSelectedItem()->toGroupItem()->groupType() == UIChooserNodeGroupType_Provider;
    305323}
    306324
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h

    r86795 r86923  
    150150        /** Returns whether machine item is selected. */
    151151        bool isMachineItemSelected() const;
     152        /** Returns whether local machine item is selected. */
     153        bool isLocalMachineItemSelected() const;
     154        /** Returns whether cloud machine item is selected. */
     155        bool isCloudMachineItemSelected() const;
    152156
    153157        /** Returns whether single group is selected. */
     
    155159        /** Returns whether single local group is selected. */
    156160        bool isSingleLocalGroupSelected() const;
     161        /** Returns whether single cloud provider group is selected. */
     162        bool isSingleCloudProviderGroupSelected() const;
    157163        /** Returns whether single cloud profile group is selected. */
    158164        bool isSingleCloudProfileGroupSelected() 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