Changeset 68764 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Sep 14, 2017 3:44:36 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.cpp
r68763 r68764 631 631 /* Rebuild the details report: */ 632 632 foreach (const DetailsElementType &enmType, m_details.keys()) 633 m_details.value(enmType)->setText(detailsReport(enmType, comMachine ));633 m_details.value(enmType)->setText(detailsReport(enmType, comMachine, comMachine.GetCurrentSnapshot())); 634 634 } 635 635 … … 1120 1120 1121 1121 QString UISnapshotDetailsWidget::detailsReport(DetailsElementType enmType, 1122 const CMachine &comMachine) const 1122 const CMachine &comMachine, 1123 const CSnapshot &comSnapshot /* = CSnapshot() */) const 1123 1124 { 1124 1125 /* Details templates: */ … … 1154 1155 const int iIconArea = iIconMetric * 1.375; 1155 1156 1157 /* Acquire current snapshot machine if any: */ 1158 const CMachine comMachineOld = comSnapshot.isNotNull() ? comSnapshot.GetMachine() : comMachine; 1159 1156 1160 /* Compose report: */ 1157 1161 QString strReport; … … 1165 1169 ++iRowCount; 1166 1170 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Name", "details (general)"), 1167 comMachine.GetName());1171 empReport(comMachine.GetName(), comMachineOld.GetName())); 1168 1172 1169 1173 /* Operating System: */ 1170 1174 ++iRowCount; 1171 1175 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Operating System", "details (general)"), 1172 vboxGlobal().vmGuestOSTypeDescription(comMachine.GetOSTypeId())); 1176 empReport(vboxGlobal().vmGuestOSTypeDescription(comMachine.GetOSTypeId()), 1177 vboxGlobal().vmGuestOSTypeDescription(comMachineOld.GetOSTypeId()))); 1173 1178 1174 1179 /* Groups? */ 1175 1180 const QString strGroups = groupReport(comMachine); 1181 const QString strGroupsOld = groupReport(comMachineOld); 1176 1182 if (!strGroups.isNull()) 1177 1183 { 1178 1184 ++iRowCount; 1179 1185 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Groups", "details (general)"), 1180 strGroups);1186 empReport(strGroups, strGroupsOld)); 1181 1187 } 1182 1188 … … 1188 1194 ++iRowCount; 1189 1195 const QString strMemory = QApplication::translate("UIGDetails", "%1 MB", "details").arg(comMachine.GetMemorySize()); 1196 const QString strMemoryOld = QApplication::translate("UIGDetails", "%1 MB", "details").arg(comMachineOld.GetMemorySize()); 1190 1197 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Base Memory", "details (system)"), 1191 strMemory);1198 empReport(strMemory, strMemoryOld)); 1192 1199 1193 1200 /* Processors? */ 1194 1201 const int cCpu = comMachine.GetCPUCount(); 1202 const int cCpuOld = comMachineOld.GetCPUCount(); 1195 1203 if (cCpu > 1) 1196 1204 { 1197 1205 ++iRowCount; 1198 1206 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Processors", "details (system)"), 1199 QString::number(cCpu));1207 empReport(QString::number(cCpu), QString::number(cCpuOld))); 1200 1208 } 1201 1209 … … 1206 1214 ++iRowCount; 1207 1215 const QString strExecutionCap = QApplication::translate("UIGDetails", "%1%", "details").arg(uExecutionCap); 1216 const QString strExecutionCapOld = QApplication::translate("UIGDetails", "%1%", "details").arg(comMachineOld.GetCPUExecutionCap()); 1208 1217 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Execution Cap", "details (system)"), 1209 strExecutionCap);1218 empReport(strExecutionCap, strExecutionCapOld)); 1210 1219 } 1211 1220 … … 1213 1222 ++iRowCount; 1214 1223 const QString strBootOrder = bootOrderReport(comMachine); 1224 const QString strBootOrderOld = bootOrderReport(comMachineOld); 1215 1225 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Boot Order", "details (system)"), 1216 strBootOrder);1226 empReport(strBootOrder, strBootOrderOld)); 1217 1227 1218 1228 /* Chipset Type? */ 1219 1229 const KChipsetType enmChipsetType = comMachine.GetChipsetType(); 1230 const KChipsetType enmChipsetTypeOld = comMachineOld.GetChipsetType(); 1220 1231 if (enmChipsetType == KChipsetType_ICH9) 1221 1232 { 1222 1233 ++iRowCount; 1223 1234 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Chipset Type", "details (system)"), 1224 gpConverter->toString(enmChipsetType)); 1235 empReport(gpConverter->toString(enmChipsetType), 1236 gpConverter->toString(enmChipsetTypeOld))); 1225 1237 } 1226 1238 1227 1239 /* EFI? */ 1228 1240 const QString strEfiState = efiStateReport(comMachine); 1241 const QString strEfiStateOld = efiStateReport(comMachineOld); 1229 1242 if (!strEfiState.isNull()) 1230 1243 { 1231 1244 ++iRowCount; 1232 1245 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "EFI", "details (system)"), 1233 strEfiState);1246 empReport(strEfiState, strEfiStateOld)); 1234 1247 } 1235 1248 1236 1249 /* Acceleration? */ 1237 1250 const QString strAcceleration = accelerationReport(comMachine); 1251 const QString strAccelerationOld = accelerationReport(comMachineOld); 1238 1252 if (!strAcceleration.isNull()) 1239 1253 { 1240 1254 ++iRowCount; 1241 1255 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Acceleration", "details (system)"), 1242 strAcceleration);1256 empReport(strAcceleration, strAccelerationOld)); 1243 1257 } 1244 1258 … … 1258 1272 ++iRowCount; 1259 1273 const QString strVram = QApplication::translate("UIGDetails", "%1 MB", "details").arg(comMachine.GetVRAMSize()); 1274 const QString strVramOld = QApplication::translate("UIGDetails", "%1 MB", "details").arg(comMachineOld.GetVRAMSize()); 1260 1275 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Video Memory", "details (display)"), 1261 strVram);1276 empReport(strVram, strVramOld)); 1262 1277 1263 1278 /* Screens? */ 1264 1279 const int cScreens = comMachine.GetMonitorCount(); 1280 const int cScreensOld = comMachineOld.GetMonitorCount(); 1265 1281 if (cScreens > 1) 1266 1282 { 1267 1283 ++iRowCount; 1268 1284 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Screens", "details (display)"), 1269 QString::number(cScreens));1285 empReport(QString::number(cScreens), QString::number(cScreensOld))); 1270 1286 } 1271 1287 1272 1288 /* Scale-factor? */ 1273 1289 const double uScaleFactor = scaleFactorReport(comMachine); 1290 const double uScaleFactorOld = scaleFactorReport(comMachineOld); 1274 1291 if (uScaleFactor != 1.0) 1275 1292 { 1276 1293 ++iRowCount; 1277 1294 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Scale-factor", "details (display)"), 1278 QString::number(uScaleFactor, 'f', 2)); 1295 empReport(QString::number(uScaleFactor, 'f', 2), 1296 QString::number(uScaleFactorOld, 'f', 2))); 1279 1297 } 1280 1298 … … 1282 1300 /* Unscaled HiDPI Video Output? */ 1283 1301 const QString strUnscaledOutput = unscaledOutputReport(comMachine); 1302 const QString strUnscaledOutputOld = unscaledOutputReport(comMachineOld); 1284 1303 if (!strUnscaledOutput.isNull()) 1285 1304 { 1286 1305 ++iRowCount; 1287 1306 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Unscaled HiDPI Video Output", "details (display)"), 1288 strUnscaledOutput);1307 empReport(strUnscaledOutput, strUnscaledOutputOld)); 1289 1308 } 1290 1309 #endif /* VBOX_WS_MAC */ … … 1292 1311 /* Acceleration? */ 1293 1312 const QString strAcceleration = displayAccelerationReport(comMachine); 1313 const QString strAccelerationOld = displayAccelerationReport(comMachineOld); 1294 1314 if (!strAcceleration.isNull()) 1295 1315 { 1296 1316 ++iRowCount; 1297 1317 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Acceleration", "details (display)"), 1298 strAcceleration);1318 empReport(strAcceleration, strAccelerationOld)); 1299 1319 } 1300 1320 1301 1321 /* Remote Desktop Server: */ 1302 1322 QStringList aVrdeReport = vrdeServerReport(comMachine); 1323 QStringList aVrdeReportOld = vrdeServerReport(comMachineOld); 1303 1324 if (!aVrdeReport.isEmpty()) 1304 1325 { 1305 1326 ++iRowCount; 1306 1327 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Remote Desktop Server Port", "details (display/vrde)"), 1307 aVrdeReport.value(0));1328 empReport(aVrdeReport.value(0), aVrdeReportOld.value(0))); 1308 1329 } 1309 1330 else … … 1311 1332 ++iRowCount; 1312 1333 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Remote Desktop Server", "details (display/vrde)"), 1313 QApplication::translate("UIGDetails", "Disabled", "details (display/vrde/VRDE server)"));1334 empReport(QApplication::translate("UIGDetails", "Disabled", "details (display/vrde/VRDE server)"), aVrdeReportOld.isEmpty())); 1314 1335 } 1315 1336 1316 1337 /* Video Capture: */ 1317 1338 QStringList aVideoCaptureReport = videoCaptureReport(comMachine); 1339 QStringList aVideoCaptureReportOld = videoCaptureReport(comMachineOld); 1318 1340 if (!aVideoCaptureReport.isEmpty()) 1319 1341 { 1320 1342 ++iRowCount; 1321 1343 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Video Capture File", "details (display/video capture)"), 1322 aVideoCaptureReport.value(0));1344 empReport(aVideoCaptureReport.value(0), aVideoCaptureReportOld.value(0))); 1323 1345 ++iRowCount; 1324 1346 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Video Capture Attributes", "details (display/video capture)"), 1325 aVideoCaptureReport.value(1));1347 empReport(aVideoCaptureReport.value(1), aVideoCaptureReportOld.value(1))); 1326 1348 } 1327 1349 else … … 1329 1351 ++iRowCount; 1330 1352 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Video Capture", "details (display/video capture)"), 1331 QApplication::translate("UIGDetails", "Disabled", "details (display/video capture)"));1353 empReport(QApplication::translate("UIGDetails", "Disabled", "details (display/video capture)"), aVideoCaptureReportOld.isEmpty())); 1332 1354 } 1333 1355 … … 1340 1362 QStringList aControllers = report.first; 1341 1363 QList<QMap<QString, QString> > aAttachments = report.second; 1364 QPair<QStringList, QList<QMap<QString, QString> > > reportOld = storageReport(comMachineOld); 1365 QStringList aControllersOld = reportOld.first; 1366 QList<QMap<QString, QString> > aAttachmentsOld = reportOld.second; 1342 1367 1343 1368 /* Iterate through storage controllers: */ … … 1346 1371 /* Add controller information: */ 1347 1372 ++iRowCount; 1348 strItem += QString(sSectionItemTpl3).arg( aControllers.value(i));1373 strItem += QString(sSectionItemTpl3).arg(empReport(aControllers.value(i), aControllersOld.value(i))); 1349 1374 1350 1375 /* Iterate through storage attachments: */ 1351 1376 QMap<QString, QString> aCurrentAttachments = aAttachments.value(i); 1377 QMap<QString, QString> aCurrentAttachmentsOld = aAttachmentsOld.value(i); 1352 1378 for (int j = 0; j < aCurrentAttachments.keys().size(); ++j) 1353 1379 { 1354 const QString &strSlotInfo = aCurrentAttachments.keys().value(j); 1355 const QString &strMediumInfo = aCurrentAttachments.value(aCurrentAttachments.keys().value(j)); 1380 const QString &strSlotInfo = empReport(aCurrentAttachments.keys().value(j), 1381 aCurrentAttachmentsOld.keys().value(j)); 1382 const QString &strMediumInfo = empReport(aCurrentAttachments.value(aCurrentAttachments.keys().value(j)), 1383 aCurrentAttachmentsOld.value(aCurrentAttachments.keys().value(j))); 1356 1384 /* Add attachment information: */ 1357 1385 ++iRowCount; … … 1365 1393 /* Not Attached: */ 1366 1394 ++iRowCount; 1367 strItem = QString(sSectionItemTpl1).arg( QApplication::translate("UIGDetails", "Not Attached", "details (storage)"));1395 strItem = QString(sSectionItemTpl1).arg(empReport(QApplication::translate("UIGDetails", "Not Attached", "details (storage)"), aControllersOld.isEmpty())); 1368 1396 } 1369 1397 … … 1374 1402 /* Audio: */ 1375 1403 QStringList aReport = audioReport(comMachine); 1404 QStringList aReportOld = audioReport(comMachineOld); 1376 1405 1377 1406 /* If there is something to report: */ … … 1381 1410 ++iRowCount; 1382 1411 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Host Driver", "details (audio)"), 1383 aReport.value(0));1412 empReport(aReport.value(0), aReportOld.value(0))); 1384 1413 1385 1414 /* Controller: */ 1386 1415 ++iRowCount; 1387 1416 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Controller", "details (audio)"), 1388 aReport.value(1));1417 empReport(aReport.value(1), aReportOld.value(1))); 1389 1418 1390 1419 #ifdef VBOX_WITH_AUDIO_INOUT_INFO … … 1392 1421 ++iRowCount; 1393 1422 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Audio Output", "details (audio)"), 1394 aReport.value(2));1423 empReport(aReport.value(2), aReportOld.value(2))); 1395 1424 1396 1425 /* Input: */ 1397 1426 ++iRowCount; 1398 1427 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Audio Input", "details (audio)"), 1399 aReport.value(3));1428 empReport(aReport.value(3), aReportOld.value(3))); 1400 1429 #endif /* VBOX_WITH_AUDIO_INOUT_INFO */ 1401 1430 } … … 1406 1435 /* Disabled: */ 1407 1436 ++iRowCount; 1408 strItem = QString(sSectionItemTpl1).arg( QApplication::translate("UIGDetails", "Disabled", "details (audio)"));1437 strItem = QString(sSectionItemTpl1).arg(empReport(QApplication::translate("UIGDetails", "Disabled", "details (audio)"), aReportOld.isEmpty())); 1409 1438 } 1410 1439 … … 1415 1444 /* Network: */ 1416 1445 QStringList aReport = networkReport(comMachine); 1446 QStringList aReportOld = networkReport(comMachineOld); 1417 1447 1418 1448 /* Iterate through network adapters: */ … … 1420 1450 { 1421 1451 const QString &strAdapterInformation = aReport.value(i); 1452 const QString &strAdapterInformationOld = aReportOld.value(i); 1422 1453 /* Add adapter information: */ 1423 1454 ++iRowCount; 1424 1455 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Adapter %1", "details (network)").arg(i + 1), 1425 strAdapterInformation);1456 empReport(strAdapterInformation, strAdapterInformationOld)); 1426 1457 } 1427 1458 … … 1431 1462 /* Disabled: */ 1432 1463 ++iRowCount; 1433 strItem = QString(sSectionItemTpl1).arg( QApplication::translate("UIGDetails", "Disabled", "details (network/adapter)"));1464 strItem = QString(sSectionItemTpl1).arg(empReport(QApplication::translate("UIGDetails", "Disabled", "details (network/adapter)"), aReportOld.isEmpty())); 1434 1465 } 1435 1466 … … 1440 1471 /* Serial: */ 1441 1472 QStringList aReport = serialReport(comMachine); 1473 QStringList aReportOld = serialReport(comMachineOld); 1442 1474 1443 1475 /* Iterate through serial ports: */ … … 1445 1477 { 1446 1478 const QString &strPortInformation = aReport.value(i); 1479 const QString &strPortInformationOld = aReportOld.value(i); 1447 1480 /* Add port information: */ 1448 1481 ++iRowCount; 1449 1482 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Port %1", "details (serial)").arg(i + 1), 1450 strPortInformation);1483 empReport(strPortInformation, strPortInformationOld)); 1451 1484 } 1452 1485 … … 1456 1489 /* Disabled: */ 1457 1490 ++iRowCount; 1458 strItem = QString(sSectionItemTpl1).arg( QApplication::translate("UIGDetails", "Disabled", "details (serial)"));1491 strItem = QString(sSectionItemTpl1).arg(empReport(QApplication::translate("UIGDetails", "Disabled", "details (serial)"), aReportOld.isEmpty())); 1459 1492 } 1460 1493 … … 1465 1498 /* USB: */ 1466 1499 QStringList aReport = usbReport(comMachine); 1500 QStringList aReportOld = usbReport(comMachineOld); 1467 1501 1468 1502 /* If there is something to report: */ … … 1472 1506 ++iRowCount; 1473 1507 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "USB Controller", "details (usb)"), 1474 aReport.value(0));1508 empReport(aReport.value(0), aReportOld.value(0))); 1475 1509 1476 1510 /* Device Filters: */ 1477 1511 ++iRowCount; 1478 1512 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Device Filters", "details (usb)"), 1479 aReport.value(1));1513 empReport(aReport.value(1), aReportOld.value(1))); 1480 1514 } 1481 1515 … … 1485 1519 /* Disabled: */ 1486 1520 ++iRowCount; 1487 strItem = QString(sSectionItemTpl1).arg( QApplication::translate("UIGDetails", "Disabled", "details (usb)"));1521 strItem = QString(sSectionItemTpl1).arg(empReport(QApplication::translate("UIGDetails", "Disabled", "details (usb)"), aReportOld.isEmpty())); 1488 1522 } 1489 1523 … … 1494 1528 /* Shared Folders: */ 1495 1529 const ulong cFolders = comMachine.GetSharedFolders().size(); 1530 const ulong cFoldersOld = comMachineOld.GetSharedFolders().size(); 1496 1531 if (cFolders > 0) 1497 1532 { 1498 1533 ++iRowCount; 1499 1534 strItem = QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Shared Folders", "details (shared folders)"), 1500 QString::number(cFolders));1535 empReport(QString::number(cFolders), QString::number(cFoldersOld))); 1501 1536 } 1502 1537 else 1503 1538 { 1504 1539 ++iRowCount; 1505 strItem = QString(sSectionItemTpl1).arg( QApplication::translate("UIGDetails", "None", "details (shared folders)"));1540 strItem = QString(sSectionItemTpl1).arg(empReport(QApplication::translate("UIGDetails", "None", "details (shared folders)"), cFoldersOld == 0)); 1506 1541 } 1507 1542 … … 1927 1962 1928 1963 /* static */ 1964 QString UISnapshotDetailsWidget::empReport(const QString &strValue, const QString &strOldValue) 1965 { 1966 return strValue == strOldValue ? strValue : QString("<u>%1</u>").arg(strValue); 1967 } 1968 1969 /* static */ 1970 QString UISnapshotDetailsWidget::empReport(const QString &strValue, bool fIgnore) 1971 { 1972 return fIgnore ? strValue : QString("<u>%1</u>").arg(strValue); 1973 } 1974 1975 /* static */ 1929 1976 QString UISnapshotDetailsWidget::summarizeGenericProperties(const CNetworkAdapter &comNetwork) 1930 1977 { -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.h
r68763 r68764 148 148 149 149 /** Returns details report of requested @a enmType for a given @a comMachine. */ 150 QString detailsReport(DetailsElementType enmType, const CMachine &comMachine ) const;150 QString detailsReport(DetailsElementType enmType, const CMachine &comMachine, const CSnapshot &comSnapshot = CSnapshot()) const; 151 151 152 152 /** Acquires @a comMachine group report. */ … … 184 184 static QString wipeHtmlStuff(const QString &strString); 185 185 186 /** Prepares emhasized report for a given @a strValue, comparing to @a strOldValue. */ 187 static QString empReport(const QString &strValue, const QString &strOldValue); 188 /** Prepares emhasized report for a given @a strValue, depending on @a fDo flag. */ 189 static QString empReport(const QString &strValue, bool fIgnore); 190 186 191 /** Summarizes generic properties. */ 187 192 static QString summarizeGenericProperties(const CNetworkAdapter &adapter);
Note:
See TracChangeset
for help on using the changeset viewer.