VirtualBox

Changeset 107284 in vbox


Ignore:
Timestamp:
Dec 11, 2024 11:06:49 AM (5 weeks ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10814: VBox Manager: More cleanup for VBox Manager widget.

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

Legend:

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

    r107279 r107284  
    399399}
    400400
    401 void UIVirtualBoxManagerWidget::sltHandleStateChange(const QUuid &uId)
     401void UIVirtualBoxManagerWidget::sltHandleMachineStateChange(const QUuid &uId)
    402402{
    403403    // WORKAROUND:
     
    503503    recacheCurrentMachineItemInformation();
    504504
    505     /* Calculate new selection type: */
     505    /* Calculate new selection type and item accessibility status: */
    506506    const SelectionType enmSelectedItemType = selectionType();
    507     /* Calculate new item accessibility status: */
    508507    const bool fCurrentItemIsOk = isItemAccessible();
    509508
     
    557556{
    558557    /* Not for global items: */
    559     if (!isGlobalItemSelected())
    560     {
    561         /* Acquire current item: */
    562         UIVirtualMachineItem *pItem = currentItem();
    563         const bool fCurrentItemIsOk = isItemAccessible(pItem);
    564 
    565         /* If current item is Ok: */
    566         if (fCurrentItemIsOk)
     558    if (isGlobalItemSelected())
     559        return;
     560
     561    /* Acquire current item: */
     562    UIVirtualMachineItem *pItem = currentItem();
     563    const bool fCurrentItemIsOk = isItemAccessible(pItem);
     564
     565    /* If current item is Ok: */
     566    if (fCurrentItemIsOk)
     567    {
     568        /* If Error-pane is chosen currently => switch to tool currently chosen in Tools-menu: */
     569        if (m_pPaneToolsMachine->currentTool() == UIToolType_Error)
     570            switchMachineToolTo(m_pMenuToolsMachine->toolsType());
     571
     572        /* If we still have same item selected: */
     573        if (pItem && pItem->id() == uId)
    567574        {
    568             /* If Error-pane is chosen currently => switch to tool currently chosen in Tools-menu: */
    569             if (m_pPaneToolsMachine->currentTool() == UIToolType_Error)
    570                 switchMachineToolTo(m_pMenuToolsMachine->toolsType());
    571 
    572             /* If we still have same item selected: */
    573             if (pItem && pItem->id() == uId)
    574             {
    575                 /* Propagate current items to update the Details-pane: */
    576                 m_pPaneToolsMachine->setItems(currentItems());
    577             }
     575            /* Propagate current items to update the Details-pane: */
     576            m_pPaneToolsMachine->setItems(currentItems());
    578577        }
    579         else
     578    }
     579    else
     580    {
     581        /* Make sure Error pane raised: */
     582        if (m_pPaneToolsMachine->currentTool() != UIToolType_Error)
     583            m_pPaneToolsMachine->openTool(UIToolType_Error);
     584
     585        /* If we still have same item selected: */
     586        if (pItem && pItem->id() == uId)
    580587        {
    581             /* Make sure Error pane raised: */
    582             if (m_pPaneToolsMachine->currentTool() != UIToolType_Error)
    583                 m_pPaneToolsMachine->openTool(UIToolType_Error);
    584 
    585             /* If we still have same item selected: */
    586             if (pItem && pItem->id() == uId)
    587             {
    588                 /* Propagate current items to update the Details-pane (in any case): */
    589                 m_pPaneToolsMachine->setItems(currentItems());
    590                 /* Propagate last access error to update the Error-pane (if machine selected but inaccessible): */
    591                 m_pPaneToolsMachine->setErrorDetails(pItem->accessError());
    592             }
     588            /* Propagate current items to update the Details-pane (in any case): */
     589            m_pPaneToolsMachine->setItems(currentItems());
     590            /* Propagate last access error to update the Error-pane (if machine selected but inaccessible): */
     591            m_pPaneToolsMachine->setErrorDetails(pItem->accessError());
    593592        }
    594 
    595         /* Pass the signal further: */
    596         emit sigCloudMachineStateChange(uId);
    597     }
     593    }
     594
     595    /* Pass the signal further: */
     596    emit sigCloudMachineStateChange(uId);
    598597}
    599598
     
    828827    /* Global VBox event handlers: */
    829828    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange,
    830             this, &UIVirtualBoxManagerWidget::sltHandleStateChange);
     829            this, &UIVirtualBoxManagerWidget::sltHandleMachineStateChange);
    831830
    832831    /* Global VBox extra-data event handlers: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h

    r107279 r107284  
    281281      * @{ */
    282282        /** Handles CVirtualBox event about state change for machine with @a uId. */
    283         void sltHandleStateChange(const QUuid &uId);
     283        void sltHandleMachineStateChange(const QUuid &uId);
    284284    /** @} */
    285285
     
    364364    /** @} */
    365365
    366     /** @name Common stuff.
     366    /** @name Tools stuff.
    367367      * @{ */
    368368        /** Recaches current machine item information.
    369369          * @param  fDontRaiseErrorPane  Brings whether we should not raise error-pane. */
    370370        void recacheCurrentMachineItemInformation(bool fDontRaiseErrorPane = false);
    371     /** @} */
    372 
    373     /** @name Tools stuff.
    374       * @{ */
     371
    375372        /** Updates Global tools menu. */
    376373        void updateToolsMenuGlobal();
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