VirtualBox

Ignore:
Timestamp:
Feb 7, 2020 12:36:56 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Chooser pane: Update fake cloud item when loading is complete.

File:
1 edited

Legend:

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

    r83008 r83016  
    3131# include "UITaskCloudAcquireInstances.h"
    3232# include "UIThreadPool.h"
     33# include "UIVirtualMachineItemCloud.h"
    3334#endif
    3435
     
    274275    UITaskCloudAcquireInstances *pAcquiringTask = static_cast<UITaskCloudAcquireInstances*>(pTask);
    275276
     277    /* Acquire parent node we referencing: */
     278    UIChooserNode *pParentNode = pAcquiringTask->parentNode();
     279    AssertPtrReturnVoid(pParentNode);
     280
     281    /* This node always have 1st child: */
     282    AssertReturnVoid(pParentNode->hasNodes());
     283    UIChooserNode *pFirstChildNode = pParentNode->nodes().at(0);
     284    AssertPtrReturnVoid(pFirstChildNode);
     285
     286    /* Which is machine node of course: */
     287    UIChooserNodeMachine *pFirstChildNodeMachine = pFirstChildNode->toMachineNode();
     288    AssertPtrReturnVoid(pFirstChildNodeMachine);
     289
     290    /* Which has cache of fake cloud item type: */
     291    AssertPtrReturnVoid(pFirstChildNodeMachine->cache());
     292    AssertReturnVoid(pFirstChildNodeMachine->cache()->itemType() == UIVirtualMachineItem::ItemType_CloudFake);
     293    UIVirtualMachineItemCloud *pFakeCloudMachineItem = pFirstChildNodeMachine->cache()->toCloud();
     294    AssertPtrReturnVoid(pFakeCloudMachineItem);
     295
     296    /* So that we could update this fake cloud item with new state and recache it: */
     297    pFakeCloudMachineItem->setFakeCloudItemState(UIVirtualMachineItemCloud::FakeCloudItemState_Done);
     298    pFakeCloudMachineItem->recache();
     299
    276300    /* Add real cloud VM items: */
    277301    int iPosition = 1; /* we've got item with index 0 already, the "Empty" one .. */
    278302    foreach (const QString &strInstanceName, pAcquiringTask->instanceNames())
    279303    {
    280         new UIChooserNodeMachine(pAcquiringTask->parentNode(),
     304        new UIChooserNodeMachine(pParentNode,
    281305                                 false /* favorite */,
    282306                                 iPosition++ /* position */,
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