Changeset 93731 in vbox for trunk/src/VBox
- Timestamp:
- Feb 14, 2022 3:11:57 PM (3 years ago)
- 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 38 38 #include "UIVMActivityMonitor.h" 39 39 #include "UISession.h" 40 #include "UIVirtualBoxEventHandler.h" 40 41 #include "UIVMInformationDialog.h" 41 42 #include "VBoxUtils.h" … … 64 65 , m_iGeometrySaveTimerId(-1) 65 66 { 67 if (m_pMachineWindow && !m_pMachineWindow->console().isNull()) 68 { 69 CMachine comMachine = m_pMachineWindow->console().GetMachine(); 70 m_uMachineId = comMachine.GetId(); 71 } 66 72 /* Prepare: */ 67 73 prepare(); 74 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange, 75 this, &UIVMInformationDialog::sltMachineStateChange); 68 76 } 69 77 … … 83 91 84 92 /* 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")); 88 96 m_pTabWidget->setTabText(3, tr("&Guest Control")); 89 97 … … 147 155 } 148 156 157 void 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 149 167 void UIVMInformationDialog::saveDialogGeometry() 150 168 { … … 205 223 { 206 224 /* 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")); 209 227 210 228 /* Create Configuration Details tab: */ … … 213 231 if (pInformationConfigurationWidget) 214 232 { 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()); 217 235 } 218 236 … … 222 240 if (pInformationRuntimeWidget) 223 241 { 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()); 226 244 } 227 245 … … 233 251 connect(m_pMachineWindow->uisession(), &UISession::sigAdditionsStateChange, 234 252 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()); 237 255 } 238 256 … … 254 272 } 255 273 256 /* Set Runtime Information tab as default: */ 257 m_pTabWidget->setCurrentIndex(2); 274 m_pTabWidget->setCurrentIndex(Tabs_ActivityMonitor); 258 275 259 276 /* Assign tab-widget page change handler: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.h
r93115 r93731 74 74 /** Handles tab-widget page change. */ 75 75 void sltHandlePageChanged(int iIndex); 76 void sltMachineStateChange(const QUuid &uMachineId, const KMachineState state); 76 77 77 78 private: 78 79 enum Tabs 80 { 81 Tabs_ConfigurationDetails = 0, 82 Tabs_RuntimeInformation, 83 Tabs_ActivityMonitor, 84 Tabs_GuestControl 85 }; 79 86 /** Prepares all. */ 80 87 void prepare(); … … 105 112 bool m_fCloseEmitted; 106 113 int m_iGeometrySaveTimerId; 114 QUuid m_uMachineId; 107 115 }; 108 116
Note:
See TracChangeset
for help on using the changeset viewer.