VirtualBox

Changeset 85439 in vbox for trunk/src


Ignore:
Timestamp:
Jul 23, 2020 4:11:33 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9686, bugref:9510: Make sure Performance Monitor tool being properly hidden/shown when current VM item state changes.

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

Legend:

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

    r85434 r85439  
    3232#include "UITabBar.h"
    3333#include "UIToolBar.h"
     34#include "UIVirtualBoxEventHandler.h"
    3435#include "UIVirtualMachineItemCloud.h"
    3536#include "UIVirtualMachineItemLocal.h"
     
    277278    m_pToolBar->updateLayout();
    278279#endif
     280}
     281
     282void UIVirtualBoxManagerWidget::sltHandleStateChange(const QUuid &)
     283{
     284    /* Recache current item info if machine or group item selected: */
     285    if (isMachineItemSelected() || isGroupItemSelected())
     286        recacheCurrentItemInformation();
    279287}
    280288
     
    627635void UIVirtualBoxManagerWidget::prepareConnections()
    628636{
     637    /* Global VBox event handlers: */
     638    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange,
     639            this, &UIVirtualBoxManagerWidget::sltHandleStateChange);
     640
    629641    /* Tool-bar connections: */
    630642    connect(m_pToolBar, &UIToolBar::customContextMenuRequested,
     
    947959    QList<UIToolType> retrictedTypes;
    948960    if (pItem && pItem->itemType() != UIVirtualMachineItemType_Local)
    949     {
    950961        retrictedTypes << UIToolType_Snapshots << UIToolType_Logs << UIToolType_Performance;
    951         if (retrictedTypes.contains(m_pPaneTools->toolsType()))
    952             m_pPaneTools->setToolsType(UIToolType_Details);
    953     }
    954     else if (pItem && !pItem->isItemRunning())
    955     {
     962    else if (pItem && !pItem->isItemStarted())
    956963        retrictedTypes << UIToolType_Performance;
    957     }
     964    if (retrictedTypes.contains(m_pPaneTools->toolsType()))
     965        m_pPaneTools->setToolsType(UIToolType_Details);
    958966    m_pPaneTools->setRestrictedToolTypes(retrictedTypes);
    959967    /* Update machine tools availability: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h

    r84595 r85439  
    215215private slots:
    216216
     217    /** @name CVirtualBox event handling stuff.
     218      * @{ */
     219        /** Handles CVirtualBox event about state change for machine with @a uId. */
     220        void sltHandleStateChange(const QUuid &uId);
     221    /** @} */
     222
    217223    /** @name Tool-bar stuff.
    218224      * @{ */
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