VirtualBox

Ignore:
Timestamp:
Sep 9, 2020 4:03:14 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: Handle couple of new events related to cloud provider (uninstall and list_changed); This should allow to uninstall extension pack when provider's VMs shown.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp

    r82968 r86077  
    2929#include "CCanShowWindowEvent.h"
    3030#include "CClipboardModeChangedEvent.h"
     31#include "CCloudProviderListChangedEvent.h"
     32#include "CCloudProviderUninstallEvent.h"
    3133#include "CCursorPositionChangedEvent.h"
    3234#include "CDnDModeChangedEvent.h"
     
    287289            break;
    288290        }
     291        case KVBoxEventType_OnCloudProviderListChanged:
     292        {
     293            emit sigCloudProviderListChanged();
     294            break;
     295        }
     296        case KVBoxEventType_OnCloudProviderUninstall:
     297        {
     298            CCloudProviderUninstallEvent comEventSpecific(pEvent);
     299            emit sigCloudProviderUninstall(comEventSpecific.GetId());
     300            break;
     301        }
    289302
    290303        case KVBoxEventType_OnExtraDataCanChange:
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h

    r82968 r86077  
    9696        /** Notifies about snapshot with @a uSnapshotId was restored for the machine with @a uId. */
    9797        void sigSnapshotRestore(const QUuid &uId, const QUuid &uSnapshotId);
     98        /** Notifies about request to uninstall cloud provider with @a uId. */
     99        void sigCloudProviderUninstall(const QUuid &uId);
     100        /** Notifies about cloud provider list changed. */
     101        void sigCloudProviderListChanged();
    98102    /** @} */
    99103
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxEventHandler.cpp

    r82968 r86077  
    5656    /** Notifies about snapshot with @a uSnapshotId was restored for the machine with @a uId. */
    5757    void sigSnapshotRestore(const QUuid &uId, const QUuid &uSnapshotId);
     58    /** Notifies about request to uninstall cloud provider with @a uId. */
     59    void sigCloudProviderUninstall(const QUuid &uId);
     60    /** Notifies about cloud provider list changed. */
     61    void sigCloudProviderListChanged();
    5862
    5963    /** Notifies about storage controller change.
     
    178182        << KVBoxEventType_OnSnapshotChanged
    179183        << KVBoxEventType_OnSnapshotRestored
     184        << KVBoxEventType_OnCloudProviderListChanged
     185        << KVBoxEventType_OnCloudProviderUninstall
    180186        << KVBoxEventType_OnStorageControllerChanged
    181187        << KVBoxEventType_OnStorageDeviceChanged
     
    228234            this, SIGNAL(sigSnapshotRestore(QUuid, QUuid)),
    229235            Qt::DirectConnection);
     236    connect(m_pQtListener->getWrapped(), SIGNAL(sigCloudProviderListChanged()),
     237            this, SIGNAL(sigCloudProviderListChanged()),
     238            Qt::DirectConnection);
     239    connect(m_pQtListener->getWrapped(), SIGNAL(sigCloudProviderUninstall(QUuid)),
     240            this, SIGNAL(sigCloudProviderUninstall(QUuid)),
     241            Qt::DirectConnection);
    230242    connect(m_pQtListener->getWrapped(), SIGNAL(sigStorageControllerChange(QUuid, QString)),
    231243            this, SIGNAL(sigStorageControllerChange(QUuid, QString)),
     
    341353            this, SIGNAL(sigSnapshotRestore(QUuid, QUuid)),
    342354            Qt::QueuedConnection);
     355    connect(m_pProxy, SIGNAL(sigCloudProviderListChanged()),
     356            this, SIGNAL(sigCloudProviderListChanged()),
     357            Qt::QueuedConnection);
     358    connect(m_pProxy, SIGNAL(sigCloudProviderUninstall(QUuid)),
     359            this, SIGNAL(sigCloudProviderUninstall(QUuid)),
     360            Qt::BlockingQueuedConnection);
    343361    connect(m_pProxy, SIGNAL(sigStorageControllerChange(QUuid, QString)),
    344362            this, SIGNAL(sigStorageControllerChange(QUuid, QString)),
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxEventHandler.h

    r83304 r86077  
    6363    /** Notifies about snapshot with @a uSnapshotId was restored for the machine with @a uId. */
    6464    void sigSnapshotRestore(const QUuid &uId, const QUuid &uSnapshotId);
     65    /** Notifies about request to uninstall cloud provider with @a uId. */
     66    void sigCloudProviderUninstall(const QUuid &uId);
     67    /** Notifies about cloud provider list changed. */
     68    void sigCloudProviderListChanged();
    6569
    6670    /** Notifies about storage controller change.
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp

    r85038 r86077  
    687687    /* Update machine-nodes with passed id: */
    688688    invisibleRoot()->updateAllNodes(uMachineId);
     689}
     690
     691void UIChooserAbstractModel::sltHandleCloudProviderListChanged()
     692{
     693    /* Reload cloud tree: */
     694    reloadCloudTree();
     695}
     696
     697void UIChooserAbstractModel::sltHandleCloudProviderUninstall(const QUuid &uId)
     698{
     699    /* Search for top-level provider node: */
     700    foreach (UIChooserNode *pNode, m_pInvisibleRootNode->nodes(UIChooserNodeType_Group))
     701    {
     702        /* Skip unrelated nodes: */
     703        AssertPtrReturnVoid(pNode);
     704        UIChooserNodeGroup *pGroupNode = pNode->toGroupNode();
     705        AssertPtrReturnVoid(pGroupNode);
     706        if (pGroupNode->groupType() != UIChooserNodeGroupType_Provider)
     707            continue;
     708        const QUuid uIteratedId = pGroupNode->property("id").toUuid();
     709        AssertReturnVoid(!uIteratedId.isNull());
     710        if (uIteratedId != uId)
     711            continue;
     712
     713        /* Remove found provider node: */
     714        delete pNode;
     715    }
    689716}
    690717
     
    798825    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotRestore,
    799826            this, &UIChooserAbstractModel::sltSnapshotChanged);
     827    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProviderListChanged,
     828            this, &UIChooserAbstractModel::sltHandleCloudProviderListChanged);
     829    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProviderUninstall,
     830            this, &UIChooserAbstractModel::sltHandleCloudProviderUninstall);
    800831
    801832    /* Setup group saving connections: */
     
    879910        /* Skip if we have nothing to populate: */
    880911        if (comCloudProvider.isNull())
     912            continue;
     913
     914        /* Acquire provider id: */
     915        QUuid uProviderId;
     916        if (!cloudProviderId(comCloudProvider, uProviderId))
    881917            continue;
    882918
     
    907943                                   strProviderShortName,
    908944                                   UIChooserNodeGroupType_Provider);
     945        pProviderNode->setProperty("id", uProviderId);
    909946
    910947        /* Iterate through provider's profiles: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h

    r85038 r86077  
    154154        /** Handles snapshot change for machine/snapshot with certain @a uMachineId / @a uSnapshotId. */
    155155        virtual void sltSnapshotChanged(const QUuid &uMachineId, const QUuid &uSnapshotId);
     156        /** Handles event about cloud provider list changed. */
     157        virtual void sltHandleCloudProviderListChanged();
     158        /** Handles event about cloud provider with @a uId being uninstalled. */
     159        virtual void sltHandleCloudProviderUninstall(const QUuid &uId);
    156160    /** @} */
    157161
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