VirtualBox

Changeset 83095 in vbox


Ignore:
Timestamp:
Feb 17, 2020 12:38:51 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
136152
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Acquire current cloud machine state after pause/resume call async way as well; s.a. r136105 and r136151.

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

Legend:

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

    r83094 r83095  
    216216    , m_pCloudMachine(0)
    217217    , m_enmFakeCloudItemState(FakeCloudItemState_Loading)
     218    , m_pTask(0)
    218219{
    219220    recache();
     
    224225    , m_pCloudMachine(new UICloudMachine(guiCloudMachine))
    225226    , m_enmFakeCloudItemState(FakeCloudItemState_NotApplicable)
     227    , m_pTask(0)
    226228{
    227229    recache();
     
    290292            msgCenter().cannotAcquireCloudClientParameter(comProgress);
    291293        else
    292             updateState(pParent);
     294            updateStateAsync(false /* delayed? */);
    293295    }
    294296}
     
    478480    AssertPtrReturnVoid(m_pCloudMachine);
    479481
    480     /* Create and start task to acquire state async way: */
    481     UITask *pTask = new UITaskGetCloudInstanceState(m_pCloudMachine->client(), m_strId);
    482     connect(pTask, &UITask::sigComplete,
    483             this, &UIVirtualMachineItemCloud::sltHandleGetCloudInstanceStateDone);
    484     uiCommon().threadPool()->enqueueTask(pTask);
     482    /* Create and start task to acquire state async way only if there is no task yet: */
     483    if (!m_pTask)
     484    {
     485        m_pTask = new UITaskGetCloudInstanceState(m_pCloudMachine->client(), m_strId);
     486        connect(m_pTask, &UITask::sigComplete,
     487                this, &UIVirtualMachineItemCloud::sltHandleGetCloudInstanceStateDone);
     488        uiCommon().threadPool()->enqueueTask(m_pTask);
     489    }
    485490}
    486491
     
    488493{
    489494    /* Skip unrelated tasks: */
    490     if (!pTask || pTask->type() != UITask::Type_GetCloudInstanceState)
     495    if (!m_pTask || pTask != m_pTask)
    491496        return;
     497
     498    /* Mark our task handled: */
     499    m_pTask = 0;
    492500
    493501    /* Cast task to corresponding sub-class: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.h

    r83094 r83095  
    143143        /** Holds fake cloud item state. */
    144144        FakeCloudItemState  m_enmFakeCloudItemState;
     145
     146        /** Holds the state acquire task instance. */
     147        UITask *m_pTask;
    145148    /** @} */
    146149};
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp

    r83064 r83095  
    312312{
    313313    UIVirtualMachineItem *pCache = qobject_cast<UIVirtualMachineItem*>(sender());
     314    printf("UIChooserAbstractModel::sltHandleCloudMachineStateChange\n, id = %s\n", pCache->id().toUtf8().constData());
    314315    AssertPtrReturnVoid(pCache);
    315316    sigCloudMachineStateChange(pCache->id());
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