Changeset 99097 in vbox
- Timestamp:
- Mar 21, 2023 4:04:12 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156462
- 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 744 744 setStateIcon(KVMExecutionEngine_HwVirt, UIIconPool::iconSet(":/vtx_amdv_16px.png")); 745 745 setStateIcon(KVMExecutionEngine_NativeApi, UIIconPool::iconSet(":/vm_execution_engine_native_api_16px.png")); 746 /* Configure machine state-change listener: */746 /* Configure connection: */ 747 747 connect(m_pMachine, &UIMachine::sigMachineStateChange, 748 748 this, &UIIndicatorFeatures::sltHandleMachineStateChange); 749 connect(m_pMachine, &UIMachine::sigCPUExecutionCapChange, 750 this, &UIIndicatorFeatures::updateAppearance); 751 /* Configure CPU load update timer: */ 749 752 m_pTimerAutoUpdate = new QTimer(this); 750 753 if (m_pTimerAutoUpdate) … … 812 815 void sltHandleMachineStateChange() 813 816 { 817 /* Update appearance first of all: */ 818 updateAppearance(); 819 820 /* Start or stop CPU load update timer: */ 814 821 if (m_pMachine->machineState() == KMachineState_Running) 815 {816 /* Start auto-update timer otherwise: */817 822 m_pTimerAutoUpdate->start(1000); 818 return; 819 } 820 /* Stop auto-update timer otherwise: */ 821 m_pTimerAutoUpdate->stop(); 823 else 824 m_pTimerAutoUpdate->stop(); 822 825 } 823 826 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineDefs.h
r99096 r99097 49 49 UIVisualElement_MouseIntegrationStuff = RT_BIT(1), 50 50 UIVisualElement_IndicatorPoolStuff = RT_BIT(2), 51 UIVisualElement_FeaturesStuff = RT_BIT(12),52 51 #ifndef VBOX_WS_MAC 53 52 UIVisualElement_MiniToolBar = RT_BIT(13), -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r99096 r99097 80 80 81 81 /* 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); 95 83 } 96 84 … … 198 186 #endif /* VBOX_WS_MAC */ 199 187 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 214 188 #ifndef VBOX_WS_MAC 215 189 void UIMachineWindowNormal::prepareMenu() … … 389 363 delete m_pIndicatorsPool; 390 364 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();401 365 } 402 366 … … 649 613 && iElement & UIVisualElement_IndicatorPoolStuff) 650 614 m_pIndicatorsPool->setAutoUpdateIndicatorStates(statusBar()->isVisible() && uimachine()->isRunning()); 651 /* Update status-bar indicator-pool appearance only when status-bar is visible: */652 if ( m_pIndicatorsPool653 && 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 }662 615 } 663 616 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h
r99096 r99097 59 59 /** Handles machine state change event. */ 60 60 void sltMachineStateChanged(); 61 /** Handles CPU execution cap change event. */62 void sltCPUExecutionCapChange();63 /** Handles Machine UI initialized event. */64 void sltHandleMachineInitialized();65 61 66 62 #ifndef RT_OS_DARWIN … … 85 81 private: 86 82 87 /** Prepare session connections routine. */88 void prepareSessionConnections();89 83 #ifndef VBOX_WS_MAC 90 84 /** Prepare menu routine. */ … … 106 100 /** Cleanup status-bar routine. */ 107 101 void cleanupStatusBar(); 108 /** Cleanup session connections routine. */109 void cleanupSessionConnections();110 102 111 103 /** Updates visibility according to visual-state. */
Note:
See TracChangeset
for help on using the changeset viewer.