VirtualBox

Changeset 103207 in vbox


Ignore:
Timestamp:
Feb 5, 2024 3:48:15 PM (14 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161474
Message:

FE/Qt: bugref:10501. Some more ironing.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/activity
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/activity/overview/UIVMActivityOverviewWidget.cpp

    r103172 r103207  
    114114};
    115115
    116 /** A simple container to store host related performance values. */
    117 
    118116
    119117/*********************************************************************************************************************************
    120118*   Class UIVMActivityOverviewHostStats definition.                                                                              *
    121119*********************************************************************************************************************************/
    122 
     120/** A simple container to store host related performance values. */
    123121class UIVMActivityOverviewHostStats
    124122{
     
    222220};
    223221
    224 /** Each instance of UIActivityOverviewItem corresponds to a running vm whose stats are displayed.
    225   * they are owned my the model. */
     222
    226223/*********************************************************************************************************************************
    227224 *   Class UIActivityOverviewItem definition.                                                                           *
    228225 *********************************************************************************************************************************/
     226/** Each instance of UIActivityOverviewItem corresponds to a vm. they are owned my the model. */
    229227class UIActivityOverviewItem : public QObject
    230228{
     
    242240    const QUuid &machineId() const;
    243241
    244 
    245242    virtual QString machineStateString() const = 0;
    246243    virtual bool isRunning() const = 0;
     
    255252    float    m_fRAMUsagePercentage;
    256253
    257     quint64  m_uNetworkDownTotal;
    258     quint64  m_uNetworkUpTotal;
    259 
    260     quint64 m_uDiskWriteTotal;
    261     quint64 m_uDiskReadTotal;
    262 
    263254protected:
    264255
     
    269260      * instead of model's data function to know the string length earlier. */
    270261    QMap<int, QString> m_columnData;
    271 
    272 private:
    273 
    274262};
    275263
     
    279267 *   Class UIActivityOverviewItemLocal definition.                                                                           *
    280268 *********************************************************************************************************************************/
     269/* A UIActivityOverviewItem derivation to show local vms in the table view: */
    281270class UIActivityOverviewItemLocal : public UIActivityOverviewItem
    282271{
     
    285274
    286275    UIActivityOverviewItemLocal(QObject *pParent, const QUuid &uid, const QString &strVMName);
    287 
    288276    UIActivityOverviewItemLocal();
    289277    ~UIActivityOverviewItemLocal();
     
    298286    virtual void setMachineState(int iState) override;
    299287
    300 protected:
    301 
    302288private:
    303289
    304     CSession m_comSession;
    305     CGuest   m_comGuest;
    306     KMachineState m_enmMachineState;
    307 
    308     quint64 m_uVMExitTotal;
     290    CSession         m_comSession;
     291    CGuest           m_comGuest;
     292    KMachineState    m_enmMachineState;
     293    quint64          m_uVMExitTotal;
     294    quint64          m_uDiskWriteTotal;
     295    quint64          m_uDiskReadTotal;
     296    quint64          m_uNetworkDownTotal;
     297    quint64          m_uNetworkUpTotal;
    309298    CMachineDebugger m_comDebugger;
    310299};
     
    313302 *   Class UIActivityOverviewItemCloud definition.                                                                           *
    314303 *********************************************************************************************************************************/
     304/* A UIActivityOverviewItem derivation to show cloud vms in the table view: */
    315305class UIActivityOverviewItemCloud : public UIActivityOverviewItem
    316306{
     
    404394    bool isVMRunning(int rowIndex) const;
    405395    bool isCloudVM(int rowIndex) const;
    406     void setDefaultViewFont(const QFont &font);
    407     void setDefaultViewFontColor(const QColor &color);
    408396    void setCloudMachineItems(const QList<UIVirtualMachineItemCloud*> &cloudItems);
    409397
     
    436424    QMap<int, bool> m_columnVisible;
    437425    UIVMActivityOverviewHostStats m_hostStats;
    438     QFont m_defaultViewFont;
    439     QColor m_defaultViewFontColor;
    440426    /** Maximum length of string length of data displayed in column. Updated in UIActivityOverviewModel::data(..). */
    441427    mutable QMap<int, int> m_columnDataMaxLength;
     
    863849    , m_uUsedRAM(0)
    864850    , m_fRAMUsagePercentage(0)
    865     , m_uNetworkDownTotal(0)
    866     , m_uNetworkUpTotal(0)
    867     , m_uDiskWriteTotal(0)
    868     , m_uDiskReadTotal(0)
    869851    , m_VMuid(uid)
    870852    , m_strVMName(strVMName)
     
    878860    , m_uUsedRAM(0)
    879861    , m_fRAMUsagePercentage(0)
    880     , m_uNetworkDownTotal(0)
    881     , m_uNetworkUpTotal(0)
    882     , m_uDiskWriteTotal(0)
    883     , m_uDiskReadTotal(0)
    884862    , m_VMuid(QUuid())
    885863{
     
    11111089    : UIActivityOverviewItem(pParent, uid, strVMName)
    11121090    , m_uVMExitTotal(0)
     1091    , m_uDiskWriteTotal(0)
     1092    , m_uDiskReadTotal(0)
     1093    , m_uNetworkDownTotal(0)
     1094    , m_uNetworkUpTotal(0)
    11131095{
    11141096    if (m_enmMachineState == KMachineState_Running)
     
    11181100UIActivityOverviewItemLocal::UIActivityOverviewItemLocal()
    11191101    : m_uVMExitTotal(0)
     1102    , m_uDiskWriteTotal(0)
     1103    , m_uDiskReadTotal(0)
     1104    , m_uNetworkDownTotal(0)
     1105    , m_uNetworkUpTotal(0)
    11201106{
    11211107}
     
    14091395}
    14101396
    1411 void UIActivityOverviewModel::setDefaultViewFont(const QFont &font)
    1412 {
    1413     m_defaultViewFont = font;
    1414 }
    1415 
    1416 void UIActivityOverviewModel::setDefaultViewFontColor(const QColor &color)
    1417 {
    1418     m_defaultViewFontColor = color;
    1419 }
    1420 
    14211397void UIActivityOverviewModel::setCloudMachineItems(const QList<UIVirtualMachineItemCloud*> &cloudItems)
    14221398{
     
    14821458        if (role == Qt::FontRole)
    14831459        {
    1484             QFont font(m_defaultViewFont);
     1460            QFont font = qApp->font();
    14851461            font.setItalic(true);
    14861462            return font;
     
    16361612
    16371613    QVector<LONG> returnData = m_performanceCollector.QueryMetricsData(m_nameList,
    1638                                                                      m_objectList,
    1639                                                                      aReturnNames,
    1640                                                                      aReturnObjects,
    1641                                                                      aReturnUnits,
    1642                                                                      aReturnScales,
    1643                                                                      aReturnSequenceNumbers,
    1644                                                                      aReturnDataIndices,
    1645                                                                      aReturnDataLengths);
     1614                                                                       m_objectList,
     1615                                                                       aReturnNames,
     1616                                                                       aReturnObjects,
     1617                                                                       aReturnUnits,
     1618                                                                       aReturnScales,
     1619                                                                       aReturnSequenceNumbers,
     1620                                                                       aReturnDataIndices,
     1621                                                                       aReturnDataLengths);
    16461622    /* Parse the result we get from CPerformanceCollector to get respective values: */
    16471623    for (int i = 0; i < aReturnNames.size(); ++i)
     
    18971873        m_pTableView->setSortingEnabled(true);
    18981874        m_pTableView->sortByColumn(0, Qt::AscendingOrder);
    1899         /* Store the default font and its color of the table on the view. They are used in ::data(..): */
    1900         m_pModel->setDefaultViewFont(m_pTableView->font());
    1901         m_pModel->setDefaultViewFontColor(m_pTableView->palette().color(QPalette::Active, QPalette::WindowText));
    19021875
    19031876        connect(m_pModel, &UIActivityOverviewModel::sigDataUpdate,
  • trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.cpp

    r103166 r103207  
    5353#include "CPerformanceCollector.h"
    5454#include "CPerformanceMetric.h"
     55#include <iprt/path.h>
    5556#include <iprt/string.h>
    5657
     
    11441145{
    11451146    QString strStartFileName = QString("%1/%2_%3").
    1146         arg(QFileInfo(defaultMachineFolder()).absolutePath()).
     1147        arg(defaultMachineFolder()).
    11471148        arg(machineName()).
    11481149        arg(QDateTime::currentDateTime().toString("dd-MM-yyyy_hh-mm-ss"));
     
    11521153                                                                                .arg(machineName()));
    11531154    QFile dataFile(strFileName);
     1155
    11541156    if (dataFile.open(QFile::WriteOnly | QFile::Truncate))
    11551157    {
     
    14121414{
    14131415    if (m_comMachine.isOk())
    1414         return m_comMachine.GetSettingsFilePath();
     1416        return m_comMachine.GetLogFolder();
    14151417    else
    14161418        return QString();
     
    20362038QString UIVMActivityMonitorCloud::defaultMachineFolder() const
    20372039{
    2038     /** @todo */
    2039     return QString();
    2040 }
     2040    char szPath[RTPATH_MAX];
     2041    int rc = RTPathUserDocuments(szPath, sizeof(szPath));
     2042    if (RT_SUCCESS(rc))
     2043        return QString(szPath);
     2044    return uiCommon().virtualBox().GetHomeFolder();
     2045}
     2046
    20412047void UIVMActivityMonitorCloud::reset()
    20422048{
Note: See TracChangeset for help on using the changeset viewer.

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