VirtualBox

Changeset 99097 in vbox


Ignore:
Timestamp:
Mar 21, 2023 4:04:12 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156462
Message:

FE/Qt: bugref:10322: Runtime UI: Features status-bar indicator should be updated directly by machine-state-change and cpu-execution-cap-change events.

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

Legend:

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

    r99096 r99097  
    744744        setStateIcon(KVMExecutionEngine_HwVirt, UIIconPool::iconSet(":/vtx_amdv_16px.png"));
    745745        setStateIcon(KVMExecutionEngine_NativeApi, UIIconPool::iconSet(":/vm_execution_engine_native_api_16px.png"));
    746         /* Configure machine state-change listener: */
     746        /* Configure connection: */
    747747        connect(m_pMachine, &UIMachine::sigMachineStateChange,
    748748                this, &UIIndicatorFeatures::sltHandleMachineStateChange);
     749        connect(m_pMachine, &UIMachine::sigCPUExecutionCapChange,
     750                this, &UIIndicatorFeatures::updateAppearance);
     751        /* Configure CPU load update timer: */
    749752        m_pTimerAutoUpdate = new QTimer(this);
    750753        if (m_pTimerAutoUpdate)
     
    812815    void sltHandleMachineStateChange()
    813816    {
     817        /* Update appearance first of all: */
     818        updateAppearance();
     819
     820        /* Start or stop CPU load update timer: */
    814821        if (m_pMachine->machineState() == KMachineState_Running)
    815         {
    816             /* Start auto-update timer otherwise: */
    817822            m_pTimerAutoUpdate->start(1000);
    818             return;
    819         }
    820         /* Stop auto-update timer otherwise: */
    821         m_pTimerAutoUpdate->stop();
     823        else
     824            m_pTimerAutoUpdate->stop();
    822825    }
    823826
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineDefs.h

    r99096 r99097  
    4949    UIVisualElement_MouseIntegrationStuff = RT_BIT(1),
    5050    UIVisualElement_IndicatorPoolStuff    = RT_BIT(2),
    51     UIVisualElement_FeaturesStuff         = RT_BIT(12),
    5251#ifndef VBOX_WS_MAC
    5352    UIVisualElement_MiniToolBar           = RT_BIT(13),
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r99096 r99097  
    8080
    8181    /* Update indicator-pool and virtualization stuff: */
    82     updateAppearanceOf(UIVisualElement_IndicatorPoolStuff | UIVisualElement_FeaturesStuff);
    83 }
    84 
    85 void UIMachineWindowNormal::sltCPUExecutionCapChange()
    86 {
    87     /* Update virtualization stuff: */
    88     updateAppearanceOf(UIVisualElement_FeaturesStuff);
    89 }
    90 
    91 void UIMachineWindowNormal::sltHandleMachineInitialized()
    92 {
    93     /* Update virtualization stuff: */
    94     updateAppearanceOf(UIVisualElement_FeaturesStuff);
     82    updateAppearanceOf(UIVisualElement_IndicatorPoolStuff);
    9583}
    9684
     
    198186#endif /* VBOX_WS_MAC */
    199187
    200 void UIMachineWindowNormal::prepareSessionConnections()
    201 {
    202     /* Call to base-class: */
    203     UIMachineWindow::prepareSessionConnections();
    204 
    205     /* Start watching for console events: */
    206     connect(machineLogic()->uimachine(), &UIMachine::sigCPUExecutionCapChange,
    207             this, &UIMachineWindowNormal::sltCPUExecutionCapChange);
    208 
    209     /* Watch for machine UI signals: */
    210     connect(machineLogic()->uimachine(), &UIMachine::sigInitialized,
    211             this, &UIMachineWindowNormal::sltHandleMachineInitialized);
    212 }
    213 
    214188#ifndef VBOX_WS_MAC
    215189void UIMachineWindowNormal::prepareMenu()
     
    389363    delete m_pIndicatorsPool;
    390364    m_pIndicatorsPool = 0;
    391 }
    392 
    393 void UIMachineWindowNormal::cleanupSessionConnections()
    394 {
    395     /* Stop watching for console events: */
    396     disconnect(machineLogic()->uimachine(), &UIMachine::sigCPUExecutionCapChange,
    397                this, &UIMachineWindowNormal::sltCPUExecutionCapChange);
    398 
    399     /* Call to base-class: */
    400     UIMachineWindow::cleanupSessionConnections();
    401365}
    402366
     
    649613        && iElement & UIVisualElement_IndicatorPoolStuff)
    650614        m_pIndicatorsPool->setAutoUpdateIndicatorStates(statusBar()->isVisible() && uimachine()->isRunning());
    651     /* Update status-bar indicator-pool appearance only when status-bar is visible: */
    652     if (   m_pIndicatorsPool
    653         && statusBar()->isVisible())
    654     {
    655         /* If VM is running: */
    656         if (uimachine()->isRunning())
    657         {
    658             if (iElement & UIVisualElement_FeaturesStuff)
    659                 m_pIndicatorsPool->updateAppearance(IndicatorType_Features);
    660         }
    661     }
    662615}
    663616
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h

    r99096 r99097  
    5959    /** Handles machine state change event. */
    6060    void sltMachineStateChanged();
    61     /** Handles CPU execution cap change event. */
    62     void sltCPUExecutionCapChange();
    63     /** Handles Machine UI initialized event. */
    64     void sltHandleMachineInitialized();
    6561
    6662#ifndef RT_OS_DARWIN
     
    8581private:
    8682
    87     /** Prepare session connections routine. */
    88     void prepareSessionConnections();
    8983#ifndef VBOX_WS_MAC
    9084    /** Prepare menu routine. */
     
    106100    /** Cleanup status-bar routine. */
    107101    void cleanupStatusBar();
    108     /** Cleanup session connections routine. */
    109     void cleanupSessionConnections();
    110102
    111103    /** Updates visibility according to visual-state. */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette