Changeset 68365 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Aug 10, 2017 12:28:32 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
r68340 r68365 1152 1152 case DetailsElementType_General: 1153 1153 { 1154 /* Name, O S Type: */1154 /* Name, Operating System: */ 1155 1155 int iRowCount = 2; 1156 QString strItem = QString(sSectionItemTpl2).arg( tr("Name", "details report"),1156 QString strItem = QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Name", "details (general)"), 1157 1157 comMachine.GetName()) 1158 + QString(sSectionItemTpl2).arg( tr("OS Type", "details report"),1158 + QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Operating System", "details (general)"), 1159 1159 vboxGlobal().vmGuestOSTypeDescription(comMachine.GetOSTypeId())); 1160 1160 1161 /* Group(s)? */ 1162 const QStringList &groups = comMachine.GetGroups().toList(); 1163 if ( groups.size() > 1 1164 || (groups.size() > 0 && groups.at(0) != "/")) 1161 /* Groups? */ 1162 QStringList aGroups = comMachine.GetGroups().toList(); 1163 /* Do not show groups for machine which is in root group only: */ 1164 if (aGroups.size() == 1) 1165 aGroups.removeAll("/"); 1166 /* If group list still not empty: */ 1167 if (!aGroups.isEmpty()) 1165 1168 { 1166 1169 ++iRowCount; 1167 strItem += QString(sSectionItemTpl2).arg(tr("Group(s)", "details report"), 1168 groups.join(", ")); 1170 /* For all groups => Trim first '/' symbol: */ 1171 for (int i = 0; i < aGroups.size(); ++i) 1172 { 1173 QString &strGroup = aGroups[i]; 1174 if (strGroup.startsWith("/") && strGroup != "/") 1175 strGroup.remove(0, 1); 1176 } 1177 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Groups", "details (general)"), 1178 aGroups.join(", ")); 1169 1179 } 1170 1180 … … 1174 1184 .arg("details://general", /* icon */ 1175 1185 QString::number(iIconArea), /* icon area */ 1176 tr("General", "details report"), /* title */1186 gpConverter->toString(enmType), /* title */ 1177 1187 strItem /* items */); 1178 1188 … … 1181 1191 case DetailsElementType_System: 1182 1192 { 1183 /* Base Memory, Processor(s): */ 1184 int iRowCount = 2; 1185 QString strItem = QString(sSectionItemTpl2).arg(tr("Base Memory", "details report"), 1186 tr("<nobr>%1 MB</nobr>", "details report") 1187 .arg(QString::number(comMachine.GetMemorySize()))) 1188 + QString(sSectionItemTpl2).arg(tr("Processor(s)", "details report"), 1189 tr("<nobr>%1</nobr>", "details report") 1190 .arg(QString::number(comMachine.GetCPUCount()))); 1193 /* Base Memory: */ 1194 int iRowCount = 1; 1195 QString strItem = QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Base Memory", "details (system)"), 1196 QApplication::translate("UIGDetails", "%1 MB", "details").arg(comMachine.GetMemorySize())); 1197 1198 /* Processors? */ 1199 const int cCPU = comMachine.GetCPUCount(); 1200 if (cCPU > 1) 1201 { 1202 ++iRowCount; 1203 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Processors", "details (system)"), 1204 QString::number(cCPU)); 1205 } 1191 1206 1192 1207 /* Execution Cap? */ 1193 ULONG uExecutionCap = comMachine.GetCPUExecutionCap();1208 const ULONG uExecutionCap = comMachine.GetCPUExecutionCap(); 1194 1209 if (uExecutionCap < 100) 1195 1210 { 1196 1211 ++iRowCount; 1197 strItem += QString(sSectionItemTpl2).arg(tr("Execution Cap", "details report"), 1198 tr("<nobr>%1%</nobr>", "details report") 1199 .arg(comMachine.GetCPUExecutionCap())); 1212 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Execution Cap", "details (system)"), 1213 QApplication::translate("UIGDetails", "%1%", "details").arg(uExecutionCap)); 1200 1214 } 1201 1215 1202 1216 /* Boot Order: */ 1203 1217 ++iRowCount; 1204 QStringList bootOrder;1218 QStringList aBootOrder; 1205 1219 for (ulong i = 1; i <= vboxGlobal().virtualBox().GetSystemProperties().GetMaxBootPosition(); ++i) 1206 1220 { 1207 1221 const KDeviceType enmDevice = comMachine.GetBootOrder(i); 1208 1222 if (enmDevice != KDeviceType_Null) 1209 bootOrder << gpConverter->toString(enmDevice);1210 } 1211 if ( bootOrder.isEmpty())1212 bootOrder << gpConverter->toString(KDeviceType_Null);1213 strItem += QString(sSectionItemTpl2).arg( tr("Boot Order", "details report"),1214 bootOrder.join(", "));1215 1216 /* Chipset type :*/1223 aBootOrder << gpConverter->toString(enmDevice); 1224 } 1225 if (aBootOrder.isEmpty()) 1226 aBootOrder << gpConverter->toString(KDeviceType_Null); 1227 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Boot Order", "details (system)"), 1228 aBootOrder.join(", ")); 1229 1230 /* Chipset type? */ 1217 1231 const KChipsetType enmChipsetType = comMachine.GetChipsetType(); 1218 1232 if (enmChipsetType == KChipsetType_ICH9) 1219 1233 { 1220 1234 ++iRowCount; 1221 strItem += QString(sSectionItemTpl2).arg( tr("Chipset Type", "details report"),1235 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Chipset Type", "details (system)"), 1222 1236 gpConverter->toString(enmChipsetType)); 1223 1237 } 1224 1238 1225 /* Firware type :*/1239 /* Firware type? */ 1226 1240 switch (comMachine.GetFirmwareType()) 1227 1241 { … … 1232 1246 { 1233 1247 ++iRowCount; 1234 const QString strEFI = tr("Enabled", "details report (EFI)");1235 strItem += QString(sSectionItemTpl2).arg( tr("EFI", "details report"), strEFI);1248 const QString strEFI = QApplication::translate("UIGDetails", "Enabled", "details (system/EFI)"); 1249 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "EFI", "details (system)"), strEFI); 1236 1250 break; 1237 1251 } … … 1239 1253 { 1240 1254 //++iRowCount; 1241 const QString strEFI = tr("Disabled", "details report (EFI)"); Q_UNUSED(strEFI);1242 //strItem += QString(sSectionItemTpl2).arg( tr("EFI", "details report"), strEFI);1255 const QString strEFI = QApplication::translate("UIGDetails", "Disabled", "details (system/EFI)"); Q_UNUSED(strEFI); 1256 //strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "EFI", "details (system)"), strEFI); 1243 1257 break; 1244 1258 } 1245 1259 } 1246 1260 1247 #ifdef VBOX_WITH_FULL_DETAILS_REPORT 1248 1249 /* Acquire BIOS Settings: */ 1250 const CBIOSSettings &comBiosSettings = comMachine.GetBIOSSettings(); 1251 1252 /* ACPI: */ 1253 ++iRowCount; 1254 const QString strAcpi = comBiosSettings.GetACPIEnabled() 1255 ? tr("Enabled", "details report (ACPI)") 1256 : tr("Disabled", "details report (ACPI)"); 1257 strItem += QString(sSectionItemTpl2).arg(tr("ACPI", "details report"), strAcpi); 1258 1259 /* I/O APIC: */ 1260 ++iRowCount; 1261 const QString strIoapic = comBiosSettings.GetIOAPICEnabled() 1262 ? tr("Enabled", "details report (I/O APIC)") 1263 : tr("Disabled", "details report (I/O APIC)"); 1264 strItem += QString(sSectionItemTpl2).arg(tr("I/O APIC", "details report"), strIoapic); 1265 1266 /* PAE/NX: */ 1267 ++iRowCount; 1268 const QString strPae = comMachine.GetCPUProperty(KCPUPropertyType_PAE) 1269 ? tr("Enabled", "details report (PAE/NX)") 1270 : tr("Disabled", "details report (PAE/NX)"); 1271 strItem += QString(sSectionItemTpl2).arg(tr("PAE/NX", "details report"), strPae); 1272 1273 #endif /* VBOX_WITH_FULL_DETAILS_REPORT */ 1274 1275 /* VT-x/AMD-V availability: */ 1276 const bool fVTxAMDVSupported = vboxGlobal().host().GetProcessorFeature(KProcessorFeature_HWVirtEx); 1277 if (fVTxAMDVSupported) 1278 { 1279 /* VT-x/AMD-V: */ 1261 /* Acceleration? */ 1262 QStringList aAcceleration; 1263 /* VT-x/AMD-V and Nested Paging? */ 1264 if (vboxGlobal().host().GetProcessorFeature(KProcessorFeature_HWVirtEx)) 1265 { 1266 /* VT-x/AMD-V? */ 1267 if (comMachine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled)) 1268 { 1269 aAcceleration << QApplication::translate("UIGDetails", "VT-x/AMD-V", "details (system)"); 1270 /* Nested Paging? */ 1271 if (comMachine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging)) 1272 aAcceleration << QApplication::translate("UIGDetails", "Nested Paging", "details (system)"); 1273 } 1274 1275 } 1276 /* PAE/NX? */ 1277 if (comMachine.GetCPUProperty(KCPUPropertyType_PAE)) 1278 aAcceleration << QApplication::translate("UIGDetails", "PAE/NX", "details (system)"); 1279 /* Paravirtualization Interface? */ 1280 switch (comMachine.GetEffectiveParavirtProvider()) 1281 { 1282 case KParavirtProvider_Minimal: aAcceleration << QApplication::translate("UIGDetails", "Minimal Paravirtualization", "details (system)"); break; 1283 case KParavirtProvider_HyperV: aAcceleration << QApplication::translate("UIGDetails", "Hyper-V Paravirtualization", "details (system)"); break; 1284 case KParavirtProvider_KVM: aAcceleration << QApplication::translate("UIGDetails", "KVM Paravirtualization", "details (system)"); break; 1285 default: break; 1286 } 1287 if (!aAcceleration.isEmpty()) 1288 { 1280 1289 ++iRowCount; 1281 const QString strVirt = comMachine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled) 1282 ? tr("Enabled", "details report (VT-x/AMD-V)") 1283 : tr("Disabled", "details report (VT-x/AMD-V)"); 1284 strItem += QString(sSectionItemTpl2).arg(tr("VT-x/AMD-V", "details report"), strVirt); 1285 1286 /* Nested Paging: */ 1287 ++iRowCount; 1288 const QString strNested = comMachine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging) 1289 ? tr("Enabled", "details report (Nested Paging)") 1290 : tr("Disabled", "details report (Nested Paging)"); 1291 strItem += QString(sSectionItemTpl2).arg(tr("Nested Paging", "details report"), strNested); 1292 } 1293 1294 /* Paravirtualization Interface: */ 1295 ++iRowCount; 1296 const QString strParavirtProvider = gpConverter->toString(comMachine.GetParavirtProvider()); 1297 strItem += QString(sSectionItemTpl2).arg(tr("Paravirtualization Interface", "details report"), strParavirtProvider); 1290 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Acceleration", "details (system)"), aAcceleration.join(", ")); 1291 } 1298 1292 1299 1293 /* Append report: */ … … 1302 1296 .arg("details://system", /* icon */ 1303 1297 QString::number(iIconArea), /* icon area */ 1304 tr("System", "details report"), /* title */1298 gpConverter->toString(enmType), /* title */ 1305 1299 strItem); /* items */ 1306 1300 … … 1319 1313 .arg("details://preview", /* icon */ 1320 1314 QString::number(iIconArea), /* icon area */ 1321 tr("Preview", "details report"), /* title */1315 gpConverter->toString(enmType), /* title */ 1322 1316 strItem); /* items */ 1323 1317 … … 1328 1322 /* Video Memory: */ 1329 1323 int iRowCount = 1; 1330 QString strItem = QString(sSectionItemTpl2).arg(tr("Video Memory", "details report"), 1331 tr("<nobr>%1 MB</nobr>", "details report") 1332 .arg(QString::number(comMachine.GetVRAMSize()))); 1324 QString strItem = QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Video Memory", "details (display)"), 1325 QApplication::translate("UIGDetails", "%1 MB", "details").arg(comMachine.GetVRAMSize())); 1333 1326 1334 1327 /* Screens? */ 1335 const int c GuestScreens = comMachine.GetMonitorCount();1336 if (c GuestScreens > 1)1328 const int cScreens = comMachine.GetMonitorCount(); 1329 if (cScreens > 1) 1337 1330 { 1338 1331 ++iRowCount; 1339 strItem += QString(sSectionItemTpl2).arg(tr("Screens", "details report"), 1340 QString::number(cGuestScreens)); 1341 } 1342 1343 /* 3D Acceleration: */ 1344 ++iRowCount; 1345 QString strAcc3d = comMachine.GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable() 1346 ? tr("Enabled", "details report (3D Acceleration)") 1347 : tr("Disabled", "details report (3D Acceleration)"); 1348 strItem += QString(sSectionItemTpl2).arg(tr("3D Acceleration", "details report"), strAcc3d); 1349 1332 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Screens", "details (display)"), 1333 QString::number(cScreens)); 1334 } 1335 1336 /* Scale-factor? */ 1337 CMachine comExtraDataMachine = comMachine; 1338 const QString strScaleFactor = comExtraDataMachine.GetExtraData(UIExtraDataDefs::GUI_ScaleFactor); 1339 { 1340 /* Try to convert loaded data to double: */ 1341 bool fOk = false; 1342 double dValue = strScaleFactor.toDouble(&fOk); 1343 /* Invent the default value: */ 1344 if (!fOk || !dValue) 1345 dValue = 1.0; 1346 /* Append information: */ 1347 if (dValue != 1.0) 1348 { 1349 ++iRowCount; 1350 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Scale-factor", "details (display)"), 1351 QString::number(dValue, 'f', 2)); 1352 } 1353 } 1354 1355 #ifdef VBOX_WS_MAC 1356 /* Unscaled HiDPI Video Output? */ 1357 const QString strUnscaledHiDPIMode = machine.GetExtraData(UIExtraDataDefs::GUI_HiDPI_UnscaledOutput); 1358 { 1359 /* Try to convert loaded data to bool: */ 1360 const bool fEnabled = strUnscaledHiDPIMode.compare("true", Qt::CaseInsensitive) == 0 || 1361 strUnscaledHiDPIMode.compare("yes", Qt::CaseInsensitive) == 0 || 1362 strUnscaledHiDPIMode.compare("on", Qt::CaseInsensitive) == 0 || 1363 strUnscaledHiDPIMode == "1"; 1364 /* Append information: */ 1365 if (fEnabled) 1366 { 1367 ++iRowCount; 1368 const QString strHiDPI = QApplication::translate("UIGDetails", "Enabled", "details (display/Unscaled HiDPI Video Output)"); 1369 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Unscaled HiDPI Video Output", "details (display)"), strHiDPI); 1370 } 1371 else 1372 { 1373 //++iRowCount; 1374 const QString strHiDPI = QApplication::translate("UIGDetails", "Disabled", "details (display/Unscaled HiDPI Video Output)"); Q_UNUSED(strHiDPI); 1375 //strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Unscaled HiDPI Video Output", "details (display)"), strHiDPI); 1376 } 1377 } 1378 #endif /* VBOX_WS_MAC */ 1379 1380 /* Acceleration? */ 1381 QStringList aAcceleration; 1350 1382 #ifdef VBOX_WITH_VIDEOHWACCEL 1351 /* 2D Video Acceleration: */ 1352 ++iRowCount; 1353 QString strAcc2dVideo = comMachine.GetAccelerate2DVideoEnabled() 1354 ? tr("Enabled", "details report (2D Video Acceleration)") 1355 : tr("Disabled", "details report (2D Video Acceleration)"); 1356 strItem += QString(sSectionItemTpl2).arg(tr("2D Video Acceleration", "details report"), strAcc2dVideo); 1383 /* 2D Video Acceleration? */ 1384 if (comMachine.GetAccelerate2DVideoEnabled()) 1385 aAcceleration << QApplication::translate("UIGDetails", "2D Video", "details (display)"); 1357 1386 #endif 1387 /* 3D Acceleration? */ 1388 if (comMachine.GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable()) 1389 aAcceleration << QApplication::translate("UIGDetails", "3D", "details (display)"); 1390 if (!aAcceleration.isEmpty()) 1391 { 1392 ++iRowCount; 1393 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Acceleration", "details (display)"), aAcceleration.join(", ")); 1394 } 1358 1395 1359 1396 /* Remote Desktop Server: */ … … 1363 1400 ++iRowCount; 1364 1401 if (comServer.GetEnabled()) 1365 strItem += QString(sSectionItemTpl2).arg( tr("Remote Desktop Server Port", "details report (VRDE Server)"),1402 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Remote Desktop Server Port", "details (display/vrde)"), 1366 1403 comServer.GetVRDEProperty("TCP/Ports")); 1367 1404 else 1368 strItem += QString(sSectionItemTpl2).arg(tr("Remote Desktop Server", "details report (VRDE Server)"), 1369 tr("Disabled", "details report (VRDE Server)")); 1405 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Remote Desktop Server", "details (display/vrde)"), 1406 QApplication::translate("UIGDetails", "Disabled", "details (display/vrde/VRDE server)")); 1407 } 1408 1409 /* Video Capture: */ 1410 if (comMachine.GetVideoCaptureEnabled()) 1411 { 1412 ++iRowCount; 1413 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Video Capture File", "details (display/video capture)"), 1414 comMachine.GetVideoCaptureFile()); 1415 ++iRowCount; 1416 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Video Capture Attributes", "details (display/video capture)"), 1417 QApplication::translate("UIGDetails", "Frame Size: %1x%2, Frame Rate: %3fps, Bit Rate: %4kbps") 1418 .arg(comMachine.GetVideoCaptureWidth()).arg(comMachine.GetVideoCaptureHeight()) 1419 .arg(comMachine.GetVideoCaptureFPS()).arg(comMachine.GetVideoCaptureRate())); 1420 } 1421 else 1422 { 1423 ++iRowCount; 1424 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Video Capture", "details (display/video capture)"), 1425 QApplication::translate("UIGDetails", "Disabled", "details (display/video capture)")); 1370 1426 } 1371 1427 … … 1375 1431 .arg("details://display", /* icon */ 1376 1432 QString::number(iIconArea), /* icon area */ 1377 tr("Display", "details report"), /* title */1433 gpConverter->toString(enmType), /* title */ 1378 1434 strItem); /* items */ 1379 1435 … … 1400 1456 /* Prepare current storage slot: */ 1401 1457 const StorageSlot attachmentSlot(comController.GetBus(), comAttachment.GetPort(), comAttachment.GetDevice()); 1402 // TODO: Fix that NLS bug one day..1403 1458 /* Append 'device slot name' with 'device type name' for optical devices only: */ 1404 QString strDeviceType = comAttachment.GetType() == KDeviceType_DVD ? tr("(Optical Drive)") : QString(); 1459 QString strDeviceType = comAttachment.GetType() == KDeviceType_DVD 1460 ? QApplication::translate("UIGDetails", "[Optical Drive]", "details (storage)") 1461 : QString(); 1405 1462 if (!strDeviceType.isNull()) 1406 1463 strDeviceType.prepend(' '); … … 1436 1493 { 1437 1494 ++iRowCount; 1438 strItem = QString(sSectionItemTpl1).arg( tr("Not Attached", "details report (Storage)"));1495 strItem = QString(sSectionItemTpl1).arg(QApplication::translate("UIGDetails", "Not Attached", "details (storage)")); 1439 1496 } 1440 1497 … … 1444 1501 .arg("details://storage", /* icon */ 1445 1502 QString::number(iIconArea), /* icon area */ 1446 tr("Storage", "details report"), /* title */1503 gpConverter->toString(enmType), /* title */ 1447 1504 strItem); /* items */ 1448 1505 … … 1460 1517 { 1461 1518 iRowCount += 2; 1462 strItem = QString(sSectionItemTpl2).arg( tr("Host Driver", "details report(audio)"),1519 strItem = QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Host Driver", "details (audio)"), 1463 1520 gpConverter->toString(comAudio.GetAudioDriver())) 1464 + QString(sSectionItemTpl2).arg( tr("Controller", "details report(audio)"),1521 + QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Controller", "details (audio)"), 1465 1522 gpConverter->toString(comAudio.GetAudioController())); 1466 1523 } … … 1468 1525 { 1469 1526 ++iRowCount; 1470 strItem = QString(sSectionItemTpl1).arg( tr("Disabled", "details report(audio)"));1527 strItem = QString(sSectionItemTpl1).arg(QApplication::translate("UIGDetails", "Disabled", "details (audio)")); 1471 1528 } 1472 1529 … … 1476 1533 .arg("details://audio", /* icon */ 1477 1534 QString::number(iIconArea), /* icon area */ 1478 tr("Audio", "details report"), /* title */1535 gpConverter->toString(enmType), /* title */ 1479 1536 strItem); /* items */ 1480 1537 … … 1505 1562 { 1506 1563 case KNetworkAttachmentType_Bridged: 1507 attType = attType.arg( tr("Bridged adapter, %1", "details report(network)")1564 attType = attType.arg(QApplication::translate("UIGDetails", "Bridged Adapter, %1", "details (network)") 1508 1565 .arg(comNetwork.GetBridgedInterface())); 1509 1566 break; 1510 1567 case KNetworkAttachmentType_Internal: 1511 attType = attType.arg( tr("Internal network, '%1'", "details report(network)")1568 attType = attType.arg(QApplication::translate("UIGDetails", "Internal Network, '%1'", "details (network)") 1512 1569 .arg(comNetwork.GetInternalNetwork())); 1513 1570 break; 1514 1571 case KNetworkAttachmentType_HostOnly: 1515 attType = attType.arg( tr("Host-only adapter, '%1'", "details report(network)")1572 attType = attType.arg(QApplication::translate("UIGDetails", "Host-only Adapter, '%1'", "details (network)") 1516 1573 .arg(comNetwork.GetHostOnlyInterface())); 1517 1574 break; 1518 1575 case KNetworkAttachmentType_Generic: 1519 attType = attType.arg(tr("Generic, '%1'", "details report (network)") 1520 .arg(comNetwork.GetGenericDriver())); 1576 { 1577 QString strGenericDriverProperties(summarizeGenericProperties(comNetwork)); 1578 attType = attType.arg(strGenericDriverProperties.isNull() 1579 ? attType.arg(QApplication::translate("UIGDetails", "Generic Driver, '%1'", "details (network)").arg(comNetwork.GetGenericDriver())) 1580 : attType.arg(QApplication::translate("UIGDetails", "Generic Driver, '%1' { %2 }", "details (network)") 1581 .arg(comNetwork.GetGenericDriver(), strGenericDriverProperties))); 1521 1582 break; 1583 } 1522 1584 case KNetworkAttachmentType_NATNetwork: 1523 attType = attType.arg( tr("NAT network, '%1'", "details report(network)")1585 attType = attType.arg(QApplication::translate("UIGDetails", "NAT Network, '%1'", "details (network)") 1524 1586 .arg(comNetwork.GetNATNetwork())); 1525 1587 break; … … 1530 1592 /* Here goes the record: */ 1531 1593 ++iRowCount; 1532 strItem += QString(sSectionItemTpl2).arg( tr("Adapter %1", "details report(network)")1594 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Adapter %1", "details (network)") 1533 1595 .arg(comNetwork.GetSlot() + 1), 1534 1596 attType); … … 1540 1602 { 1541 1603 ++iRowCount; 1542 strItem = QString(sSectionItemTpl1).arg( tr("Disabled", "details report (network)"));1604 strItem = QString(sSectionItemTpl1).arg(QApplication::translate("UIGDetails", "Disabled", "details (network/adapter)")); 1543 1605 } 1544 1606 … … 1548 1610 .arg("details://network", /* icon */ 1549 1611 QString::number(iIconArea), /* icon area */ 1550 tr("Network", "details report"), /* title */1612 gpConverter->toString(enmType), /* title */ 1551 1613 strItem); /* items */ 1552 1614 … … 1581 1643 /* Here goes the record: */ 1582 1644 ++iRowCount; 1583 strItem += QString(sSectionItemTpl2).arg( tr("Port %1", "details report (serial ports)")1645 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Port %1", "details (serial)") 1584 1646 .arg(comSerial.GetSlot() + 1), 1585 1647 strData); … … 1591 1653 { 1592 1654 ++iRowCount; 1593 strItem = QString(sSectionItemTpl1).arg( tr("Disabled", "details report (serial ports)"));1655 strItem = QString(sSectionItemTpl1).arg(QApplication::translate("UIGDetails", "Disabled", "details (serial)")); 1594 1656 } 1595 1657 … … 1599 1661 .arg("details://serialPorts", /* icon */ 1600 1662 QString::number(iIconArea), /* icon area */ 1601 tr("Serial Ports", "details report"), /* title */1663 gpConverter->toString(enmType), /* title */ 1602 1664 strItem); /* items */ 1603 1665 … … 1624 1686 /* Here goes the record: */ 1625 1687 ++iRowCount; 1626 strItem += QString(sSectionItemTpl2).arg( tr("Port %1", "details report (parallel ports)")1688 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Port %1", "details (parallel)") 1627 1689 .arg(comParallel.GetSlot() + 1), 1628 1690 strData); … … 1634 1696 { 1635 1697 ++iRowCount; 1636 strItem = QString(sSectionItemTpl1).arg( tr("Disabled", "details report (parallel ports)"));1698 strItem = QString(sSectionItemTpl1).arg(QApplication::translate("UIGDetails", "Disabled", "details (parallel)")); 1637 1699 } 1638 1700 … … 1642 1704 .arg("details://parallelPorts", /* icon */ 1643 1705 QString::number(iIconArea), /* icon area */ 1644 tr("Parallel Ports", "details report"), /* title */1706 gpConverter->toString(enmType), /* title */ 1645 1707 strItem); /* items */ 1646 1708 … … 1660 1722 1661 1723 /* The USB controller may be unavailable (i.e. in VirtualBox OSE): */ 1662 if (!comMachine.GetUSBControllers().isEmpty()) 1724 const CUSBControllerVector controllers = comMachine.GetUSBControllers(); 1725 if (!controllers.isEmpty()) 1663 1726 { 1727 /* USB Controller: */ 1728 ++iRowCount; 1729 QStringList aControllerList; 1730 foreach (const CUSBController &comController, controllers) 1731 aControllerList << gpConverter->toString(comController.GetType()); 1732 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "USB Controller", "details (usb)"), 1733 aControllerList.join(", ")); 1734 1664 1735 /* Acquire USB filters: */ 1665 1736 const CUSBDeviceFilterVector &filterVector = comFilters.GetDeviceFilters(); … … 1670 1741 ++cActive; 1671 1742 /* Here goes the record: */ 1672 strItem = QString(sSectionItemTpl2).arg(tr("Device Filters", "details report (USB)"),1673 tr("%1 (%2 active)", "details report (USB)")1674 .arg(filterVector.size()).arg(cActive));1743 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Device Filters", "details (usb)"), 1744 QApplication::translate("UIGDetails", "%1 (%2 active)", "details (usb)") 1745 .arg(filterVector.size()).arg(cActive)); 1675 1746 } 1676 1747 1677 1748 /* Handle side-case: */ 1678 1749 if (strItem.isNull()) 1679 strItem = QString(sSectionItemTpl1).arg( tr("Disabled", "details report (USB)"));1750 strItem = QString(sSectionItemTpl1).arg(QApplication::translate("UIGDetails", "Disabled", "details (usb)")); 1680 1751 1681 1752 /* Append report: */ … … 1684 1755 .arg("details://usb", /* icon */ 1685 1756 QString::number(iIconArea), /* icon area */ 1686 tr("USB", "details report"), /* title */1757 gpConverter->toString(enmType), /* title */ 1687 1758 strItem); /* items */ 1688 1759 } … … 1697 1768 1698 1769 /* Acquire shared folders count: */ 1699 const ulong iCount= comMachine.GetSharedFolders().size();1700 if ( iCount> 0)1701 strItem = QString(sSectionItemTpl2).arg( tr("Shared Folders", "details report(shared folders)"),1702 QString::number( iCount));1770 const ulong cFolders = comMachine.GetSharedFolders().size(); 1771 if (cFolders > 0) 1772 strItem = QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Shared Folders", "details (shared folders)"), 1773 QString::number(cFolders)); 1703 1774 else 1704 strItem = QString(sSectionItemTpl1).arg( tr("None", "details report(shared folders)"));1775 strItem = QString(sSectionItemTpl1).arg(QApplication::translate("UIGDetails", "None", "details (shared folders)")); 1705 1776 1706 1777 /* Append report: */ … … 1709 1780 .arg("details://sharedFolders", /* icon */ 1710 1781 QString::number(iIconArea), /* icon area */ 1711 tr("Shared Folders", "details report"), /* title */1782 gpConverter->toString(enmType), /* title */ 1712 1783 strItem); /* items */ 1713 1784 … … 1722 1793 } 1723 1794 1795 /* static */ 1796 QString UISnapshotDetailsWidget::summarizeGenericProperties(const CNetworkAdapter &comNetwork) 1797 { 1798 QVector<QString> names; 1799 QVector<QString> props; 1800 props = comNetwork.GetProperties(QString(), names); 1801 QString strResult; 1802 for (int i = 0; i < names.size(); ++i) 1803 { 1804 strResult += names[i] + "=" + props[i]; 1805 if (i < names.size() - 1) 1806 strResult += ", "; 1807 } 1808 return strResult; 1809 } 1810 1724 1811 #include "UISnapshotDetailsWidget.moc" 1725 1812 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.h
r67517 r68365 30 30 31 31 /* Forward declarations: */ 32 class CNetworkAdapter; 32 33 class QGridLayout; 33 34 class QLabel; … … 144 145 QString detailsReport(const CMachine &comMachine, DetailsElementType enmType); 145 146 147 /** Summarizes generic properties. */ 148 static QString summarizeGenericProperties(const CNetworkAdapter &adapter); 149 146 150 /** Holds the snapshot object to load data from. */ 147 151 CSnapshot m_comSnapshot;
Note:
See TracChangeset
for help on using the changeset viewer.