- Timestamp:
- Mar 31, 2020 9:41:58 AM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
r83452 r83494 126 126 template<> SHARED_LIBRARY_STUFF bool canConvert<UIMediumFormat>(); 127 127 template<> SHARED_LIBRARY_STUFF bool canConvert<UISettingsDefs::RecordingMode>(); 128 template<> SHARED_LIBRARY_STUFF bool canConvert<VMResou ceMonitorColumn>();128 template<> SHARED_LIBRARY_STUFF bool canConvert<VMResourceMonitorColumn>(); 129 129 130 130 /* Declare COM canConvert specializations: */ … … 269 269 template<> SHARED_LIBRARY_STUFF QString toString(const UISettingsDefs::RecordingMode &enmRecordingMode); 270 270 template<> SHARED_LIBRARY_STUFF UISettingsDefs::RecordingMode fromString<UISettingsDefs::RecordingMode>(const QString &enmRecordingMode); 271 template<> SHARED_LIBRARY_STUFF QString toInternalString(const VMResou ceMonitorColumn &enmVMResourceMonitorColumn);272 template<> SHARED_LIBRARY_STUFF VMResou ceMonitorColumn fromInternalString<VMResouceMonitorColumn>(const QString &strVMResourceMonitorColumn);271 template<> SHARED_LIBRARY_STUFF QString toInternalString(const VMResourceMonitorColumn &enmVMResourceMonitorColumn); 272 template<> SHARED_LIBRARY_STUFF VMResourceMonitorColumn fromInternalString<VMResourceMonitorColumn>(const QString &strVMResourceMonitorColumn); 273 273 274 274 /* Declare COM conversion specializations: */ -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r83452 r83494 80 80 template<> bool canConvert<UIMediumFormat>() { return true; } 81 81 template<> bool canConvert<UISettingsDefs::RecordingMode>() { return true; } 82 template<> bool canConvert<VMResou ceMonitorColumn>(){ return true; };82 template<> bool canConvert<VMResourceMonitorColumn>(){ return true; }; 83 83 84 84 … … 2571 2571 } 2572 2572 2573 template<> QString toInternalString(const VMResou ceMonitorColumn &enmVMResourceMonitorColumn)2573 template<> QString toInternalString(const VMResourceMonitorColumn &enmVMResourceMonitorColumn) 2574 2574 { 2575 2575 QString strResult; 2576 2576 switch (enmVMResourceMonitorColumn) 2577 2577 { 2578 case VMResou ceMonitorColumn_Name: strResult = "VMName"; break;2579 case VMResou ceMonitorColumn_CPUGuestLoad: strResult = "CPUGuestLoad"; break;2580 case VMResou ceMonitorColumn_CPUVMMLoad: strResult = "CPUVMMLoad"; break;2581 case VMResou ceMonitorColumn_RAMUsedAndTotal: strResult = "RAMUsedAndTotal"; break;2582 case VMResou ceMonitorColumn_RAMUsedPercentage: strResult = "RAMUsedPercentage"; break;2583 case VMResou ceMonitorColumn_NetworkUpRate: strResult = "NetworkUpRate"; break;2584 case VMResou ceMonitorColumn_NetworkDownRate: strResult = "NetworkDownRate"; break;2585 case VMResou ceMonitorColumn_NetworkUpTotal: strResult = "NetworkUpTotal"; break;2586 case VMResou ceMonitorColumn_NetworkDownTotal: strResult = "NetworkDownTotal"; break;2587 case VMResou ceMonitorColumn_DiskIOReadRate: strResult = "DiskIOReadRate"; break;2588 case VMResou ceMonitorColumn_DiskIOWriteRate: strResult = "DiskIOWriteRate"; break;2589 case VMResou ceMonitorColumn_DiskIOReadTotal: strResult = "DiskIOReadTotal"; break;2590 case VMResou ceMonitorColumn_DiskIOWriteTotal: strResult = "DiskIOWriteTotal"; break;2591 case VMResou ceMonitorColumn_VMExits: strResult = "VMExits"; break;2578 case VMResourceMonitorColumn_Name: strResult = "VMName"; break; 2579 case VMResourceMonitorColumn_CPUGuestLoad: strResult = "CPUGuestLoad"; break; 2580 case VMResourceMonitorColumn_CPUVMMLoad: strResult = "CPUVMMLoad"; break; 2581 case VMResourceMonitorColumn_RAMUsedAndTotal: strResult = "RAMUsedAndTotal"; break; 2582 case VMResourceMonitorColumn_RAMUsedPercentage: strResult = "RAMUsedPercentage"; break; 2583 case VMResourceMonitorColumn_NetworkUpRate: strResult = "NetworkUpRate"; break; 2584 case VMResourceMonitorColumn_NetworkDownRate: strResult = "NetworkDownRate"; break; 2585 case VMResourceMonitorColumn_NetworkUpTotal: strResult = "NetworkUpTotal"; break; 2586 case VMResourceMonitorColumn_NetworkDownTotal: strResult = "NetworkDownTotal"; break; 2587 case VMResourceMonitorColumn_DiskIOReadRate: strResult = "DiskIOReadRate"; break; 2588 case VMResourceMonitorColumn_DiskIOWriteRate: strResult = "DiskIOWriteRate"; break; 2589 case VMResourceMonitorColumn_DiskIOReadTotal: strResult = "DiskIOReadTotal"; break; 2590 case VMResourceMonitorColumn_DiskIOWriteTotal: strResult = "DiskIOWriteTotal"; break; 2591 case VMResourceMonitorColumn_VMExits: strResult = "VMExits"; break; 2592 2592 default: 2593 2593 { … … 2599 2599 } 2600 2600 2601 template<> VMResou ceMonitorColumn fromInternalString<VMResouceMonitorColumn>(const QString &strVMResourceMonitorColumn)2602 { 2603 QStringList keys; QList<VMResou ceMonitorColumn> values;2604 keys << "VMName"; values << VMResou ceMonitorColumn_Name;2605 keys << "CPUGuestLoad"; values << VMResou ceMonitorColumn_CPUGuestLoad;2606 keys << "CPUVMMLoad"; values << VMResou ceMonitorColumn_CPUVMMLoad;2607 keys << "RAMUsedAndTotal"; values << VMResou ceMonitorColumn_RAMUsedAndTotal;2608 keys << "RAMUsedPercentage"; values << VMResou ceMonitorColumn_RAMUsedPercentage;2609 keys << "NetworkUpRate"; values << VMResou ceMonitorColumn_NetworkUpRate;2610 keys << "NetworkDownRate"; values << VMResou ceMonitorColumn_NetworkDownRate;2611 keys << "NetworkUpTotal"; values << VMResou ceMonitorColumn_NetworkUpTotal;2612 keys << "NetworkDownTotal"; values << VMResou ceMonitorColumn_NetworkDownTotal;2613 keys << "DiskIOReadRate"; values << VMResou ceMonitorColumn_DiskIOReadRate;2614 keys << "DiskIOWriteRate"; values << VMResou ceMonitorColumn_DiskIOWriteRate;2615 keys << "DiskIOReadTotal"; values << VMResou ceMonitorColumn_DiskIOReadTotal;2616 keys << "DiskIOWriteTotal"; values << VMResou ceMonitorColumn_DiskIOWriteTotal;2617 keys << "VMExits"; values << VMResou ceMonitorColumn_VMExits;2601 template<> VMResourceMonitorColumn fromInternalString<VMResourceMonitorColumn>(const QString &strVMResourceMonitorColumn) 2602 { 2603 QStringList keys; QList<VMResourceMonitorColumn> values; 2604 keys << "VMName"; values << VMResourceMonitorColumn_Name; 2605 keys << "CPUGuestLoad"; values << VMResourceMonitorColumn_CPUGuestLoad; 2606 keys << "CPUVMMLoad"; values << VMResourceMonitorColumn_CPUVMMLoad; 2607 keys << "RAMUsedAndTotal"; values << VMResourceMonitorColumn_RAMUsedAndTotal; 2608 keys << "RAMUsedPercentage"; values << VMResourceMonitorColumn_RAMUsedPercentage; 2609 keys << "NetworkUpRate"; values << VMResourceMonitorColumn_NetworkUpRate; 2610 keys << "NetworkDownRate"; values << VMResourceMonitorColumn_NetworkDownRate; 2611 keys << "NetworkUpTotal"; values << VMResourceMonitorColumn_NetworkUpTotal; 2612 keys << "NetworkDownTotal"; values << VMResourceMonitorColumn_NetworkDownTotal; 2613 keys << "DiskIOReadRate"; values << VMResourceMonitorColumn_DiskIOReadRate; 2614 keys << "DiskIOWriteRate"; values << VMResourceMonitorColumn_DiskIOWriteRate; 2615 keys << "DiskIOReadTotal"; values << VMResourceMonitorColumn_DiskIOReadTotal; 2616 keys << "DiskIOWriteTotal"; values << VMResourceMonitorColumn_DiskIOWriteTotal; 2617 keys << "VMExits"; values << VMResourceMonitorColumn_VMExits; 2618 2618 if (!keys.contains(strVMResourceMonitorColumn, Qt::CaseInsensitive)) 2619 return VMResou ceMonitorColumn_Max;2619 return VMResourceMonitorColumn_Max; 2620 2620 /* Corresponding format for known words: */ 2621 2621 return values.at(keys.indexOf(QRegExp(strVMResourceMonitorColumn, Qt::CaseInsensitive))); -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r83452 r83494 1071 1071 /** Manager UI: VM resource Monitor Column types. 1072 1072 * @note The first element must be 0 and the rest must be consecutive */ 1073 enum VMResou ceMonitorColumn1074 { 1075 VMResou ceMonitorColumn_Name = 0,1076 VMResou ceMonitorColumn_CPUGuestLoad,1077 VMResou ceMonitorColumn_CPUVMMLoad,1078 VMResou ceMonitorColumn_RAMUsedAndTotal,1079 VMResou ceMonitorColumn_RAMUsedPercentage,1080 VMResou ceMonitorColumn_NetworkUpRate,1081 VMResou ceMonitorColumn_NetworkDownRate,1082 VMResou ceMonitorColumn_NetworkUpTotal,1083 VMResou ceMonitorColumn_NetworkDownTotal,1084 VMResou ceMonitorColumn_DiskIOReadRate,1085 VMResou ceMonitorColumn_DiskIOWriteRate,1086 VMResou ceMonitorColumn_DiskIOReadTotal,1087 VMResou ceMonitorColumn_DiskIOWriteTotal,1088 VMResou ceMonitorColumn_VMExits,1089 VMResou ceMonitorColumn_Max1073 enum VMResourceMonitorColumn 1074 { 1075 VMResourceMonitorColumn_Name = 0, 1076 VMResourceMonitorColumn_CPUGuestLoad, 1077 VMResourceMonitorColumn_CPUVMMLoad, 1078 VMResourceMonitorColumn_RAMUsedAndTotal, 1079 VMResourceMonitorColumn_RAMUsedPercentage, 1080 VMResourceMonitorColumn_NetworkUpRate, 1081 VMResourceMonitorColumn_NetworkDownRate, 1082 VMResourceMonitorColumn_NetworkUpTotal, 1083 VMResourceMonitorColumn_NetworkDownTotal, 1084 VMResourceMonitorColumn_DiskIOReadRate, 1085 VMResourceMonitorColumn_DiskIOWriteRate, 1086 VMResourceMonitorColumn_DiskIOReadTotal, 1087 VMResourceMonitorColumn_DiskIOWriteTotal, 1088 VMResourceMonitorColumn_VMExits, 1089 VMResourceMonitorColumn_Max 1090 1090 }; 1091 1091 -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.cpp
r83493 r83494 61 61 }; 62 62 63 64 /********************************************************************************************************************************* 65 * Class UIVMResouceMonitorTableView definition. * 66 *********************************************************************************************************************************/ 67 68 class UIVMResouceMonitorTableView : public QTableView 63 /********************************************************************************************************************************* 64 * Class UIVMResourceMonitorTableView definition. * 65 *********************************************************************************************************************************/ 66 67 class UIVMResourceMonitorTableView : public QTableView 69 68 { 70 69 Q_OBJECT; … … 72 71 public: 73 72 74 UIVMResou ceMonitorTableView(QWidget *pParent = 0);73 UIVMResourceMonitorTableView(QWidget *pParent = 0); 75 74 void setMinimumColumnWidths(const QVector<int>& widths); 76 75 void updateColumVisibility(); … … 91 90 92 91 /********************************************************************************************************************************* 93 * Class UIVMResou ceMonitorItem definition. *92 * Class UIVMResourceMonitorItem definition. * 94 93 *********************************************************************************************************************************/ 95 94 class UIResourceMonitorItem … … 134 133 135 134 /********************************************************************************************************************************* 136 * Class UIVMResou ceMonitorHostStats definition. *137 *********************************************************************************************************************************/ 138 139 class UIVMResou ceMonitorHostStats135 * Class UIVMResourceMonitorHostStats definition. * 136 *********************************************************************************************************************************/ 137 138 class UIVMResourceMonitorHostStats 140 139 { 141 140 142 141 public: 143 142 144 UIVMResou ceMonitorHostStats();143 UIVMResourceMonitorHostStats(); 145 144 quint64 m_fCPUUserLoad; 146 145 quint64 m_fCPUKernelLoad; … … 150 149 151 150 /********************************************************************************************************************************* 152 * Class UIVMResou ceMonitorCheckBox definition. *153 *********************************************************************************************************************************/ 154 155 class UIVMResou ceMonitorCheckBox : public QCheckBox151 * Class UIVMResourceMonitorCheckBox definition. * 152 *********************************************************************************************************************************/ 153 154 class UIVMResourceMonitorCheckBox : public QCheckBox 156 155 { 157 156 Q_OBJECT; … … 159 158 public: 160 159 161 UIVMResou ceMonitorCheckBox(QWidget *parent = 0);160 UIVMResourceMonitorCheckBox(QWidget *parent = 0); 162 161 void setData(const QVariant& data); 163 162 const QVariant data() const; … … 169 168 170 169 /********************************************************************************************************************************* 171 * Class UIVMResou ceMonitorProxyModel definition. *170 * Class UIVMResourceMonitorProxyModel definition. * 172 171 *********************************************************************************************************************************/ 173 172 class UIResourceMonitorProxyModel : public QSortFilterProxyModel … … 185 184 186 185 //virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const /* override */; 187 /** Section (column) visibility is controlled by the QHeaderView (see UIVMResou ceMonitorTableView::updateColumVisibility)186 /** Section (column) visibility is controlled by the QHeaderView (see UIVMResourceMonitorTableView::updateColumVisibility) 188 187 * to have somewhat meaningful column resizing. */ 189 188 //virtual bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const /* override */; … … 246 245 * when the widget is visible in the main UI. */ 247 246 bool m_fShouldUpdate; 248 UIVMResou ceMonitorHostStats m_hostStats;247 UIVMResourceMonitorHostStats m_hostStats; 249 248 }; 250 249 251 250 252 251 /********************************************************************************************************************************* 253 * UIVMResou ceMonitorDelegate definition. *252 * UIVMResourceMonitorDelegate definition. * 254 253 *********************************************************************************************************************************/ 255 254 /** A QItemDelegate child class to disable dashed lines drawn around selected cells in QTableViews */ 256 class UIVMResou ceMonitorDelegate : public QItemDelegate255 class UIVMResourceMonitorDelegate : public QItemDelegate 257 256 { 258 257 … … 267 266 268 267 /********************************************************************************************************************************* 269 * Class UIVMResou ceMonitorTableView implementation. *270 *********************************************************************************************************************************/ 271 272 UIVMResou ceMonitorTableView::UIVMResouceMonitorTableView(QWidget *pParent /* = 0 */)268 * Class UIVMResourceMonitorTableView implementation. * 269 *********************************************************************************************************************************/ 270 271 UIVMResourceMonitorTableView::UIVMResourceMonitorTableView(QWidget *pParent /* = 0 */) 273 272 :QTableView(pParent) 274 , m_minimumColumnWidths(QVector<int>((int)VMResou ceMonitorColumn_Max, 0))275 { 276 } 277 278 void UIVMResou ceMonitorTableView::setMinimumColumnWidths(const QVector<int>& widths)273 , m_minimumColumnWidths(QVector<int>((int)VMResourceMonitorColumn_Max, 0)) 274 { 275 } 276 277 void UIVMResourceMonitorTableView::setMinimumColumnWidths(const QVector<int>& widths) 279 278 { 280 279 m_minimumColumnWidths = widths; 281 280 } 282 281 283 void UIVMResou ceMonitorTableView::updateColumVisibility()282 void UIVMResourceMonitorTableView::updateColumVisibility() 284 283 { 285 284 UIResourceMonitorProxyModel *pProxyModel = qobject_cast<UIResourceMonitorProxyModel *>(model()); … … 291 290 if (!pModel || !pHeader) 292 291 return; 293 for (int i = (int)VMResou ceMonitorColumn_Name; i < (int)VMResouceMonitorColumn_Max; ++i)292 for (int i = (int)VMResourceMonitorColumn_Name; i < (int)VMResourceMonitorColumn_Max; ++i) 294 293 { 295 294 if (!pModel->columnVisible(i)) … … 301 300 } 302 301 303 void UIVMResou ceMonitorTableView::resizeEvent(QResizeEvent *pEvent)302 void UIVMResourceMonitorTableView::resizeEvent(QResizeEvent *pEvent) 304 303 { 305 304 resizeHeader(); … … 307 306 } 308 307 309 void UIVMResou ceMonitorTableView::resizeHeader()308 void UIVMResourceMonitorTableView::resizeHeader() 310 309 { 311 310 QHeaderView* pHeader = horizontalHeader(); … … 325 324 326 325 /********************************************************************************************************************************* 327 * Class UIVMResou ceMonitorItem implementation. *326 * Class UIVMResourceMonitorItem implementation. * 328 327 *********************************************************************************************************************************/ 329 328 UIResourceMonitorItem::UIResourceMonitorItem(const QUuid &uid, const QString &strVMName) … … 415 414 416 415 /********************************************************************************************************************************* 417 * Class UIVMResou ceMonitorHostStats implementation. *418 *********************************************************************************************************************************/ 419 420 UIVMResou ceMonitorHostStats::UIVMResouceMonitorHostStats()416 * Class UIVMResourceMonitorHostStats implementation. * 417 *********************************************************************************************************************************/ 418 419 UIVMResourceMonitorHostStats::UIVMResourceMonitorHostStats() 421 420 : m_fCPUUserLoad(0) 422 421 , m_fCPUKernelLoad(0) … … 428 427 429 428 /********************************************************************************************************************************* 430 * Class UIVMResou ceMonitorCheckBox implementation. *431 *********************************************************************************************************************************/ 432 433 UIVMResou ceMonitorCheckBox::UIVMResouceMonitorCheckBox(QWidget *parent /* = 0 */)429 * Class UIVMResourceMonitorCheckBox implementation. * 430 *********************************************************************************************************************************/ 431 432 UIVMResourceMonitorCheckBox::UIVMResourceMonitorCheckBox(QWidget *parent /* = 0 */) 434 433 :QCheckBox(parent) 435 434 { 436 435 } 437 void UIVMResou ceMonitorCheckBox::setData(const QVariant& data)436 void UIVMResourceMonitorCheckBox::setData(const QVariant& data) 438 437 { 439 438 m_data = data; 440 439 } 441 440 442 const QVariant UIVMResou ceMonitorCheckBox::data() const441 const QVariant UIVMResourceMonitorCheckBox::data() const 443 442 { 444 443 return m_data; … … 447 446 448 447 /********************************************************************************************************************************* 449 * Class UIVMResou ceMonitorProxyModel implementation. *448 * Class UIVMResourceMonitorProxyModel implementation. * 450 449 *********************************************************************************************************************************/ 451 450 UIResourceMonitorProxyModel::UIResourceMonitorProxyModel(QObject *parent /* = 0 */) … … 507 506 { 508 507 Q_UNUSED(parent); 509 return VMResou ceMonitorColumn_Max;508 return VMResourceMonitorColumn_Max; 510 509 } 511 510 … … 523 522 switch (index.column()) 524 523 { 525 case VMResou ceMonitorColumn_Name:524 case VMResourceMonitorColumn_Name: 526 525 return m_itemList[index.row()].m_strVMName; 527 526 break; 528 case VMResou ceMonitorColumn_CPUGuestLoad:527 case VMResourceMonitorColumn_CPUGuestLoad: 529 528 return m_itemList[index.row()].m_uCPUGuestLoad; 530 529 break; 531 case VMResou ceMonitorColumn_CPUVMMLoad:530 case VMResourceMonitorColumn_CPUVMMLoad: 532 531 return m_itemList[index.row()].m_uCPUVMMLoad; 533 532 break; 534 case VMResou ceMonitorColumn_RAMUsedAndTotal:533 case VMResourceMonitorColumn_RAMUsedAndTotal: 535 534 if (m_itemList[index.row()].isWithGuestAdditions()) 536 535 return QString("%1/%2").arg(uiCommon().formatSize(_1K * m_itemList[index.row()].m_uUsedRAM, iDecimalCount)). … … 539 538 return tr("N/A"); 540 539 break; 541 case VMResou ceMonitorColumn_RAMUsedPercentage:540 case VMResourceMonitorColumn_RAMUsedPercentage: 542 541 if (m_itemList[index.row()].isWithGuestAdditions()) 543 542 return QString("%1%").arg(QString::number(m_itemList[index.row()].m_fRAMUsagePercentage, 'f', 2)); … … 545 544 return tr("N/A"); 546 545 break; 547 case VMResou ceMonitorColumn_NetworkUpRate:546 case VMResourceMonitorColumn_NetworkUpRate: 548 547 return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uNetworkUpRate, iDecimalCount)); 549 548 break; 550 case VMResou ceMonitorColumn_NetworkDownRate:549 case VMResourceMonitorColumn_NetworkDownRate: 551 550 return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uNetworkDownRate, iDecimalCount)); 552 551 break; 553 case VMResou ceMonitorColumn_NetworkUpTotal:552 case VMResourceMonitorColumn_NetworkUpTotal: 554 553 return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uNetworkUpTotal, iDecimalCount)); 555 554 break; 556 case VMResou ceMonitorColumn_NetworkDownTotal:555 case VMResourceMonitorColumn_NetworkDownTotal: 557 556 return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uNetworkDownTotal, iDecimalCount)); 558 557 break; 559 case VMResou ceMonitorColumn_DiskIOReadRate:558 case VMResourceMonitorColumn_DiskIOReadRate: 560 559 return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uDiskReadRate, iDecimalCount)); 561 560 break; 562 case VMResou ceMonitorColumn_DiskIOWriteRate:561 case VMResourceMonitorColumn_DiskIOWriteRate: 563 562 return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uDiskWriteRate, iDecimalCount)); 564 563 break; 565 case VMResou ceMonitorColumn_DiskIOReadTotal:564 case VMResourceMonitorColumn_DiskIOReadTotal: 566 565 return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uDiskReadTotal, iDecimalCount)); 567 566 break; 568 case VMResou ceMonitorColumn_DiskIOWriteTotal:567 case VMResourceMonitorColumn_DiskIOWriteTotal: 569 568 return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uDiskWriteTotal, iDecimalCount)); 570 569 break; 571 case VMResou ceMonitorColumn_VMExits:570 case VMResourceMonitorColumn_VMExits: 572 571 return QString("%1/%2").arg(UICommon::addMetricSuffixToNumber(m_itemList[index.row()].m_uVMExitRate)). 573 572 arg(UICommon::addMetricSuffixToNumber(m_itemList[index.row()].m_uVMExitTotal)); … … 642 641 ULONG aPctVMM; 643 642 644 // bool fRAMColumns = columnVisible(VMResou ceMonitorColumn_RAMUsedAndTotal)645 // || columnVisible(VMResou ceMonitorColumn_RAMUsedPercentage);646 bool fCPUColumns = columnVisible(VMResou ceMonitorColumn_CPUVMMLoad) || columnVisible(VMResouceMonitorColumn_CPUGuestLoad);647 bool fNetworkColumns = columnVisible(VMResou ceMonitorColumn_NetworkUpRate)648 || columnVisible(VMResou ceMonitorColumn_NetworkDownRate)649 || columnVisible(VMResou ceMonitorColumn_NetworkUpTotal)650 || columnVisible(VMResou ceMonitorColumn_NetworkDownTotal);651 bool fIOColumns = columnVisible(VMResou ceMonitorColumn_DiskIOReadRate)652 || columnVisible(VMResou ceMonitorColumn_DiskIOWriteRate)653 || columnVisible(VMResou ceMonitorColumn_DiskIOReadTotal)654 || columnVisible(VMResou ceMonitorColumn_DiskIOWriteTotal);655 bool fVMExitColumn = columnVisible(VMResou ceMonitorColumn_VMExits);643 // bool fRAMColumns = columnVisible(VMResourceMonitorColumn_RAMUsedAndTotal) 644 // || columnVisible(VMResourceMonitorColumn_RAMUsedPercentage); 645 bool fCPUColumns = columnVisible(VMResourceMonitorColumn_CPUVMMLoad) || columnVisible(VMResourceMonitorColumn_CPUGuestLoad); 646 bool fNetworkColumns = columnVisible(VMResourceMonitorColumn_NetworkUpRate) 647 || columnVisible(VMResourceMonitorColumn_NetworkDownRate) 648 || columnVisible(VMResourceMonitorColumn_NetworkUpTotal) 649 || columnVisible(VMResourceMonitorColumn_NetworkDownTotal); 650 bool fIOColumns = columnVisible(VMResourceMonitorColumn_DiskIOReadRate) 651 || columnVisible(VMResourceMonitorColumn_DiskIOWriteRate) 652 || columnVisible(VMResourceMonitorColumn_DiskIOReadTotal) 653 || columnVisible(VMResourceMonitorColumn_DiskIOWriteTotal); 654 bool fVMExitColumn = columnVisible(VMResourceMonitorColumn_VMExits); 656 655 657 656 getHostRAMStats(); … … 862 861 void UIResourceMonitorWidget::retranslateUi() 863 862 { 864 m_columnCaptions.resize(VMResou ceMonitorColumn_Max);865 m_columnCaptions[VMResou ceMonitorColumn_Name] = tr("VM Name");866 m_columnCaptions[VMResou ceMonitorColumn_CPUGuestLoad] = tr("CPU Guest");867 m_columnCaptions[VMResou ceMonitorColumn_CPUVMMLoad] = tr("CPU VMM");868 m_columnCaptions[VMResou ceMonitorColumn_RAMUsedAndTotal] = tr("RAM Used/Total");869 m_columnCaptions[VMResou ceMonitorColumn_RAMUsedPercentage] = tr("RAM %");870 m_columnCaptions[VMResou ceMonitorColumn_NetworkUpRate] = tr("Network Up Rate");871 m_columnCaptions[VMResou ceMonitorColumn_NetworkDownRate] = tr("Network Down Rate");872 m_columnCaptions[VMResou ceMonitorColumn_NetworkUpTotal] = tr("Network Up Total");873 m_columnCaptions[VMResou ceMonitorColumn_NetworkDownTotal] = tr("Network Down Total");874 m_columnCaptions[VMResou ceMonitorColumn_DiskIOReadRate] = tr("Disk Read Rate");875 m_columnCaptions[VMResou ceMonitorColumn_DiskIOWriteRate] = tr("Disk Write Rate");876 m_columnCaptions[VMResou ceMonitorColumn_DiskIOReadTotal] = tr("Disk Read Total");877 m_columnCaptions[VMResou ceMonitorColumn_DiskIOWriteTotal] = tr("Disk Write Total");878 m_columnCaptions[VMResou ceMonitorColumn_VMExits] = tr("VM Exits");863 m_columnCaptions.resize(VMResourceMonitorColumn_Max); 864 m_columnCaptions[VMResourceMonitorColumn_Name] = tr("VM Name"); 865 m_columnCaptions[VMResourceMonitorColumn_CPUGuestLoad] = tr("CPU Guest"); 866 m_columnCaptions[VMResourceMonitorColumn_CPUVMMLoad] = tr("CPU VMM"); 867 m_columnCaptions[VMResourceMonitorColumn_RAMUsedAndTotal] = tr("RAM Used/Total"); 868 m_columnCaptions[VMResourceMonitorColumn_RAMUsedPercentage] = tr("RAM %"); 869 m_columnCaptions[VMResourceMonitorColumn_NetworkUpRate] = tr("Network Up Rate"); 870 m_columnCaptions[VMResourceMonitorColumn_NetworkDownRate] = tr("Network Down Rate"); 871 m_columnCaptions[VMResourceMonitorColumn_NetworkUpTotal] = tr("Network Up Total"); 872 m_columnCaptions[VMResourceMonitorColumn_NetworkDownTotal] = tr("Network Down Total"); 873 m_columnCaptions[VMResourceMonitorColumn_DiskIOReadRate] = tr("Disk Read Rate"); 874 m_columnCaptions[VMResourceMonitorColumn_DiskIOWriteRate] = tr("Disk Write Rate"); 875 m_columnCaptions[VMResourceMonitorColumn_DiskIOReadTotal] = tr("Disk Read Total"); 876 m_columnCaptions[VMResourceMonitorColumn_DiskIOWriteTotal] = tr("Disk Write Total"); 877 m_columnCaptions[VMResourceMonitorColumn_VMExits] = tr("VM Exits"); 879 878 if (m_pModel) 880 879 m_pModel->setColumnCaptions(m_columnCaptions); … … 939 938 m_pProxyModel = new UIResourceMonitorProxyModel(this); 940 939 941 m_pTableView = new UIVMResou ceMonitorTableView();940 m_pTableView = new UIVMResourceMonitorTableView(); 942 941 if (m_pTableView && m_pModel && m_pProxyModel) 943 942 { … … 948 947 m_pProxyModel->setSourceModel(m_pModel); 949 948 m_pTableView->setModel(m_pProxyModel); 950 m_pTableView->setItemDelegate(new UIVMResou ceMonitorDelegate);949 m_pTableView->setItemDelegate(new UIVMResourceMonitorDelegate); 951 950 m_pTableView->setSelectionMode(QAbstractItemView::NoSelection); 952 951 /* m_pTableView->setSelectionMode(QAbstractItemView::SingleSelection); … … 978 977 QVBoxLayout* pLayout = new QVBoxLayout(m_pColumnSelectionMenu); 979 978 int iLength = 0; 980 for (int i = 0; i < VMResou ceMonitorColumn_Max; ++i)981 { 982 UIVMResou ceMonitorCheckBox* pCheckBox = new UIVMResouceMonitorCheckBox;979 for (int i = 0; i < VMResourceMonitorColumn_Max; ++i) 980 { 981 UIVMResourceMonitorCheckBox* pCheckBox = new UIVMResourceMonitorCheckBox; 983 982 pCheckBox->setText(m_columnCaptions[i]); 984 983 iLength = m_columnCaptions[i].length() > iLength ? m_columnCaptions[i].length() : iLength; … … 988 987 pCheckBox->setData(i); 989 988 pCheckBox->setChecked(columnVisible(i)); 990 if (i == (int)VMResou ceMonitorColumn_Name)989 if (i == (int)VMResourceMonitorColumn_Name) 991 990 pCheckBox->setEnabled(false); 992 connect(pCheckBox, &UIVMResou ceMonitorCheckBox::toggled, this, &UIResourceMonitorWidget::sltHandleColumnAction);991 connect(pCheckBox, &UIVMResourceMonitorCheckBox::toggled, this, &UIResourceMonitorWidget::sltHandleColumnAction); 993 992 } 994 993 QFontMetrics fontMetrics(m_pColumnSelectionMenu->font()); … … 1032 1031 { 1033 1032 QStringList hiddenColumnList = gEDataManager->VMResourceMonitorHiddenColumnList(); 1034 for (int i = (int)VMResou ceMonitorColumn_Name; i < (int)VMResouceMonitorColumn_Max; ++i)1033 for (int i = (int)VMResourceMonitorColumn_Name; i < (int)VMResourceMonitorColumn_Max; ++i) 1035 1034 m_columnVisible[i] = true; 1036 1035 foreach(const QString& strColumn, hiddenColumnList) 1037 setColumnVisible((int)gpConverter->fromInternalString<VMResou ceMonitorColumn>(strColumn), false);1036 setColumnVisible((int)gpConverter->fromInternalString<VMResourceMonitorColumn>(strColumn), false); 1038 1037 } 1039 1038 … … 1044 1043 { 1045 1044 if (!columnVisible(i)) 1046 hiddenColumnList << gpConverter->toInternalString((VMResou ceMonitorColumn) i);1045 hiddenColumnList << gpConverter->toInternalString((VMResourceMonitorColumn) i); 1047 1046 } 1048 1047 gEDataManager->setVMResourceMonitorHiddenColumnList(hiddenColumnList); … … 1070 1069 void UIResourceMonitorWidget::sltHandleColumnAction(bool fChecked) 1071 1070 { 1072 UIVMResou ceMonitorCheckBox* pSender = qobject_cast<UIVMResouceMonitorCheckBox*>(sender());1071 UIVMResourceMonitorCheckBox* pSender = qobject_cast<UIVMResourceMonitorCheckBox*>(sender()); 1073 1072 if (!pSender) 1074 1073 return; -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.h
r83475 r83494 39 39 class UIResourceMonitorProxyModel; 40 40 class UIResourceMonitorModel; 41 class UIVMResou ceMonitorTableView;41 class UIVMResourceMonitorTableView; 42 42 43 43 /** QWidget extension to display a Linux top like utility that sort running vm wrt. resource allocations. */ … … 106 106 * @{ */ 107 107 UIToolBar *m_pToolBar; 108 UIVMResou ceMonitorTableView *m_pTableView;108 UIVMResourceMonitorTableView *m_pTableView; 109 109 UIResourceMonitorProxyModel *m_pProxyModel; 110 110 UIResourceMonitorModel *m_pModel; 111 111 QVector<QString> m_columnCaptions; 112 /* The key is the column id (VMResou ceMonitorColumn) and value is true if the column is visible. */112 /* The key is the column id (VMResourceMonitorColumn) and value is true if the column is visible. */ 113 113 QMap<int, bool> m_columnVisible; 114 114 /** @} */
Note:
See TracChangeset
for help on using the changeset viewer.