VirtualBox

Changeset 85038 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 1, 2020 6:37:27 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Chooser pane: Handle Cloud Profile Manager restriction changes at runtime now.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
Files:
4 edited

Legend:

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

    r85037 r85038  
    724724    QList<UIChooserNode*> profileNodes;
    725725    invisibleRoot()->searchForNodes(strProfileNodeName, UIChooserItemSearchFlag_CloudProfile | UIChooserItemSearchFlag_ExactId, profileNodes);
    726     AssertReturnVoid(!profileNodes.isEmpty());
    727     UIChooserNode *pProfileNode = profileNodes.first();
    728     AssertPtrReturnVoid(pProfileNode);
     726    UIChooserNode *pProfileNode = profileNodes.value(0);
     727    if (!pProfileNode)
     728        return;
    729729
    730730    /* Search for fake node: */
     
    732732    pProfileNode->searchForNodes(QUuid().toString(), UIChooserItemSearchFlag_Machine | UIChooserItemSearchFlag_ExactId, fakeNodes);
    733733    UIChooserNode *pFakeNode = fakeNodes.value(0);
    734     AssertPtrReturnVoid(pFakeNode);
     734    if (!pFakeNode)
     735        return;
    735736
    736737    /* And if we have at least one cloud machine: */
     
    755756        pFakeCloudMachineItem->setFakeCloudItemErrorMessage(pAcquiringTask->errorInfo());
    756757    }
     758}
     759
     760void UIChooserAbstractModel::sltHandleCloudProfileManagerRestrictionChange()
     761{
     762    /* Reload cloud tree: */
     763    reloadCloudTree();
    757764}
    758765
     
    796803            this, &UIChooserAbstractModel::sltStartGroupSaving,
    797804            Qt::QueuedConnection);
     805
     806    /* Setup extra-data connections: */
     807    connect(gEDataManager, &UIExtraDataManager::sigCloudProfileManagerRestrictionChange,
     808            this, &UIChooserAbstractModel::sltHandleCloudProfileManagerRestrictionChange);
    798809}
    799810
     
    848859#ifdef VBOX_GUI_WITH_CLOUD_VMS
    849860    LogRelFlow(("UIChooserAbstractModel: Loading cloud providers/profiles...\n"));
     861
     862    /* Wipe out existing cloud providers first.
     863     * This is quite rude, in future we need to reimplement it more wise.. */
     864    foreach (UIChooserNode *pNode, invisibleRoot()->nodes(UIChooserNodeType_Group))
     865    {
     866        AssertPtrReturnVoid(pNode);
     867        UIChooserNodeGroup *pGroupNode = pNode->toGroupNode();
     868        AssertPtrReturnVoid(pGroupNode);
     869        if (pGroupNode->groupType() == UIChooserNodeGroupType_Provider)
     870            delete pNode;
     871    }
    850872
    851873    /* Acquire Cloud Profile Manager restrictions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h

    r85036 r85038  
    166166        /** Handles list cloud machines task complete signal. */
    167167        virtual void sltHandleCloudListMachinesTaskComplete(UITask *pTask);
     168        /** Handles Cloud Profile Manager restriction change. */
     169        virtual void sltHandleCloudProfileManagerRestrictionChange();
    168170    /** @} */
    169171
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r84635 r85038  
    11571157
    11581158    /* Rebuild tree for main root: */
     1159    buildTreeForMainRoot(true /* preserve selection */);
     1160}
     1161
     1162void UIChooserModel::sltHandleCloudProfileManagerRestrictionChange()
     1163{
     1164    /* Call to base-class: */
     1165    UIChooserAbstractModel::sltHandleCloudProfileManagerRestrictionChange();
     1166
     1167    /* Build tree for main root: */
    11591168    buildTreeForMainRoot(true /* preserve selection */);
    11601169}
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h

    r84635 r85038  
    278278        /** Handles list cloud machines task complete signal. */
    279279        virtual void sltHandleCloudListMachinesTaskComplete(UITask *pTask) /* override */;
     280        /** Handles Cloud Profile Manager restriction changes. */
     281        virtual void sltHandleCloudProfileManagerRestrictionChange() /* override */;
    280282    /** @} */
    281283
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