VirtualBox

Changeset 83494 in vbox for trunk/src


Ignore:
Timestamp:
Mar 31, 2020 9:41:58 AM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9686. Correcting some typo.

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  
    126126template<> SHARED_LIBRARY_STUFF bool canConvert<UIMediumFormat>();
    127127template<> SHARED_LIBRARY_STUFF bool canConvert<UISettingsDefs::RecordingMode>();
    128 template<> SHARED_LIBRARY_STUFF bool canConvert<VMResouceMonitorColumn>();
     128template<> SHARED_LIBRARY_STUFF bool canConvert<VMResourceMonitorColumn>();
    129129
    130130/* Declare COM canConvert specializations: */
     
    269269template<> SHARED_LIBRARY_STUFF QString toString(const UISettingsDefs::RecordingMode &enmRecordingMode);
    270270template<> SHARED_LIBRARY_STUFF UISettingsDefs::RecordingMode fromString<UISettingsDefs::RecordingMode>(const QString &enmRecordingMode);
    271 template<> SHARED_LIBRARY_STUFF QString toInternalString(const VMResouceMonitorColumn &enmVMResourceMonitorColumn);
    272 template<> SHARED_LIBRARY_STUFF VMResouceMonitorColumn fromInternalString<VMResouceMonitorColumn>(const QString &strVMResourceMonitorColumn);
     271template<> SHARED_LIBRARY_STUFF QString toInternalString(const VMResourceMonitorColumn &enmVMResourceMonitorColumn);
     272template<> SHARED_LIBRARY_STUFF VMResourceMonitorColumn fromInternalString<VMResourceMonitorColumn>(const QString &strVMResourceMonitorColumn);
    273273
    274274/* Declare COM conversion specializations: */
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp

    r83452 r83494  
    8080template<> bool canConvert<UIMediumFormat>() { return true; }
    8181template<> bool canConvert<UISettingsDefs::RecordingMode>() { return true; }
    82 template<> bool canConvert<VMResouceMonitorColumn>(){ return true; };
     82template<> bool canConvert<VMResourceMonitorColumn>(){ return true; };
    8383
    8484
     
    25712571}
    25722572
    2573 template<> QString toInternalString(const VMResouceMonitorColumn &enmVMResourceMonitorColumn)
     2573template<> QString toInternalString(const VMResourceMonitorColumn &enmVMResourceMonitorColumn)
    25742574{
    25752575    QString strResult;
    25762576    switch (enmVMResourceMonitorColumn)
    25772577    {
    2578         case VMResouceMonitorColumn_Name:              strResult = "VMName"; break;
    2579         case VMResouceMonitorColumn_CPUGuestLoad:      strResult = "CPUGuestLoad"; break;
    2580         case VMResouceMonitorColumn_CPUVMMLoad:        strResult = "CPUVMMLoad"; break;
    2581         case VMResouceMonitorColumn_RAMUsedAndTotal:   strResult = "RAMUsedAndTotal"; break;
    2582         case VMResouceMonitorColumn_RAMUsedPercentage: strResult = "RAMUsedPercentage"; break;
    2583         case VMResouceMonitorColumn_NetworkUpRate:     strResult = "NetworkUpRate"; break;
    2584         case VMResouceMonitorColumn_NetworkDownRate:   strResult = "NetworkDownRate"; break;
    2585         case VMResouceMonitorColumn_NetworkUpTotal:    strResult = "NetworkUpTotal"; break;
    2586         case VMResouceMonitorColumn_NetworkDownTotal:  strResult = "NetworkDownTotal"; break;
    2587         case VMResouceMonitorColumn_DiskIOReadRate:    strResult = "DiskIOReadRate"; break;
    2588         case VMResouceMonitorColumn_DiskIOWriteRate:   strResult = "DiskIOWriteRate"; break;
    2589         case VMResouceMonitorColumn_DiskIOReadTotal:   strResult = "DiskIOReadTotal"; break;
    2590         case VMResouceMonitorColumn_DiskIOWriteTotal:  strResult = "DiskIOWriteTotal"; break;
    2591         case VMResouceMonitorColumn_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;
    25922592        default:
    25932593            {
     
    25992599}
    26002600
    2601 template<> VMResouceMonitorColumn fromInternalString<VMResouceMonitorColumn>(const QString &strVMResourceMonitorColumn)
    2602 {
    2603     QStringList keys;    QList<VMResouceMonitorColumn> values;
    2604     keys << "VMName";             values << VMResouceMonitorColumn_Name;
    2605     keys << "CPUGuestLoad";       values << VMResouceMonitorColumn_CPUGuestLoad;
    2606     keys << "CPUVMMLoad";         values << VMResouceMonitorColumn_CPUVMMLoad;
    2607     keys << "RAMUsedAndTotal";    values << VMResouceMonitorColumn_RAMUsedAndTotal;
    2608     keys << "RAMUsedPercentage";  values << VMResouceMonitorColumn_RAMUsedPercentage;
    2609     keys << "NetworkUpRate";      values << VMResouceMonitorColumn_NetworkUpRate;
    2610     keys << "NetworkDownRate";    values << VMResouceMonitorColumn_NetworkDownRate;
    2611     keys << "NetworkUpTotal";     values << VMResouceMonitorColumn_NetworkUpTotal;
    2612     keys << "NetworkDownTotal";   values << VMResouceMonitorColumn_NetworkDownTotal;
    2613     keys << "DiskIOReadRate";     values << VMResouceMonitorColumn_DiskIOReadRate;
    2614     keys << "DiskIOWriteRate";    values << VMResouceMonitorColumn_DiskIOWriteRate;
    2615     keys << "DiskIOReadTotal";    values << VMResouceMonitorColumn_DiskIOReadTotal;
    2616     keys << "DiskIOWriteTotal";   values << VMResouceMonitorColumn_DiskIOWriteTotal;
    2617     keys << "VMExits";            values << VMResouceMonitorColumn_VMExits;
     2601template<> 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;
    26182618    if (!keys.contains(strVMResourceMonitorColumn, Qt::CaseInsensitive))
    2619         return VMResouceMonitorColumn_Max;
     2619        return VMResourceMonitorColumn_Max;
    26202620    /* Corresponding format for known words: */
    26212621    return values.at(keys.indexOf(QRegExp(strVMResourceMonitorColumn, Qt::CaseInsensitive)));
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r83452 r83494  
    10711071/** Manager UI: VM resource Monitor Column types.
    10721072  * @note The first element must be 0 and the rest must be consecutive */
    1073 enum VMResouceMonitorColumn
    1074 {
    1075     VMResouceMonitorColumn_Name = 0,
    1076     VMResouceMonitorColumn_CPUGuestLoad,
    1077     VMResouceMonitorColumn_CPUVMMLoad,
    1078     VMResouceMonitorColumn_RAMUsedAndTotal,
    1079     VMResouceMonitorColumn_RAMUsedPercentage,
    1080     VMResouceMonitorColumn_NetworkUpRate,
    1081     VMResouceMonitorColumn_NetworkDownRate,
    1082     VMResouceMonitorColumn_NetworkUpTotal,
    1083     VMResouceMonitorColumn_NetworkDownTotal,
    1084     VMResouceMonitorColumn_DiskIOReadRate,
    1085     VMResouceMonitorColumn_DiskIOWriteRate,
    1086     VMResouceMonitorColumn_DiskIOReadTotal,
    1087     VMResouceMonitorColumn_DiskIOWriteTotal,
    1088     VMResouceMonitorColumn_VMExits,
    1089     VMResouceMonitorColumn_Max
     1073enum 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
    10901090};
    10911091
  • trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.cpp

    r83493 r83494  
    6161};
    6262
    63 
    64 /*********************************************************************************************************************************
    65 *   Class UIVMResouceMonitorTableView definition.                                                                           *
    66 *********************************************************************************************************************************/
    67 
    68 class UIVMResouceMonitorTableView : public QTableView
     63/*********************************************************************************************************************************
     64*   Class UIVMResourceMonitorTableView definition.                                                                           *
     65*********************************************************************************************************************************/
     66
     67class UIVMResourceMonitorTableView : public QTableView
    6968{
    7069    Q_OBJECT;
     
    7271public:
    7372
    74     UIVMResouceMonitorTableView(QWidget *pParent = 0);
     73    UIVMResourceMonitorTableView(QWidget *pParent = 0);
    7574    void setMinimumColumnWidths(const QVector<int>& widths);
    7675    void updateColumVisibility();
     
    9190
    9291/*********************************************************************************************************************************
    93 *   Class UIVMResouceMonitorItem definition.                                                                           *
     92*   Class UIVMResourceMonitorItem definition.                                                                           *
    9493*********************************************************************************************************************************/
    9594class UIResourceMonitorItem
     
    134133
    135134/*********************************************************************************************************************************
    136 *   Class UIVMResouceMonitorHostStats definition.                                                                           *
    137 *********************************************************************************************************************************/
    138 
    139 class UIVMResouceMonitorHostStats
     135*   Class UIVMResourceMonitorHostStats definition.                                                                           *
     136*********************************************************************************************************************************/
     137
     138class UIVMResourceMonitorHostStats
    140139{
    141140
    142141public:
    143142
    144     UIVMResouceMonitorHostStats();
     143    UIVMResourceMonitorHostStats();
    145144    quint64 m_fCPUUserLoad;
    146145    quint64 m_fCPUKernelLoad;
     
    150149
    151150/*********************************************************************************************************************************
    152 *   Class UIVMResouceMonitorCheckBox definition.                                                                           *
    153 *********************************************************************************************************************************/
    154 
    155 class UIVMResouceMonitorCheckBox : public QCheckBox
     151*   Class UIVMResourceMonitorCheckBox definition.                                                                           *
     152*********************************************************************************************************************************/
     153
     154class UIVMResourceMonitorCheckBox : public QCheckBox
    156155{
    157156    Q_OBJECT;
     
    159158public:
    160159
    161     UIVMResouceMonitorCheckBox(QWidget *parent = 0);
     160    UIVMResourceMonitorCheckBox(QWidget *parent = 0);
    162161    void setData(const QVariant& data);
    163162    const QVariant data() const;
     
    169168
    170169/*********************************************************************************************************************************
    171 *   Class UIVMResouceMonitorProxyModel definition.                                                                           *
     170*   Class UIVMResourceMonitorProxyModel definition.                                                                           *
    172171*********************************************************************************************************************************/
    173172class UIResourceMonitorProxyModel : public QSortFilterProxyModel
     
    185184
    186185    //virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const /* override */;
    187     /** Section (column) visibility is controlled by the QHeaderView (see UIVMResouceMonitorTableView::updateColumVisibility)
     186    /** Section (column) visibility is controlled by the QHeaderView (see UIVMResourceMonitorTableView::updateColumVisibility)
    188187     *  to have somewhat meaningful column resizing. */
    189188    //virtual bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const /* override */;
     
    246245      *  when the widget is visible in the main UI. */
    247246    bool m_fShouldUpdate;
    248     UIVMResouceMonitorHostStats m_hostStats;
     247    UIVMResourceMonitorHostStats m_hostStats;
    249248};
    250249
    251250
    252251/*********************************************************************************************************************************
    253 *   UIVMResouceMonitorDelegate definition.                                                                                       *
     252*   UIVMResourceMonitorDelegate definition.                                                                                       *
    254253*********************************************************************************************************************************/
    255254/** A QItemDelegate child class to disable dashed lines drawn around selected cells in QTableViews */
    256 class UIVMResouceMonitorDelegate : public QItemDelegate
     255class UIVMResourceMonitorDelegate : public QItemDelegate
    257256{
    258257
     
    267266
    268267/*********************************************************************************************************************************
    269 *   Class UIVMResouceMonitorTableView implementation.                                                                            *
    270 *********************************************************************************************************************************/
    271 
    272 UIVMResouceMonitorTableView::UIVMResouceMonitorTableView(QWidget *pParent /* = 0 */)
     268*   Class UIVMResourceMonitorTableView implementation.                                                                            *
     269*********************************************************************************************************************************/
     270
     271UIVMResourceMonitorTableView::UIVMResourceMonitorTableView(QWidget *pParent /* = 0 */)
    273272    :QTableView(pParent)
    274     , m_minimumColumnWidths(QVector<int>((int)VMResouceMonitorColumn_Max, 0))
    275 {
    276 }
    277 
    278 void UIVMResouceMonitorTableView::setMinimumColumnWidths(const QVector<int>& widths)
     273    , m_minimumColumnWidths(QVector<int>((int)VMResourceMonitorColumn_Max, 0))
     274{
     275}
     276
     277void UIVMResourceMonitorTableView::setMinimumColumnWidths(const QVector<int>& widths)
    279278{
    280279    m_minimumColumnWidths = widths;
    281280}
    282281
    283 void UIVMResouceMonitorTableView::updateColumVisibility()
     282void UIVMResourceMonitorTableView::updateColumVisibility()
    284283{
    285284    UIResourceMonitorProxyModel *pProxyModel = qobject_cast<UIResourceMonitorProxyModel *>(model());
     
    291290    if (!pModel || !pHeader)
    292291        return;
    293     for (int i = (int)VMResouceMonitorColumn_Name; i < (int)VMResouceMonitorColumn_Max; ++i)
     292    for (int i = (int)VMResourceMonitorColumn_Name; i < (int)VMResourceMonitorColumn_Max; ++i)
    294293    {
    295294        if (!pModel->columnVisible(i))
     
    301300}
    302301
    303 void UIVMResouceMonitorTableView::resizeEvent(QResizeEvent *pEvent)
     302void UIVMResourceMonitorTableView::resizeEvent(QResizeEvent *pEvent)
    304303{
    305304    resizeHeader();
     
    307306}
    308307
    309 void UIVMResouceMonitorTableView::resizeHeader()
     308void UIVMResourceMonitorTableView::resizeHeader()
    310309{
    311310    QHeaderView* pHeader = horizontalHeader();
     
    325324
    326325/*********************************************************************************************************************************
    327 *   Class UIVMResouceMonitorItem implementation.                                                                           *
     326*   Class UIVMResourceMonitorItem implementation.                                                                           *
    328327*********************************************************************************************************************************/
    329328UIResourceMonitorItem::UIResourceMonitorItem(const QUuid &uid, const QString &strVMName)
     
    415414
    416415/*********************************************************************************************************************************
    417 *   Class UIVMResouceMonitorHostStats implementation.                                                                            *
    418 *********************************************************************************************************************************/
    419 
    420 UIVMResouceMonitorHostStats::UIVMResouceMonitorHostStats()
     416*   Class UIVMResourceMonitorHostStats implementation.                                                                            *
     417*********************************************************************************************************************************/
     418
     419UIVMResourceMonitorHostStats::UIVMResourceMonitorHostStats()
    421420    : m_fCPUUserLoad(0)
    422421    , m_fCPUKernelLoad(0)
     
    428427
    429428/*********************************************************************************************************************************
    430 *   Class UIVMResouceMonitorCheckBox implementation.                                                                             *
    431 *********************************************************************************************************************************/
    432 
    433 UIVMResouceMonitorCheckBox::UIVMResouceMonitorCheckBox(QWidget *parent /* = 0 */)
     429*   Class UIVMResourceMonitorCheckBox implementation.                                                                             *
     430*********************************************************************************************************************************/
     431
     432UIVMResourceMonitorCheckBox::UIVMResourceMonitorCheckBox(QWidget *parent /* = 0 */)
    434433    :QCheckBox(parent)
    435434{
    436435}
    437 void UIVMResouceMonitorCheckBox::setData(const QVariant& data)
     436void UIVMResourceMonitorCheckBox::setData(const QVariant& data)
    438437{
    439438    m_data = data;
    440439}
    441440
    442 const QVariant UIVMResouceMonitorCheckBox::data() const
     441const QVariant UIVMResourceMonitorCheckBox::data() const
    443442{
    444443    return m_data;
     
    447446
    448447/*********************************************************************************************************************************
    449 *   Class UIVMResouceMonitorProxyModel implementation.                                                                           *
     448*   Class UIVMResourceMonitorProxyModel implementation.                                                                           *
    450449*********************************************************************************************************************************/
    451450UIResourceMonitorProxyModel::UIResourceMonitorProxyModel(QObject *parent /* = 0 */)
     
    507506{
    508507    Q_UNUSED(parent);
    509     return VMResouceMonitorColumn_Max;
     508    return VMResourceMonitorColumn_Max;
    510509}
    511510
     
    523522    switch (index.column())
    524523    {
    525         case VMResouceMonitorColumn_Name:
     524        case VMResourceMonitorColumn_Name:
    526525            return m_itemList[index.row()].m_strVMName;
    527526            break;
    528         case VMResouceMonitorColumn_CPUGuestLoad:
     527        case VMResourceMonitorColumn_CPUGuestLoad:
    529528            return m_itemList[index.row()].m_uCPUGuestLoad;
    530529            break;
    531         case VMResouceMonitorColumn_CPUVMMLoad:
     530        case VMResourceMonitorColumn_CPUVMMLoad:
    532531            return m_itemList[index.row()].m_uCPUVMMLoad;
    533532            break;
    534         case VMResouceMonitorColumn_RAMUsedAndTotal:
     533        case VMResourceMonitorColumn_RAMUsedAndTotal:
    535534            if (m_itemList[index.row()].isWithGuestAdditions())
    536535                return QString("%1/%2").arg(uiCommon().formatSize(_1K * m_itemList[index.row()].m_uUsedRAM, iDecimalCount)).
     
    539538                return tr("N/A");
    540539            break;
    541         case VMResouceMonitorColumn_RAMUsedPercentage:
     540        case VMResourceMonitorColumn_RAMUsedPercentage:
    542541            if (m_itemList[index.row()].isWithGuestAdditions())
    543542                return QString("%1%").arg(QString::number(m_itemList[index.row()].m_fRAMUsagePercentage, 'f', 2));
     
    545544                return tr("N/A");
    546545            break;
    547         case VMResouceMonitorColumn_NetworkUpRate:
     546        case VMResourceMonitorColumn_NetworkUpRate:
    548547            return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uNetworkUpRate, iDecimalCount));
    549548            break;
    550         case VMResouceMonitorColumn_NetworkDownRate:
     549        case VMResourceMonitorColumn_NetworkDownRate:
    551550            return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uNetworkDownRate, iDecimalCount));
    552551            break;
    553         case VMResouceMonitorColumn_NetworkUpTotal:
     552        case VMResourceMonitorColumn_NetworkUpTotal:
    554553            return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uNetworkUpTotal, iDecimalCount));
    555554            break;
    556         case VMResouceMonitorColumn_NetworkDownTotal:
     555        case VMResourceMonitorColumn_NetworkDownTotal:
    557556            return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uNetworkDownTotal, iDecimalCount));
    558557            break;
    559         case VMResouceMonitorColumn_DiskIOReadRate:
     558        case VMResourceMonitorColumn_DiskIOReadRate:
    560559            return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uDiskReadRate, iDecimalCount));
    561560            break;
    562         case VMResouceMonitorColumn_DiskIOWriteRate:
     561        case VMResourceMonitorColumn_DiskIOWriteRate:
    563562            return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uDiskWriteRate, iDecimalCount));
    564563            break;
    565         case VMResouceMonitorColumn_DiskIOReadTotal:
     564        case VMResourceMonitorColumn_DiskIOReadTotal:
    566565            return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uDiskReadTotal, iDecimalCount));
    567566            break;
    568         case VMResouceMonitorColumn_DiskIOWriteTotal:
     567        case VMResourceMonitorColumn_DiskIOWriteTotal:
    569568            return QString("%1").arg(uiCommon().formatSize(m_itemList[index.row()].m_uDiskWriteTotal, iDecimalCount));
    570569            break;
    571         case VMResouceMonitorColumn_VMExits:
     570        case VMResourceMonitorColumn_VMExits:
    572571           return QString("%1/%2").arg(UICommon::addMetricSuffixToNumber(m_itemList[index.row()].m_uVMExitRate)).
    573572               arg(UICommon::addMetricSuffixToNumber(m_itemList[index.row()].m_uVMExitTotal));
     
    642641    ULONG aPctVMM;
    643642
    644     // bool fRAMColumns = columnVisible(VMResouceMonitorColumn_RAMUsedAndTotal)
    645     //     || columnVisible(VMResouceMonitorColumn_RAMUsedPercentage);
    646     bool fCPUColumns = columnVisible(VMResouceMonitorColumn_CPUVMMLoad) || columnVisible(VMResouceMonitorColumn_CPUGuestLoad);
    647     bool fNetworkColumns = columnVisible(VMResouceMonitorColumn_NetworkUpRate)
    648         || columnVisible(VMResouceMonitorColumn_NetworkDownRate)
    649         || columnVisible(VMResouceMonitorColumn_NetworkUpTotal)
    650         || columnVisible(VMResouceMonitorColumn_NetworkDownTotal);
    651     bool fIOColumns = columnVisible(VMResouceMonitorColumn_DiskIOReadRate)
    652         || columnVisible(VMResouceMonitorColumn_DiskIOWriteRate)
    653         || columnVisible(VMResouceMonitorColumn_DiskIOReadTotal)
    654         || columnVisible(VMResouceMonitorColumn_DiskIOWriteTotal);
    655     bool fVMExitColumn = columnVisible(VMResouceMonitorColumn_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);
    656655
    657656    getHostRAMStats();
     
    862861void UIResourceMonitorWidget::retranslateUi()
    863862{
    864     m_columnCaptions.resize(VMResouceMonitorColumn_Max);
    865     m_columnCaptions[VMResouceMonitorColumn_Name] = tr("VM Name");
    866     m_columnCaptions[VMResouceMonitorColumn_CPUGuestLoad] = tr("CPU Guest");
    867     m_columnCaptions[VMResouceMonitorColumn_CPUVMMLoad] = tr("CPU VMM");
    868     m_columnCaptions[VMResouceMonitorColumn_RAMUsedAndTotal] = tr("RAM Used/Total");
    869     m_columnCaptions[VMResouceMonitorColumn_RAMUsedPercentage] = tr("RAM %");
    870     m_columnCaptions[VMResouceMonitorColumn_NetworkUpRate] = tr("Network Up Rate");
    871     m_columnCaptions[VMResouceMonitorColumn_NetworkDownRate] = tr("Network Down Rate");
    872     m_columnCaptions[VMResouceMonitorColumn_NetworkUpTotal] = tr("Network Up Total");
    873     m_columnCaptions[VMResouceMonitorColumn_NetworkDownTotal] = tr("Network Down Total");
    874     m_columnCaptions[VMResouceMonitorColumn_DiskIOReadRate] = tr("Disk Read Rate");
    875     m_columnCaptions[VMResouceMonitorColumn_DiskIOWriteRate] = tr("Disk Write Rate");
    876     m_columnCaptions[VMResouceMonitorColumn_DiskIOReadTotal] = tr("Disk Read Total");
    877     m_columnCaptions[VMResouceMonitorColumn_DiskIOWriteTotal] = tr("Disk Write Total");
    878     m_columnCaptions[VMResouceMonitorColumn_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");
    879878    if (m_pModel)
    880879        m_pModel->setColumnCaptions(m_columnCaptions);
     
    939938    m_pProxyModel = new UIResourceMonitorProxyModel(this);
    940939
    941     m_pTableView = new UIVMResouceMonitorTableView();
     940    m_pTableView = new UIVMResourceMonitorTableView();
    942941    if (m_pTableView && m_pModel && m_pProxyModel)
    943942    {
     
    948947        m_pProxyModel->setSourceModel(m_pModel);
    949948        m_pTableView->setModel(m_pProxyModel);
    950         m_pTableView->setItemDelegate(new UIVMResouceMonitorDelegate);
     949        m_pTableView->setItemDelegate(new UIVMResourceMonitorDelegate);
    951950        m_pTableView->setSelectionMode(QAbstractItemView::NoSelection);
    952951        /* m_pTableView->setSelectionMode(QAbstractItemView::SingleSelection);
     
    978977    QVBoxLayout* pLayout = new QVBoxLayout(m_pColumnSelectionMenu);
    979978    int iLength = 0;
    980     for (int i = 0; i < VMResouceMonitorColumn_Max; ++i)
    981     {
    982         UIVMResouceMonitorCheckBox* pCheckBox = new UIVMResouceMonitorCheckBox;
     979    for (int i = 0; i < VMResourceMonitorColumn_Max; ++i)
     980    {
     981        UIVMResourceMonitorCheckBox* pCheckBox = new UIVMResourceMonitorCheckBox;
    983982        pCheckBox->setText(m_columnCaptions[i]);
    984983        iLength = m_columnCaptions[i].length() > iLength ? m_columnCaptions[i].length() : iLength;
     
    988987        pCheckBox->setData(i);
    989988        pCheckBox->setChecked(columnVisible(i));
    990         if (i == (int)VMResouceMonitorColumn_Name)
     989        if (i == (int)VMResourceMonitorColumn_Name)
    991990            pCheckBox->setEnabled(false);
    992         connect(pCheckBox, &UIVMResouceMonitorCheckBox::toggled, this, &UIResourceMonitorWidget::sltHandleColumnAction);
     991        connect(pCheckBox, &UIVMResourceMonitorCheckBox::toggled, this, &UIResourceMonitorWidget::sltHandleColumnAction);
    993992    }
    994993    QFontMetrics fontMetrics(m_pColumnSelectionMenu->font());
     
    10321031{
    10331032    QStringList hiddenColumnList = gEDataManager->VMResourceMonitorHiddenColumnList();
    1034     for (int i = (int)VMResouceMonitorColumn_Name; i < (int)VMResouceMonitorColumn_Max; ++i)
     1033    for (int i = (int)VMResourceMonitorColumn_Name; i < (int)VMResourceMonitorColumn_Max; ++i)
    10351034        m_columnVisible[i] = true;
    10361035    foreach(const QString& strColumn, hiddenColumnList)
    1037         setColumnVisible((int)gpConverter->fromInternalString<VMResouceMonitorColumn>(strColumn), false);
     1036        setColumnVisible((int)gpConverter->fromInternalString<VMResourceMonitorColumn>(strColumn), false);
    10381037}
    10391038
     
    10441043    {
    10451044        if (!columnVisible(i))
    1046             hiddenColumnList << gpConverter->toInternalString((VMResouceMonitorColumn) i);
     1045            hiddenColumnList << gpConverter->toInternalString((VMResourceMonitorColumn) i);
    10471046    }
    10481047    gEDataManager->setVMResourceMonitorHiddenColumnList(hiddenColumnList);
     
    10701069void UIResourceMonitorWidget::sltHandleColumnAction(bool fChecked)
    10711070{
    1072     UIVMResouceMonitorCheckBox* pSender = qobject_cast<UIVMResouceMonitorCheckBox*>(sender());
     1071    UIVMResourceMonitorCheckBox* pSender = qobject_cast<UIVMResourceMonitorCheckBox*>(sender());
    10731072    if (!pSender)
    10741073        return;
  • trunk/src/VBox/Frontends/VirtualBox/src/monitor/resource/UIResourceMonitor.h

    r83475 r83494  
    3939class UIResourceMonitorProxyModel;
    4040class UIResourceMonitorModel;
    41 class UIVMResouceMonitorTableView;
     41class UIVMResourceMonitorTableView;
    4242
    4343/** QWidget extension to display a Linux top like utility that sort running vm wrt. resource allocations. */
     
    106106      * @{ */
    107107        UIToolBar *m_pToolBar;
    108         UIVMResouceMonitorTableView *m_pTableView;
     108        UIVMResourceMonitorTableView *m_pTableView;
    109109        UIResourceMonitorProxyModel *m_pProxyModel;
    110110        UIResourceMonitorModel      *m_pModel;
    111111        QVector<QString>             m_columnCaptions;
    112         /* The key is the column id (VMResouceMonitorColumn) 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. */
    113113        QMap<int, bool>              m_columnVisible;
    114114    /** @} */
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