- Timestamp:
- Sep 13, 2017 2:01:54 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
r68735 r68744 631 631 /* Rebuild the details report: */ 632 632 foreach (const DetailsElementType &enmType, m_details.keys()) 633 m_details.value(enmType)->setText(detailsReport( comMachine, enmType));633 m_details.value(enmType)->setText(detailsReport(enmType, comMachine)); 634 634 } 635 635 … … 1119 1119 } 1120 1120 1121 QString UISnapshotDetailsWidget::detailsReport(const CMachine &comMachine, DetailsElementType enmType) 1121 QString UISnapshotDetailsWidget::detailsReport(DetailsElementType enmType, 1122 const CMachine &comMachine) const 1122 1123 { 1123 1124 /* Details templates: */ … … 1155 1156 /* Compose report: */ 1156 1157 QString strReport; 1158 QString strItem; 1159 int iRowCount = 0; 1157 1160 switch (enmType) 1158 1161 { 1159 1162 case DetailsElementType_General: 1160 1163 { 1161 /* Name, Operating System: */ 1162 int iRowCount = 2; 1163 QString strItem = QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Name", "details (general)"), 1164 comMachine.GetName()) 1165 + QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Operating System", "details (general)"), 1166 vboxGlobal().vmGuestOSTypeDescription(comMachine.GetOSTypeId())); 1164 /* Name: */ 1165 ++iRowCount; 1166 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Name", "details (general)"), 1167 comMachine.GetName()); 1168 1169 /* Operating System: */ 1170 ++iRowCount; 1171 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Operating System", "details (general)"), 1172 vboxGlobal().vmGuestOSTypeDescription(comMachine.GetOSTypeId())); 1167 1173 1168 1174 /* Groups? */ … … 1174 1180 if (!aGroups.isEmpty()) 1175 1181 { 1176 ++iRowCount;1177 1182 /* For all groups => Trim first '/' symbol: */ 1178 1183 for (int i = 0; i < aGroups.size(); ++i) … … 1182 1187 strGroup.remove(0, 1); 1183 1188 } 1189 ++iRowCount; 1184 1190 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Groups", "details (general)"), 1185 1191 aGroups.join(", ")); 1186 1192 } 1187 1188 /* Append report: */1189 strReport += strSectionTpl1190 .arg(1 + iRowCount) /* rows */1191 .arg("details://general", /* icon */1192 QString::number(iIconArea), /* icon area */1193 gpConverter->toString(enmType), /* title */1194 strItem /* items */);1195 1193 1196 1194 break; … … 1199 1197 { 1200 1198 /* Base Memory: */ 1201 int iRowCount = 1;1202 QString strItem= QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Base Memory", "details (system)"),1203 1199 ++iRowCount; 1200 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Base Memory", "details (system)"), 1201 QApplication::translate("UIGDetails", "%1 MB", "details").arg(comMachine.GetMemorySize())); 1204 1202 1205 1203 /* Processors? */ … … 1222 1220 1223 1221 /* Boot Order: */ 1224 ++iRowCount;1225 1222 QStringList aBootOrder; 1226 1223 for (ulong i = 1; i <= vboxGlobal().virtualBox().GetSystemProperties().GetMaxBootPosition(); ++i) … … 1232 1229 if (aBootOrder.isEmpty()) 1233 1230 aBootOrder << gpConverter->toString(KDeviceType_Null); 1231 ++iRowCount; 1234 1232 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Boot Order", "details (system)"), 1235 1233 aBootOrder.join(", ")); … … 1252 1250 case KFirmwareType_EFIDUAL: 1253 1251 { 1252 const QString strEFI = QApplication::translate("UIGDetails", "Enabled", "details (system/EFI)"); 1254 1253 ++iRowCount; 1255 const QString strEFI = QApplication::translate("UIGDetails", "Enabled", "details (system/EFI)");1256 1254 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "EFI", "details (system)"), strEFI); 1257 1255 break; … … 1259 1257 default: 1260 1258 { 1259 const QString strEFI = QApplication::translate("UIGDetails", "Disabled", "details (system/EFI)"); Q_UNUSED(strEFI); 1261 1260 //++iRowCount; 1262 const QString strEFI = QApplication::translate("UIGDetails", "Disabled", "details (system/EFI)"); Q_UNUSED(strEFI);1263 1261 //strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "EFI", "details (system)"), strEFI); 1264 1262 break; … … 1298 1296 } 1299 1297 1300 /* Append report: */1301 strReport += strSectionTpl1302 .arg(1 + iRowCount) /* rows */1303 .arg("details://system", /* icon */1304 QString::number(iIconArea), /* icon area */1305 gpConverter->toString(enmType), /* title */1306 strItem); /* items */1307 1308 1298 break; 1309 1299 } … … 1311 1301 { 1312 1302 /* Preview: */ 1313 int iRowCount = 1; 1314 QString strItem = QString(sSectionItemTpl4).arg("details://thumbnail").arg("#thumbnail"); 1315 1316 /* Append report: */ 1317 if (!m_pixmapScreenshot.isNull()) 1318 strReport += strSectionTpl 1319 .arg(1 + iRowCount) /* rows */ 1320 .arg("details://preview", /* icon */ 1321 QString::number(iIconArea), /* icon area */ 1322 gpConverter->toString(enmType), /* title */ 1323 strItem); /* items */ 1303 ++iRowCount; 1304 strItem += QString(sSectionItemTpl4).arg("details://thumbnail").arg("#thumbnail"); 1324 1305 1325 1306 break; … … 1332 1313 1333 1314 /* Video Memory: */ 1334 int iRowCount = 1;1335 QString strItem= QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Video Memory", "details (display)"),1336 1315 ++iRowCount; 1316 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Video Memory", "details (display)"), 1317 QApplication::translate("UIGDetails", "%1 MB", "details").arg(comMachine.GetVRAMSize())); 1337 1318 1338 1319 /* Screens? */ … … 1381 1362 else 1382 1363 { 1364 const QString strHiDPI = QApplication::translate("UIGDetails", "Disabled", "details (display/Unscaled HiDPI Video Output)"); Q_UNUSED(strHiDPI); 1383 1365 //++iRowCount; 1384 const QString strHiDPI = QApplication::translate("UIGDetails", "Disabled", "details (display/Unscaled HiDPI Video Output)"); Q_UNUSED(strHiDPI);1385 1366 //strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Unscaled HiDPI Video Output", "details (display)"), strHiDPI); 1386 1367 } … … 1436 1417 } 1437 1418 1438 /* Append report: */1439 strReport += strSectionTpl1440 .arg(1 + iRowCount) /* rows */1441 .arg("details://display", /* icon */1442 QString::number(iIconArea), /* icon area */1443 gpConverter->toString(enmType), /* title */1444 strItem); /* items */1445 1446 1419 break; 1447 1420 } 1448 1421 case DetailsElementType_Storage: 1449 1422 { 1450 /* Nothing: */1451 int iRowCount = 0;1452 QString strItem;1453 1454 1423 /* Iterate over the all machine controllers: */ 1455 1424 foreach (const CStorageController &comController, comMachine.GetStorageControllers()) 1456 1425 { 1457 1426 /* Add controller information: */ 1458 ++iRowCount;1459 1427 const QString strControllerName = QApplication::translate("UIMachineSettingsStorage", "Controller: %1"); 1428 ++iRowCount; 1460 1429 strItem += QString(sSectionItemTpl3).arg(strControllerName.arg(comController.GetName())); 1461 1430 … … 1502 1471 if (strItem.isNull()) 1503 1472 { 1473 /* Not Attached: */ 1504 1474 ++iRowCount; 1505 1475 strItem = QString(sSectionItemTpl1).arg(QApplication::translate("UIGDetails", "Not Attached", "details (storage)")); 1506 1476 } 1507 1508 /* Append report: */1509 strReport += strSectionTpl1510 .arg(1 + iRowCount) /* rows */1511 .arg("details://storage", /* icon */1512 QString::number(iIconArea), /* icon area */1513 gpConverter->toString(enmType), /* title */1514 strItem); /* items */1515 1477 1516 1478 break; … … 1518 1480 case DetailsElementType_Audio: 1519 1481 { 1520 /* Nothing: */1521 int iRowCount = 0;1522 QString strItem;1523 1524 /* Host Driver, Controller? */1525 1482 const CAudioAdapter &comAudio = comMachine.GetAudioAdapter(); 1526 1483 if (comAudio.GetEnabled()) 1527 1484 { 1528 iRowCount += 2; 1529 strItem = QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Host Driver", "details (audio)"), 1530 gpConverter->toString(comAudio.GetAudioDriver())) 1531 + QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Controller", "details (audio)"), 1532 gpConverter->toString(comAudio.GetAudioController())); 1485 /* Host Driver: */ 1486 ++iRowCount; 1487 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Host Driver", "details (audio)"), 1488 gpConverter->toString(comAudio.GetAudioDriver())); 1489 1490 /* Controller: */ 1491 ++iRowCount; 1492 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Controller", "details (audio)"), 1493 gpConverter->toString(comAudio.GetAudioController())); 1533 1494 1534 1495 #ifdef VBOX_WITH_AUDIO_INOUT_INFO … … 1550 1511 else 1551 1512 { 1513 /* Disabled: */ 1552 1514 ++iRowCount; 1553 1515 strItem = QString(sSectionItemTpl1).arg(QApplication::translate("UIGDetails", "Disabled", "details (audio)")); 1554 1516 } 1555 1556 /* Append report: */1557 strReport += strSectionTpl1558 .arg(1 + iRowCount) /* rows */1559 .arg("details://audio", /* icon */1560 QString::number(iIconArea), /* icon area */1561 gpConverter->toString(enmType), /* title */1562 strItem); /* items */1563 1517 1564 1518 break; … … 1566 1520 case DetailsElementType_Network: 1567 1521 { 1568 /* Nothing: */1569 int iRowCount = 0;1570 QString strItem;1571 1572 1522 /* Enumerate all the network adapters (up to acquired/limited count): */ 1573 1523 const ulong iCount = vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(comMachine.GetChipsetType()); … … 1619 1569 ++iRowCount; 1620 1570 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Adapter %1", "details (network)") 1621 .arg(comNetwork.GetSlot() + 1),1571 .arg(comNetwork.GetSlot() + 1), 1622 1572 attType); 1623 1573 } … … 1627 1577 if (strItem.isNull()) 1628 1578 { 1579 /* Disabled: */ 1629 1580 ++iRowCount; 1630 1581 strItem = QString(sSectionItemTpl1).arg(QApplication::translate("UIGDetails", "Disabled", "details (network/adapter)")); 1631 1582 } 1632 1633 /* Append report: */1634 strReport += strSectionTpl1635 .arg(1 + iRowCount) /* rows */1636 .arg("details://network", /* icon */1637 QString::number(iIconArea), /* icon area */1638 gpConverter->toString(enmType), /* title */1639 strItem); /* items */1640 1583 1641 1584 break; … … 1643 1586 case DetailsElementType_Serial: 1644 1587 { 1645 /* Nothing: */1646 int iRowCount = 0;1647 QString strItem;1648 1649 1588 /* Enumerate all the serial ports (up to acquired/limited count): */ 1650 1589 const ulong iCount = vboxGlobal().virtualBox().GetSystemProperties().GetSerialPortCount(); … … 1678 1617 if (strItem.isNull()) 1679 1618 { 1619 /* Disabled: */ 1680 1620 ++iRowCount; 1681 1621 strItem = QString(sSectionItemTpl1).arg(QApplication::translate("UIGDetails", "Disabled", "details (serial)")); 1682 1622 } 1683 1684 /* Append report: */1685 strReport += strSectionTpl1686 .arg(1 + iRowCount) /* rows */1687 .arg("details://serialPorts", /* icon */1688 QString::number(iIconArea), /* icon area */1689 gpConverter->toString(enmType), /* title */1690 strItem); /* items */1691 1623 1692 1624 break; … … 1699 1631 && comMachine.GetUSBProxyAvailable()) 1700 1632 { 1701 /* Device Filters: */1702 int iRowCount = 1;1703 QString strItem;1704 1705 1633 /* The USB controller may be unavailable (i.e. in VirtualBox OSE): */ 1706 1634 const CUSBControllerVector controllers = comMachine.GetUSBControllers(); … … 1708 1636 { 1709 1637 /* USB Controller: */ 1710 ++iRowCount;1711 1638 QStringList aControllerList; 1712 1639 foreach (const CUSBController &comController, controllers) 1713 1640 aControllerList << gpConverter->toString(comController.GetType()); 1641 ++iRowCount; 1714 1642 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "USB Controller", "details (usb)"), 1715 1643 aControllerList.join(", ")); … … 1723 1651 ++cActive; 1724 1652 /* Here goes the record: */ 1653 ++iRowCount; 1725 1654 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Device Filters", "details (usb)"), 1726 1655 QApplication::translate("UIGDetails", "%1 (%2 active)", "details (usb)") … … 1730 1659 /* Handle side-case: */ 1731 1660 if (strItem.isNull()) 1661 { 1662 /* Disabled: */ 1663 ++iRowCount; 1732 1664 strItem = QString(sSectionItemTpl1).arg(QApplication::translate("UIGDetails", "Disabled", "details (usb)")); 1733 1734 /* Append report: */ 1735 strReport += strSectionTpl 1736 .arg(1 + iRowCount) /* rows */ 1737 .arg("details://usb", /* icon */ 1738 QString::number(iIconArea), /* icon area */ 1739 gpConverter->toString(enmType), /* title */ 1740 strItem); /* items */ 1665 } 1741 1666 } 1742 1667 … … 1745 1670 case DetailsElementType_SF: 1746 1671 { 1747 /* Shared Folders: */1748 int iRowCount = 1;1749 QString strItem;1750 1751 1672 /* Acquire shared folders count: */ 1752 1673 const ulong cFolders = comMachine.GetSharedFolders().size(); 1674 ++iRowCount; 1753 1675 if (cFolders > 0) 1754 1676 strItem = QString(sSectionItemTpl2).arg(QApplication::translate("UIGDetails", "Shared Folders", "details (shared folders)"), … … 1757 1679 strItem = QString(sSectionItemTpl1).arg(QApplication::translate("UIGDetails", "None", "details (shared folders)")); 1758 1680 1759 /* Append report: */1760 strReport += strSectionTpl1761 .arg(1 + iRowCount) /* rows */1762 .arg("details://sharedFolders", /* icon */1763 QString::number(iIconArea), /* icon area */1764 gpConverter->toString(enmType), /* title */1765 strItem); /* items */1766 1767 1681 break; 1768 1682 } … … 1770 1684 break; 1771 1685 } 1686 1687 /* Append report: */ 1688 if (enmType != DetailsElementType_Preview || !m_pixmapScreenshot.isNull()) 1689 strReport += strSectionTpl 1690 .arg(1 + iRowCount) /* rows */ 1691 .arg(QString("details://%1").arg(gpConverter->toInternalString(enmType)), /* icon */ 1692 QString::number(iIconArea), /* icon area */ 1693 gpConverter->toString(enmType), /* title */ 1694 strItem /* items */); 1772 1695 1773 1696 /* Return report as table: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.h
r68735 r68744 147 147 void updateButtonStates(); 148 148 149 /** Returns a details report ona given @a comMachine. */150 QString detailsReport( const CMachine &comMachine, DetailsElementType enmType);149 /** Returns details report of requested @a enmType for a given @a comMachine. */ 150 QString detailsReport(DetailsElementType enmType, const CMachine &comMachine) const; 151 151 152 152 /** Wipes the HTML stuff from the passed @a strString. */
Note:
See TracChangeset
for help on using the changeset viewer.