Changeset 88071 in vbox
- Timestamp:
- Mar 10, 2021 3:10:39 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 16 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r87916 r88071 830 830 src/logviewer/UIVMLogViewerTextEdit.h \ 831 831 src/logviewer/UIVMLogViewerWidget.h \ 832 src/monitor/performance/UI PerformanceMonitor.h \832 src/monitor/performance/UIVMActivityMonitor.h \ 833 833 src/medium/UIFDCreationDialog.h \ 834 834 src/medium/UIMediumEnumerator.h \ … … 1007 1007 src/logviewer/UIVMLogViewerFilterPanel.cpp \ 1008 1008 src/logviewer/UIVMLogViewerTextEdit.cpp \ 1009 src/monitor/performance/UI PerformanceMonitor.cpp \1009 src/monitor/performance/UIVMActivityMonitor.cpp \ 1010 1010 src/medium/UIMediumEnumerator.cpp \ 1011 1011 src/medium/viso/UIVisoContentBrowser.cpp \ … … 1364 1364 src/logviewer/UIVMLogViewerWidget.cpp \ 1365 1365 src/monitor/UIMonitorCommon.cpp \ 1366 src/monitor/performance/UI PerformanceMonitor.cpp \1366 src/monitor/performance/UIVMActivityMonitor.cpp \ 1367 1367 src/medium/UIFDCreationDialog.cpp \ 1368 1368 src/medium/UIMedium.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r87475 r88071 1522 1522 case UIToolType_Snapshots: strResult = "Snapshots"; break; 1523 1523 case UIToolType_Logs: strResult = "Logs"; break; 1524 case UIToolType_ Performance:strResult = "Performance"; break;1524 case UIToolType_VMActivity: strResult = "Performance"; break; 1525 1525 default: 1526 1526 { … … 1548 1548 keys << "Snapshots"; values << UIToolType_Snapshots; 1549 1549 keys << "Logs"; values << UIToolType_Logs; 1550 keys << "Performance"; values << UIToolType_ Performance;1550 keys << "Performance"; values << UIToolType_VMActivity; 1551 1551 /* Invalid type for unknown words: */ 1552 1552 if (!keys.contains(strToolType, Qt::CaseInsensitive)) -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r87475 r88071 285 285 case UIToolType_Snapshots: 286 286 case UIToolType_Logs: 287 case UIToolType_ Performance:287 case UIToolType_VMActivity: 288 288 return true; 289 289 default: -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r87475 r88071 903 903 UIToolType_Snapshots, 904 904 UIToolType_Logs, 905 UIToolType_ Performance,905 UIToolType_VMActivity, 906 906 }; 907 907 Q_DECLARE_METATYPE(UIToolType); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp
r87101 r88071 2219 2219 virtual QString shortcutExtraDataID() const /* override */ 2220 2220 { 2221 return QString(" PerformanceMonitorMenu");2221 return QString("VMActivityMonitorMenu"); 2222 2222 } 2223 2223 … … 2589 2589 m_menuUpdateHandlers[UIActionIndex_M_LogWindow].ptf = &UIActionPool::updateMenuLogViewerWindow; 2590 2590 m_menuUpdateHandlers[UIActionIndex_M_Log].ptf = &UIActionPool::updateMenuLogViewer; 2591 m_menuUpdateHandlers[UIActionIndex_M_Performance].ptf = &UIActionPool::updateMenu PerformanceMonitor;2591 m_menuUpdateHandlers[UIActionIndex_M_Performance].ptf = &UIActionPool::updateMenuVMActivityMonitor; 2592 2592 m_menuUpdateHandlers[UIActionIndex_M_FileManager].ptf = &UIActionPool::updateMenuFileManager; 2593 2593 … … 2965 2965 } 2966 2966 2967 void UIActionPool::updateMenu PerformanceMonitor()2967 void UIActionPool::updateMenuVMActivityMonitor() 2968 2968 { 2969 2969 /* Get corresponding menu: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h
r87101 r88071 588 588 void updateMenuLogViewerWrapper(UIMenu *pMenu); 589 589 /** Updates 'Performance Monitor' menu. */ 590 void updateMenu PerformanceMonitor();590 void updateMenuVMActivityMonitor(); 591 591 /** Updates 'File Manager' menu. */ 592 592 void updateMenuFileManager(); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp
r87516 r88071 1883 1883 : UIActionToggle(pParent) 1884 1884 { 1885 setProperty("UIToolType", QVariant::fromValue(UIToolType_ Performance));1885 setProperty("UIToolType", QVariant::fromValue(UIToolType_VMActivity)); 1886 1886 /// @todo use icons with check-boxes 1887 1887 setIcon(UIIconPool::iconSetFull(":/performance_monitor_32px.png", ":/performance_monitor_16px.png", … … 1894 1894 virtual QString shortcutExtraDataID() const /* override */ 1895 1895 { 1896 return QString("ToolsMachine PerformanceMonitor");1896 return QString("ToolsMachineVMActivityMonitor"); 1897 1897 } 1898 1898 … … 3800 3800 /* 'Performance' menu: */ 3801 3801 addMenu(m_mainMenus, action(UIActionIndex_M_Performance)); 3802 updateMenu PerformanceMonitor();3802 updateMenuVMActivityMonitor(); 3803 3803 3804 3804 /* 'Help' menu: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp
r87101 r88071 28 28 #include "UIDetails.h" 29 29 #include "UIIconPool.h" 30 #include "UI PerformanceMonitor.h"30 #include "UIVMActivityMonitor.h" 31 31 #include "UISnapshotPane.h" 32 32 #include "UIToolPaneMachine.h" … … 47 47 , m_pPaneSnapshots(0) 48 48 , m_pPaneLogViewer(0) 49 , m_pPane PerformanceMonitor(0)49 , m_pPaneVMActivityMonitor(0) 50 50 , m_fActive(false) 51 51 { … … 191 191 break; 192 192 } 193 case UIToolType_ Performance:194 { 195 m_pPane PerformanceMonitor = new UIPerformanceMonitor(EmbedTo_Stack, 0,193 case UIToolType_VMActivity: 194 { 195 m_pPaneVMActivityMonitor = new UIVMActivityMonitor(EmbedTo_Stack, 0, 196 196 m_comMachine, m_pActionPool, false /* Show toolbar */); 197 AssertPtrReturnVoid(m_pPane PerformanceMonitor);197 AssertPtrReturnVoid(m_pPaneVMActivityMonitor); 198 198 #ifndef VBOX_WS_MAC 199 199 const int iMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 4; 200 m_pPane PerformanceMonitor->setContentsMargins(iMargin, 0, iMargin, 0);200 m_pPaneVMActivityMonitor->setContentsMargins(iMargin, 0, iMargin, 0); 201 201 #endif 202 202 203 203 /* Configure pane: */ 204 m_pPane PerformanceMonitor->setProperty("ToolType", QVariant::fromValue(UIToolType_Performance));204 m_pPaneVMActivityMonitor->setProperty("ToolType", QVariant::fromValue(UIToolType_VMActivity)); 205 205 206 206 /* Add into layout: */ 207 m_pLayout->addWidget(m_pPane PerformanceMonitor);208 m_pLayout->setCurrentWidget(m_pPane PerformanceMonitor);209 210 connect(m_pPane PerformanceMonitor, &UIPerformanceMonitor::sigSwitchToResourcesPane,207 m_pLayout->addWidget(m_pPaneVMActivityMonitor); 208 m_pLayout->setCurrentWidget(m_pPaneVMActivityMonitor); 209 210 connect(m_pPaneVMActivityMonitor, &UIVMActivityMonitor::sigSwitchToResourcesPane, 211 211 this, &UIToolPaneMachine::sigSwitchToResourcesPane); 212 212 break; … … 239 239 case UIToolType_Snapshots: m_pPaneSnapshots = 0; break; 240 240 case UIToolType_Logs: m_pPaneLogViewer = 0; break; 241 case UIToolType_ Performance: m_pPanePerformanceMonitor = 0; break;241 case UIToolType_VMActivity: m_pPaneVMActivityMonitor = 0; break; 242 242 default: break; 243 243 } … … 299 299 } 300 300 /* Update performance monitor pane is it is open: */ 301 if (isToolOpened(UIToolType_ Performance))302 { 303 AssertPtrReturnVoid(m_pPane PerformanceMonitor);304 m_pPane PerformanceMonitor->setMachine(m_comMachine);301 if (isToolOpened(UIToolType_VMActivity)) 302 { 303 AssertPtrReturnVoid(m_pPaneVMActivityMonitor); 304 m_pPaneVMActivityMonitor->setMachine(m_comMachine); 305 305 } 306 306 } … … 330 330 pCurrentToolWidget = m_pPaneLogViewer; 331 331 break; 332 case UIToolType_ Performance:333 pCurrentToolWidget = m_pPane PerformanceMonitor;332 case UIToolType_VMActivity: 333 pCurrentToolWidget = m_pPaneVMActivityMonitor; 334 334 break; 335 335 default: -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h
r87101 r88071 39 39 class UIDetails; 40 40 class UIErrorPane; 41 class UI PerformanceMonitor;41 class UIVMActivityMonitor; 42 42 class UISnapshotPane; 43 43 class UIVirtualMachineItem; … … 133 133 UIVMLogViewerWidget *m_pPaneLogViewer; 134 134 /** Holds the Performance Monitor pane instance. */ 135 UI PerformanceMonitor *m_pPanePerformanceMonitor;135 UIVMActivityMonitor *m_pPaneVMActivityMonitor; 136 136 137 137 /** Holds whether this pane is active. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r87516 r88071 711 711 sltCloseLogViewerWindow(); 712 712 break; 713 case UIToolType_Performance: 714 sltClosePerformanceMonitorWindow(); 713 case UIToolType_VMActivity: 715 714 break; 716 715 default: … … 2050 2049 } 2051 2050 2052 void UIVirtualBoxManager::sltOpenPerformanceMonitorWindow()2053 {2054 }2055 2056 void UIVirtualBoxManager::sltClosePerformanceMonitorWindow()2057 {2058 }2059 2051 2060 2052 void UIVirtualBoxManager::sltPerformRefreshMachine() … … 3132 3124 /* Determine whether Performance menu should be visible: */ 3133 3125 const bool fPerformanceMenuShown = (fMachineMenuShown || fGroupMenuShown) && 3134 m_pWidget->currentMachineTool() == UIToolType_ Performance;3126 m_pWidget->currentMachineTool() == UIToolType_VMActivity; 3135 3127 actionPool()->action(UIActionIndex_M_Performance)->setVisible(fPerformanceMenuShown); 3136 3128 … … 3305 3297 break; 3306 3298 } 3307 case UIToolType_ Performance:3299 case UIToolType_VMActivity: 3308 3300 { 3309 3301 actionPool()->action(UIActionIndexMN_M_Group_M_Tools_T_Performance)->setChecked(true); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r87516 r88071 280 280 /** Handles call to close machine Log Viewer window. */ 281 281 void sltCloseLogViewerWindow(); 282 283 /** Handles call to open machine Performance Monitor window. */284 void sltOpenPerformanceMonitorWindow();285 286 /** Handles call to close machine Performance Monitor window. */287 void sltClosePerformanceMonitorWindow();288 282 289 283 /** Handles call to refresh machine. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r87516 r88071 511 511 AssertPtrReturnVoid(m_pPaneTools); 512 512 m_pPaneChooser->setCurrentMachine(uMachineId); 513 m_pPaneTools->setToolsType(UIToolType_ Performance);513 m_pPaneTools->setToolsType(UIToolType_VMActivity); 514 514 } 515 515 … … 920 920 break; 921 921 } 922 case UIToolType_ Performance:922 case UIToolType_VMActivity: 923 923 { 924 924 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Performance_S_Export)); … … 1042 1042 QList<UIToolType> retrictedTypes; 1043 1043 if (pItem && pItem->itemType() != UIVirtualMachineItemType_Local) 1044 retrictedTypes << UIToolType_Snapshots << UIToolType_Logs << UIToolType_ Performance;1044 retrictedTypes << UIToolType_Snapshots << UIToolType_Logs << UIToolType_VMActivity; 1045 1045 else if (pItem && !pItem->isItemStarted()) 1046 retrictedTypes << UIToolType_ Performance;1046 retrictedTypes << UIToolType_VMActivity; 1047 1047 if (retrictedTypes.contains(m_pPaneTools->toolsType())) 1048 1048 m_pPaneTools->setToolsType(UIToolType_Details); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp
r87516 r88071 461 461 case UIToolType_Snapshots: pItem->reconfigure(tr("Snapshots")); break; 462 462 case UIToolType_Logs: pItem->reconfigure(tr("Logs")); break; 463 case UIToolType_ Performance: pItem->reconfigure(tr("Performance")); break;463 case UIToolType_VMActivity: pItem->reconfigure(tr("Performance")); break; 464 464 default: break; 465 465 } … … 536 536 537 537 /* Performance: */ 538 m_items << new UIToolsItem(scene(), UIToolClass_Machine, UIToolType_ Performance, QString(),538 m_items << new UIToolsItem(scene(), UIToolClass_Machine, UIToolType_VMActivity, QString(), 539 539 UIIconPool::iconSet(":/performance_monitor_24px.png", ":/performance_monitor_disabled_24px.png")); 540 540 } -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/performance/UIVMActivityMonitor.cpp
r88070 r88071 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI PerformanceMonitor class implementation.3 * VBox Qt GUI - UIVMActivityMonitor class implementation. 4 4 */ 5 5 … … 33 33 #include "UICommon.h" 34 34 #include "UIIconPool.h" 35 #include "UI PerformanceMonitor.h"35 #include "UIVMActivityMonitor.h" 36 36 #include "QIToolBar.h" 37 37 #include "UIVirtualBoxEventHandler.h" … … 767 767 768 768 /********************************************************************************************************************************* 769 * UI PerformanceMonitor implementation. *769 * UIVMActivityMonitor implementation. * 770 770 *********************************************************************************************************************************/ 771 771 772 UI PerformanceMonitor::UIPerformanceMonitor(EmbedTo enmEmbedding, QWidget *pParent,772 UIVMActivityMonitor::UIVMActivityMonitor(EmbedTo enmEmbedding, QWidget *pParent, 773 773 const CMachine &machine, UIActionPool *pActionPool, bool fShowToolbar /* = false */) 774 774 : QIWithRetranslateUI<QWidget>(pParent) … … 794 794 prepareActions(); 795 795 retranslateUi(); 796 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange, this, &UI PerformanceMonitor::sltMachineStateChange);796 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange, this, &UIVMActivityMonitor::sltMachineStateChange); 797 797 setMachine(machine); 798 798 uiCommon().setHelpKeyword(this, "vm-session-information"); 799 799 setContextMenuPolicy(Qt::CustomContextMenu); 800 connect(this, &UI PerformanceMonitor::customContextMenuRequested,801 this, &UI PerformanceMonitor::sltCreateContextMenu);802 } 803 804 UI PerformanceMonitor::~UIPerformanceMonitor()800 connect(this, &UIVMActivityMonitor::customContextMenuRequested, 801 this, &UIVMActivityMonitor::sltCreateContextMenu); 802 } 803 804 UIVMActivityMonitor::~UIVMActivityMonitor() 805 805 { 806 806 if (!m_comSession.isNull()) … … 808 808 } 809 809 810 void UI PerformanceMonitor::setMachine(const CMachine &comMachine)810 void UIVMActivityMonitor::setMachine(const CMachine &comMachine) 811 811 { 812 812 reset(); … … 827 827 } 828 828 829 void UI PerformanceMonitor::openSession()829 void UIVMActivityMonitor::openSession() 830 830 { 831 831 m_comSession = uiCommon().openSession(m_comMachine.GetId(), KLockType_Shared); … … 839 839 } 840 840 841 void UI PerformanceMonitor::retranslateUi()841 void UIVMActivityMonitor::retranslateUi() 842 842 { 843 843 foreach (UIChart *pChart, m_charts) … … 903 903 } 904 904 905 void UI PerformanceMonitor::prepareWidgets()905 void UIVMActivityMonitor::prepareWidgets() 906 906 { 907 907 m_pMainLayout = new QVBoxLayout(this); … … 918 918 m_pTimer = new QTimer(this); 919 919 if (m_pTimer) 920 connect(m_pTimer, &QTimer::timeout, this, &UI PerformanceMonitor::sltTimeout);920 connect(m_pTimer, &QTimer::timeout, this, &UIVMActivityMonitor::sltTimeout); 921 921 922 922 QScrollArea *pScrollArea = new QScrollArea(this); … … 949 949 UIChart *pChart = new UIChart(this, &(m_metrics[strMetricName])); 950 950 connect(pChart, &UIChart::sigExportMetricsToFile, 951 this, &UI PerformanceMonitor::sltExportMetricsToFile);951 this, &UIVMActivityMonitor::sltExportMetricsToFile); 952 952 m_charts.insert(strMetricName, pChart); 953 953 pChart->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); … … 970 970 } 971 971 972 void UI PerformanceMonitor::sltTimeout()973 { 974 if (m_performance Monitor.isNull())972 void UIVMActivityMonitor::sltTimeout() 973 { 974 if (m_performanceCollector.isNull()) 975 975 return; 976 976 ++m_iTimeStep; … … 980 980 quint64 iTotalRAM = 0; 981 981 quint64 iFreeRAM = 0; 982 UIMonitorCommon::getRAMLoad(m_performance Monitor, m_nameList, m_objectList, iTotalRAM, iFreeRAM);982 UIMonitorCommon::getRAMLoad(m_performanceCollector, m_nameList, m_objectList, iTotalRAM, iFreeRAM); 983 983 updateRAMGraphsAndMetric(iTotalRAM, iFreeRAM); 984 984 } … … 1018 1018 } 1019 1019 1020 void UI PerformanceMonitor::sltMachineStateChange(const QUuid &uId)1020 void UIVMActivityMonitor::sltMachineStateChange(const QUuid &uId) 1021 1021 { 1022 1022 if (m_comMachine.isNull()) … … 1033 1033 } 1034 1034 1035 void UI PerformanceMonitor::sltExportMetricsToFile()1035 void UIVMActivityMonitor::sltExportMetricsToFile() 1036 1036 { 1037 1037 QString strStartFileName = QString("%1/%2_%3"). … … 1053 1053 } 1054 1054 1055 void UI PerformanceMonitor::sltCreateContextMenu(const QPoint &point)1055 void UIVMActivityMonitor::sltCreateContextMenu(const QPoint &point) 1056 1056 { 1057 1057 QMenu menu; … … 1059 1059 menu.addAction(QApplication::translate("UIVMInformationDialog", "Export")); 1060 1060 pExportAction->setIcon(UIIconPool::iconSet(":/performance_monitor_export_16px.png")); 1061 connect(pExportAction, &QAction::triggered, this, &UI PerformanceMonitor::sltExportMetricsToFile);1061 connect(pExportAction, &QAction::triggered, this, &UIVMActivityMonitor::sltExportMetricsToFile); 1062 1062 menu.exec(mapToGlobal(point)); 1063 1063 } 1064 1064 1065 void UI PerformanceMonitor::sltGuestAdditionsStateChange()1065 void UIVMActivityMonitor::sltGuestAdditionsStateChange() 1066 1066 { 1067 1067 bool fGuestAdditionsAvailable = guestAdditionsAvailable(6 /* minimum major version */); … … 1072 1072 } 1073 1073 1074 void UI PerformanceMonitor::prepareMetrics()1075 { 1076 m_performance Monitor = uiCommon().virtualBox().GetPerformanceCollector();1077 if (m_performance Monitor.isNull())1074 void UIVMActivityMonitor::prepareMetrics() 1075 { 1076 m_performanceCollector = uiCommon().virtualBox().GetPerformanceCollector(); 1077 if (m_performanceCollector.isNull()) 1078 1078 return; 1079 1079 1080 1080 m_nameList << "Guest/RAM/Usage*"; 1081 1081 m_objectList = QVector<CUnknown>(m_nameList.size(), CUnknown()); 1082 m_performance Monitor.SetupMetrics(m_nameList, m_objectList, g_iPeriod, g_iMetricSetupCount);1083 { 1084 QVector<CPerformanceMetric> metrics = m_performance Monitor.GetMetrics(m_nameList, m_objectList);1082 m_performanceCollector.SetupMetrics(m_nameList, m_objectList, g_iPeriod, g_iMetricSetupCount); 1083 { 1084 QVector<CPerformanceMetric> metrics = m_performanceCollector.GetMetrics(m_nameList, m_objectList); 1085 1085 for (int i = 0; i < metrics.size(); ++i) 1086 1086 { … … 1123 1123 } 1124 1124 1125 void UI PerformanceMonitor::prepareToolBar()1125 void UIVMActivityMonitor::prepareToolBar() 1126 1126 { 1127 1127 /* Create toolbar: */ … … 1148 1148 } 1149 1149 1150 void UI PerformanceMonitor::prepareActions()1150 void UIVMActivityMonitor::prepareActions() 1151 1151 { 1152 1152 QAction *pExportAction = 1153 1153 m_pActionPool->action(UIActionIndex_M_Performance_S_Export); 1154 1154 if (pExportAction) 1155 connect(pExportAction, &QAction::triggered, this, &UI PerformanceMonitor::sltExportMetricsToFile);1155 connect(pExportAction, &QAction::triggered, this, &UIVMActivityMonitor::sltExportMetricsToFile); 1156 1156 1157 1157 QAction *pToResourcesAction = 1158 1158 m_pActionPool->action(UIActionIndex_M_Performance_S_ToResources); 1159 1159 if (pToResourcesAction) 1160 connect(pToResourcesAction, &QAction::triggered, this, &UI PerformanceMonitor::sigSwitchToResourcesPane);1161 } 1162 1163 bool UI PerformanceMonitor::guestAdditionsAvailable(int iMinimumMajorVersion)1160 connect(pToResourcesAction, &QAction::triggered, this, &UIVMActivityMonitor::sigSwitchToResourcesPane); 1161 } 1162 1163 bool UIVMActivityMonitor::guestAdditionsAvailable(int iMinimumMajorVersion) 1164 1164 { 1165 1165 if (m_comGuest.isNull()) … … 1180 1180 } 1181 1181 1182 void UI PerformanceMonitor::enableDisableGuestAdditionDependedWidgets(bool fEnable)1182 void UIVMActivityMonitor::enableDisableGuestAdditionDependedWidgets(bool fEnable) 1183 1183 { 1184 1184 for (QMap<QString, UIMetric>::const_iterator iterator = m_metrics.begin(); … … 1197 1197 } 1198 1198 1199 void UI PerformanceMonitor::updateCPUGraphsAndMetric(ULONG iExecutingPercentage, ULONG iOtherPercentage)1199 void UIVMActivityMonitor::updateCPUGraphsAndMetric(ULONG iExecutingPercentage, ULONG iOtherPercentage) 1200 1200 { 1201 1201 UIMetric &CPUMetric = m_metrics[m_strCPUMetricName]; … … 1220 1220 } 1221 1221 1222 void UI PerformanceMonitor::updateRAMGraphsAndMetric(quint64 iTotalRAM, quint64 iFreeRAM)1222 void UIVMActivityMonitor::updateRAMGraphsAndMetric(quint64 iTotalRAM, quint64 iFreeRAM) 1223 1223 { 1224 1224 UIMetric &RAMMetric = m_metrics[m_strRAMMetricName]; … … 1237 1237 } 1238 1238 1239 void UI PerformanceMonitor::updateNetworkGraphsAndMetric(quint64 iReceiveTotal, quint64 iTransmitTotal)1239 void UIVMActivityMonitor::updateNetworkGraphsAndMetric(quint64 iReceiveTotal, quint64 iTransmitTotal) 1240 1240 { 1241 1241 UIMetric &NetMetric = m_metrics[m_strNetworkMetricName]; … … 1273 1273 } 1274 1274 1275 void UI PerformanceMonitor::resetCPUInfoLabel()1275 void UIVMActivityMonitor::resetCPUInfoLabel() 1276 1276 { 1277 1277 if (m_infoLabels.contains(m_strCPUMetricName) && m_infoLabels[m_strCPUMetricName]) … … 1285 1285 } 1286 1286 1287 void UI PerformanceMonitor::resetRAMInfoLabel()1287 void UIVMActivityMonitor::resetRAMInfoLabel() 1288 1288 { 1289 1289 if (m_infoLabels.contains(m_strRAMMetricName) && m_infoLabels[m_strRAMMetricName]) … … 1297 1297 } 1298 1298 1299 void UI PerformanceMonitor::resetNetworkInfoLabel()1299 void UIVMActivityMonitor::resetNetworkInfoLabel() 1300 1300 { 1301 1301 if (m_infoLabels.contains(m_strNetworkMetricName) && m_infoLabels[m_strNetworkMetricName]) … … 1311 1311 } 1312 1312 1313 void UI PerformanceMonitor::resetVMExitInfoLabel()1313 void UIVMActivityMonitor::resetVMExitInfoLabel() 1314 1314 { 1315 1315 if (m_infoLabels.contains(m_strVMExitMetricName) && m_infoLabels[m_strVMExitMetricName]) … … 1325 1325 } 1326 1326 1327 void UI PerformanceMonitor::resetDiskIOInfoLabel()1327 void UIVMActivityMonitor::resetDiskIOInfoLabel() 1328 1328 { 1329 1329 if (m_infoLabels.contains(m_strDiskIOMetricName) && m_infoLabels[m_strDiskIOMetricName]) … … 1339 1339 } 1340 1340 1341 void UI PerformanceMonitor::updateDiskIOGraphsAndMetric(quint64 uDiskIOTotalWritten, quint64 uDiskIOTotalRead)1341 void UIVMActivityMonitor::updateDiskIOGraphsAndMetric(quint64 uDiskIOTotalWritten, quint64 uDiskIOTotalRead) 1342 1342 { 1343 1343 UIMetric &diskMetric = m_metrics[m_strDiskIOMetricName]; … … 1374 1374 } 1375 1375 1376 void UI PerformanceMonitor::updateVMExitMetric(quint64 uTotalVMExits)1376 void UIVMActivityMonitor::updateVMExitMetric(quint64 uTotalVMExits) 1377 1377 { 1378 1378 if (uTotalVMExits <= 0) … … 1404 1404 } 1405 1405 1406 QString UI PerformanceMonitor::dataColorString(const QString &strChartName, int iDataIndex)1406 QString UIVMActivityMonitor::dataColorString(const QString &strChartName, int iDataIndex) 1407 1407 { 1408 1408 if (!m_charts.contains(strChartName)) … … 1414 1414 } 1415 1415 1416 void UI PerformanceMonitor::reset()1416 void UIVMActivityMonitor::reset() 1417 1417 { 1418 1418 m_fGuestAdditionsAvailable = false; … … 1438 1438 } 1439 1439 1440 void UI PerformanceMonitor::start()1440 void UIVMActivityMonitor::start() 1441 1441 { 1442 1442 if (m_comMachine.isNull() || m_comMachine.GetState() != KMachineState_Running) … … 1450 1450 1451 1451 1452 #include "UI PerformanceMonitor.moc"1452 #include "UIVMActivityMonitor.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/performance/UIVMActivityMonitor.h
r88070 r88071 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI PerformanceMonitor class declaration.3 * VBox Qt GUI - UIVMActivityMonitor class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_monitor_performance_UI PerformanceMonitor_h19 #define FEQT_INCLUDED_SRC_monitor_performance_UI PerformanceMonitor_h18 #ifndef FEQT_INCLUDED_SRC_monitor_performance_UIVMActivityMonitor_h 19 #define FEQT_INCLUDED_SRC_monitor_performance_UIVMActivityMonitor_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 106 106 }; 107 107 108 /** UI PerformanceMonitor class displays some high level performance metric of the guest system.108 /** UIVMActivityMonitor class displays some high level performance metric of the guest system. 109 109 * The values are read in certain periods and cached in the GUI side. Currently we draw some line charts 110 110 * and pie charts (where applicable) alongside with some text. IPerformanceCollector and IMachineDebugger are 111 111 * two sources of the performance metrics. Unfortunately these two have very distinct APIs resulting a bit too much 112 112 * special casing etc.*/ 113 class SHARED_LIBRARY_STUFF UI PerformanceMonitor : public QIWithRetranslateUI<QWidget>113 class SHARED_LIBRARY_STUFF UIVMActivityMonitor : public QIWithRetranslateUI<QWidget> 114 114 { 115 115 Q_OBJECT; … … 123 123 /** Constructs information-tab passing @a pParent to the QWidget base-class constructor. 124 124 * @param machine is machine reference. */ 125 UI PerformanceMonitor(EmbedTo enmEmbedding, QWidget *pParent, const CMachine &machine,125 UIVMActivityMonitor(EmbedTo enmEmbedding, QWidget *pParent, const CMachine &machine, 126 126 UIActionPool *pActionPool,bool fShowToolbar = false); 127 ~UI PerformanceMonitor();127 ~UIVMActivityMonitor(); 128 128 void setMachine(const CMachine &machine); 129 129 … … 191 191 CGuest m_comGuest; 192 192 193 CPerformanceCollector m_performance Monitor;193 CPerformanceCollector m_performanceCollector; 194 194 CMachineDebugger m_comMachineDebugger; 195 195 /** Holds the instance of layout we create. */ … … 253 253 }; 254 254 255 #endif /* !FEQT_INCLUDED_SRC_monitor_performance_UI PerformanceMonitor_h */255 #endif /* !FEQT_INCLUDED_SRC_monitor_performance_UIVMActivityMonitor_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.cpp
r87103 r88071 38 38 #include "UIExtraDataManager.h" 39 39 #include "UIIconPool.h" 40 #include "UI PerformanceMonitor.h"40 #include "UIVMActivityMonitor.h" 41 41 #include "UIResourceMonitor.h" 42 42 #include "UIMessageCenter.h" … … 327 327 QVector<CUnknown> m_objectList; 328 328 /** @} */ 329 CPerformanceCollector m_performance Monitor;329 CPerformanceCollector m_performanceCollector; 330 330 QMap<int, bool> m_columnVisible; 331 331 /** If true the table data and corresponding view is updated. Possibly set by host widget to true only … … 1135 1135 const ULONG iPeriod = 1; 1136 1136 const int iMetricSetupCount = 1; 1137 if (m_performance Monitor.isNull())1138 m_performance Monitor = uiCommon().virtualBox().GetPerformanceCollector();1137 if (m_performanceCollector.isNull()) 1138 m_performanceCollector = uiCommon().virtualBox().GetPerformanceCollector(); 1139 1139 for (int i = 0; i < m_itemList.size(); ++i) 1140 1140 m_nameList << "Guest/RAM/Usage*"; … … 1143 1143 m_nameList << "FS*"; 1144 1144 m_objectList = QVector<CUnknown>(m_nameList.size(), CUnknown()); 1145 m_performance Monitor.SetupMetrics(m_nameList, m_objectList, iPeriod, iMetricSetupCount);1145 m_performanceCollector.SetupMetrics(m_nameList, m_objectList, iPeriod, iMetricSetupCount); 1146 1146 } 1147 1147 … … 1156 1156 QVector<ULONG> aReturnDataLengths; 1157 1157 1158 QVector<LONG> returnData = m_performance Monitor.QueryMetricsData(m_nameList,1158 QVector<LONG> returnData = m_performanceCollector.QueryMetricsData(m_nameList, 1159 1159 m_objectList, 1160 1160 aReturnNames, … … 1273 1273 , m_pColumnVisibilityToggleMenu(0) 1274 1274 , m_pHostStatsWidget(0) 1275 , m_p ShowPerformanceMonitorAction(0)1275 , m_pVMActivityMonitorAction(0) 1276 1276 , m_fIsCurrentTool(true) 1277 1277 , m_iSortIndicatorWidth(0) … … 1334 1334 void UIResourceMonitorWidget::showEvent(QShowEvent *pEvent) 1335 1335 { 1336 if (m_p ShowPerformanceMonitorAction && m_pTableView)1337 m_p ShowPerformanceMonitorAction->setEnabled(m_pTableView->hasSelection());1336 if (m_pVMActivityMonitorAction && m_pTableView) 1337 m_pVMActivityMonitorAction->setEnabled(m_pTableView->hasSelection()); 1338 1338 1339 1339 QIWithRetranslateUI<QWidget>::showEvent(pEvent); … … 1438 1438 { 1439 1439 updateColumnsMenu(); 1440 m_p ShowPerformanceMonitorAction =1440 m_pVMActivityMonitorAction = 1441 1441 m_pActionPool->action(UIActionIndexMN_M_VMResourceMonitor_S_SwitchToMachinePerformance); 1442 1442 1443 if (m_p ShowPerformanceMonitorAction)1444 connect(m_p ShowPerformanceMonitorAction, &QAction::triggered, this, &UIResourceMonitorWidget::sltHandleShowPerformanceMonitor);1443 if (m_pVMActivityMonitorAction) 1444 connect(m_pVMActivityMonitorAction, &QAction::triggered, this, &UIResourceMonitorWidget::sltHandleShowVMActivityMonitor); 1445 1445 } 1446 1446 … … 1529 1529 1530 1530 QMenu menu; 1531 if (m_p ShowPerformanceMonitorAction)1532 menu.addAction(m_p ShowPerformanceMonitorAction);1531 if (m_pVMActivityMonitorAction) 1532 menu.addAction(m_pVMActivityMonitorAction); 1533 1533 1534 1534 menu.exec(m_pTableView->mapToGlobal(pos)); … … 1538 1538 { 1539 1539 Q_UNUSED(deselected); 1540 if (m_p ShowPerformanceMonitorAction)1541 m_p ShowPerformanceMonitorAction->setEnabled(!selected.isEmpty());1542 } 1543 1544 void UIResourceMonitorWidget::sltHandleShow PerformanceMonitor()1540 if (m_pVMActivityMonitorAction) 1541 m_pVMActivityMonitorAction->setEnabled(!selected.isEmpty()); 1542 } 1543 1544 void UIResourceMonitorWidget::sltHandleShowVMActivityMonitor() 1545 1545 { 1546 1546 if (!m_pTableView || !m_pModel) -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.h
r86233 r88071 84 84 void sltHandleHostStatsUpdate(const UIVMResourceMonitorHostStats &stats); 85 85 void sltHandleTableContextMenuRequest(const QPoint &pos); 86 void sltHandleShow PerformanceMonitor();86 void sltHandleShowVMActivityMonitor(); 87 87 void sltHandleTableSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); 88 88 … … 126 126 QMap<int, bool> m_columnVisible; 127 127 UIVMResourceMonitorHostStatsWidget *m_pHostStatsWidget; 128 QAction *m_p ShowPerformanceMonitorAction;128 QAction *m_pVMActivityMonitorAction; 129 129 /** @} */ 130 130 /** Indicates if this widget's host tool is current tool. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp
r87103 r88071 36 36 #include "UIMachineWindow.h" 37 37 #include "UIMessageCenter.h" 38 #include "UI PerformanceMonitor.h"38 #include "UIVMActivityMonitor.h" 39 39 #include "UISession.h" 40 40 #include "UIVMInformationDialog.h" … … 114 114 m_pTabWidget->setTabText(0, tr("Configuration &Details")); 115 115 m_pTabWidget->setTabText(1, tr("&Runtime Information")); 116 m_pTabWidget->setTabText(2, tr(" Performance &Monitor"));116 m_pTabWidget->setTabText(2, tr("VM &Activity")); 117 117 m_pTabWidget->setTabText(3, tr("&Guest Control")); 118 118 … … 214 214 215 215 /* Create Performance Monitor tab: */ 216 UI PerformanceMonitor *pPerformanceMonitorWidget =217 new UI PerformanceMonitor(EmbedTo_Dialog, this, m_pMachineWindow->machine(),216 UIVMActivityMonitor *pVMActivityMonitorWidget = 217 new UIVMActivityMonitor(EmbedTo_Dialog, this, m_pMachineWindow->machine(), 218 218 m_pMachineWindow->uisession()->actionPool()); 219 if (p PerformanceMonitorWidget)219 if (pVMActivityMonitorWidget) 220 220 { 221 221 connect(m_pMachineWindow->uisession(), &UISession::sigAdditionsStateChange, 222 p PerformanceMonitorWidget, &UIPerformanceMonitor::sltGuestAdditionsStateChange);223 m_tabs.insert(2, p PerformanceMonitorWidget);222 pVMActivityMonitorWidget, &UIVMActivityMonitor::sltGuestAdditionsStateChange); 223 m_tabs.insert(2, pVMActivityMonitorWidget); 224 224 m_pTabWidget->addTab(m_tabs.value(2), QString()); 225 225 }
Note:
See TracChangeset
for help on using the changeset viewer.