VirtualBox

Changeset 93731 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 14, 2022 3:11:57 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10165. Disabling the guest control tab of the 'session information' dialog when the vm is paused.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp

    r93115 r93731  
    3838#include "UIVMActivityMonitor.h"
    3939#include "UISession.h"
     40#include "UIVirtualBoxEventHandler.h"
    4041#include "UIVMInformationDialog.h"
    4142#include "VBoxUtils.h"
     
    6465    , m_iGeometrySaveTimerId(-1)
    6566{
     67    if (m_pMachineWindow && !m_pMachineWindow->console().isNull())
     68    {
     69        CMachine comMachine = m_pMachineWindow->console().GetMachine();
     70        m_uMachineId = comMachine.GetId();
     71    }
    6672    /* Prepare: */
    6773    prepare();
     74    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange,
     75            this, &UIVMInformationDialog::sltMachineStateChange);
    6876}
    6977
     
    8391
    8492    /* Translate tabs: */
    85     m_pTabWidget->setTabText(0, tr("Configuration &Details"));
    86     m_pTabWidget->setTabText(1, tr("&Runtime Information"));
    87     m_pTabWidget->setTabText(2, tr("VM &Activity"));
     93    m_pTabWidget->setTabText(Tabs_ConfigurationDetails, tr("Configuration &Details"));
     94    m_pTabWidget->setTabText(Tabs_RuntimeInformation, tr("&Runtime Information"));
     95    m_pTabWidget->setTabText(Tabs_ActivityMonitor, tr("VM &Activity"));
    8896    m_pTabWidget->setTabText(3, tr("&Guest Control"));
    8997
     
    147155}
    148156
     157void UIVMInformationDialog::sltMachineStateChange(const QUuid &uMachineId, const KMachineState state)
     158{
     159    if (m_uMachineId != uMachineId)
     160        return;
     161    QWidget *pWidget = m_tabs.value(Tabs_GuestControl);
     162    if (!pWidget)
     163        return;
     164    pWidget->setEnabled(state == KMachineState_Running);
     165}
     166
    149167void UIVMInformationDialog::saveDialogGeometry()
    150168{
     
    205223    {
    206224        /* Prepare tab-widget: */
    207         m_pTabWidget->setTabIcon(0, UIIconPool::iconSet(":/session_info_details_16px.png"));
    208         m_pTabWidget->setTabIcon(1, UIIconPool::iconSet(":/session_info_runtime_16px.png"));
     225        m_pTabWidget->setTabIcon(Tabs_ConfigurationDetails, UIIconPool::iconSet(":/session_info_details_16px.png"));
     226        m_pTabWidget->setTabIcon(Tabs_RuntimeInformation, UIIconPool::iconSet(":/session_info_runtime_16px.png"));
    209227
    210228        /* Create Configuration Details tab: */
     
    213231        if (pInformationConfigurationWidget)
    214232        {
    215             m_tabs.insert(0, pInformationConfigurationWidget);
    216             m_pTabWidget->addTab(m_tabs.value(0), QString());
     233            m_tabs.insert(Tabs_ConfigurationDetails, pInformationConfigurationWidget);
     234            m_pTabWidget->addTab(m_tabs.value(Tabs_ConfigurationDetails), QString());
    217235        }
    218236
     
    222240        if (pInformationRuntimeWidget)
    223241        {
    224             m_tabs.insert(1, pInformationRuntimeWidget);
    225             m_pTabWidget->addTab(m_tabs.value(1), QString());
     242            m_tabs.insert(Tabs_RuntimeInformation, pInformationRuntimeWidget);
     243            m_pTabWidget->addTab(m_tabs.value(Tabs_RuntimeInformation), QString());
    226244        }
    227245
     
    233251            connect(m_pMachineWindow->uisession(), &UISession::sigAdditionsStateChange,
    234252                    pVMActivityMonitorWidget, &UIVMActivityMonitor::sltGuestAdditionsStateChange);
    235             m_tabs.insert(2, pVMActivityMonitorWidget);
    236             m_pTabWidget->addTab(m_tabs.value(2), QString());
     253            m_tabs.insert(Tabs_ActivityMonitor, pVMActivityMonitorWidget);
     254            m_pTabWidget->addTab(m_tabs.value(Tabs_ActivityMonitor), QString());
    237255        }
    238256
     
    254272        }
    255273
    256         /* Set Runtime Information tab as default: */
    257         m_pTabWidget->setCurrentIndex(2);
     274        m_pTabWidget->setCurrentIndex(Tabs_ActivityMonitor);
    258275
    259276        /* Assign tab-widget page change handler: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.h

    r93115 r93731  
    7474    /** Handles tab-widget page change. */
    7575    void sltHandlePageChanged(int iIndex);
     76    void sltMachineStateChange(const QUuid &uMachineId, const KMachineState state);
    7677
    7778private:
    78 
     79    enum Tabs
     80    {
     81        Tabs_ConfigurationDetails = 0,
     82        Tabs_RuntimeInformation,
     83        Tabs_ActivityMonitor,
     84        Tabs_GuestControl
     85    };
    7986    /** Prepares all. */
    8087    void prepare();
     
    105112    bool m_fCloseEmitted;
    106113    int m_iGeometrySaveTimerId;
     114    QUuid m_uMachineId;
    107115};
    108116
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