Changeset 103207 in vbox
- Timestamp:
- Feb 5, 2024 3:48:15 PM (14 months ago)
- svn:sync-xref-src-repo-rev:
- 161474
- 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 114 114 }; 115 115 116 /** A simple container to store host related performance values. */117 118 116 119 117 /********************************************************************************************************************************* 120 118 * Class UIVMActivityOverviewHostStats definition. * 121 119 *********************************************************************************************************************************/ 122 120 /** A simple container to store host related performance values. */ 123 121 class UIVMActivityOverviewHostStats 124 122 { … … 222 220 }; 223 221 224 /** Each instance of UIActivityOverviewItem corresponds to a running vm whose stats are displayed. 225 * they are owned my the model. */ 222 226 223 /********************************************************************************************************************************* 227 224 * Class UIActivityOverviewItem definition. * 228 225 *********************************************************************************************************************************/ 226 /** Each instance of UIActivityOverviewItem corresponds to a vm. they are owned my the model. */ 229 227 class UIActivityOverviewItem : public QObject 230 228 { … … 242 240 const QUuid &machineId() const; 243 241 244 245 242 virtual QString machineStateString() const = 0; 246 243 virtual bool isRunning() const = 0; … … 255 252 float m_fRAMUsagePercentage; 256 253 257 quint64 m_uNetworkDownTotal;258 quint64 m_uNetworkUpTotal;259 260 quint64 m_uDiskWriteTotal;261 quint64 m_uDiskReadTotal;262 263 254 protected: 264 255 … … 269 260 * instead of model's data function to know the string length earlier. */ 270 261 QMap<int, QString> m_columnData; 271 272 private:273 274 262 }; 275 263 … … 279 267 * Class UIActivityOverviewItemLocal definition. * 280 268 *********************************************************************************************************************************/ 269 /* A UIActivityOverviewItem derivation to show local vms in the table view: */ 281 270 class UIActivityOverviewItemLocal : public UIActivityOverviewItem 282 271 { … … 285 274 286 275 UIActivityOverviewItemLocal(QObject *pParent, const QUuid &uid, const QString &strVMName); 287 288 276 UIActivityOverviewItemLocal(); 289 277 ~UIActivityOverviewItemLocal(); … … 298 286 virtual void setMachineState(int iState) override; 299 287 300 protected:301 302 288 private: 303 289 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; 309 298 CMachineDebugger m_comDebugger; 310 299 }; … … 313 302 * Class UIActivityOverviewItemCloud definition. * 314 303 *********************************************************************************************************************************/ 304 /* A UIActivityOverviewItem derivation to show cloud vms in the table view: */ 315 305 class UIActivityOverviewItemCloud : public UIActivityOverviewItem 316 306 { … … 404 394 bool isVMRunning(int rowIndex) const; 405 395 bool isCloudVM(int rowIndex) const; 406 void setDefaultViewFont(const QFont &font);407 void setDefaultViewFontColor(const QColor &color);408 396 void setCloudMachineItems(const QList<UIVirtualMachineItemCloud*> &cloudItems); 409 397 … … 436 424 QMap<int, bool> m_columnVisible; 437 425 UIVMActivityOverviewHostStats m_hostStats; 438 QFont m_defaultViewFont;439 QColor m_defaultViewFontColor;440 426 /** Maximum length of string length of data displayed in column. Updated in UIActivityOverviewModel::data(..). */ 441 427 mutable QMap<int, int> m_columnDataMaxLength; … … 863 849 , m_uUsedRAM(0) 864 850 , m_fRAMUsagePercentage(0) 865 , m_uNetworkDownTotal(0)866 , m_uNetworkUpTotal(0)867 , m_uDiskWriteTotal(0)868 , m_uDiskReadTotal(0)869 851 , m_VMuid(uid) 870 852 , m_strVMName(strVMName) … … 878 860 , m_uUsedRAM(0) 879 861 , m_fRAMUsagePercentage(0) 880 , m_uNetworkDownTotal(0)881 , m_uNetworkUpTotal(0)882 , m_uDiskWriteTotal(0)883 , m_uDiskReadTotal(0)884 862 , m_VMuid(QUuid()) 885 863 { … … 1111 1089 : UIActivityOverviewItem(pParent, uid, strVMName) 1112 1090 , m_uVMExitTotal(0) 1091 , m_uDiskWriteTotal(0) 1092 , m_uDiskReadTotal(0) 1093 , m_uNetworkDownTotal(0) 1094 , m_uNetworkUpTotal(0) 1113 1095 { 1114 1096 if (m_enmMachineState == KMachineState_Running) … … 1118 1100 UIActivityOverviewItemLocal::UIActivityOverviewItemLocal() 1119 1101 : m_uVMExitTotal(0) 1102 , m_uDiskWriteTotal(0) 1103 , m_uDiskReadTotal(0) 1104 , m_uNetworkDownTotal(0) 1105 , m_uNetworkUpTotal(0) 1120 1106 { 1121 1107 } … … 1409 1395 } 1410 1396 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 1421 1397 void UIActivityOverviewModel::setCloudMachineItems(const QList<UIVirtualMachineItemCloud*> &cloudItems) 1422 1398 { … … 1482 1458 if (role == Qt::FontRole) 1483 1459 { 1484 QFont font (m_defaultViewFont);1460 QFont font = qApp->font(); 1485 1461 font.setItalic(true); 1486 1462 return font; … … 1636 1612 1637 1613 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); 1646 1622 /* Parse the result we get from CPerformanceCollector to get respective values: */ 1647 1623 for (int i = 0; i < aReturnNames.size(); ++i) … … 1897 1873 m_pTableView->setSortingEnabled(true); 1898 1874 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));1902 1875 1903 1876 connect(m_pModel, &UIActivityOverviewModel::sigDataUpdate, -
trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.cpp
r103166 r103207 53 53 #include "CPerformanceCollector.h" 54 54 #include "CPerformanceMetric.h" 55 #include <iprt/path.h> 55 56 #include <iprt/string.h> 56 57 … … 1144 1145 { 1145 1146 QString strStartFileName = QString("%1/%2_%3"). 1146 arg( QFileInfo(defaultMachineFolder()).absolutePath()).1147 arg(defaultMachineFolder()). 1147 1148 arg(machineName()). 1148 1149 arg(QDateTime::currentDateTime().toString("dd-MM-yyyy_hh-mm-ss")); … … 1152 1153 .arg(machineName())); 1153 1154 QFile dataFile(strFileName); 1155 1154 1156 if (dataFile.open(QFile::WriteOnly | QFile::Truncate)) 1155 1157 { … … 1412 1414 { 1413 1415 if (m_comMachine.isOk()) 1414 return m_comMachine.Get SettingsFilePath();1416 return m_comMachine.GetLogFolder(); 1415 1417 else 1416 1418 return QString(); … … 2036 2038 QString UIVMActivityMonitorCloud::defaultMachineFolder() const 2037 2039 { 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 2041 2047 void UIVMActivityMonitorCloud::reset() 2042 2048 {
Note:
See TracChangeset
for help on using the changeset viewer.