VirtualBox

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


Ignore:
Timestamp:
Oct 30, 2020 1:18:39 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Chooser pane: Move refresh-subscribe logic to cloud machine item itself; This gives us an edge in control of it.

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

Legend:

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

    r86769 r86771  
    407407                /* Propagate current items to update the Details-pane: */
    408408                m_pPaneToolsMachine->setItems(currentItems());
    409                 /* Repeat the task a bit delayed: */
    410                 pItem->toCloud()->updateInfoAsync(true /* delayed? */);
    411409            }
    412410        }
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.cpp

    r86748 r86771  
    4040    , m_enmMachineState(KCloudMachineState_Invalid)
    4141    , m_enmFakeCloudItemState(enmState)
     42    , m_fRefreshScheduled(false)
    4243    , m_pTimer(0)
    4344{
     
    5051    , m_enmMachineState(KCloudMachineState_Invalid)
    5152    , m_enmFakeCloudItemState(UIFakeCloudVirtualMachineItemState_NotApplicable)
     53    , m_fRefreshScheduled(false)
    5254    , m_pTimer(0)
    5355{
     
    5759UIVirtualMachineItemCloud::~UIVirtualMachineItemCloud()
    5860{
     61    cleanup();
    5962}
    6063
     
    7174}
    7275
    73 void UIVirtualMachineItemCloud::updateInfoAsync(bool fDelayed)
    74 {
     76void UIVirtualMachineItemCloud::updateInfoAsync(bool fDelayed, bool fSubscribe /* = false */)
     77{
     78    /* Mark update scheduled if requested: */
     79    if (fSubscribe)
     80        m_fRefreshScheduled = true;
     81
    7582    /* Ignore refresh request if timer or progress is already running: */
    7683    if (m_pTimer->isActive() || m_pProgressHandler)
     
    8491void UIVirtualMachineItemCloud::waitForAsyncInfoUpdateFinished()
    8592{
     93    /* Mark update canceled in any case: */
     94    m_fRefreshScheduled = false;
     95
    8696    /* Cancel the progress-handler if any: */
    8797    if (m_pProgressHandler)
     
    333343    if (!fCanceled)
    334344        emit sigRefreshFinished();
     345
     346    /* Refresh again if scheduled: */
     347    if (m_fRefreshScheduled)
     348        updateInfoAsync(true /* async? */);
    335349}
    336350
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.h

    r86748 r86771  
    8080
    8181        /** Updates cloud VM info async way, @a fDelayed if requested or instant otherwise. */
    82         void updateInfoAsync(bool fDelayed);
     82        void updateInfoAsync(bool fDelayed, bool fSubscribe = false);
    8383        /** Makes sure async info update is finished.
    8484          * @note  This method creates own event-loop to avoid blocking calling thread event processing,
     
    160160        QString                             m_strFakeCloudItemErrorMessage;
    161161
     162        /** Holds whether we should update info. */
     163        bool                  m_fRefreshScheduled;
    162164        /** Holds the machine refresh timer instance. */
    163165        QTimer               *m_pTimer;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp

    r86769 r86771  
    233233        AssertPtrReturnVoid(pCloudMachineItem);
    234234        if (fSelected && pCloudMachineItem->accessible())
    235             pCloudMachineItem->updateInfoAsync(false /* delayed? */);
     235            pCloudMachineItem->updateInfoAsync(false /* delayed? */, true /* subscribe */);
    236236        else
    237237            pCloudMachineItem->waitForAsyncInfoUpdateFinished();
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