Changeset 83334 in vbox for trunk/src/VBox
- Timestamp:
- Mar 19, 2020 4:17:08 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 added
- 3 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r83304 r83334 331 331 ./src/manager/chooser \ 332 332 ./src/manager/details \ 333 ./src/manager/tools 333 ./src/manager/tools \ 334 ./src/monitor \ 335 ./src/monitor/resource 334 336 335 337 ifdef VBOX_GUI_WITH_NETWORK_MANAGER … … 625 627 src/manager/UIVirtualMachineItemCloud.h \ 626 628 src/manager/UIVirtualMachineItemLocal.h \ 627 src/manager/UIVMResourceMonitor.h \628 629 src/manager/UIWelcomePane.h \ 629 630 src/manager/chooser/UIChooser.h \ … … 660 661 src/medium/UIMediumDetailsWidget.h \ 661 662 src/medium/UIMediumManager.h \ 663 src/monitor/resource/UIResourceMonitor.h \ 662 664 src/snapshots/UISnapshotDetailsWidget.h \ 663 665 src/snapshots/UISnapshotPane.h \ … … 958 960 VirtualBox_QT_MOCSRCS = \ 959 961 src/hostnetwork/UIHostNetworkManager.cpp \ 960 src/manager/UIVMResourceMonitor.cpp \961 962 src/manager/UIWelcomePane.cpp \ 963 src/monitor/resource/UIResourceMonitor.cpp \ 962 964 src/snapshots/UISnapshotDetailsWidget.cpp \ 963 965 src/snapshots/UISnapshotPane.cpp \ … … 994 996 # 995 997 # VirtualBox - GUI Global Shared Library. 996 # Sources .998 # Sources containing local definitions of classes that use the Q_OBJECT macro. 997 999 # 998 1000 UICommon_QT_MOCSRCS = \ … … 1074 1076 src/manager/UIVirtualMachineItemCloud.cpp \ 1075 1077 src/manager/UIVirtualMachineItemLocal.cpp \ 1076 src/manager/UIVMResourceMonitor.cpp \1077 1078 src/manager/UIWelcomePane.cpp \ 1078 1079 src/manager/chooser/UIChooser.cpp \ … … 1109 1110 src/medium/UIMediumDetailsWidget.cpp \ 1110 1111 src/medium/UIMediumManager.cpp \ 1112 src/monitor/resource/UIResourceMonitor.cpp \ 1111 1113 src/snapshots/UISnapshotDetailsWidget.cpp \ 1112 1114 src/snapshots/UISnapshotPane.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.cpp
r83304 r83334 29 29 #include "UIMediumManager.h" 30 30 #include "UIToolPaneGlobal.h" 31 #include "UI VMResourceMonitor.h"31 #include "UIResourceMonitor.h" 32 32 #include "UIWelcomePane.h" 33 33 … … 171 171 case UIToolType_VMResourceMonitor: 172 172 { 173 m_pPaneResourceMonitor = new UI VMResourceMonitorWidget(EmbedTo_Stack, m_pActionPool, false /* show toolbar */);173 m_pPaneResourceMonitor = new UIResourceMonitorWidget(EmbedTo_Stack, m_pActionPool, false /* show toolbar */); 174 174 AssertPtrReturnVoid(m_pPaneResourceMonitor); 175 175 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.h
r83304 r83334 37 37 class UIMediumManagerWidget; 38 38 class UIVirtualMachineItem; 39 class UI VMResourceMonitorWidget;39 class UIResourceMonitorWidget; 40 40 class UIWelcomePane; 41 41 class CMachine; … … 91 91 UICloudProfileManagerWidget *m_pPaneCloud; 92 92 /** The VM Resource Monitor instance. */ 93 UI VMResourceMonitorWidget *m_pPaneResourceMonitor;93 UIResourceMonitorWidget *m_pPaneResourceMonitor; 94 94 }; 95 95 -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.cpp
r83333 r83334 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI VMResourceMonitor class implementation.3 * VBox Qt GUI - UIResourceMonitor class implementation. 4 4 */ 5 5 … … 33 33 #include "UIIconPool.h" 34 34 #include "UIInformationPerformanceMonitor.h" 35 #include "UI VMResourceMonitor.h"35 #include "UIResourceMonitor.h" 36 36 #include "UIMessageCenter.h" 37 37 #include "UIToolBar.h" … … 68 68 * Class UIVMResouceMonitorItem definition. * 69 69 *********************************************************************************************************************************/ 70 class UI VMResourceMonitorItem70 class UIResourceMonitorItem 71 71 { 72 72 public: 73 UI VMResourceMonitorItem(const QUuid &uid, const QString &strVMName);74 UI VMResourceMonitorItem(const QUuid &uid);75 UI VMResourceMonitorItem();76 bool operator==(const UI VMResourceMonitorItem& other) const;73 UIResourceMonitorItem(const QUuid &uid, const QString &strVMName); 74 UIResourceMonitorItem(const QUuid &uid); 75 UIResourceMonitorItem(); 76 bool operator==(const UIResourceMonitorItem& other) const; 77 77 QUuid m_VMuid; 78 78 QString m_strVMName; … … 96 96 * Class UIVMResouceMonitorProxyModel definition. * 97 97 *********************************************************************************************************************************/ 98 class UI VMResourceMonitorProxyModel : public QSortFilterProxyModel98 class UIResourceMonitorProxyModel : public QSortFilterProxyModel 99 99 { 100 100 … … 103 103 public: 104 104 105 UI VMResourceMonitorProxyModel(QObject *parent = 0);105 UIResourceMonitorProxyModel(QObject *parent = 0); 106 106 107 107 protected: … … 115 115 116 116 /********************************************************************************************************************************* 117 * Class UI VMResourceMonitorModel definition.*118 *********************************************************************************************************************************/ 119 class UI VMResourceMonitorModel : public QAbstractTableModel117 * Class UIResourceMonitorModel definition. * 118 *********************************************************************************************************************************/ 119 class UIResourceMonitorModel : public QAbstractTableModel 120 120 { 121 121 Q_OBJECT; … … 123 123 public: 124 124 125 UI VMResourceMonitorModel(QObject *parent = 0);125 UIResourceMonitorModel(QObject *parent = 0); 126 126 int rowCount(const QModelIndex &parent = QModelIndex()) const /* override */; 127 127 int columnCount(const QModelIndex &parent = QModelIndex()) const /* override */; … … 136 136 private: 137 137 138 QVector<UI VMResourceMonitorItem> m_itemList;138 QVector<UIResourceMonitorItem> m_itemList; 139 139 void initializeItems(); 140 140 … … 145 145 * Class UIVMResouceMonitorItem implementation. * 146 146 *********************************************************************************************************************************/ 147 UI VMResourceMonitorItem::UIVMResourceMonitorItem(const QUuid &uid, const QString &strVMName)147 UIResourceMonitorItem::UIResourceMonitorItem(const QUuid &uid, const QString &strVMName) 148 148 : m_VMuid(uid) 149 149 , m_strVMName(strVMName) … … 166 166 } 167 167 168 UI VMResourceMonitorItem::UIVMResourceMonitorItem()168 UIResourceMonitorItem::UIResourceMonitorItem() 169 169 : m_VMuid(QUuid()) 170 170 , m_uNetworkDownRate(0) … … 179 179 } 180 180 181 UI VMResourceMonitorItem::UIVMResourceMonitorItem(const QUuid &uid)181 UIResourceMonitorItem::UIResourceMonitorItem(const QUuid &uid) 182 182 : m_VMuid(uid) 183 183 , m_uNetworkDownRate(0) … … 192 192 } 193 193 194 bool UI VMResourceMonitorItem::operator==(const UIVMResourceMonitorItem& other) const194 bool UIResourceMonitorItem::operator==(const UIResourceMonitorItem& other) const 195 195 { 196 196 if (m_VMuid == other.m_VMuid) … … 203 203 * Class UIVMResouceMonitorProxyModel implementation. * 204 204 *********************************************************************************************************************************/ 205 UI VMResourceMonitorProxyModel::UIVMResourceMonitorProxyModel(QObject *parent /* = 0 */)205 UIResourceMonitorProxyModel::UIResourceMonitorProxyModel(QObject *parent /* = 0 */) 206 206 :QSortFilterProxyModel(parent) 207 207 { … … 210 210 211 211 /********************************************************************************************************************************* 212 * Class UI VMResourceMonitorModel implementation.*213 *********************************************************************************************************************************/ 214 UI VMResourceMonitorModel::UIVMResourceMonitorModel(QObject *parent /*= 0*/)212 * Class UIResourceMonitorModel implementation. * 213 *********************************************************************************************************************************/ 214 UIResourceMonitorModel::UIResourceMonitorModel(QObject *parent /*= 0*/) 215 215 :QAbstractTableModel(parent) 216 216 , m_pTimer(new QTimer(this)) … … 218 218 initializeItems(); 219 219 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange, 220 this, &UI VMResourceMonitorModel::sltMachineStateChanged);220 this, &UIResourceMonitorModel::sltMachineStateChanged); 221 221 222 222 if (m_pTimer) 223 223 { 224 connect(m_pTimer, &QTimer::timeout, this, &UI VMResourceMonitorModel::sltTimeout);224 connect(m_pTimer, &QTimer::timeout, this, &UIResourceMonitorModel::sltTimeout); 225 225 m_pTimer->start(1000); 226 226 } 227 227 } 228 228 229 int UI VMResourceMonitorModel::rowCount(const QModelIndex &parent /* = QModelIndex() */) const229 int UIResourceMonitorModel::rowCount(const QModelIndex &parent /* = QModelIndex() */) const 230 230 { 231 231 Q_UNUSED(parent); … … 233 233 } 234 234 235 int UI VMResourceMonitorModel::columnCount(const QModelIndex &parent /* = QModelIndex() */) const235 int UIResourceMonitorModel::columnCount(const QModelIndex &parent /* = QModelIndex() */) const 236 236 { 237 237 Q_UNUSED(parent); … … 239 239 } 240 240 241 QVariant UI VMResourceMonitorModel::data(const QModelIndex &index, int role) const241 QVariant UIResourceMonitorModel::data(const QModelIndex &index, int role) const 242 242 { 243 243 if (!index.isValid() || role != Qt::DisplayRole || index.row() >= rowCount()) … … 263 263 } 264 264 265 QVariant UI VMResourceMonitorModel::headerData(int section, Qt::Orientation orientation, int role) const265 QVariant UIResourceMonitorModel::headerData(int section, Qt::Orientation orientation, int role) const 266 266 { 267 267 if (role == Qt::DisplayRole && orientation == Qt::Horizontal) … … 296 296 } 297 297 298 void UI VMResourceMonitorModel::initializeItems()298 void UIResourceMonitorModel::initializeItems() 299 299 { 300 300 foreach (const CMachine &comMachine, uiCommon().virtualBox().GetMachines()) … … 304 304 if (comMachine.GetState() == KMachineState_Running) 305 305 { 306 m_itemList << UI VMResourceMonitorItem(comMachine.GetId(), comMachine.GetName());306 m_itemList << UIResourceMonitorItem(comMachine.GetId(), comMachine.GetName()); 307 307 } 308 308 } … … 310 310 } 311 311 312 void UI VMResourceMonitorModel::sltMachineStateChanged(const QUuid &uId, const KMachineState state)313 { 314 int iIndex = m_itemList.indexOf(UI VMResourceMonitorItem(uId));312 void UIResourceMonitorModel::sltMachineStateChanged(const QUuid &uId, const KMachineState state) 313 { 314 int iIndex = m_itemList.indexOf(UIResourceMonitorItem(uId)); 315 315 /* Remove the machine in case machine is no longer working. */ 316 316 if (iIndex != -1 && state != KMachineState_Running) … … 324 324 { 325 325 CMachine comMachine = uiCommon().virtualBox().FindMachine(uId.toString()); 326 m_itemList << UI VMResourceMonitorItem(uId, comMachine.GetName());326 m_itemList << UIResourceMonitorItem(uId, comMachine.GetName()); 327 327 emit layoutChanged(); 328 328 } 329 329 } 330 330 331 void UI VMResourceMonitorModel::sltTimeout()331 void UIResourceMonitorModel::sltTimeout() 332 332 { 333 333 ULONG aPctExecuting; … … 350 350 351 351 /********************************************************************************************************************************* 352 * Class UI VMResourceMonitorWidget implementation.*353 *********************************************************************************************************************************/ 354 355 UI VMResourceMonitorWidget::UIVMResourceMonitorWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,352 * Class UIResourceMonitorWidget implementation. * 353 *********************************************************************************************************************************/ 354 355 UIResourceMonitorWidget::UIResourceMonitorWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool, 356 356 bool fShowToolbar /* = true */, QWidget *pParent /* = 0 */) 357 357 : QIWithRetranslateUI<QWidget>(pParent) … … 366 366 } 367 367 368 QMenu *UI VMResourceMonitorWidget::menu() const368 QMenu *UIResourceMonitorWidget::menu() const 369 369 { 370 370 return m_pActionPool->action(UIActionIndexST_M_NetworkWindow)->menu(); 371 371 } 372 372 373 void UI VMResourceMonitorWidget::retranslateUi()374 { 375 } 376 377 void UI VMResourceMonitorWidget::resizeEvent(QResizeEvent *pEvent)373 void UIResourceMonitorWidget::retranslateUi() 374 { 375 } 376 377 void UIResourceMonitorWidget::resizeEvent(QResizeEvent *pEvent) 378 378 { 379 379 QIWithRetranslateUI<QWidget>::resizeEvent(pEvent); 380 380 } 381 381 382 void UI VMResourceMonitorWidget::showEvent(QShowEvent *pEvent)382 void UIResourceMonitorWidget::showEvent(QShowEvent *pEvent) 383 383 { 384 384 QIWithRetranslateUI<QWidget>::showEvent(pEvent); 385 385 } 386 386 387 void UI VMResourceMonitorWidget::prepare()387 void UIResourceMonitorWidget::prepare() 388 388 { 389 389 prepareActions(); … … 393 393 } 394 394 395 void UI VMResourceMonitorWidget::prepareActions()396 { 397 } 398 399 void UI VMResourceMonitorWidget::prepareWidgets()395 void UIResourceMonitorWidget::prepareActions() 396 { 397 } 398 399 void UIResourceMonitorWidget::prepareWidgets() 400 400 { 401 401 /* Create main-layout: */ … … 414 414 prepareToolBar(); 415 415 416 m_pModel = new UI VMResourceMonitorModel(this);417 m_pProxyModel = new UI VMResourceMonitorProxyModel(this);416 m_pModel = new UIResourceMonitorModel(this); 417 m_pProxyModel = new UIResourceMonitorProxyModel(this); 418 418 419 419 m_pTableWidget = new QTableView(); … … 440 440 } 441 441 442 void UI VMResourceMonitorWidget::prepareToolBar()442 void UIResourceMonitorWidget::prepareToolBar() 443 443 { 444 444 /* Create toolbar: */ … … 466 466 467 467 468 void UI VMResourceMonitorWidget::loadSettings()469 { 470 } 471 472 473 /********************************************************************************************************************************* 474 * Class UI VMResourceMonitorFactory implementation.*475 *********************************************************************************************************************************/ 476 477 UI VMResourceMonitorFactory::UIVMResourceMonitorFactory(UIActionPool *pActionPool /* = 0 */)468 void UIResourceMonitorWidget::loadSettings() 469 { 470 } 471 472 473 /********************************************************************************************************************************* 474 * Class UIResourceMonitorFactory implementation. * 475 *********************************************************************************************************************************/ 476 477 UIResourceMonitorFactory::UIResourceMonitorFactory(UIActionPool *pActionPool /* = 0 */) 478 478 : m_pActionPool(pActionPool) 479 479 { 480 480 } 481 481 482 void UI VMResourceMonitorFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget)483 { 484 pDialog = new UI VMResourceMonitor(pCenterWidget, m_pActionPool);485 } 486 487 488 /********************************************************************************************************************************* 489 * Class UI VMResourceMonitor implementation.*490 *********************************************************************************************************************************/ 491 492 UI VMResourceMonitor::UIVMResourceMonitor(QWidget *pCenterWidget, UIActionPool *pActionPool)482 void UIResourceMonitorFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget) 483 { 484 pDialog = new UIResourceMonitor(pCenterWidget, m_pActionPool); 485 } 486 487 488 /********************************************************************************************************************************* 489 * Class UIResourceMonitor implementation. * 490 *********************************************************************************************************************************/ 491 492 UIResourceMonitor::UIResourceMonitor(QWidget *pCenterWidget, UIActionPool *pActionPool) 493 493 : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget) 494 494 , m_pActionPool(pActionPool) … … 496 496 } 497 497 498 void UI VMResourceMonitor::retranslateUi()498 void UIResourceMonitor::retranslateUi() 499 499 { 500 500 setWindowTitle(tr("VM Resource Monitor")); 501 501 } 502 502 503 void UI VMResourceMonitor::configure()503 void UIResourceMonitor::configure() 504 504 { 505 505 /* Apply window icons: */ … … 507 507 } 508 508 509 void UI VMResourceMonitor::configureCentralWidget()510 { 511 UI VMResourceMonitorWidget *pWidget = new UIVMResourceMonitorWidget(EmbedTo_Dialog, m_pActionPool, true, this);509 void UIResourceMonitor::configureCentralWidget() 510 { 511 UIResourceMonitorWidget *pWidget = new UIResourceMonitorWidget(EmbedTo_Dialog, m_pActionPool, true, this); 512 512 AssertPtrReturnVoid(pWidget); 513 513 { … … 521 521 } 522 522 523 void UI VMResourceMonitor::configureButtonBox()524 { 525 } 526 527 void UI VMResourceMonitor::finalize()523 void UIResourceMonitor::configureButtonBox() 524 { 525 } 526 527 void UIResourceMonitor::finalize() 528 528 { 529 529 /* Apply language settings: */ … … 531 531 } 532 532 533 UI VMResourceMonitorWidget *UIVMResourceMonitor::widget()534 { 535 return qobject_cast<UI VMResourceMonitorWidget*>(QIManagerDialog::widget());536 } 537 538 539 #include "UI VMResourceMonitor.moc"533 UIResourceMonitorWidget *UIResourceMonitor::widget() 534 { 535 return qobject_cast<UIResourceMonitorWidget*>(QIManagerDialog::widget()); 536 } 537 538 539 #include "UIResourceMonitor.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.h
r83333 r83334 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI VMResourceMonitor class declaration.3 * VBox Qt GUI - UIResourceMonitor class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_m anager_UIVMResourceMonitor_h19 #define FEQT_INCLUDED_SRC_m anager_UIVMResourceMonitor_h18 #ifndef FEQT_INCLUDED_SRC_monitor_resource_UIResourceMonitor_h 19 #define FEQT_INCLUDED_SRC_monitor_resource_UIResourceMonitor_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 36 36 class UIActionPool; 37 37 class UIToolBar; 38 class UI VMResourceMonitorProxyModel;39 class UI VMResourceMonitorModel;38 class UIResourceMonitorProxyModel; 39 class UIResourceMonitorModel; 40 40 41 41 42 42 /** QWidget extension to display a Linux top like utility that sort running vm wrt. resource allocations. */ 43 class UI VMResourceMonitorWidget : public QIWithRetranslateUI<QWidget>43 class UIResourceMonitorWidget : public QIWithRetranslateUI<QWidget> 44 44 { 45 45 Q_OBJECT; … … 50 50 public: 51 51 52 UI VMResourceMonitorWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,52 UIResourceMonitorWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool, 53 53 bool fShowToolbar = true, QWidget *pParent = 0); 54 54 … … 95 95 UIToolBar *m_pToolBar; 96 96 QTableView *m_pTableWidget; 97 UI VMResourceMonitorProxyModel *m_pProxyModel;98 UI VMResourceMonitorModel *m_pModel;97 UIResourceMonitorProxyModel *m_pProxyModel; 98 UIResourceMonitorModel *m_pModel; 99 99 /** @} */ 100 100 101 101 }; 102 102 103 class UI VMResourceMonitorFactory : public QIManagerDialogFactory103 class UIResourceMonitorFactory : public QIManagerDialogFactory 104 104 { 105 105 public: 106 106 107 UI VMResourceMonitorFactory(UIActionPool *pActionPool = 0);107 UIResourceMonitorFactory(UIActionPool *pActionPool = 0); 108 108 109 109 protected: … … 113 113 }; 114 114 115 class UI VMResourceMonitor : public QIWithRetranslateUI<QIManagerDialog>115 class UIResourceMonitor : public QIWithRetranslateUI<QIManagerDialog> 116 116 { 117 117 Q_OBJECT; … … 119 119 private: 120 120 121 UI VMResourceMonitor(QWidget *pCenterWidget, UIActionPool *pActionPool);121 UIResourceMonitor(QWidget *pCenterWidget, UIActionPool *pActionPool); 122 122 123 123 virtual void retranslateUi() /* override */; … … 133 133 /** @name Widget stuff. 134 134 * @{ */ 135 virtual UI VMResourceMonitorWidget *widget() /* override */;135 virtual UIResourceMonitorWidget *widget() /* override */; 136 136 /** @} */ 137 137 … … 141 141 /** @} */ 142 142 143 friend class UI VMResourceMonitorFactory;143 friend class UIResourceMonitorFactory; 144 144 }; 145 145 146 #endif /* !FEQT_INCLUDED_SRC_m anager_UIVMResourceMonitor_h */146 #endif /* !FEQT_INCLUDED_SRC_monitor_resource_UIResourceMonitor_h */
Note:
See TracChangeset
for help on using the changeset viewer.