Changeset 88082 in vbox
- Timestamp:
- Mar 11, 2021 10:57:36 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
r86978 r88082 125 125 template<> SHARED_LIBRARY_STUFF bool canConvert<UIMediumFormat>(); 126 126 template<> SHARED_LIBRARY_STUFF bool canConvert<UISettingsDefs::RecordingMode>(); 127 template<> SHARED_LIBRARY_STUFF bool canConvert<VM ResourceMonitorColumn>();127 template<> SHARED_LIBRARY_STUFF bool canConvert<VMActivityOverviewColumn>(); 128 128 129 129 /* Declare COM canConvert specializations: */ … … 270 270 template<> SHARED_LIBRARY_STUFF QString toString(const UISettingsDefs::RecordingMode &enmRecordingMode); 271 271 template<> SHARED_LIBRARY_STUFF UISettingsDefs::RecordingMode fromString<UISettingsDefs::RecordingMode>(const QString &enmRecordingMode); 272 template<> SHARED_LIBRARY_STUFF QString toInternalString(const VM ResourceMonitorColumn &enmVMResourceMonitorColumn);273 template<> SHARED_LIBRARY_STUFF VM ResourceMonitorColumn fromInternalString<VMResourceMonitorColumn>(const QString &strVMResourceMonitorColumn);272 template<> SHARED_LIBRARY_STUFF QString toInternalString(const VMActivityOverviewColumn &enmVMActivityOverviewColumn); 273 template<> SHARED_LIBRARY_STUFF VMActivityOverviewColumn fromInternalString<VMActivityOverviewColumn>(const QString &strVMActivityOverviewColumn); 274 274 275 275 /* Declare COM conversion specializations: */ -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r88074 r88082 79 79 template<> bool canConvert<UIMediumFormat>() { return true; } 80 80 template<> bool canConvert<UISettingsDefs::RecordingMode>() { return true; } 81 template<> bool canConvert<VM ResourceMonitorColumn>(){ return true; };81 template<> bool canConvert<VMActivityOverviewColumn>(){ return true; }; 82 82 83 83 … … 2605 2605 } 2606 2606 2607 template<> QString toInternalString(const VM ResourceMonitorColumn &enmVMResourceMonitorColumn)2608 { 2609 QString strResult; 2610 switch (enmVM ResourceMonitorColumn)2611 { 2612 case VM ResourceMonitorColumn_Name: strResult = "VMName"; break;2613 case VM ResourceMonitorColumn_CPUGuestLoad: strResult = "CPUGuestLoad"; break;2614 case VM ResourceMonitorColumn_CPUVMMLoad: strResult = "CPUVMMLoad"; break;2615 case VM ResourceMonitorColumn_RAMUsedAndTotal: strResult = "RAMUsedAndTotal"; break;2616 case VM ResourceMonitorColumn_RAMUsedPercentage: strResult = "RAMUsedPercentage"; break;2617 case VM ResourceMonitorColumn_NetworkUpRate: strResult = "NetworkUpRate"; break;2618 case VM ResourceMonitorColumn_NetworkDownRate: strResult = "NetworkDownRate"; break;2619 case VM ResourceMonitorColumn_NetworkUpTotal: strResult = "NetworkUpTotal"; break;2620 case VM ResourceMonitorColumn_NetworkDownTotal: strResult = "NetworkDownTotal"; break;2621 case VM ResourceMonitorColumn_DiskIOReadRate: strResult = "DiskIOReadRate"; break;2622 case VM ResourceMonitorColumn_DiskIOWriteRate: strResult = "DiskIOWriteRate"; break;2623 case VM ResourceMonitorColumn_DiskIOReadTotal: strResult = "DiskIOReadTotal"; break;2624 case VM ResourceMonitorColumn_DiskIOWriteTotal: strResult = "DiskIOWriteTotal"; break;2625 case VM ResourceMonitorColumn_VMExits: strResult = "VMExits"; break;2607 template<> QString toInternalString(const VMActivityOverviewColumn &enmVMActivityOverviewColumn) 2608 { 2609 QString strResult; 2610 switch (enmVMActivityOverviewColumn) 2611 { 2612 case VMActivityOverviewColumn_Name: strResult = "VMName"; break; 2613 case VMActivityOverviewColumn_CPUGuestLoad: strResult = "CPUGuestLoad"; break; 2614 case VMActivityOverviewColumn_CPUVMMLoad: strResult = "CPUVMMLoad"; break; 2615 case VMActivityOverviewColumn_RAMUsedAndTotal: strResult = "RAMUsedAndTotal"; break; 2616 case VMActivityOverviewColumn_RAMUsedPercentage: strResult = "RAMUsedPercentage"; break; 2617 case VMActivityOverviewColumn_NetworkUpRate: strResult = "NetworkUpRate"; break; 2618 case VMActivityOverviewColumn_NetworkDownRate: strResult = "NetworkDownRate"; break; 2619 case VMActivityOverviewColumn_NetworkUpTotal: strResult = "NetworkUpTotal"; break; 2620 case VMActivityOverviewColumn_NetworkDownTotal: strResult = "NetworkDownTotal"; break; 2621 case VMActivityOverviewColumn_DiskIOReadRate: strResult = "DiskIOReadRate"; break; 2622 case VMActivityOverviewColumn_DiskIOWriteRate: strResult = "DiskIOWriteRate"; break; 2623 case VMActivityOverviewColumn_DiskIOReadTotal: strResult = "DiskIOReadTotal"; break; 2624 case VMActivityOverviewColumn_DiskIOWriteTotal: strResult = "DiskIOWriteTotal"; break; 2625 case VMActivityOverviewColumn_VMExits: strResult = "VMExits"; break; 2626 2626 default: 2627 2627 { 2628 AssertMsgFailed(("No text for VM Resource Monitor Column=%d", enmVM ResourceMonitorColumn));2628 AssertMsgFailed(("No text for VM Resource Monitor Column=%d", enmVMActivityOverviewColumn)); 2629 2629 break; 2630 2630 } … … 2633 2633 } 2634 2634 2635 template<> VM ResourceMonitorColumn fromInternalString<VMResourceMonitorColumn>(const QString &strVMResourceMonitorColumn)2636 { 2637 QStringList keys; QList<VM ResourceMonitorColumn> values;2638 keys << "VMName"; values << VM ResourceMonitorColumn_Name;2639 keys << "CPUGuestLoad"; values << VM ResourceMonitorColumn_CPUGuestLoad;2640 keys << "CPUVMMLoad"; values << VM ResourceMonitorColumn_CPUVMMLoad;2641 keys << "RAMUsedAndTotal"; values << VM ResourceMonitorColumn_RAMUsedAndTotal;2642 keys << "RAMUsedPercentage"; values << VM ResourceMonitorColumn_RAMUsedPercentage;2643 keys << "NetworkUpRate"; values << VM ResourceMonitorColumn_NetworkUpRate;2644 keys << "NetworkDownRate"; values << VM ResourceMonitorColumn_NetworkDownRate;2645 keys << "NetworkUpTotal"; values << VM ResourceMonitorColumn_NetworkUpTotal;2646 keys << "NetworkDownTotal"; values << VM ResourceMonitorColumn_NetworkDownTotal;2647 keys << "DiskIOReadRate"; values << VM ResourceMonitorColumn_DiskIOReadRate;2648 keys << "DiskIOWriteRate"; values << VM ResourceMonitorColumn_DiskIOWriteRate;2649 keys << "DiskIOReadTotal"; values << VM ResourceMonitorColumn_DiskIOReadTotal;2650 keys << "DiskIOWriteTotal"; values << VM ResourceMonitorColumn_DiskIOWriteTotal;2651 keys << "VMExits"; values << VM ResourceMonitorColumn_VMExits;2652 if (!keys.contains(strVM ResourceMonitorColumn, Qt::CaseInsensitive))2653 return VM ResourceMonitorColumn_Max;2635 template<> VMActivityOverviewColumn fromInternalString<VMActivityOverviewColumn>(const QString &strVMActivityOverviewColumn) 2636 { 2637 QStringList keys; QList<VMActivityOverviewColumn> values; 2638 keys << "VMName"; values << VMActivityOverviewColumn_Name; 2639 keys << "CPUGuestLoad"; values << VMActivityOverviewColumn_CPUGuestLoad; 2640 keys << "CPUVMMLoad"; values << VMActivityOverviewColumn_CPUVMMLoad; 2641 keys << "RAMUsedAndTotal"; values << VMActivityOverviewColumn_RAMUsedAndTotal; 2642 keys << "RAMUsedPercentage"; values << VMActivityOverviewColumn_RAMUsedPercentage; 2643 keys << "NetworkUpRate"; values << VMActivityOverviewColumn_NetworkUpRate; 2644 keys << "NetworkDownRate"; values << VMActivityOverviewColumn_NetworkDownRate; 2645 keys << "NetworkUpTotal"; values << VMActivityOverviewColumn_NetworkUpTotal; 2646 keys << "NetworkDownTotal"; values << VMActivityOverviewColumn_NetworkDownTotal; 2647 keys << "DiskIOReadRate"; values << VMActivityOverviewColumn_DiskIOReadRate; 2648 keys << "DiskIOWriteRate"; values << VMActivityOverviewColumn_DiskIOWriteRate; 2649 keys << "DiskIOReadTotal"; values << VMActivityOverviewColumn_DiskIOReadTotal; 2650 keys << "DiskIOWriteTotal"; values << VMActivityOverviewColumn_DiskIOWriteTotal; 2651 keys << "VMExits"; values << VMActivityOverviewColumn_VMExits; 2652 if (!keys.contains(strVMActivityOverviewColumn, Qt::CaseInsensitive)) 2653 return VMActivityOverviewColumn_Max; 2654 2654 /* Corresponding format for known words: */ 2655 return values.at(keys.indexOf(QRegExp(strVM ResourceMonitorColumn, Qt::CaseInsensitive)));2656 } 2655 return values.at(keys.indexOf(QRegExp(strVMActivityOverviewColumn, Qt::CaseInsensitive))); 2656 } -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r88074 r88082 1074 1074 1075 1075 1076 /** Manager UI: VM resource MonitorColumn types.1076 /** Manager UI: VM Activity Overview Column types. 1077 1077 * @note The first element must be 0 and the rest must be consecutive */ 1078 enum VM ResourceMonitorColumn1079 { 1080 VM ResourceMonitorColumn_Name = 0,1081 VM ResourceMonitorColumn_CPUGuestLoad,1082 VM ResourceMonitorColumn_CPUVMMLoad,1083 VM ResourceMonitorColumn_RAMUsedAndTotal,1084 VM ResourceMonitorColumn_RAMUsedPercentage,1085 VM ResourceMonitorColumn_NetworkUpRate,1086 VM ResourceMonitorColumn_NetworkDownRate,1087 VM ResourceMonitorColumn_NetworkUpTotal,1088 VM ResourceMonitorColumn_NetworkDownTotal,1089 VM ResourceMonitorColumn_DiskIOReadRate,1090 VM ResourceMonitorColumn_DiskIOWriteRate,1091 VM ResourceMonitorColumn_DiskIOReadTotal,1092 VM ResourceMonitorColumn_DiskIOWriteTotal,1093 VM ResourceMonitorColumn_VMExits,1094 VM ResourceMonitorColumn_Max1078 enum VMActivityOverviewColumn 1079 { 1080 VMActivityOverviewColumn_Name = 0, 1081 VMActivityOverviewColumn_CPUGuestLoad, 1082 VMActivityOverviewColumn_CPUVMMLoad, 1083 VMActivityOverviewColumn_RAMUsedAndTotal, 1084 VMActivityOverviewColumn_RAMUsedPercentage, 1085 VMActivityOverviewColumn_NetworkUpRate, 1086 VMActivityOverviewColumn_NetworkDownRate, 1087 VMActivityOverviewColumn_NetworkUpTotal, 1088 VMActivityOverviewColumn_NetworkDownTotal, 1089 VMActivityOverviewColumn_DiskIOReadRate, 1090 VMActivityOverviewColumn_DiskIOWriteRate, 1091 VMActivityOverviewColumn_DiskIOReadTotal, 1092 VMActivityOverviewColumn_DiskIOWriteTotal, 1093 VMActivityOverviewColumn_VMExits, 1094 VMActivityOverviewColumn_Max 1095 1095 }; 1096 1096 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r86977 r88082 4644 4644 } 4645 4645 4646 void UIExtraDataManager::setVM ResourceMonitorHiddenColumnList(const QStringList &hiddenColumnList)4646 void UIExtraDataManager::setVMActivityOverviewHiddenColumnList(const QStringList &hiddenColumnList) 4647 4647 { 4648 4648 setExtraDataStringList(GUI_VMResourceManager_HiddenColumns, hiddenColumnList); 4649 4649 } 4650 4650 4651 QStringList UIExtraDataManager::VM ResourceMonitorHiddenColumnList()4651 QStringList UIExtraDataManager::VMActivityOverviewHiddenColumnList() 4652 4652 { 4653 4653 return extraDataStringList(GUI_VMResourceManager_HiddenColumns); -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r86977 r88082 798 798 /** @name Manager UI: VM Resource Monitor 799 799 * @{ */ 800 void setVM ResourceMonitorHiddenColumnList(const QStringList &hiddenColumnList);801 QStringList VM ResourceMonitorHiddenColumnList();800 void setVMActivityOverviewHiddenColumnList(const QStringList &hiddenColumnList); 801 QStringList VMActivityOverviewHiddenColumnList(); 802 802 /** @} */ 803 803 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp
r88074 r88082 355 355 356 356 /** Simple action extension, used as 'Show VM Resource Monitor' action class. */ 357 class UIActionToggleManagerToolsGlobalShowVM ResourceMonitor: public UIActionToggle358 { 359 Q_OBJECT; 360 361 public: 362 363 /** Constructs action passing @a pParent to the base-class. */ 364 UIActionToggleManagerToolsGlobalShowVM ResourceMonitor(UIActionPool *pParent)357 class UIActionToggleManagerToolsGlobalShowVMActivityOverview : public UIActionToggle 358 { 359 Q_OBJECT; 360 361 public: 362 363 /** Constructs action passing @a pParent to the base-class. */ 364 UIActionToggleManagerToolsGlobalShowVMActivityOverview(UIActionPool *pParent) 365 365 : UIActionToggle(pParent) 366 366 { … … 376 376 virtual QString shortcutExtraDataID() const /* override */ 377 377 { 378 return QString("ToolsGlobalVM ResourceMonitor");378 return QString("ToolsGlobalVMActivityOverview"); 379 379 } 380 380 … … 3385 3385 3386 3386 /** Menu action extension, used as 'Resources' menu class. */ 3387 class UIActionMenuVM ResourceMonitor: public UIActionMenu3388 { 3389 Q_OBJECT; 3390 3391 public: 3392 3393 /** Constructs action passing @a pParent to the base-class. */ 3394 UIActionMenuVM ResourceMonitor(UIActionPool *pParent)3387 class UIActionMenuVMActivityOverview : public UIActionMenu 3388 { 3389 Q_OBJECT; 3390 3391 public: 3392 3393 /** Constructs action passing @a pParent to the base-class. */ 3394 UIActionMenuVMActivityOverview(UIActionPool *pParent) 3395 3395 : UIActionMenu(pParent) 3396 3396 {} … … 3401 3401 virtual QString shortcutExtraDataID() const /* override */ 3402 3402 { 3403 return QString("VM ResourceMonitorMenu");3403 return QString("VMActivityOverviewMenu"); 3404 3404 } 3405 3405 … … 3412 3412 3413 3413 /** Menu action extension, used as 'Columns' menu class. */ 3414 class UIActionMenuManagerVM ResourceMonitorColumns : public UIActionMenu3415 { 3416 Q_OBJECT; 3417 3418 public: 3419 3420 /** Constructs action passing @a pParent to the base-class. */ 3421 UIActionMenuManagerVM ResourceMonitorColumns(UIActionPool *pParent)3414 class UIActionMenuManagerVMActivityOverviewColumns : public UIActionMenu 3415 { 3416 Q_OBJECT; 3417 3418 public: 3419 3420 /** Constructs action passing @a pParent to the base-class. */ 3421 UIActionMenuManagerVMActivityOverviewColumns(UIActionPool *pParent) 3422 3422 : UIActionMenu(pParent, 3423 3423 ":/resources_monitor_columns_32px.png", ":/resources_monitor_columns_16px.png", … … 3432 3432 virtual QString shortcutExtraDataID() const /* override */ 3433 3433 { 3434 return QString("VM ResourceMonitorColumns");3434 return QString("VMActivityOverviewColumns"); 3435 3435 } 3436 3436 … … 3447 3447 3448 3448 /** Simple action extension, used as 'Switch to Machine Performance' action class. */ 3449 class UIActionMenuManagerVM ResourceMonitorSwitchToMachinePerformance : public UIActionSimple3450 { 3451 Q_OBJECT; 3452 3453 public: 3454 3455 /** Constructs action passing @a pParent to the base-class. */ 3456 UIActionMenuManagerVM ResourceMonitorSwitchToMachinePerformance(UIActionPool *pParent)3449 class UIActionMenuManagerVMActivityOverviewSwitchToMachinePerformance : public UIActionSimple 3450 { 3451 Q_OBJECT; 3452 3453 public: 3454 3455 /** Constructs action passing @a pParent to the base-class. */ 3456 UIActionMenuManagerVMActivityOverviewSwitchToMachinePerformance(UIActionPool *pParent) 3457 3457 : UIActionSimple(pParent, 3458 3458 ":/resources_monitor_jump_to_vm_32px.png", ":/resources_monitor_jump_to_vm_16px.png", … … 3467 3467 virtual QString shortcutExtraDataID() const /* override */ 3468 3468 { 3469 return QString("VM ResourceMonitorSwitchToMachinePerformance");3469 return QString("VMActivityOverviewSwitchToMachinePerformance"); 3470 3470 } 3471 3471 … … 3503 3503 m_pool[UIActionIndexMN_M_File_M_Tools_T_NetworkManager] = new UIActionToggleManagerToolsGlobalShowNetworkManager(this); 3504 3504 m_pool[UIActionIndexMN_M_File_M_Tools_T_CloudProfileManager] = new UIActionToggleManagerToolsGlobalShowCloudProfileManager(this); 3505 m_pool[UIActionIndexMN_M_File_M_Tools_T_VM ResourceMonitor] = new UIActionToggleManagerToolsGlobalShowVMResourceMonitor(this);3505 m_pool[UIActionIndexMN_M_File_M_Tools_T_VMActivityOverview] = new UIActionToggleManagerToolsGlobalShowVMActivityOverview(this); 3506 3506 #ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI 3507 3507 m_pool[UIActionIndexMN_M_File_S_ShowExtraDataManager] = new UIActionSimpleManagerFileShowExtraDataManager(this); … … 3650 3650 3651 3651 /* VM resource Monitor actions: */ 3652 m_pool[UIActionIndexMN_M_VM ResourceMonitor] = new UIActionMenuVMResourceMonitor(this);3653 m_pool[UIActionIndexMN_M_VM ResourceMonitor_M_Columns] = new UIActionMenuManagerVMResourceMonitorColumns(this);3654 m_pool[UIActionIndexMN_M_VM ResourceMonitor_S_SwitchToMachinePerformance] = new UIActionMenuManagerVMResourceMonitorSwitchToMachinePerformance(this);3652 m_pool[UIActionIndexMN_M_VMActivityOverview] = new UIActionMenuVMActivityOverview(this); 3653 m_pool[UIActionIndexMN_M_VMActivityOverview_M_Columns] = new UIActionMenuManagerVMActivityOverviewColumns(this); 3654 m_pool[UIActionIndexMN_M_VMActivityOverview_S_SwitchToMachinePerformance] = new UIActionMenuManagerVMActivityOverviewSwitchToMachinePerformance(this); 3655 3655 3656 3656 /* 'File' action groups: */ … … 3661 3661 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_NetworkManager)); 3662 3662 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_CloudProfileManager)); 3663 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_VM ResourceMonitor));3663 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_VMActivityOverview)); 3664 3664 3665 3665 /* 'Group' action groups: */ … … 3703 3703 m_menuUpdateHandlers[UIActionIndexMN_M_CloudConsoleWindow].ptfm = &UIActionPoolManager::updateMenuCloudConsoleWindow; 3704 3704 m_menuUpdateHandlers[UIActionIndexMN_M_CloudConsole].ptfm = &UIActionPoolManager::updateMenuCloudConsole; 3705 m_menuUpdateHandlers[UIActionIndexMN_M_VM ResourceMonitor].ptfm = &UIActionPoolManager::updateMenuVMResourceMonitor;3705 m_menuUpdateHandlers[UIActionIndexMN_M_VMActivityOverview].ptfm = &UIActionPoolManager::updateMenuVMActivityOverview; 3706 3706 m_menuUpdateHandlers[UIActionIndexMN_M_Snapshot].ptfm = &UIActionPoolManager::updateMenuSnapshot; 3707 3707 … … 3788 3788 updateMenuCloud(); 3789 3789 /* 'VM Resource Monitor' menu: */ 3790 addMenu(m_mainMenus, action(UIActionIndexMN_M_VM ResourceMonitor));3791 updateMenuVM ResourceMonitor();3790 addMenu(m_mainMenus, action(UIActionIndexMN_M_VMActivityOverview)); 3791 updateMenuVMActivityOverview(); 3792 3792 3793 3793 /* 'Snapshot' menu: */ … … 4015 4015 pMenu->addAction(action(UIActionIndexMN_M_File_M_Tools_T_NetworkManager)); 4016 4016 pMenu->addAction(action(UIActionIndexMN_M_File_M_Tools_T_CloudProfileManager)); 4017 pMenu->addAction(action(UIActionIndexMN_M_File_M_Tools_T_VM ResourceMonitor));4017 pMenu->addAction(action(UIActionIndexMN_M_File_M_Tools_T_VMActivityOverview)); 4018 4018 4019 4019 /* Mark menu as valid: */ … … 4482 4482 } 4483 4483 4484 void UIActionPoolManager::updateMenuVM ResourceMonitor()4484 void UIActionPoolManager::updateMenuVMActivityOverview() 4485 4485 { 4486 4486 /* Update corresponding menu: */ 4487 updateMenuVM ResourceMonitorWrapper(action(UIActionIndexMN_M_VMResourceMonitor)->menu());4487 updateMenuVMActivityOverviewWrapper(action(UIActionIndexMN_M_VMActivityOverview)->menu()); 4488 4488 4489 4489 /* Mark menu as valid: */ 4490 m_invalidations.remove(UIActionIndexMN_M_VM ResourceMonitor);4490 m_invalidations.remove(UIActionIndexMN_M_VMActivityOverview); 4491 4491 } 4492 4492 4493 void UIActionPoolManager::updateMenuVM ResourceMonitorWrapper(UIMenu *pMenu)4493 void UIActionPoolManager::updateMenuVMActivityOverviewWrapper(UIMenu *pMenu) 4494 4494 { 4495 4495 /* Clear contents: */ 4496 4496 pMenu->clear(); 4497 addAction(pMenu, action(UIActionIndexMN_M_VM ResourceMonitor_M_Columns));4498 addAction(pMenu, action(UIActionIndexMN_M_VM ResourceMonitor_S_SwitchToMachinePerformance));4497 addAction(pMenu, action(UIActionIndexMN_M_VMActivityOverview_M_Columns)); 4498 addAction(pMenu, action(UIActionIndexMN_M_VMActivityOverview_S_SwitchToMachinePerformance)); 4499 4499 } 4500 4500 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h
r87516 r88082 45 45 UIActionIndexMN_M_File_M_Tools_T_NetworkManager, 46 46 UIActionIndexMN_M_File_M_Tools_T_CloudProfileManager, 47 UIActionIndexMN_M_File_M_Tools_T_VM ResourceMonitor,47 UIActionIndexMN_M_File_M_Tools_T_VMActivityOverview, 48 48 #ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI 49 49 UIActionIndexMN_M_File_S_ShowExtraDataManager, … … 191 191 192 192 /* VM Resource Monitor actions: */ 193 UIActionIndexMN_M_VM ResourceMonitor,194 UIActionIndexMN_M_VM ResourceMonitor_M_Columns,195 UIActionIndexMN_M_VM ResourceMonitor_S_SwitchToMachinePerformance,193 UIActionIndexMN_M_VMActivityOverview, 194 UIActionIndexMN_M_VMActivityOverview_M_Columns, 195 UIActionIndexMN_M_VMActivityOverview_S_SwitchToMachinePerformance, 196 196 197 197 /* Maximum index: */ … … 299 299 300 300 /** Updates 'VM Resource Monitor' menu. */ 301 void updateMenuVM ResourceMonitor();301 void updateMenuVMActivityOverview(); 302 302 /** Updates 'VM Resource Monitor' @a pMenu. */ 303 void updateMenuVM ResourceMonitorWrapper(UIMenu *pMenu);303 void updateMenuVMActivityOverviewWrapper(UIMenu *pMenu); 304 304 305 305 /** Updates 'Snapshot' menu. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.cpp
r88074 r88082 206 206 { 207 207 /* Create VM Resource Monitor: */ 208 m_pPaneResourceMonitor = new UI ResourceMonitorWidget(EmbedTo_Stack, m_pActionPool, false /* show toolbar */);208 m_pPaneResourceMonitor = new UIVMActivityOverviewWidget(EmbedTo_Stack, m_pActionPool, false /* show toolbar */); 209 209 AssertPtrReturnVoid(m_pPaneResourceMonitor); 210 210 { … … 216 216 /* Configure pane: */ 217 217 m_pPaneResourceMonitor->setProperty("ToolType", QVariant::fromValue(UIToolType_VMActivityOverview)); 218 connect(m_pPaneResourceMonitor, &UI ResourceMonitorWidget::sigSwitchToMachinePerformancePane,218 connect(m_pPaneResourceMonitor, &UIVMActivityOverviewWidget::sigSwitchToMachinePerformancePane, 219 219 this, &UIToolPaneGlobal::sigSwitchToMachinePerformancePane); 220 220 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.h
r87354 r88082 37 37 class UIMediumManagerWidget; 38 38 class UINetworkManagerWidget; 39 class UI ResourceMonitorWidget;39 class UIVMActivityOverviewWidget; 40 40 class UIVirtualMachineItem; 41 41 class UIWelcomePane; … … 104 104 UICloudProfileManagerWidget *m_pPaneCloud; 105 105 /** Holds the VM Resource Monitor instance. */ 106 UI ResourceMonitorWidget*m_pPaneResourceMonitor;106 UIVMActivityOverviewWidget *m_pPaneResourceMonitor; 107 107 108 108 /** Holds whether this pane is active. */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r88074 r88082 3112 3112 /* Determine whether Resources menu should be visible: */ 3113 3113 const bool fResourcesMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == UIToolType_VMActivityOverview; 3114 actionPool()->action(UIActionIndexMN_M_VM ResourceMonitor)->setVisible(fResourcesMenuShown);3114 actionPool()->action(UIActionIndexMN_M_VMActivityOverview)->setVisible(fResourcesMenuShown); 3115 3115 3116 3116 /* Determine whether Snapshots menu should be visible: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r88074 r88082 843 843 case UIToolType_VMActivityOverview: 844 844 { 845 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_VM ResourceMonitor_M_Columns));846 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_VM ResourceMonitor_S_SwitchToMachinePerformance));845 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_VMActivityOverview_M_Columns)); 846 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_VMActivityOverview_S_SwitchToMachinePerformance)); 847 847 QToolButton *pButton = 848 qobject_cast<QToolButton*>(m_pToolBar->widgetForAction(actionPool()->action(UIActionIndexMN_M_VM ResourceMonitor_M_Columns)));848 qobject_cast<QToolButton*>(m_pToolBar->widgetForAction(actionPool()->action(UIActionIndexMN_M_VMActivityOverview_M_Columns))); 849 849 if (pButton) 850 850 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp
r88074 r88082 248 248 actions[UIToolType_Network] = actionPool()->action(UIActionIndexMN_M_File_M_Tools_T_NetworkManager); 249 249 actions[UIToolType_Cloud] = actionPool()->action(UIActionIndexMN_M_File_M_Tools_T_CloudProfileManager); 250 actions[UIToolType_VMActivityOverview] = actionPool()->action(UIActionIndexMN_M_File_M_Tools_T_VM ResourceMonitor);250 actions[UIToolType_VMActivityOverview] = actionPool()->action(UIActionIndexMN_M_File_M_Tools_T_VMActivityOverview); 251 251 if (actions.contains(enmType)) 252 252 actions.value(enmType)->setChecked(true); -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.cpp
r88081 r88082 67 67 68 68 /********************************************************************************************************************************* 69 * Class UIVM ResourceMonitorDoughnutChart definition. *69 * Class UIVMActivityOverviewDoughnutChart definition. * 70 70 *********************************************************************************************************************************/ 71 71 72 class UIVM ResourceMonitorDoughnutChart : public QWidget72 class UIVMActivityOverviewDoughnutChart : public QWidget 73 73 { 74 74 … … 77 77 public: 78 78 79 UIVM ResourceMonitorDoughnutChart(QWidget *pParent = 0);79 UIVMActivityOverviewDoughnutChart(QWidget *pParent = 0); 80 80 void updateData(quint64 iData0, quint64 iData1); 81 81 void setChartColors(const QColor &color0, const QColor &color1); … … 103 103 104 104 /********************************************************************************************************************************* 105 * Class UIVM ResourceMonitorHostStats definition. *105 * Class UIVMActivityOverviewHostStats definition. * 106 106 *********************************************************************************************************************************/ 107 107 108 class UIVM ResourceMonitorHostStats108 class UIVMActivityOverviewHostStats 109 109 { 110 110 111 111 public: 112 112 113 UIVM ResourceMonitorHostStats();113 UIVMActivityOverviewHostStats(); 114 114 quint64 m_iCPUUserLoad; 115 115 quint64 m_iCPUKernelLoad; … … 125 125 126 126 /********************************************************************************************************************************* 127 * Class UIVM ResourceMonitorHostStatsWidget definition. *127 * Class UIVMActivityOverviewHostStatsWidget definition. * 128 128 *********************************************************************************************************************************/ 129 129 130 class UIVM ResourceMonitorHostStatsWidget : public QIWithRetranslateUI<QWidget>130 class UIVMActivityOverviewHostStatsWidget : public QIWithRetranslateUI<QWidget> 131 131 { 132 132 … … 135 135 public: 136 136 137 UIVM ResourceMonitorHostStatsWidget(QWidget *pParent = 0);138 void setHostStats(const UIVM ResourceMonitorHostStats &hostStats);137 UIVMActivityOverviewHostStatsWidget(QWidget *pParent = 0); 138 void setHostStats(const UIVMActivityOverviewHostStats &hostStats); 139 139 140 140 protected: … … 148 148 void updateLabels(); 149 149 150 UIVM ResourceMonitorDoughnutChart *m_pHostCPUChart;151 UIVM ResourceMonitorDoughnutChart *m_pHostRAMChart;152 UIVM ResourceMonitorDoughnutChart *m_pHostFSChart;150 UIVMActivityOverviewDoughnutChart *m_pHostCPUChart; 151 UIVMActivityOverviewDoughnutChart *m_pHostRAMChart; 152 UIVMActivityOverviewDoughnutChart *m_pHostFSChart; 153 153 QLabel *m_pCPUTitleLabel; 154 154 QLabel *m_pCPUUserLabel; … … 167 167 QColor m_RAMFreeColor; 168 168 QColor m_RAMUsedColor; 169 UIVM ResourceMonitorHostStats m_hostStats;169 UIVMActivityOverviewHostStats m_hostStats; 170 170 }; 171 171 172 172 173 173 /********************************************************************************************************************************* 174 * Class UIVM ResourceMonitorTableView definition. *174 * Class UIVMActivityOverviewTableView definition. * 175 175 *********************************************************************************************************************************/ 176 176 /** A QTableView extension so manage the column width a bit better than what Qt offers out of box. */ 177 class UIVM ResourceMonitorTableView : public QTableView177 class UIVMActivityOverviewTableView : public QTableView 178 178 { 179 179 Q_OBJECT; … … 185 185 public: 186 186 187 UIVM ResourceMonitorTableView(QWidget *pParent = 0);187 UIVMActivityOverviewTableView(QWidget *pParent = 0); 188 188 void setMinimumColumnWidths(const QMap<int, int>& widths); 189 189 void updateColumVisibility(); … … 209 209 }; 210 210 211 /** Each instance of UIVM ResourceMonitorItem corresponds to a running vm whose stats are displayed.211 /** Each instance of UIVMActivityOverviewItem corresponds to a running vm whose stats are displayed. 212 212 * they are owned my the model. */ 213 213 /********************************************************************************************************************************* 214 * Class UIVM ResourceMonitorItem definition. *214 * Class UIVMActivityOverviewItem definition. * 215 215 *********************************************************************************************************************************/ 216 class UI ResourceMonitorItem216 class UIActivityOverviewItem 217 217 { 218 218 public: 219 UI ResourceMonitorItem(const QUuid &uid, const QString &strVMName);220 UI ResourceMonitorItem(const QUuid &uid);221 UI ResourceMonitorItem();222 ~UI ResourceMonitorItem();223 bool operator==(const UI ResourceMonitorItem& other) const;219 UIActivityOverviewItem(const QUuid &uid, const QString &strVMName); 220 UIActivityOverviewItem(const QUuid &uid); 221 UIActivityOverviewItem(); 222 ~UIActivityOverviewItem(); 223 bool operator==(const UIActivityOverviewItem& other) const; 224 224 bool isWithGuestAdditions(); 225 225 … … 259 259 }; 260 260 261 Q_DECLARE_METATYPE(UI ResourceMonitorItem);262 263 264 /********************************************************************************************************************************* 265 * Class UIVM ResourceMonitorProxyModel definition. *261 Q_DECLARE_METATYPE(UIActivityOverviewItem); 262 263 264 /********************************************************************************************************************************* 265 * Class UIVMActivityOverviewProxyModel definition. * 266 266 *********************************************************************************************************************************/ 267 class UI ResourceMonitorProxyModel : public QSortFilterProxyModel267 class UIActivityOverviewProxyModel : public QSortFilterProxyModel 268 268 { 269 269 … … 272 272 public: 273 273 274 UI ResourceMonitorProxyModel(QObject *parent = 0);274 UIActivityOverviewProxyModel(QObject *parent = 0); 275 275 void dataUpdate(); 276 276 }; … … 278 278 279 279 /********************************************************************************************************************************* 280 * Class UI ResourceMonitorModel definition. *280 * Class UIActivityOverviewModel definition. * 281 281 *********************************************************************************************************************************/ 282 class UI ResourceMonitorModel : public QAbstractTableModel282 class UIActivityOverviewModel : public QAbstractTableModel 283 283 { 284 284 Q_OBJECT; … … 287 287 288 288 void sigDataUpdate(); 289 void sigHostStatsUpdate(const UIVM ResourceMonitorHostStats &stats);289 void sigHostStatsUpdate(const UIVMActivityOverviewHostStats &stats); 290 290 291 291 public: 292 292 293 UI ResourceMonitorModel(QObject *parent = 0);293 UIActivityOverviewModel(QObject *parent = 0); 294 294 int rowCount(const QModelIndex &parent = QModelIndex()) const /* override */; 295 295 int columnCount(const QModelIndex &parent = QModelIndex()) const /* override */; … … 319 319 void getHostRAMStats(); 320 320 321 QVector<UI ResourceMonitorItem> m_itemList;321 QVector<UIActivityOverviewItem> m_itemList; 322 322 QMap<int, QString> m_columnTitles; 323 323 QTimer *m_pTimer; … … 332 332 * when the widget is visible in the main UI. */ 333 333 bool m_fShouldUpdate; 334 UIVM ResourceMonitorHostStats m_hostStats;335 /** Maximum length of string length of data displayed in column. Updated in UI ResourceMonitorModel::data(..). */334 UIVMActivityOverviewHostStats m_hostStats; 335 /** Maximum length of string length of data displayed in column. Updated in UIActivityOverviewModel::data(..). */ 336 336 mutable QMap<int, int> m_columnDataMaxLength; 337 337 }; … … 339 339 340 340 /********************************************************************************************************************************* 341 * UIVM ResourceMonitorDelegate definition. *341 * UIVMActivityOverviewDelegate definition. * 342 342 *********************************************************************************************************************************/ 343 343 /** A QItemDelegate child class to disable dashed lines drawn around selected cells in QTableViews */ 344 class UIVM ResourceMonitorDelegate : public QItemDelegate344 class UIVMActivityOverviewDelegate : public QItemDelegate 345 345 { 346 346 … … 354 354 355 355 /********************************************************************************************************************************* 356 * Class UIVM ResourceMonitorDoughnutChart implementation. *356 * Class UIVMActivityOverviewDoughnutChart implementation. * 357 357 *********************************************************************************************************************************/ 358 UIVM ResourceMonitorDoughnutChart::UIVMResourceMonitorDoughnutChart(QWidget *pParent /* = 0 */)358 UIVMActivityOverviewDoughnutChart::UIVMActivityOverviewDoughnutChart(QWidget *pParent /* = 0 */) 359 359 :QWidget(pParent) 360 360 , m_iData0(0) … … 365 365 } 366 366 367 void UIVM ResourceMonitorDoughnutChart::updateData(quint64 iData0, quint64 iData1)367 void UIVMActivityOverviewDoughnutChart::updateData(quint64 iData0, quint64 iData1) 368 368 { 369 369 m_iData0 = iData0; … … 372 372 } 373 373 374 void UIVM ResourceMonitorDoughnutChart::setChartColors(const QColor &color0, const QColor &color1)374 void UIVMActivityOverviewDoughnutChart::setChartColors(const QColor &color0, const QColor &color1) 375 375 { 376 376 m_color0 = color0; … … 378 378 } 379 379 380 void UIVM ResourceMonitorDoughnutChart::setChartCenterString(const QString &strCenter)380 void UIVMActivityOverviewDoughnutChart::setChartCenterString(const QString &strCenter) 381 381 { 382 382 m_strCenter = strCenter; 383 383 } 384 384 385 void UIVM ResourceMonitorDoughnutChart::setDataMaximum(quint64 iMax)385 void UIVMActivityOverviewDoughnutChart::setDataMaximum(quint64 iMax) 386 386 { 387 387 m_iDataMaximum = iMax; 388 388 } 389 389 390 void UIVM ResourceMonitorDoughnutChart::paintEvent(QPaintEvent *pEvent)390 void UIVMActivityOverviewDoughnutChart::paintEvent(QPaintEvent *pEvent) 391 391 { 392 392 QWidget::paintEvent(pEvent); … … 413 413 414 414 /********************************************************************************************************************************* 415 * Class UIVM ResourceMonitorHostStatsWidget implementation. *415 * Class UIVMActivityOverviewHostStatsWidget implementation. * 416 416 *********************************************************************************************************************************/ 417 417 418 UIVM ResourceMonitorHostStatsWidget::UIVMResourceMonitorHostStatsWidget(QWidget *pParent /* = 0 */)418 UIVMActivityOverviewHostStatsWidget::UIVMActivityOverviewHostStatsWidget(QWidget *pParent /* = 0 */) 419 419 : QIWithRetranslateUI<QWidget>(pParent) 420 420 , m_pHostCPUChart(0) … … 442 442 } 443 443 444 void UIVM ResourceMonitorHostStatsWidget::setHostStats(const UIVMResourceMonitorHostStats &hostStats)444 void UIVMActivityOverviewHostStatsWidget::setHostStats(const UIVMActivityOverviewHostStats &hostStats) 445 445 { 446 446 m_hostStats = hostStats; … … 459 459 { 460 460 quint64 iUsedRamPer = 100 * (iUsedRAM / (float) m_hostStats.m_iRAMTotal); 461 QString strCenter = QString("%1%\n%2").arg(iUsedRamPer).arg(UI ResourceMonitorWidget::tr("Used"));461 QString strCenter = QString("%1%\n%2").arg(iUsedRamPer).arg(UIVMActivityOverviewWidget::tr("Used")); 462 462 m_pHostRAMChart->setChartCenterString(strCenter); 463 463 } … … 471 471 { 472 472 quint64 iUsedFSPer = 100 * (iUsedFS / (float) m_hostStats.m_iFSTotal); 473 QString strCenter = QString("%1%\n%2").arg(iUsedFSPer).arg(UI ResourceMonitorWidget::tr("Used"));473 QString strCenter = QString("%1%\n%2").arg(iUsedFSPer).arg(UIVMActivityOverviewWidget::tr("Used")); 474 474 m_pHostFSChart->setChartCenterString(strCenter); 475 475 } … … 479 479 } 480 480 481 void UIVM ResourceMonitorHostStatsWidget::retranslateUi()481 void UIVMActivityOverviewHostStatsWidget::retranslateUi() 482 482 { 483 483 updateLabels(); 484 484 } 485 485 486 void UIVM ResourceMonitorHostStatsWidget::addVerticalLine(QHBoxLayout *pLayout)486 void UIVMActivityOverviewHostStatsWidget::addVerticalLine(QHBoxLayout *pLayout) 487 487 { 488 488 QFrame *pLine = new QFrame; … … 492 492 } 493 493 494 void UIVM ResourceMonitorHostStatsWidget::prepare()494 void UIVMActivityOverviewHostStatsWidget::prepare() 495 495 { 496 496 QHBoxLayout *pLayout = new QHBoxLayout; … … 518 518 pCPULabelsLayout->setSpacing(0); 519 519 /* Host CPU chart widget: */ 520 m_pHostCPUChart = new UIVM ResourceMonitorDoughnutChart;520 m_pHostCPUChart = new UIVMActivityOverviewDoughnutChart; 521 521 if (m_pHostCPUChart) 522 522 { … … 547 547 pRAMLabelsLayout->addWidget(m_pRAMTotalLabel); 548 548 549 m_pHostRAMChart = new UIVM ResourceMonitorDoughnutChart;549 m_pHostRAMChart = new UIVMActivityOverviewDoughnutChart; 550 550 if (m_pHostRAMChart) 551 551 { … … 574 574 pFSLabelsLayout->addWidget(m_pFSTotalLabel); 575 575 576 m_pHostFSChart = new UIVM ResourceMonitorDoughnutChart;576 m_pHostFSChart = new UIVMActivityOverviewDoughnutChart; 577 577 if (m_pHostFSChart) 578 578 { … … 586 586 } 587 587 588 void UIVM ResourceMonitorHostStatsWidget::updateLabels()588 void UIVMActivityOverviewHostStatsWidget::updateLabels() 589 589 { 590 590 if (m_pCPUTitleLabel) 591 m_pCPUTitleLabel->setText(QString("<b>%1</b>").arg(UI ResourceMonitorWidget::tr("Host CPU Load")));591 m_pCPUTitleLabel->setText(QString("<b>%1</b>").arg(UIVMActivityOverviewWidget::tr("Host CPU Load"))); 592 592 if (m_pCPUUserLabel) 593 593 { 594 594 QString strColor = QColor(m_CPUUserColor).name(QColor::HexRgb); 595 m_pCPUUserLabel->setText(QString("<font color=\"%1\">%2: %3%</font>").arg(strColor).arg(UI ResourceMonitorWidget::tr("User")).arg(QString::number(m_hostStats.m_iCPUUserLoad)));595 m_pCPUUserLabel->setText(QString("<font color=\"%1\">%2: %3%</font>").arg(strColor).arg(UIVMActivityOverviewWidget::tr("User")).arg(QString::number(m_hostStats.m_iCPUUserLoad))); 596 596 } 597 597 if (m_pCPUKernelLabel) 598 598 { 599 599 QString strColor = QColor(m_CPUKernelColor).name(QColor::HexRgb); 600 m_pCPUKernelLabel->setText(QString("<font color=\"%1\">%2: %3%</font>").arg(strColor).arg(UI ResourceMonitorWidget::tr("Kernel")).arg(QString::number(m_hostStats.m_iCPUKernelLoad)));600 m_pCPUKernelLabel->setText(QString("<font color=\"%1\">%2: %3%</font>").arg(strColor).arg(UIVMActivityOverviewWidget::tr("Kernel")).arg(QString::number(m_hostStats.m_iCPUKernelLoad))); 601 601 } 602 602 if (m_pCPUTotalLabel) 603 m_pCPUTotalLabel->setText(QString("%1: %2%").arg(UI ResourceMonitorWidget::tr("Total")).arg(m_hostStats.m_iCPUUserLoad + m_hostStats.m_iCPUKernelLoad));603 m_pCPUTotalLabel->setText(QString("%1: %2%").arg(UIVMActivityOverviewWidget::tr("Total")).arg(m_hostStats.m_iCPUUserLoad + m_hostStats.m_iCPUKernelLoad)); 604 604 if (m_pRAMTitleLabel) 605 m_pRAMTitleLabel->setText(QString("<b>%1</b>").arg(UI ResourceMonitorWidget::tr("Host RAM Usage")));605 m_pRAMTitleLabel->setText(QString("<b>%1</b>").arg(UIVMActivityOverviewWidget::tr("Host RAM Usage"))); 606 606 if (m_pRAMFreeLabel) 607 607 { 608 608 QString strRAM = uiCommon().formatSize(m_hostStats.m_iRAMFree); 609 609 QString strColor = QColor(m_RAMFreeColor).name(QColor::HexRgb); 610 m_pRAMFreeLabel->setText(QString("<font color=\"%1\">%2: %3</font>").arg(strColor).arg(UI ResourceMonitorWidget::tr("Free")).arg(strRAM));610 m_pRAMFreeLabel->setText(QString("<font color=\"%1\">%2: %3</font>").arg(strColor).arg(UIVMActivityOverviewWidget::tr("Free")).arg(strRAM)); 611 611 } 612 612 if (m_pRAMUsedLabel) … … 614 614 QString strRAM = uiCommon().formatSize(m_hostStats.m_iRAMTotal - m_hostStats.m_iRAMFree); 615 615 QString strColor = QColor(m_RAMUsedColor).name(QColor::HexRgb); 616 m_pRAMUsedLabel->setText(QString("<font color=\"%1\">%2: %3</font>").arg(strColor).arg(UI ResourceMonitorWidget::tr("Used")).arg(strRAM));616 m_pRAMUsedLabel->setText(QString("<font color=\"%1\">%2: %3</font>").arg(strColor).arg(UIVMActivityOverviewWidget::tr("Used")).arg(strRAM)); 617 617 } 618 618 if (m_pRAMTotalLabel) 619 619 { 620 620 QString strRAM = uiCommon().formatSize(m_hostStats.m_iRAMTotal); 621 m_pRAMTotalLabel->setText(QString("%1: %2").arg(UI ResourceMonitorWidget::tr("Total")).arg(strRAM));621 m_pRAMTotalLabel->setText(QString("%1: %2").arg(UIVMActivityOverviewWidget::tr("Total")).arg(strRAM)); 622 622 } 623 623 if (m_pFSTitleLabel) 624 m_pFSTitleLabel->setText(QString("<b>%1</b>").arg(UI ResourceMonitorWidget::tr("Host File System")));624 m_pFSTitleLabel->setText(QString("<b>%1</b>").arg(UIVMActivityOverviewWidget::tr("Host File System"))); 625 625 if (m_pFSFreeLabel) 626 626 { 627 627 QString strFS = uiCommon().formatSize(m_hostStats.m_iFSFree); 628 628 QString strColor = QColor(m_RAMFreeColor).name(QColor::HexRgb); 629 m_pFSFreeLabel->setText(QString("<font color=\"%1\">%2: %3</font>").arg(strColor).arg(UI ResourceMonitorWidget::tr("Free")).arg(strFS));629 m_pFSFreeLabel->setText(QString("<font color=\"%1\">%2: %3</font>").arg(strColor).arg(UIVMActivityOverviewWidget::tr("Free")).arg(strFS)); 630 630 } 631 631 if (m_pFSUsedLabel) … … 633 633 QString strFS = uiCommon().formatSize(m_hostStats.m_iFSTotal - m_hostStats.m_iFSFree); 634 634 QString strColor = QColor(m_RAMUsedColor).name(QColor::HexRgb); 635 m_pFSUsedLabel->setText(QString("<font color=\"%1\">%2: %3</font>").arg(strColor).arg(UI ResourceMonitorWidget::tr("Used")).arg(strFS));635 m_pFSUsedLabel->setText(QString("<font color=\"%1\">%2: %3</font>").arg(strColor).arg(UIVMActivityOverviewWidget::tr("Used")).arg(strFS)); 636 636 } 637 637 if (m_pFSTotalLabel) 638 638 { 639 639 QString strFS = uiCommon().formatSize(m_hostStats.m_iFSTotal); 640 m_pFSTotalLabel->setText(QString("%1: %2").arg(UI ResourceMonitorWidget::tr("Total")).arg(strFS));641 } 642 } 643 644 645 646 /********************************************************************************************************************************* 647 * Class UIVM ResourceMonitorTableView implementation. *640 m_pFSTotalLabel->setText(QString("%1: %2").arg(UIVMActivityOverviewWidget::tr("Total")).arg(strFS)); 641 } 642 } 643 644 645 646 /********************************************************************************************************************************* 647 * Class UIVMActivityOverviewTableView implementation. * 648 648 *********************************************************************************************************************************/ 649 649 650 UIVM ResourceMonitorTableView::UIVMResourceMonitorTableView(QWidget *pParent /* = 0 */)650 UIVMActivityOverviewTableView::UIVMActivityOverviewTableView(QWidget *pParent /* = 0 */) 651 651 :QTableView(pParent) 652 652 { 653 653 } 654 654 655 void UIVM ResourceMonitorTableView::setMinimumColumnWidths(const QMap<int, int>& widths)655 void UIVMActivityOverviewTableView::setMinimumColumnWidths(const QMap<int, int>& widths) 656 656 { 657 657 m_minimumColumnWidths = widths; … … 659 659 } 660 660 661 void UIVM ResourceMonitorTableView::updateColumVisibility()662 { 663 UI ResourceMonitorProxyModel *pProxyModel = qobject_cast<UIResourceMonitorProxyModel *>(model());661 void UIVMActivityOverviewTableView::updateColumVisibility() 662 { 663 UIActivityOverviewProxyModel *pProxyModel = qobject_cast<UIActivityOverviewProxyModel *>(model()); 664 664 if (!pProxyModel) 665 665 return; 666 UI ResourceMonitorModel *pModel = qobject_cast<UIResourceMonitorModel *>(pProxyModel->sourceModel());666 UIActivityOverviewModel *pModel = qobject_cast<UIActivityOverviewModel *>(pProxyModel->sourceModel()); 667 667 QHeaderView *pHeader = horizontalHeader(); 668 668 669 669 if (!pModel || !pHeader) 670 670 return; 671 for (int i = (int)VM ResourceMonitorColumn_Name; i < (int)VMResourceMonitorColumn_Max; ++i)671 for (int i = (int)VMActivityOverviewColumn_Name; i < (int)VMActivityOverviewColumn_Max; ++i) 672 672 { 673 673 if (!pModel->columnVisible(i)) … … 679 679 } 680 680 681 int UIVM ResourceMonitorTableView::selectedItemIndex() const682 { 683 UI ResourceMonitorProxyModel *pModel = qobject_cast<UIResourceMonitorProxyModel*>(model());681 int UIVMActivityOverviewTableView::selectedItemIndex() const 682 { 683 UIActivityOverviewProxyModel *pModel = qobject_cast<UIActivityOverviewProxyModel*>(model()); 684 684 if (!pModel) 685 685 return -1; … … 700 700 } 701 701 702 bool UIVM ResourceMonitorTableView::hasSelection() const702 bool UIVMActivityOverviewTableView::hasSelection() const 703 703 { 704 704 if (!selectionModel()) … … 707 707 } 708 708 709 void UIVM ResourceMonitorTableView::resizeEvent(QResizeEvent *pEvent)709 void UIVMActivityOverviewTableView::resizeEvent(QResizeEvent *pEvent) 710 710 { 711 711 resizeHeaders(); … … 713 713 } 714 714 715 void UIVM ResourceMonitorTableView::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)715 void UIVMActivityOverviewTableView::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) 716 716 { 717 717 emit sigSelectionChanged(selected, deselected); … … 719 719 } 720 720 721 void UIVM ResourceMonitorTableView::mousePressEvent(QMouseEvent *pEvent)721 void UIVMActivityOverviewTableView::mousePressEvent(QMouseEvent *pEvent) 722 722 { 723 723 if (!indexAt(pEvent->pos()).isValid()) … … 726 726 } 727 727 728 void UIVM ResourceMonitorTableView::resizeHeaders()728 void UIVMActivityOverviewTableView::resizeHeaders() 729 729 { 730 730 QHeaderView* pHeader = horizontalHeader(); … … 738 738 if (pHeader->isSectionHidden(i)) 739 739 continue; 740 int iMinWidth = m_minimumColumnWidths.value((VM ResourceMonitorColumn)i, 0);740 int iMinWidth = m_minimumColumnWidths.value((VMActivityOverviewColumn)i, 0); 741 741 pHeader->resizeSection(i, iWidth < iMinWidth ? iMinWidth : iWidth); 742 742 } … … 745 745 746 746 /********************************************************************************************************************************* 747 * Class UIVM ResourceMonitorItem implementation. *747 * Class UIVMActivityOverviewItem implementation. * 748 748 *********************************************************************************************************************************/ 749 UI ResourceMonitorItem::UIResourceMonitorItem(const QUuid &uid, const QString &strVMName)749 UIActivityOverviewItem::UIActivityOverviewItem(const QUuid &uid, const QString &strVMName) 750 750 : m_VMuid(uid) 751 751 , m_strVMName(strVMName) … … 779 779 } 780 780 781 UI ResourceMonitorItem::UIResourceMonitorItem()781 UIActivityOverviewItem::UIActivityOverviewItem() 782 782 : m_VMuid(QUuid()) 783 783 , m_uCPUGuestLoad(0) … … 799 799 } 800 800 801 UI ResourceMonitorItem::UIResourceMonitorItem(const QUuid &uid)801 UIActivityOverviewItem::UIActivityOverviewItem(const QUuid &uid) 802 802 : m_VMuid(uid) 803 803 , m_uCPUGuestLoad(0) … … 819 819 } 820 820 821 UI ResourceMonitorItem::~UIResourceMonitorItem()821 UIActivityOverviewItem::~UIActivityOverviewItem() 822 822 { 823 823 if (!m_comSession.isNull()) … … 825 825 } 826 826 827 bool UI ResourceMonitorItem::operator==(const UIResourceMonitorItem& other) const827 bool UIActivityOverviewItem::operator==(const UIActivityOverviewItem& other) const 828 828 { 829 829 if (m_VMuid == other.m_VMuid) … … 832 832 } 833 833 834 bool UI ResourceMonitorItem::isWithGuestAdditions()834 bool UIActivityOverviewItem::isWithGuestAdditions() 835 835 { 836 836 if (m_comGuest.isNull()) … … 841 841 842 842 /********************************************************************************************************************************* 843 * Class UIVM ResourceMonitorHostStats implementation. *843 * Class UIVMActivityOverviewHostStats implementation. * 844 844 *********************************************************************************************************************************/ 845 845 846 UIVM ResourceMonitorHostStats::UIVMResourceMonitorHostStats()846 UIVMActivityOverviewHostStats::UIVMActivityOverviewHostStats() 847 847 : m_iCPUUserLoad(0) 848 848 , m_iCPUKernelLoad(0) … … 857 857 858 858 /********************************************************************************************************************************* 859 * Class UIVM ResourceMonitorProxyModel implementation. *859 * Class UIVMActivityOverviewProxyModel implementation. * 860 860 *********************************************************************************************************************************/ 861 UI ResourceMonitorProxyModel::UIResourceMonitorProxyModel(QObject *parent /* = 0 */)861 UIActivityOverviewProxyModel::UIActivityOverviewProxyModel(QObject *parent /* = 0 */) 862 862 :QSortFilterProxyModel(parent) 863 863 { 864 864 } 865 865 866 void UI ResourceMonitorProxyModel::dataUpdate()866 void UIActivityOverviewProxyModel::dataUpdate() 867 867 { 868 868 if (sourceModel()) … … 873 873 874 874 /********************************************************************************************************************************* 875 * Class UI ResourceMonitorModel implementation. *875 * Class UIActivityOverviewModel implementation. * 876 876 *********************************************************************************************************************************/ 877 UI ResourceMonitorModel::UIResourceMonitorModel(QObject *parent /*= 0*/)877 UIActivityOverviewModel::UIActivityOverviewModel(QObject *parent /*= 0*/) 878 878 :QAbstractTableModel(parent) 879 879 , m_pTimer(new QTimer(this)) … … 883 883 } 884 884 885 void UI ResourceMonitorModel::initialize()886 { 887 for (int i = 0; i < (int)VM ResourceMonitorColumn_Max; ++i)885 void UIActivityOverviewModel::initialize() 886 { 887 for (int i = 0; i < (int)VMActivityOverviewColumn_Max; ++i) 888 888 m_columnDataMaxLength[i] = 0; 889 889 890 890 initializeItems(); 891 891 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange, 892 this, &UI ResourceMonitorModel::sltMachineStateChanged);892 this, &UIActivityOverviewModel::sltMachineStateChanged); 893 893 894 894 if (m_pTimer) 895 895 { 896 connect(m_pTimer, &QTimer::timeout, this, &UI ResourceMonitorModel::sltTimeout);896 connect(m_pTimer, &QTimer::timeout, this, &UIActivityOverviewModel::sltTimeout); 897 897 m_pTimer->start(1000); 898 898 } 899 899 } 900 900 901 int UI ResourceMonitorModel::rowCount(const QModelIndex &parent /* = QModelIndex() */) const901 int UIActivityOverviewModel::rowCount(const QModelIndex &parent /* = QModelIndex() */) const 902 902 { 903 903 Q_UNUSED(parent); … … 905 905 } 906 906 907 int UI ResourceMonitorModel::columnCount(const QModelIndex &parent /* = QModelIndex() */) const907 int UIActivityOverviewModel::columnCount(const QModelIndex &parent /* = QModelIndex() */) const 908 908 { 909 909 Q_UNUSED(parent); 910 return VM ResourceMonitorColumn_Max;911 } 912 913 void UI ResourceMonitorModel::setShouldUpdate(bool fShouldUpdate)910 return VMActivityOverviewColumn_Max; 911 } 912 913 void UIActivityOverviewModel::setShouldUpdate(bool fShouldUpdate) 914 914 { 915 915 m_fShouldUpdate = fShouldUpdate; 916 916 } 917 917 918 const QMap<int, int> UI ResourceMonitorModel::dataLengths() const918 const QMap<int, int> UIActivityOverviewModel::dataLengths() const 919 919 { 920 920 return m_columnDataMaxLength; 921 921 } 922 922 923 QUuid UI ResourceMonitorModel::itemUid(int iIndex)923 QUuid UIActivityOverviewModel::itemUid(int iIndex) 924 924 { 925 925 if (iIndex >= m_itemList.size()) … … 928 928 } 929 929 930 int UI ResourceMonitorModel::itemIndex(const QUuid &uid)930 int UIActivityOverviewModel::itemIndex(const QUuid &uid) 931 931 { 932 932 for (int i = 0; i < m_itemList.size(); ++i) … … 938 938 } 939 939 940 QVariant UI ResourceMonitorModel::data(const QModelIndex &index, int role) const940 QVariant UIActivityOverviewModel::data(const QModelIndex &index, int role) const 941 941 { 942 942 if (!index.isValid() || role != Qt::DisplayRole || index.row() >= rowCount()) … … 945 945 } 946 946 947 QVariant UI ResourceMonitorModel::headerData(int section, Qt::Orientation orientation, int role) const947 QVariant UIActivityOverviewModel::headerData(int section, Qt::Orientation orientation, int role) const 948 948 { 949 949 if (role == Qt::DisplayRole && orientation == Qt::Horizontal) 950 return m_columnTitles.value((VM ResourceMonitorColumn)section, QString());;950 return m_columnTitles.value((VMActivityOverviewColumn)section, QString());; 951 951 return QVariant(); 952 952 } 953 953 954 void UI ResourceMonitorModel::setColumnCaptions(const QMap<int, QString>& captions)954 void UIActivityOverviewModel::setColumnCaptions(const QMap<int, QString>& captions) 955 955 { 956 956 m_columnTitles = captions; 957 957 } 958 958 959 void UI ResourceMonitorModel::initializeItems()959 void UIActivityOverviewModel::initializeItems() 960 960 { 961 961 foreach (const CMachine &comMachine, uiCommon().virtualBox().GetMachines()) … … 970 970 } 971 971 972 void UI ResourceMonitorModel::sltMachineStateChanged(const QUuid &uId, const KMachineState state)972 void UIActivityOverviewModel::sltMachineStateChanged(const QUuid &uId, const KMachineState state) 973 973 { 974 974 int iIndex = itemIndex(uId); … … 995 995 } 996 996 997 void UI ResourceMonitorModel::getHostRAMStats()997 void UIActivityOverviewModel::getHostRAMStats() 998 998 { 999 999 CHost comHost = uiCommon().host(); … … 1002 1002 } 1003 1003 1004 void UI ResourceMonitorModel::sltTimeout()1004 void UIActivityOverviewModel::sltTimeout() 1005 1005 { 1006 1006 if (!m_fShouldUpdate) … … 1010 1010 ULONG aPctVMM; 1011 1011 1012 bool fCPUColumns = columnVisible(VM ResourceMonitorColumn_CPUVMMLoad) || columnVisible(VMResourceMonitorColumn_CPUGuestLoad);1013 bool fNetworkColumns = columnVisible(VM ResourceMonitorColumn_NetworkUpRate)1014 || columnVisible(VM ResourceMonitorColumn_NetworkDownRate)1015 || columnVisible(VM ResourceMonitorColumn_NetworkUpTotal)1016 || columnVisible(VM ResourceMonitorColumn_NetworkDownTotal);1017 bool fIOColumns = columnVisible(VM ResourceMonitorColumn_DiskIOReadRate)1018 || columnVisible(VM ResourceMonitorColumn_DiskIOWriteRate)1019 || columnVisible(VM ResourceMonitorColumn_DiskIOReadTotal)1020 || columnVisible(VM ResourceMonitorColumn_DiskIOWriteTotal);1021 bool fVMExitColumn = columnVisible(VM ResourceMonitorColumn_VMExits);1012 bool fCPUColumns = columnVisible(VMActivityOverviewColumn_CPUVMMLoad) || columnVisible(VMActivityOverviewColumn_CPUGuestLoad); 1013 bool fNetworkColumns = columnVisible(VMActivityOverviewColumn_NetworkUpRate) 1014 || columnVisible(VMActivityOverviewColumn_NetworkDownRate) 1015 || columnVisible(VMActivityOverviewColumn_NetworkUpTotal) 1016 || columnVisible(VMActivityOverviewColumn_NetworkDownTotal); 1017 bool fIOColumns = columnVisible(VMActivityOverviewColumn_DiskIOReadRate) 1018 || columnVisible(VMActivityOverviewColumn_DiskIOWriteRate) 1019 || columnVisible(VMActivityOverviewColumn_DiskIOReadTotal) 1020 || columnVisible(VMActivityOverviewColumn_DiskIOWriteTotal); 1021 bool fVMExitColumn = columnVisible(VMActivityOverviewColumn_VMExits); 1022 1022 1023 1023 /* Host's RAM usage is obtained from IHost not from IPerformanceCollectior: */ … … 1070 1070 for (int i = 0; i < m_itemList.size(); ++i) 1071 1071 { 1072 m_itemList[i].m_columnData[VM ResourceMonitorColumn_Name] = m_itemList[i].m_strVMName;1073 m_itemList[i].m_columnData[VM ResourceMonitorColumn_CPUGuestLoad] =1072 m_itemList[i].m_columnData[VMActivityOverviewColumn_Name] = m_itemList[i].m_strVMName; 1073 m_itemList[i].m_columnData[VMActivityOverviewColumn_CPUGuestLoad] = 1074 1074 QString("%1%").arg(QString::number(m_itemList[i].m_uCPUGuestLoad)); 1075 m_itemList[i].m_columnData[VM ResourceMonitorColumn_CPUVMMLoad] =1075 m_itemList[i].m_columnData[VMActivityOverviewColumn_CPUVMMLoad] = 1076 1076 QString("%1%").arg(QString::number(m_itemList[i].m_uCPUVMMLoad)); 1077 1077 1078 1078 if (m_itemList[i].isWithGuestAdditions()) 1079 m_itemList[i].m_columnData[VM ResourceMonitorColumn_RAMUsedAndTotal] =1079 m_itemList[i].m_columnData[VMActivityOverviewColumn_RAMUsedAndTotal] = 1080 1080 QString("%1/%2").arg(uiCommon().formatSize(_1K * m_itemList[i].m_uUsedRAM, iDecimalCount)). 1081 1081 arg(uiCommon().formatSize(_1K * m_itemList[i].m_uTotalRAM, iDecimalCount)); 1082 1082 else 1083 m_itemList[i].m_columnData[VM ResourceMonitorColumn_RAMUsedAndTotal] = UIResourceMonitorWidget::tr("N/A");1083 m_itemList[i].m_columnData[VMActivityOverviewColumn_RAMUsedAndTotal] = UIVMActivityOverviewWidget::tr("N/A"); 1084 1084 1085 1085 if (m_itemList[i].isWithGuestAdditions()) 1086 m_itemList[i].m_columnData[VM ResourceMonitorColumn_RAMUsedPercentage] =1086 m_itemList[i].m_columnData[VMActivityOverviewColumn_RAMUsedPercentage] = 1087 1087 QString("%1%").arg(QString::number(m_itemList[i].m_fRAMUsagePercentage, 'f', 2)); 1088 1088 else 1089 m_itemList[i].m_columnData[VM ResourceMonitorColumn_RAMUsedPercentage] = UIResourceMonitorWidget::tr("N/A");1090 1091 m_itemList[i].m_columnData[VM ResourceMonitorColumn_NetworkUpRate] =1089 m_itemList[i].m_columnData[VMActivityOverviewColumn_RAMUsedPercentage] = UIVMActivityOverviewWidget::tr("N/A"); 1090 1091 m_itemList[i].m_columnData[VMActivityOverviewColumn_NetworkUpRate] = 1092 1092 QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uNetworkUpRate, iDecimalCount)); 1093 1093 1094 m_itemList[i].m_columnData[VM ResourceMonitorColumn_NetworkDownRate] =1094 m_itemList[i].m_columnData[VMActivityOverviewColumn_NetworkDownRate] = 1095 1095 QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uNetworkDownRate, iDecimalCount)); 1096 1096 1097 m_itemList[i].m_columnData[VM ResourceMonitorColumn_NetworkUpTotal] =1097 m_itemList[i].m_columnData[VMActivityOverviewColumn_NetworkUpTotal] = 1098 1098 QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uNetworkUpTotal, iDecimalCount)); 1099 1099 1100 m_itemList[i].m_columnData[VM ResourceMonitorColumn_NetworkDownTotal] =1100 m_itemList[i].m_columnData[VMActivityOverviewColumn_NetworkDownTotal] = 1101 1101 QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uNetworkDownTotal, iDecimalCount)); 1102 1102 1103 m_itemList[i].m_columnData[VM ResourceMonitorColumn_DiskIOReadRate] =1103 m_itemList[i].m_columnData[VMActivityOverviewColumn_DiskIOReadRate] = 1104 1104 QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uDiskReadRate, iDecimalCount)); 1105 1105 1106 m_itemList[i].m_columnData[VM ResourceMonitorColumn_DiskIOWriteRate] =1106 m_itemList[i].m_columnData[VMActivityOverviewColumn_DiskIOWriteRate] = 1107 1107 QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uDiskWriteRate, iDecimalCount)); 1108 1108 1109 m_itemList[i].m_columnData[VM ResourceMonitorColumn_DiskIOReadTotal] =1109 m_itemList[i].m_columnData[VMActivityOverviewColumn_DiskIOReadTotal] = 1110 1110 QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uDiskReadTotal, iDecimalCount)); 1111 1111 1112 m_itemList[i].m_columnData[VM ResourceMonitorColumn_DiskIOWriteTotal] =1112 m_itemList[i].m_columnData[VMActivityOverviewColumn_DiskIOWriteTotal] = 1113 1113 QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uDiskWriteTotal, iDecimalCount)); 1114 1114 1115 m_itemList[i].m_columnData[VM ResourceMonitorColumn_VMExits] =1115 m_itemList[i].m_columnData[VMActivityOverviewColumn_VMExits] = 1116 1116 QString("%1/%2").arg(UICommon::addMetricSuffixToNumber(m_itemList[i].m_uVMExitRate)). 1117 1117 arg(UICommon::addMetricSuffixToNumber(m_itemList[i].m_uVMExitTotal)); 1118 1118 } 1119 1119 1120 for (int i = 0; i < (int)VM ResourceMonitorColumn_Max; ++i)1120 for (int i = 0; i < (int)VMActivityOverviewColumn_Max; ++i) 1121 1121 { 1122 1122 for (int j = 0; j < m_itemList.size(); ++j) … … 1128 1128 } 1129 1129 1130 void UI ResourceMonitorModel::setupPerformanceCollector()1130 void UIActivityOverviewModel::setupPerformanceCollector() 1131 1131 { 1132 1132 m_nameList.clear(); … … 1146 1146 } 1147 1147 1148 void UI ResourceMonitorModel::queryPerformanceCollector()1148 void UIActivityOverviewModel::queryPerformanceCollector() 1149 1149 { 1150 1150 QVector<QString> aReturnNames; … … 1233 1233 } 1234 1234 1235 void UI ResourceMonitorModel::addItem(const QUuid& uMachineId, const QString& strMachineName)1236 { 1237 m_itemList.append(UI ResourceMonitorItem(uMachineId, strMachineName));1238 } 1239 1240 void UI ResourceMonitorModel::removeItem(const QUuid& uMachineId)1235 void UIActivityOverviewModel::addItem(const QUuid& uMachineId, const QString& strMachineName) 1236 { 1237 m_itemList.append(UIActivityOverviewItem(uMachineId, strMachineName)); 1238 } 1239 1240 void UIActivityOverviewModel::removeItem(const QUuid& uMachineId) 1241 1241 { 1242 1242 int iIndex = itemIndex(uMachineId); … … 1246 1246 } 1247 1247 1248 void UI ResourceMonitorModel::setColumnVisible(const QMap<int, bool>& columnVisible)1248 void UIActivityOverviewModel::setColumnVisible(const QMap<int, bool>& columnVisible) 1249 1249 { 1250 1250 m_columnVisible = columnVisible; 1251 1251 } 1252 1252 1253 bool UI ResourceMonitorModel::columnVisible(int iColumnId) const1253 bool UIActivityOverviewModel::columnVisible(int iColumnId) const 1254 1254 { 1255 1255 return m_columnVisible.value(iColumnId, true); … … 1258 1258 1259 1259 /********************************************************************************************************************************* 1260 * Class UI ResourceMonitorWidget implementation. *1260 * Class UIVMActivityOverviewWidget implementation. * 1261 1261 *********************************************************************************************************************************/ 1262 1262 1263 UI ResourceMonitorWidget::UIResourceMonitorWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,1263 UIVMActivityOverviewWidget::UIVMActivityOverviewWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool, 1264 1264 bool fShowToolbar /* = true */, QWidget *pParent /* = 0 */) 1265 1265 : QIWithRetranslateUI<QWidget>(pParent) … … 1280 1280 } 1281 1281 1282 UI ResourceMonitorWidget::~UIResourceMonitorWidget()1282 UIVMActivityOverviewWidget::~UIVMActivityOverviewWidget() 1283 1283 { 1284 1284 saveSettings(); 1285 1285 } 1286 1286 1287 QMenu *UI ResourceMonitorWidget::menu() const1287 QMenu *UIVMActivityOverviewWidget::menu() const 1288 1288 { 1289 1289 return NULL; 1290 1290 } 1291 1291 1292 QMenu *UI ResourceMonitorWidget::columnVisiblityToggleMenu() const1292 QMenu *UIVMActivityOverviewWidget::columnVisiblityToggleMenu() const 1293 1293 { 1294 1294 return m_pColumnVisibilityToggleMenu; 1295 1295 } 1296 1296 1297 bool UI ResourceMonitorWidget::isCurrentTool() const1297 bool UIVMActivityOverviewWidget::isCurrentTool() const 1298 1298 { 1299 1299 return m_fIsCurrentTool; 1300 1300 } 1301 1301 1302 void UI ResourceMonitorWidget::setIsCurrentTool(bool fIsCurrentTool)1302 void UIVMActivityOverviewWidget::setIsCurrentTool(bool fIsCurrentTool) 1303 1303 { 1304 1304 m_fIsCurrentTool = fIsCurrentTool; … … 1307 1307 } 1308 1308 1309 void UI ResourceMonitorWidget::retranslateUi()1310 { 1311 m_columnTitles[VM ResourceMonitorColumn_Name] = UIResourceMonitorWidget::tr("VM Name");1312 m_columnTitles[VM ResourceMonitorColumn_CPUGuestLoad] = UIResourceMonitorWidget::tr("CPU Guest");1313 m_columnTitles[VM ResourceMonitorColumn_CPUVMMLoad] = UIResourceMonitorWidget::tr("CPU VMM");1314 m_columnTitles[VM ResourceMonitorColumn_RAMUsedAndTotal] = UIResourceMonitorWidget::tr("RAM Used/Total");1315 m_columnTitles[VM ResourceMonitorColumn_RAMUsedPercentage] = UIResourceMonitorWidget::tr("RAM %");1316 m_columnTitles[VM ResourceMonitorColumn_NetworkUpRate] = UIResourceMonitorWidget::tr("Network Up Rate");1317 m_columnTitles[VM ResourceMonitorColumn_NetworkDownRate] = UIResourceMonitorWidget::tr("Network Down Rate");1318 m_columnTitles[VM ResourceMonitorColumn_NetworkUpTotal] = UIResourceMonitorWidget::tr("Network Up Total");1319 m_columnTitles[VM ResourceMonitorColumn_NetworkDownTotal] = UIResourceMonitorWidget::tr("Network Down Total");1320 m_columnTitles[VM ResourceMonitorColumn_DiskIOReadRate] = UIResourceMonitorWidget::tr("Disk Read Rate");1321 m_columnTitles[VM ResourceMonitorColumn_DiskIOWriteRate] = UIResourceMonitorWidget::tr("Disk Write Rate");1322 m_columnTitles[VM ResourceMonitorColumn_DiskIOReadTotal] = UIResourceMonitorWidget::tr("Disk Read Total");1323 m_columnTitles[VM ResourceMonitorColumn_DiskIOWriteTotal] = UIResourceMonitorWidget::tr("Disk Write Total");1324 m_columnTitles[VM ResourceMonitorColumn_VMExits] = UIResourceMonitorWidget::tr("VM Exits");1309 void UIVMActivityOverviewWidget::retranslateUi() 1310 { 1311 m_columnTitles[VMActivityOverviewColumn_Name] = UIVMActivityOverviewWidget::tr("VM Name"); 1312 m_columnTitles[VMActivityOverviewColumn_CPUGuestLoad] = UIVMActivityOverviewWidget::tr("CPU Guest"); 1313 m_columnTitles[VMActivityOverviewColumn_CPUVMMLoad] = UIVMActivityOverviewWidget::tr("CPU VMM"); 1314 m_columnTitles[VMActivityOverviewColumn_RAMUsedAndTotal] = UIVMActivityOverviewWidget::tr("RAM Used/Total"); 1315 m_columnTitles[VMActivityOverviewColumn_RAMUsedPercentage] = UIVMActivityOverviewWidget::tr("RAM %"); 1316 m_columnTitles[VMActivityOverviewColumn_NetworkUpRate] = UIVMActivityOverviewWidget::tr("Network Up Rate"); 1317 m_columnTitles[VMActivityOverviewColumn_NetworkDownRate] = UIVMActivityOverviewWidget::tr("Network Down Rate"); 1318 m_columnTitles[VMActivityOverviewColumn_NetworkUpTotal] = UIVMActivityOverviewWidget::tr("Network Up Total"); 1319 m_columnTitles[VMActivityOverviewColumn_NetworkDownTotal] = UIVMActivityOverviewWidget::tr("Network Down Total"); 1320 m_columnTitles[VMActivityOverviewColumn_DiskIOReadRate] = UIVMActivityOverviewWidget::tr("Disk Read Rate"); 1321 m_columnTitles[VMActivityOverviewColumn_DiskIOWriteRate] = UIVMActivityOverviewWidget::tr("Disk Write Rate"); 1322 m_columnTitles[VMActivityOverviewColumn_DiskIOReadTotal] = UIVMActivityOverviewWidget::tr("Disk Read Total"); 1323 m_columnTitles[VMActivityOverviewColumn_DiskIOWriteTotal] = UIVMActivityOverviewWidget::tr("Disk Write Total"); 1324 m_columnTitles[VMActivityOverviewColumn_VMExits] = UIVMActivityOverviewWidget::tr("VM Exits"); 1325 1325 1326 1326 updateColumnsMenu(); … … 1332 1332 } 1333 1333 1334 void UI ResourceMonitorWidget::showEvent(QShowEvent *pEvent)1334 void UIVMActivityOverviewWidget::showEvent(QShowEvent *pEvent) 1335 1335 { 1336 1336 if (m_pVMActivityMonitorAction && m_pTableView) … … 1340 1340 } 1341 1341 1342 void UI ResourceMonitorWidget::prepare()1342 void UIVMActivityOverviewWidget::prepare() 1343 1343 { 1344 1344 /* Try to guest the sort indicator's width: */ … … 1361 1361 } 1362 1362 1363 void UI ResourceMonitorWidget::prepareWidgets()1363 void UIVMActivityOverviewWidget::prepareWidgets() 1364 1364 { 1365 1365 /* Create main-layout: */ … … 1378 1378 prepareToolBar(); 1379 1379 1380 m_pHostStatsWidget = new UIVM ResourceMonitorHostStatsWidget;1380 m_pHostStatsWidget = new UIVMActivityOverviewHostStatsWidget; 1381 1381 if (m_pHostStatsWidget) 1382 1382 layout()->addWidget(m_pHostStatsWidget); 1383 1383 1384 m_pModel = new UI ResourceMonitorModel(this);1385 m_pProxyModel = new UI ResourceMonitorProxyModel(this);1386 1387 m_pTableView = new UIVM ResourceMonitorTableView();1384 m_pModel = new UIActivityOverviewModel(this); 1385 m_pProxyModel = new UIActivityOverviewProxyModel(this); 1386 1387 m_pTableView = new UIVMActivityOverviewTableView(); 1388 1388 if (m_pTableView && m_pModel && m_pProxyModel) 1389 1389 { … … 1391 1391 m_pProxyModel->setSourceModel(m_pModel); 1392 1392 m_pTableView->setModel(m_pProxyModel); 1393 m_pTableView->setItemDelegate(new UIVM ResourceMonitorDelegate);1393 m_pTableView->setItemDelegate(new UIVMActivityOverviewDelegate); 1394 1394 m_pTableView->setSelectionMode(QAbstractItemView::SingleSelection); 1395 1395 m_pTableView->setSelectionBehavior(QAbstractItemView::SelectRows); … … 1405 1405 m_pTableView->setSortingEnabled(true); 1406 1406 m_pTableView->sortByColumn(0, Qt::AscendingOrder); 1407 connect(m_pModel, &UI ResourceMonitorModel::sigDataUpdate,1408 this, &UI ResourceMonitorWidget::sltHandleDataUpdate);1409 connect(m_pModel, &UI ResourceMonitorModel::sigHostStatsUpdate,1410 this, &UI ResourceMonitorWidget::sltHandleHostStatsUpdate);1411 connect(m_pTableView, &UIVM ResourceMonitorTableView::customContextMenuRequested,1412 this, &UI ResourceMonitorWidget::sltHandleTableContextMenuRequest);1413 connect(m_pTableView, &UIVM ResourceMonitorTableView::sigSelectionChanged,1414 this, &UI ResourceMonitorWidget::sltHandleTableSelectionChanged);1407 connect(m_pModel, &UIActivityOverviewModel::sigDataUpdate, 1408 this, &UIVMActivityOverviewWidget::sltHandleDataUpdate); 1409 connect(m_pModel, &UIActivityOverviewModel::sigHostStatsUpdate, 1410 this, &UIVMActivityOverviewWidget::sltHandleHostStatsUpdate); 1411 connect(m_pTableView, &UIVMActivityOverviewTableView::customContextMenuRequested, 1412 this, &UIVMActivityOverviewWidget::sltHandleTableContextMenuRequest); 1413 connect(m_pTableView, &UIVMActivityOverviewTableView::sigSelectionChanged, 1414 this, &UIVMActivityOverviewWidget::sltHandleTableSelectionChanged); 1415 1415 updateModelColumVisibilityCache(); 1416 1416 } 1417 1417 } 1418 1418 1419 void UI ResourceMonitorWidget::updateColumnsMenu()1420 { 1421 UIMenu *pMenu = m_pActionPool->action(UIActionIndexMN_M_VM ResourceMonitor_M_Columns)->menu();1419 void UIVMActivityOverviewWidget::updateColumnsMenu() 1420 { 1421 UIMenu *pMenu = m_pActionPool->action(UIActionIndexMN_M_VMActivityOverview_M_Columns)->menu(); 1422 1422 if (!pMenu) 1423 1423 return; 1424 1424 pMenu->clear(); 1425 for (int i = 0; i < VM ResourceMonitorColumn_Max; ++i)1425 for (int i = 0; i < VMActivityOverviewColumn_Max; ++i) 1426 1426 { 1427 1427 QAction *pAction = pMenu->addAction(m_columnTitles[i]); 1428 1428 pAction->setCheckable(true); 1429 if (i == (int)VM ResourceMonitorColumn_Name)1429 if (i == (int)VMActivityOverviewColumn_Name) 1430 1430 pAction->setEnabled(false); 1431 1431 pAction->setData(i); 1432 1432 pAction->setChecked(columnVisible(i)); 1433 connect(pAction, &QAction::toggled, this, &UI ResourceMonitorWidget::sltHandleColumnAction);1434 } 1435 } 1436 1437 void UI ResourceMonitorWidget::prepareActions()1433 connect(pAction, &QAction::toggled, this, &UIVMActivityOverviewWidget::sltHandleColumnAction); 1434 } 1435 } 1436 1437 void UIVMActivityOverviewWidget::prepareActions() 1438 1438 { 1439 1439 updateColumnsMenu(); 1440 1440 m_pVMActivityMonitorAction = 1441 m_pActionPool->action(UIActionIndexMN_M_VM ResourceMonitor_S_SwitchToMachinePerformance);1441 m_pActionPool->action(UIActionIndexMN_M_VMActivityOverview_S_SwitchToMachinePerformance); 1442 1442 1443 1443 if (m_pVMActivityMonitorAction) 1444 connect(m_pVMActivityMonitorAction, &QAction::triggered, this, &UI ResourceMonitorWidget::sltHandleShowVMActivityMonitor);1445 } 1446 1447 void UI ResourceMonitorWidget::prepareToolBar()1444 connect(m_pVMActivityMonitorAction, &QAction::triggered, this, &UIVMActivityOverviewWidget::sltHandleShowVMActivityMonitor); 1445 } 1446 1447 void UIVMActivityOverviewWidget::prepareToolBar() 1448 1448 { 1449 1449 /* Create toolbar: */ … … 1470 1470 } 1471 1471 1472 void UI ResourceMonitorWidget::loadSettings()1473 { 1474 } 1475 1476 void UI ResourceMonitorWidget::loadHiddenColumnList()1477 { 1478 QStringList hiddenColumnList = gEDataManager->VM ResourceMonitorHiddenColumnList();1479 for (int i = (int)VM ResourceMonitorColumn_Name; i < (int)VMResourceMonitorColumn_Max; ++i)1472 void UIVMActivityOverviewWidget::loadSettings() 1473 { 1474 } 1475 1476 void UIVMActivityOverviewWidget::loadHiddenColumnList() 1477 { 1478 QStringList hiddenColumnList = gEDataManager->VMActivityOverviewHiddenColumnList(); 1479 for (int i = (int)VMActivityOverviewColumn_Name; i < (int)VMActivityOverviewColumn_Max; ++i) 1480 1480 m_columnVisible[i] = true; 1481 1481 foreach(const QString& strColumn, hiddenColumnList) 1482 setColumnVisible((int)gpConverter->fromInternalString<VM ResourceMonitorColumn>(strColumn), false);1483 } 1484 1485 void UI ResourceMonitorWidget::saveSettings()1482 setColumnVisible((int)gpConverter->fromInternalString<VMActivityOverviewColumn>(strColumn), false); 1483 } 1484 1485 void UIVMActivityOverviewWidget::saveSettings() 1486 1486 { 1487 1487 QStringList hiddenColumnList; … … 1489 1489 { 1490 1490 if (!columnVisible(i)) 1491 hiddenColumnList << gpConverter->toInternalString((VM ResourceMonitorColumn) i);1492 } 1493 gEDataManager->setVM ResourceMonitorHiddenColumnList(hiddenColumnList);1494 } 1495 1496 void UI ResourceMonitorWidget::sltToggleColumnSelectionMenu(bool fChecked)1491 hiddenColumnList << gpConverter->toInternalString((VMActivityOverviewColumn) i); 1492 } 1493 gEDataManager->setVMActivityOverviewHiddenColumnList(hiddenColumnList); 1494 } 1495 1496 void UIVMActivityOverviewWidget::sltToggleColumnSelectionMenu(bool fChecked) 1497 1497 { 1498 1498 (void)fChecked; … … 1502 1502 } 1503 1503 1504 void UI ResourceMonitorWidget::sltHandleColumnAction(bool fChecked)1504 void UIVMActivityOverviewWidget::sltHandleColumnAction(bool fChecked) 1505 1505 { 1506 1506 QAction* pSender = qobject_cast<QAction*>(sender()); … … 1510 1510 } 1511 1511 1512 void UI ResourceMonitorWidget::sltHandleHostStatsUpdate(const UIVMResourceMonitorHostStats &stats)1512 void UIVMActivityOverviewWidget::sltHandleHostStatsUpdate(const UIVMActivityOverviewHostStats &stats) 1513 1513 { 1514 1514 if (m_pHostStatsWidget) … … 1516 1516 } 1517 1517 1518 void UI ResourceMonitorWidget::sltHandleDataUpdate()1518 void UIVMActivityOverviewWidget::sltHandleDataUpdate() 1519 1519 { 1520 1520 computeMinimumColumnWidths(); … … 1523 1523 } 1524 1524 1525 void UI ResourceMonitorWidget::sltHandleTableContextMenuRequest(const QPoint &pos)1525 void UIVMActivityOverviewWidget::sltHandleTableContextMenuRequest(const QPoint &pos) 1526 1526 { 1527 1527 if (!m_pTableView || !m_pTableView->hasSelection()) … … 1535 1535 } 1536 1536 1537 void UI ResourceMonitorWidget::sltHandleTableSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)1537 void UIVMActivityOverviewWidget::sltHandleTableSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected) 1538 1538 { 1539 1539 Q_UNUSED(deselected); … … 1542 1542 } 1543 1543 1544 void UI ResourceMonitorWidget::sltHandleShowVMActivityMonitor()1544 void UIVMActivityOverviewWidget::sltHandleShowVMActivityMonitor() 1545 1545 { 1546 1546 if (!m_pTableView || !m_pModel) … … 1552 1552 } 1553 1553 1554 void UI ResourceMonitorWidget::setColumnVisible(int iColumnId, bool fVisible)1554 void UIVMActivityOverviewWidget::setColumnVisible(int iColumnId, bool fVisible) 1555 1555 { 1556 1556 if (m_columnVisible.contains(iColumnId) && m_columnVisible[iColumnId] == fVisible) … … 1560 1560 } 1561 1561 1562 void UI ResourceMonitorWidget::updateModelColumVisibilityCache()1562 void UIVMActivityOverviewWidget::updateModelColumVisibilityCache() 1563 1563 { 1564 1564 if (m_pModel) … … 1569 1569 } 1570 1570 1571 void UI ResourceMonitorWidget::computeMinimumColumnWidths()1571 void UIVMActivityOverviewWidget::computeMinimumColumnWidths() 1572 1572 { 1573 1573 if (!m_pTableView || !m_pModel) … … 1576 1576 const QMap<int, int> &columnDataStringLengths = m_pModel->dataLengths(); 1577 1577 QMap<int, int> columnWidthsInPixels; 1578 for (int i = 0; i < (int)VM ResourceMonitorColumn_Max; ++i)1578 for (int i = 0; i < (int)VMActivityOverviewColumn_Max; ++i) 1579 1579 { 1580 1580 int iColumnStringWidth = columnDataStringLengths.value(i, 0); … … 1589 1589 } 1590 1590 1591 bool UI ResourceMonitorWidget::columnVisible(int iColumnId) const1591 bool UIVMActivityOverviewWidget::columnVisible(int iColumnId) const 1592 1592 { 1593 1593 return m_columnVisible.value(iColumnId, true); … … 1611 1611 1612 1612 /********************************************************************************************************************************* 1613 * Class UI ResourceMonitorimplementation. *1613 * Class UIActivityOverview implementation. * 1614 1614 *********************************************************************************************************************************/ 1615 1615 … … 1622 1622 void UIVMActivityOverviewDialog::retranslateUi() 1623 1623 { 1624 setWindowTitle(UI ResourceMonitorWidget::tr("VM Resource Monitor"));1624 setWindowTitle(UIVMActivityOverviewWidget::tr("VM Resource Monitor")); 1625 1625 } 1626 1626 … … 1633 1633 void UIVMActivityOverviewDialog::configureCentralWidget() 1634 1634 { 1635 UI ResourceMonitorWidget *pWidget = new UIResourceMonitorWidget(EmbedTo_Dialog, m_pActionPool, true, this);1635 UIVMActivityOverviewWidget *pWidget = new UIVMActivityOverviewWidget(EmbedTo_Dialog, m_pActionPool, true, this); 1636 1636 AssertPtrReturnVoid(pWidget); 1637 1637 { … … 1654 1654 } 1655 1655 1656 UI ResourceMonitorWidget *UIVMActivityOverviewDialog::widget()1657 { 1658 return qobject_cast<UI ResourceMonitorWidget*>(QIManagerDialog::widget());1656 UIVMActivityOverviewWidget *UIVMActivityOverviewDialog::widget() 1657 { 1658 return qobject_cast<UIVMActivityOverviewWidget*>(QIManagerDialog::widget()); 1659 1659 } 1660 1660 -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.h
r88081 r88082 39 39 class UIActionPool; 40 40 class QIToolBar; 41 class UI ResourceMonitorProxyModel;42 class UI ResourceMonitorModel;43 class UIVM ResourceMonitorHostStats;44 class UIVM ResourceMonitorHostStatsWidget;45 class UIVM ResourceMonitorTableView;41 class UIActivityOverviewProxyModel; 42 class UIActivityOverviewModel; 43 class UIVMActivityOverviewHostStats; 44 class UIVMActivityOverviewHostStatsWidget; 45 class UIVMActivityOverviewTableView; 46 46 47 47 /** QWidget extension to display a Linux top like utility that sort running vm wrt. resource allocations. */ 48 class UI ResourceMonitorWidget : public QIWithRetranslateUI<QWidget>48 class UIVMActivityOverviewWidget : public QIWithRetranslateUI<QWidget> 49 49 { 50 50 Q_OBJECT; … … 56 56 public: 57 57 58 UI ResourceMonitorWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,58 UIVMActivityOverviewWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool, 59 59 bool fShowToolbar = true, QWidget *pParent = 0); 60 ~UI ResourceMonitorWidget();60 ~UIVMActivityOverviewWidget(); 61 61 QMenu *columnVisiblityToggleMenu() const; 62 62 QMenu *menu() const; … … 82 82 void sltToggleColumnSelectionMenu(bool fChecked); 83 83 void sltHandleColumnAction(bool fChecked); 84 void sltHandleHostStatsUpdate(const UIVM ResourceMonitorHostStats &stats);84 void sltHandleHostStatsUpdate(const UIVMActivityOverviewHostStats &stats); 85 85 void sltHandleTableContextMenuRequest(const QPoint &pos); 86 86 void sltHandleShowVMActivityMonitor(); … … 117 117 * @{ */ 118 118 QIToolBar *m_pToolBar; 119 UIVM ResourceMonitorTableView *m_pTableView;120 UI ResourceMonitorProxyModel *m_pProxyModel;121 UI ResourceMonitorModel *m_pModel;119 UIVMActivityOverviewTableView *m_pTableView; 120 UIActivityOverviewProxyModel *m_pProxyModel; 121 UIActivityOverviewModel *m_pModel; 122 122 QMenu *m_pColumnVisibilityToggleMenu; 123 /* The key is the column id (VM ResourceMonitorColumn) and value is column title. */123 /* The key is the column id (VMActivityOverviewColumn) and value is column title. */ 124 124 QMap<int, QString> m_columnTitles; 125 /* The key is the column id (VM ResourceMonitorColumn) and value is true if the column is visible. */125 /* The key is the column id (VMActivityOverviewColumn) and value is true if the column is visible. */ 126 126 QMap<int, bool> m_columnVisible; 127 UIVM ResourceMonitorHostStatsWidget *m_pHostStatsWidget;127 UIVMActivityOverviewHostStatsWidget *m_pHostStatsWidget; 128 128 QAction *m_pVMActivityMonitorAction; 129 129 /** @} */ … … 165 165 /** @name Widget stuff. 166 166 * @{ */ 167 virtual UI ResourceMonitorWidget *widget() /* override */;167 virtual UIVMActivityOverviewWidget *widget() /* override */; 168 168 /** @} */ 169 169
Note:
See TracChangeset
for help on using the changeset viewer.