VirtualBox

Changeset 83334 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 19, 2020 4:17:08 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9686. Renaming and moving some classes/files.

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  
    331331        ./src/manager/chooser \
    332332        ./src/manager/details \
    333         ./src/manager/tools
     333        ./src/manager/tools \
     334        ./src/monitor \
     335        ./src/monitor/resource
    334336
    335337ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     
    625627        src/manager/UIVirtualMachineItemCloud.h \
    626628        src/manager/UIVirtualMachineItemLocal.h \
    627         src/manager/UIVMResourceMonitor.h \
    628629        src/manager/UIWelcomePane.h \
    629630        src/manager/chooser/UIChooser.h \
     
    660661        src/medium/UIMediumDetailsWidget.h \
    661662        src/medium/UIMediumManager.h \
     663        src/monitor/resource/UIResourceMonitor.h \
    662664        src/snapshots/UISnapshotDetailsWidget.h \
    663665        src/snapshots/UISnapshotPane.h \
     
    958960VirtualBox_QT_MOCSRCS = \
    959961        src/hostnetwork/UIHostNetworkManager.cpp \
    960         src/manager/UIVMResourceMonitor.cpp \
    961962        src/manager/UIWelcomePane.cpp \
     963        src/monitor/resource/UIResourceMonitor.cpp \
    962964        src/snapshots/UISnapshotDetailsWidget.cpp \
    963965        src/snapshots/UISnapshotPane.cpp \
     
    994996#
    995997# VirtualBox - GUI Global Shared Library.
    996 # Sources.
     998# Sources containing local definitions of classes that use the Q_OBJECT macro.
    997999#
    9981000UICommon_QT_MOCSRCS = \
     
    10741076        src/manager/UIVirtualMachineItemCloud.cpp \
    10751077        src/manager/UIVirtualMachineItemLocal.cpp \
    1076         src/manager/UIVMResourceMonitor.cpp \
    10771078        src/manager/UIWelcomePane.cpp \
    10781079        src/manager/chooser/UIChooser.cpp \
     
    11091110        src/medium/UIMediumDetailsWidget.cpp \
    11101111        src/medium/UIMediumManager.cpp \
     1112        src/monitor/resource/UIResourceMonitor.cpp \
    11111113        src/snapshots/UISnapshotDetailsWidget.cpp \
    11121114        src/snapshots/UISnapshotPane.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.cpp

    r83304 r83334  
    2929#include "UIMediumManager.h"
    3030#include "UIToolPaneGlobal.h"
    31 #include "UIVMResourceMonitor.h"
     31#include "UIResourceMonitor.h"
    3232#include "UIWelcomePane.h"
    3333
     
    171171            case UIToolType_VMResourceMonitor:
    172172            {
    173                 m_pPaneResourceMonitor = new UIVMResourceMonitorWidget(EmbedTo_Stack, m_pActionPool, false /* show toolbar */);
     173                m_pPaneResourceMonitor = new UIResourceMonitorWidget(EmbedTo_Stack, m_pActionPool, false /* show toolbar */);
    174174                AssertPtrReturnVoid(m_pPaneResourceMonitor);
    175175                {
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.h

    r83304 r83334  
    3737class UIMediumManagerWidget;
    3838class UIVirtualMachineItem;
    39 class UIVMResourceMonitorWidget;
     39class UIResourceMonitorWidget;
    4040class UIWelcomePane;
    4141class CMachine;
     
    9191    UICloudProfileManagerWidget *m_pPaneCloud;
    9292    /** The VM Resource Monitor instance. */
    93     UIVMResourceMonitorWidget   *m_pPaneResourceMonitor;
     93    UIResourceMonitorWidget   *m_pPaneResourceMonitor;
    9494};
    9595
  • trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.cpp

    r83333 r83334  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIVMResourceMonitor class implementation.
     3 * VBox Qt GUI - UIResourceMonitor class implementation.
    44 */
    55
     
    3333#include "UIIconPool.h"
    3434#include "UIInformationPerformanceMonitor.h"
    35 #include "UIVMResourceMonitor.h"
     35#include "UIResourceMonitor.h"
    3636#include "UIMessageCenter.h"
    3737#include "UIToolBar.h"
     
    6868*   Class UIVMResouceMonitorItem definition.                                                                           *
    6969*********************************************************************************************************************************/
    70 class UIVMResourceMonitorItem
     70class UIResourceMonitorItem
    7171{
    7272public:
    73     UIVMResourceMonitorItem(const QUuid &uid, const QString &strVMName);
    74     UIVMResourceMonitorItem(const QUuid &uid);
    75     UIVMResourceMonitorItem();
    76     bool operator==(const UIVMResourceMonitorItem& other) const;
     73    UIResourceMonitorItem(const QUuid &uid, const QString &strVMName);
     74    UIResourceMonitorItem(const QUuid &uid);
     75    UIResourceMonitorItem();
     76    bool operator==(const UIResourceMonitorItem& other) const;
    7777    QUuid    m_VMuid;
    7878    QString  m_strVMName;
     
    9696*   Class UIVMResouceMonitorProxyModel definition.                                                                           *
    9797*********************************************************************************************************************************/
    98 class UIVMResourceMonitorProxyModel : public QSortFilterProxyModel
     98class UIResourceMonitorProxyModel : public QSortFilterProxyModel
    9999{
    100100
     
    103103public:
    104104
    105     UIVMResourceMonitorProxyModel(QObject *parent = 0);
     105    UIResourceMonitorProxyModel(QObject *parent = 0);
    106106
    107107protected:
     
    115115
    116116/*********************************************************************************************************************************
    117 *   Class UIVMResourceMonitorModel definition.                                                                                   *
    118 *********************************************************************************************************************************/
    119 class UIVMResourceMonitorModel : public QAbstractTableModel
     117*   Class UIResourceMonitorModel definition.                                                                                     *
     118*********************************************************************************************************************************/
     119class UIResourceMonitorModel : public QAbstractTableModel
    120120{
    121121    Q_OBJECT;
     
    123123public:
    124124
    125     UIVMResourceMonitorModel(QObject *parent = 0);
     125    UIResourceMonitorModel(QObject *parent = 0);
    126126    int      rowCount(const QModelIndex &parent = QModelIndex()) const /* override */;
    127127    int      columnCount(const QModelIndex &parent = QModelIndex()) const /* override */;
     
    136136private:
    137137
    138     QVector<UIVMResourceMonitorItem> m_itemList;
     138    QVector<UIResourceMonitorItem> m_itemList;
    139139    void initializeItems();
    140140
     
    145145*   Class UIVMResouceMonitorItem implementation.                                                                           *
    146146*********************************************************************************************************************************/
    147 UIVMResourceMonitorItem::UIVMResourceMonitorItem(const QUuid &uid, const QString &strVMName)
     147UIResourceMonitorItem::UIResourceMonitorItem(const QUuid &uid, const QString &strVMName)
    148148    : m_VMuid(uid)
    149149    , m_strVMName(strVMName)
     
    166166}
    167167
    168 UIVMResourceMonitorItem::UIVMResourceMonitorItem()
     168UIResourceMonitorItem::UIResourceMonitorItem()
    169169    : m_VMuid(QUuid())
    170170    , m_uNetworkDownRate(0)
     
    179179}
    180180
    181 UIVMResourceMonitorItem::UIVMResourceMonitorItem(const QUuid &uid)
     181UIResourceMonitorItem::UIResourceMonitorItem(const QUuid &uid)
    182182    : m_VMuid(uid)
    183183    , m_uNetworkDownRate(0)
     
    192192}
    193193
    194 bool UIVMResourceMonitorItem::operator==(const UIVMResourceMonitorItem& other) const
     194bool UIResourceMonitorItem::operator==(const UIResourceMonitorItem& other) const
    195195{
    196196    if (m_VMuid == other.m_VMuid)
     
    203203*   Class UIVMResouceMonitorProxyModel implementation.                                                                           *
    204204*********************************************************************************************************************************/
    205 UIVMResourceMonitorProxyModel::UIVMResourceMonitorProxyModel(QObject *parent /* = 0 */)
     205UIResourceMonitorProxyModel::UIResourceMonitorProxyModel(QObject *parent /* = 0 */)
    206206    :QSortFilterProxyModel(parent)
    207207{
     
    210210
    211211/*********************************************************************************************************************************
    212 *   Class UIVMResourceMonitorModel implementation.                                                                               *
    213 *********************************************************************************************************************************/
    214 UIVMResourceMonitorModel::UIVMResourceMonitorModel(QObject *parent /*= 0*/)
     212*   Class UIResourceMonitorModel implementation.                                                                                 *
     213*********************************************************************************************************************************/
     214UIResourceMonitorModel::UIResourceMonitorModel(QObject *parent /*= 0*/)
    215215    :QAbstractTableModel(parent)
    216216    , m_pTimer(new QTimer(this))
     
    218218    initializeItems();
    219219    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineStateChange,
    220             this, &UIVMResourceMonitorModel::sltMachineStateChanged);
     220            this, &UIResourceMonitorModel::sltMachineStateChanged);
    221221
    222222    if (m_pTimer)
    223223    {
    224         connect(m_pTimer, &QTimer::timeout, this, &UIVMResourceMonitorModel::sltTimeout);
     224        connect(m_pTimer, &QTimer::timeout, this, &UIResourceMonitorModel::sltTimeout);
    225225        m_pTimer->start(1000);
    226226    }
    227227}
    228228
    229 int UIVMResourceMonitorModel::rowCount(const QModelIndex &parent /* = QModelIndex() */) const
     229int UIResourceMonitorModel::rowCount(const QModelIndex &parent /* = QModelIndex() */) const
    230230{
    231231    Q_UNUSED(parent);
     
    233233}
    234234
    235 int UIVMResourceMonitorModel::columnCount(const QModelIndex &parent /* = QModelIndex() */) const
     235int UIResourceMonitorModel::columnCount(const QModelIndex &parent /* = QModelIndex() */) const
    236236{
    237237    Q_UNUSED(parent);
     
    239239}
    240240
    241 QVariant UIVMResourceMonitorModel::data(const QModelIndex &index, int role) const
     241QVariant UIResourceMonitorModel::data(const QModelIndex &index, int role) const
    242242{
    243243    if (!index.isValid() || role != Qt::DisplayRole || index.row() >= rowCount())
     
    263263}
    264264
    265 QVariant UIVMResourceMonitorModel::headerData(int section, Qt::Orientation orientation, int role) const
     265QVariant UIResourceMonitorModel::headerData(int section, Qt::Orientation orientation, int role) const
    266266{
    267267    if (role == Qt::DisplayRole && orientation == Qt::Horizontal)
     
    296296}
    297297
    298 void UIVMResourceMonitorModel::initializeItems()
     298void UIResourceMonitorModel::initializeItems()
    299299{
    300300    foreach (const CMachine &comMachine, uiCommon().virtualBox().GetMachines())
     
    304304            if (comMachine.GetState() == KMachineState_Running)
    305305            {
    306                 m_itemList << UIVMResourceMonitorItem(comMachine.GetId(), comMachine.GetName());
     306                m_itemList << UIResourceMonitorItem(comMachine.GetId(), comMachine.GetName());
    307307            }
    308308        }
     
    310310}
    311311
    312 void UIVMResourceMonitorModel::sltMachineStateChanged(const QUuid &uId, const KMachineState state)
    313 {
    314     int iIndex = m_itemList.indexOf(UIVMResourceMonitorItem(uId));
     312void UIResourceMonitorModel::sltMachineStateChanged(const QUuid &uId, const KMachineState state)
     313{
     314    int iIndex = m_itemList.indexOf(UIResourceMonitorItem(uId));
    315315    /* Remove the machine in case machine is no longer working. */
    316316    if (iIndex != -1 && state != KMachineState_Running)
     
    324324    {
    325325        CMachine comMachine = uiCommon().virtualBox().FindMachine(uId.toString());
    326         m_itemList << UIVMResourceMonitorItem(uId, comMachine.GetName());
     326        m_itemList << UIResourceMonitorItem(uId, comMachine.GetName());
    327327        emit layoutChanged();
    328328    }
    329329}
    330330
    331 void UIVMResourceMonitorModel::sltTimeout()
     331void UIResourceMonitorModel::sltTimeout()
    332332{
    333333    ULONG aPctExecuting;
     
    350350
    351351/*********************************************************************************************************************************
    352 *   Class UIVMResourceMonitorWidget implementation.                                                                              *
    353 *********************************************************************************************************************************/
    354 
    355 UIVMResourceMonitorWidget::UIVMResourceMonitorWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,
     352*   Class UIResourceMonitorWidget implementation.                                                                                *
     353*********************************************************************************************************************************/
     354
     355UIResourceMonitorWidget::UIResourceMonitorWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,
    356356                                                       bool fShowToolbar /* = true */, QWidget *pParent /* = 0 */)
    357357    : QIWithRetranslateUI<QWidget>(pParent)
     
    366366}
    367367
    368 QMenu *UIVMResourceMonitorWidget::menu() const
     368QMenu *UIResourceMonitorWidget::menu() const
    369369{
    370370    return m_pActionPool->action(UIActionIndexST_M_NetworkWindow)->menu();
    371371}
    372372
    373 void UIVMResourceMonitorWidget::retranslateUi()
    374 {
    375 }
    376 
    377 void UIVMResourceMonitorWidget::resizeEvent(QResizeEvent *pEvent)
     373void UIResourceMonitorWidget::retranslateUi()
     374{
     375}
     376
     377void UIResourceMonitorWidget::resizeEvent(QResizeEvent *pEvent)
    378378{
    379379    QIWithRetranslateUI<QWidget>::resizeEvent(pEvent);
    380380}
    381381
    382 void UIVMResourceMonitorWidget::showEvent(QShowEvent *pEvent)
     382void UIResourceMonitorWidget::showEvent(QShowEvent *pEvent)
    383383{
    384384    QIWithRetranslateUI<QWidget>::showEvent(pEvent);
    385385}
    386386
    387 void UIVMResourceMonitorWidget::prepare()
     387void UIResourceMonitorWidget::prepare()
    388388{
    389389    prepareActions();
     
    393393}
    394394
    395 void UIVMResourceMonitorWidget::prepareActions()
    396 {
    397 }
    398 
    399 void UIVMResourceMonitorWidget::prepareWidgets()
     395void UIResourceMonitorWidget::prepareActions()
     396{
     397}
     398
     399void UIResourceMonitorWidget::prepareWidgets()
    400400{
    401401    /* Create main-layout: */
     
    414414        prepareToolBar();
    415415
    416     m_pModel = new UIVMResourceMonitorModel(this);
    417     m_pProxyModel = new UIVMResourceMonitorProxyModel(this);
     416    m_pModel = new UIResourceMonitorModel(this);
     417    m_pProxyModel = new UIResourceMonitorProxyModel(this);
    418418
    419419    m_pTableWidget = new QTableView();
     
    440440}
    441441
    442 void UIVMResourceMonitorWidget::prepareToolBar()
     442void UIResourceMonitorWidget::prepareToolBar()
    443443{
    444444    /* Create toolbar: */
     
    466466
    467467
    468 void UIVMResourceMonitorWidget::loadSettings()
    469 {
    470 }
    471 
    472 
    473 /*********************************************************************************************************************************
    474 *   Class UIVMResourceMonitorFactory implementation.                                                                             *
    475 *********************************************************************************************************************************/
    476 
    477 UIVMResourceMonitorFactory::UIVMResourceMonitorFactory(UIActionPool *pActionPool /* = 0 */)
     468void UIResourceMonitorWidget::loadSettings()
     469{
     470}
     471
     472
     473/*********************************************************************************************************************************
     474*   Class UIResourceMonitorFactory implementation.                                                                               *
     475*********************************************************************************************************************************/
     476
     477UIResourceMonitorFactory::UIResourceMonitorFactory(UIActionPool *pActionPool /* = 0 */)
    478478    : m_pActionPool(pActionPool)
    479479{
    480480}
    481481
    482 void UIVMResourceMonitorFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget)
    483 {
    484     pDialog = new UIVMResourceMonitor(pCenterWidget, m_pActionPool);
    485 }
    486 
    487 
    488 /*********************************************************************************************************************************
    489 *   Class UIVMResourceMonitor implementation.                                                                                    *
    490 *********************************************************************************************************************************/
    491 
    492 UIVMResourceMonitor::UIVMResourceMonitor(QWidget *pCenterWidget, UIActionPool *pActionPool)
     482void UIResourceMonitorFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget)
     483{
     484    pDialog = new UIResourceMonitor(pCenterWidget, m_pActionPool);
     485}
     486
     487
     488/*********************************************************************************************************************************
     489*   Class UIResourceMonitor implementation.                                                                                      *
     490*********************************************************************************************************************************/
     491
     492UIResourceMonitor::UIResourceMonitor(QWidget *pCenterWidget, UIActionPool *pActionPool)
    493493    : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget)
    494494    , m_pActionPool(pActionPool)
     
    496496}
    497497
    498 void UIVMResourceMonitor::retranslateUi()
     498void UIResourceMonitor::retranslateUi()
    499499{
    500500    setWindowTitle(tr("VM Resource Monitor"));
    501501}
    502502
    503 void UIVMResourceMonitor::configure()
     503void UIResourceMonitor::configure()
    504504{
    505505    /* Apply window icons: */
     
    507507}
    508508
    509 void UIVMResourceMonitor::configureCentralWidget()
    510 {
    511     UIVMResourceMonitorWidget *pWidget = new UIVMResourceMonitorWidget(EmbedTo_Dialog, m_pActionPool, true, this);
     509void UIResourceMonitor::configureCentralWidget()
     510{
     511    UIResourceMonitorWidget *pWidget = new UIResourceMonitorWidget(EmbedTo_Dialog, m_pActionPool, true, this);
    512512    AssertPtrReturnVoid(pWidget);
    513513    {
     
    521521}
    522522
    523 void UIVMResourceMonitor::configureButtonBox()
    524 {
    525 }
    526 
    527 void UIVMResourceMonitor::finalize()
     523void UIResourceMonitor::configureButtonBox()
     524{
     525}
     526
     527void UIResourceMonitor::finalize()
    528528{
    529529    /* Apply language settings: */
     
    531531}
    532532
    533 UIVMResourceMonitorWidget *UIVMResourceMonitor::widget()
    534 {
    535     return qobject_cast<UIVMResourceMonitorWidget*>(QIManagerDialog::widget());
    536 }
    537 
    538 
    539 #include "UIVMResourceMonitor.moc"
     533UIResourceMonitorWidget *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  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIVMResourceMonitor class declaration.
     3 * VBox Qt GUI - UIResourceMonitor class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef FEQT_INCLUDED_SRC_manager_UIVMResourceMonitor_h
    19 #define FEQT_INCLUDED_SRC_manager_UIVMResourceMonitor_h
     18#ifndef FEQT_INCLUDED_SRC_monitor_resource_UIResourceMonitor_h
     19#define FEQT_INCLUDED_SRC_monitor_resource_UIResourceMonitor_h
    2020#ifndef RT_WITHOUT_PRAGMA_ONCE
    2121# pragma once
     
    3636class UIActionPool;
    3737class UIToolBar;
    38 class UIVMResourceMonitorProxyModel;
    39 class UIVMResourceMonitorModel;
     38class UIResourceMonitorProxyModel;
     39class UIResourceMonitorModel;
    4040
    4141
    4242/** QWidget extension to display a Linux top like utility that sort running vm wrt. resource allocations. */
    43 class UIVMResourceMonitorWidget : public QIWithRetranslateUI<QWidget>
     43class UIResourceMonitorWidget : public QIWithRetranslateUI<QWidget>
    4444{
    4545    Q_OBJECT;
     
    5050public:
    5151
    52     UIVMResourceMonitorWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,
     52    UIResourceMonitorWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,
    5353                               bool fShowToolbar = true, QWidget *pParent = 0);
    5454
     
    9595        UIToolBar *m_pToolBar;
    9696        QTableView *m_pTableWidget;
    97         UIVMResourceMonitorProxyModel *m_pProxyModel;
    98         UIVMResourceMonitorModel      *m_pModel;
     97        UIResourceMonitorProxyModel *m_pProxyModel;
     98        UIResourceMonitorModel      *m_pModel;
    9999    /** @} */
    100100
    101101};
    102102
    103 class UIVMResourceMonitorFactory : public QIManagerDialogFactory
     103class UIResourceMonitorFactory : public QIManagerDialogFactory
    104104{
    105105public:
    106106
    107     UIVMResourceMonitorFactory(UIActionPool *pActionPool = 0);
     107    UIResourceMonitorFactory(UIActionPool *pActionPool = 0);
    108108
    109109protected:
     
    113113};
    114114
    115 class UIVMResourceMonitor : public QIWithRetranslateUI<QIManagerDialog>
     115class UIResourceMonitor : public QIWithRetranslateUI<QIManagerDialog>
    116116{
    117117    Q_OBJECT;
     
    119119private:
    120120
    121     UIVMResourceMonitor(QWidget *pCenterWidget, UIActionPool *pActionPool);
     121    UIResourceMonitor(QWidget *pCenterWidget, UIActionPool *pActionPool);
    122122
    123123    virtual void retranslateUi() /* override */;
     
    133133    /** @name Widget stuff.
    134134      * @{ */
    135         virtual UIVMResourceMonitorWidget *widget() /* override */;
     135        virtual UIResourceMonitorWidget *widget() /* override */;
    136136    /** @} */
    137137
     
    141141    /** @} */
    142142
    143     friend class UIVMResourceMonitorFactory;
     143    friend class UIResourceMonitorFactory;
    144144};
    145145
    146 #endif /* !FEQT_INCLUDED_SRC_manager_UIVMResourceMonitor_h */
     146#endif /* !FEQT_INCLUDED_SRC_monitor_resource_UIResourceMonitor_h */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette