VirtualBox

Changeset 103023 in vbox for trunk


Ignore:
Timestamp:
Jan 24, 2024 1:28:00 PM (8 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10501: On cloud profile state changes we should notify Global Activity Overview tool about cloud machine list changes.

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

Legend:

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

    r102838 r103023  
    517517}
    518518
     519void UIVirtualBoxManagerWidget::sltHandleCloudProfileStateChange(const QString &strProviderShortName,
     520                                                                 const QString &strProfileName)
     521{
     522    RT_NOREF(strProviderShortName, strProfileName);
     523
     524    /* If Global Activity Overview tool is currently chosen: */
     525    if (   m_pStackedWidget->currentWidget() == m_pPaneToolsGlobal
     526        && m_pPaneToolsGlobal->currentTool() == UIToolType_VMActivityOverview)
     527        m_pPaneToolsGlobal->setCloudMachineItems(m_pPaneChooser->cloudMachineItems());
     528}
     529
    519530void UIVirtualBoxManagerWidget::sltHandleCloudMachineStateChange(const QUuid &uId)
    520531{
     
    809820    connect(m_pPaneChooser, &UIChooser::sigToolMenuRequested,
    810821            this, &UIVirtualBoxManagerWidget::sltHandleToolMenuRequested);
     822    connect(m_pPaneChooser, &UIChooser::sigCloudProfileStateChange,
     823            this, &UIVirtualBoxManagerWidget::sltHandleCloudProfileStateChange);
    811824    connect(m_pPaneChooser, &UIChooser::sigCloudMachineStateChange,
    812825            this, &UIVirtualBoxManagerWidget::sltHandleCloudMachineStateChange);
     
    10631076    disconnect(m_pPaneChooser, &UIChooser::sigToolMenuRequested,
    10641077               this, &UIVirtualBoxManagerWidget::sltHandleToolMenuRequested);
     1078    disconnect(m_pPaneChooser, &UIChooser::sigCloudProfileStateChange,
     1079               this, &UIVirtualBoxManagerWidget::sltHandleCloudProfileStateChange);
    10651080    disconnect(m_pPaneChooser, &UIChooser::sigCloudMachineStateChange,
    10661081               this, &UIVirtualBoxManagerWidget::sltHandleCloudMachineStateChange);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h

    r102838 r103023  
    315315        void sltHandleSlidingAnimationComplete(SlidingDirection enmDirection);
    316316
     317        /** Handles state change for cloud profile with certain @a strProviderShortName and @a strProfileName. */
     318        void sltHandleCloudProfileStateChange(const QString &strProviderShortName,
     319                                              const QString &strProfileName);
    317320        /** Handles state change for cloud machine with certain @a uId. */
    318321        void sltHandleCloudMachineStateChange(const QUuid &uId);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.cpp

    r103022 r103023  
    6767    AssertPtrReturn(model(), false);
    6868    return model()->isCloudProfileUpdateInProgress();
     69}
     70
     71QList<UIVirtualMachineItemCloud*> UIChooser::cloudMachineItems() const
     72{
     73    AssertPtrReturn(model(), QList<UIVirtualMachineItemCloud*>());
     74    return model()->cloudMachineItems();
    6975}
    7076
     
    276282    connect(model(), &UIChooserModel::sigGroupSavingStateChanged,
    277283            this, &UIChooser::sigGroupSavingStateChanged);
     284    connect(model(), &UIChooserModel::sigCloudProfileStateChange,
     285            this, &UIChooser::sigCloudProfileStateChange);
    278286    connect(model(), &UIChooserModel::sigCloudMachineStateChange,
    279287            this, &UIChooser::sigCloudMachineStateChange);
     
    324332    disconnect(model(), &UIChooserModel::sigGroupSavingStateChanged,
    325333               this, &UIChooser::sigGroupSavingStateChanged);
     334    disconnect(model(), &UIChooserModel::sigCloudProfileStateChange,
     335               this, &UIChooser::sigCloudProfileStateChange);
    326336    disconnect(model(), &UIChooserModel::sigCloudMachineStateChange,
    327337               this, &UIChooser::sigCloudMachineStateChange);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h

    r103022 r103023  
    4343class UIChooserView;
    4444class UIVirtualMachineItem;
     45class UIVirtualMachineItemCloud;
    4546
    4647/** QWidget extension used as VM Chooser-pane. */
     
    5960    /** @name Cloud update stuff.
    6061      * @{ */
     62        /** Notifies listeners about cloud profile state change.
     63          * @param  strProviderShortName  Brings the cloud provider short name.
     64          * @param  strProfileName        Brings the cloud profile name. */
     65        void sigCloudProfileStateChange(const QString &strProviderShortName,
     66                                        const QString &strProfileName);
    6167        /** Notifies listeners about cloud machine state change.
    6268          * @param  uId  Brings the cloud machine ID. */
     
    126132        /** Returns whether at least one cloud profile currently being updated. */
    127133        bool isCloudProfileUpdateInProgress() const;
     134
     135        /** Returns a list of real cloud machine items. */
     136        QList<UIVirtualMachineItemCloud*> cloudMachineItems() const;
    128137    /** @} */
    129138
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp

    r103021 r103023  
    664664    /* False by default: */
    665665    return false;
     666}
     667
     668QList<UIVirtualMachineItemCloud*> UIChooserAbstractModel::cloudMachineItems() const
     669{
     670    QList<UIVirtualMachineItemCloud*> items;
     671    foreach (UIChooserNode *pNode, enumerateCloudMachineNodes())
     672    {
     673        AssertReturn(pNode && pNode->type() == UIChooserNodeType_Machine, items);
     674        UIChooserNodeMachine *pMachineNode = pNode->toMachineNode();
     675        AssertPtrReturn(pMachineNode, items);
     676        if (pMachineNode->cacheType() != UIVirtualMachineItemType_CloudReal)
     677            continue;
     678        UIVirtualMachineItemCloud *pCloudMachineItem = pMachineNode->cache()->toCloud();
     679        AssertPtrReturn(pCloudMachineItem, items);
     680        items << pCloudMachineItem;
     681    }
     682    return items;
    666683}
    667684
     
    10111028    /* Remove cloud entity key from the list of keys currently being updated: */
    10121029    removeCloudEntityKey(guiCloudProfileKey);
     1030
     1031    /* Notify listeners: */
     1032    emit sigCloudProfileStateChange(guiCloudProfileKey.m_strProviderShortName,
     1033                                    guiCloudProfileKey.m_strProfileName);
    10131034}
    10141035
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h

    r103021 r103023  
    4848class UIChooser;
    4949class UIChooserNode;
     50class UIVirtualMachineItemCloud;
    5051class CMachine;
    5152
     
    6970    /** @name Cloud update stuff.
    7071      * @{ */
     72        /** Notifies listeners about cloud profile state change.
     73          * @param  strProviderShortName  Brings the cloud provider short name.
     74          * @param  strProfileName        Brings the cloud profile name. */
     75        void sigCloudProfileStateChange(const QString &strProviderShortName,
     76                                        const QString &strProfileName);
    7177        /** Notifies listeners about cloud machine state change.
    7278          * @param  uId  Brings the cloud machine ID. */
     
    155161        /** Returns whether at least one cloud profile currently being updated. */
    156162        bool isCloudProfileUpdateInProgress() const;
     163
     164        /** Returns a list of real cloud machine items. */
     165        QList<UIVirtualMachineItemCloud*> cloudMachineItems() const;
    157166    /** @} */
    158167
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