VirtualBox

Changeset 83480 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 30, 2020 1:03:58 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Make sure cloud item state change signal doesn't bother global item.

File:
1 edited

Legend:

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

    r83439 r83480  
    285285void UIVirtualBoxManagerWidget::sltHandleCloudMachineStateChange(const QUuid &uId)
    286286{
    287     /* Acquire current item: */
    288     UIVirtualMachineItem *pItem = currentItem();
    289     const bool fCurrentItemIsOk = pItem && pItem->accessible();
    290 
    291     /* If current item is Ok: */
    292     if (fCurrentItemIsOk)
    293     {
    294         /* If Error-pane is chosen currently => open tool currently chosen in Tools-pane: */
    295         if (m_pPaneToolsMachine->currentTool() == UIToolType_Error)
    296             sltHandleToolsPaneIndexChange();
    297 
    298         /* If we still have same item selected: */
    299         if (pItem && pItem->id() == uId)
    300         {
    301             /* Propagate current items to update the Details-pane: */
    302             m_pPaneToolsMachine->setItems(currentItems());
    303             /* Repeat the task a bit delayed: */
    304             pItem->toCloud()->updateInfoAsync(true /* delayed? */);
    305         }
    306     }
    307     else
    308     {
    309         /* Make sure Error pane raised: */
    310         m_pPaneToolsMachine->openTool(UIToolType_Error);
    311 
    312         /* If we still have same item selected: */
    313         if (pItem && pItem->id() == uId)
    314         {
    315             /* Propagate current items to update the Details-pane (in any case): */
    316             m_pPaneToolsMachine->setItems(currentItems());
    317             /* Propagate last access error to update the Error-pane (if machine selected but inaccessible): */
    318             m_pPaneToolsMachine->setErrorDetails(pItem->accessError());
    319         }
    320     }
    321 
    322     /* Pass the signal further: */
    323     emit sigCloudMachineStateChange(uId);
     287    /* Not for global items: */
     288    if (!isGlobalItemSelected())
     289    {
     290        /* Acquire current item: */
     291        UIVirtualMachineItem *pItem = currentItem();
     292        const bool fCurrentItemIsOk = pItem && pItem->accessible();
     293
     294        /* If current item is Ok: */
     295        if (fCurrentItemIsOk)
     296        {
     297            /* If Error-pane is chosen currently => open tool currently chosen in Tools-pane: */
     298            if (m_pPaneToolsMachine->currentTool() == UIToolType_Error)
     299                sltHandleToolsPaneIndexChange();
     300
     301            /* If we still have same item selected: */
     302            if (pItem && pItem->id() == uId)
     303            {
     304                /* Propagate current items to update the Details-pane: */
     305                m_pPaneToolsMachine->setItems(currentItems());
     306                /* Repeat the task a bit delayed: */
     307                pItem->toCloud()->updateInfoAsync(true /* delayed? */);
     308            }
     309        }
     310        else
     311        {
     312            /* Make sure Error pane raised: */
     313            if (m_pPaneToolsMachine->currentTool() != UIToolType_Error)
     314                m_pPaneToolsMachine->openTool(UIToolType_Error);
     315
     316            /* If we still have same item selected: */
     317            if (pItem && pItem->id() == uId)
     318            {
     319                /* Propagate current items to update the Details-pane (in any case): */
     320                m_pPaneToolsMachine->setItems(currentItems());
     321                /* Propagate last access error to update the Error-pane (if machine selected but inaccessible): */
     322                m_pPaneToolsMachine->setErrorDetails(pItem->accessError());
     323            }
     324        }
     325
     326        /* Pass the signal further: */
     327        emit sigCloudMachineStateChange(uId);
     328    }
    324329}
    325330
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