Changeset 105150 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 4, 2024 3:53:45 PM (7 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r105081 r105150 328 328 ./src/softkeyboard \ 329 329 ./src/snapshots \ 330 ./src/usb \ 330 331 ./src/widgets \ 331 332 ./src/widgets/graphics \ … … 1544 1545 src/settings/machine/UIMachineSettingsSystem.cpp \ 1545 1546 src/settings/machine/UIMachineSettingsUSB.cpp \ 1547 src/usb/UIUSBTools.cpp \ 1546 1548 src/widgets/UIAddDiskEncryptionPasswordDialog.cpp \ 1547 1549 src/widgets/UIFilePathSelector.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r105122 r105150 84 84 /* COM includes: */ 85 85 #include "CCloudMachine.h" 86 #include "CHostUSBDevice.h"87 #include "CHostVideoInputDevice.h"88 86 #include "CMachine.h" 89 #include "CUSBDevice.h"90 #include "CUSBDeviceFilter.h"91 87 92 88 /* Other VBox includes: */ … … 101 97 # include <VBox/sup.h> /* for SUPR3HardenedLdrLoadAppPriv */ 102 98 #endif 103 104 /* VirtualBox interface declarations: */105 #include <VBox/com/VirtualBox.h>106 99 107 100 /* External includes: */ … … 1161 1154 1162 1155 /* static */ 1163 QString UICommon::usbDetails(const CUSBDevice &comDevice)1164 {1165 QString strDetails;1166 if (comDevice.isNull())1167 strDetails = tr("Unknown device", "USB device details");1168 else1169 {1170 QVector<QString> devInfoVector = comDevice.GetDeviceInfo();1171 QString strManufacturer;1172 QString strProduct;1173 1174 if (devInfoVector.size() >= 1)1175 strManufacturer = devInfoVector[0].trimmed();1176 if (devInfoVector.size() >= 2)1177 strProduct = devInfoVector[1].trimmed();1178 1179 if (strManufacturer.isEmpty() && strProduct.isEmpty())1180 {1181 strDetails =1182 tr("Unknown device %1:%2", "USB device details")1183 .arg(QString::number(comDevice.GetVendorId(), 16).toUpper().rightJustified(4, '0'))1184 .arg(QString::number(comDevice.GetProductId(), 16).toUpper().rightJustified(4, '0'));1185 }1186 else1187 {1188 if (strProduct.toUpper().startsWith(strManufacturer.toUpper()))1189 strDetails = strProduct;1190 else1191 strDetails = strManufacturer + " " + strProduct;1192 }1193 ushort iRev = comDevice.GetRevision();1194 if (iRev != 0)1195 {1196 strDetails += " [";1197 strDetails += QString::number(iRev, 16).toUpper().rightJustified(4, '0');1198 strDetails += "]";1199 }1200 }1201 1202 return strDetails.trimmed();1203 }1204 1205 /* static */1206 QString UICommon::usbToolTip(const CUSBDevice &comDevice)1207 {1208 QString strTip =1209 tr("<nobr>Vendor ID: %1</nobr><br>"1210 "<nobr>Product ID: %2</nobr><br>"1211 "<nobr>Revision: %3</nobr>", "USB device tooltip")1212 .arg(QString::number(comDevice.GetVendorId(), 16).toUpper().rightJustified(4, '0'))1213 .arg(QString::number(comDevice.GetProductId(), 16).toUpper().rightJustified(4, '0'))1214 .arg(QString::number(comDevice.GetRevision(), 16).toUpper().rightJustified(4, '0'));1215 1216 const QString strSerial = comDevice.GetSerialNumber();1217 if (!strSerial.isEmpty())1218 strTip += QString(tr("<br><nobr>Serial No. %1</nobr>", "USB device tooltip"))1219 .arg(strSerial);1220 1221 /* Add the state field if it's a host USB device: */1222 CHostUSBDevice hostDev(comDevice);1223 if (!hostDev.isNull())1224 {1225 strTip += QString(tr("<br><nobr>State: %1</nobr>", "USB device tooltip"))1226 .arg(gpConverter->toString(hostDev.GetState()));1227 }1228 1229 return strTip;1230 }1231 1232 /* static */1233 QString UICommon::usbToolTip(const CUSBDeviceFilter &comFilter)1234 {1235 QString strTip;1236 1237 const QString strVendorId = comFilter.GetVendorId();1238 if (!strVendorId.isEmpty())1239 strTip += tr("<nobr>Vendor ID: %1</nobr>", "USB filter tooltip")1240 .arg(strVendorId);1241 1242 const QString strProductId = comFilter.GetProductId();1243 if (!strProductId.isEmpty())1244 strTip += strTip.isEmpty() ? "":"<br/>" + tr("<nobr>Product ID: %2</nobr>", "USB filter tooltip")1245 .arg(strProductId);1246 1247 const QString strRevision = comFilter.GetRevision();1248 if (!strRevision.isEmpty())1249 strTip += strTip.isEmpty() ? "":"<br/>" + tr("<nobr>Revision: %3</nobr>", "USB filter tooltip")1250 .arg(strRevision);1251 1252 const QString strProduct = comFilter.GetProduct();1253 if (!strProduct.isEmpty())1254 strTip += strTip.isEmpty() ? "":"<br/>" + tr("<nobr>Product: %4</nobr>", "USB filter tooltip")1255 .arg(strProduct);1256 1257 const QString strManufacturer = comFilter.GetManufacturer();1258 if (!strManufacturer.isEmpty())1259 strTip += strTip.isEmpty() ? "":"<br/>" + tr("<nobr>Manufacturer: %5</nobr>", "USB filter tooltip")1260 .arg(strManufacturer);1261 1262 const QString strSerial = comFilter.GetSerialNumber();1263 if (!strSerial.isEmpty())1264 strTip += strTip.isEmpty() ? "":"<br/>" + tr("<nobr>Serial No.: %1</nobr>", "USB filter tooltip")1265 .arg(strSerial);1266 1267 const QString strPort = comFilter.GetPort();1268 if (!strPort.isEmpty())1269 strTip += strTip.isEmpty() ? "":"<br/>" + tr("<nobr>Port: %1</nobr>", "USB filter tooltip")1270 .arg(strPort);1271 1272 /* Add the state field if it's a host USB device: */1273 CHostUSBDevice hostDev(comFilter);1274 if (!hostDev.isNull())1275 {1276 strTip += strTip.isEmpty() ? "":"<br/>" + tr("<nobr>State: %1</nobr>", "USB filter tooltip")1277 .arg(gpConverter->toString(hostDev.GetState()));1278 }1279 1280 return strTip;1281 }1282 1283 /* static */1284 QString UICommon::usbToolTip(const CHostVideoInputDevice &comWebcam)1285 {1286 QStringList records;1287 1288 const QString strName = comWebcam.GetName();1289 if (!strName.isEmpty())1290 records << strName;1291 1292 const QString strPath = comWebcam.GetPath();1293 if (!strPath.isEmpty())1294 records << strPath;1295 1296 return records.join("<br>");1297 }1298 1299 /* static */1300 1156 QString UICommon::helpFile() 1301 1157 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r105128 r105150 52 52 class QSpinBox; 53 53 class CCloudMachine; 54 class CHostVideoInputDevice;55 class CUSBDevice;56 class CUSBDeviceFilter;57 54 class UIThreadPool; 58 55 … … 265 262 /** @} */ 266 263 267 /** @name COM: USB stuff.268 * @{ */269 /** Generates details for passed USB @a comDevice. */270 static QString usbDetails(const CUSBDevice &comDevice);271 /** Generates tool-tip for passed USB @a comDevice. */272 static QString usbToolTip(const CUSBDevice &comDevice);273 /** Generates tool-tip for passed USB @a comFilter. */274 static QString usbToolTip(const CUSBDeviceFilter &comFilter);275 /** Generates tool-tip for passed USB @a comWebcam. */276 static QString usbToolTip(const CHostVideoInputDevice &comWebcam);277 /** @} */278 279 264 /** @name File-system stuff. 280 265 * @{ */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp
r104917 r105150 33 33 /* GUI includes: */ 34 34 #include "UIBootOrderEditor.h" 35 #include "UICommon.h"36 35 #include "UIConverter.h" 37 36 #include "UIDetailsGenerator.h" … … 42 41 #include "UIMediumTools.h" 43 42 #include "UITranslator.h" 43 #include "UIUSBTools.h" 44 44 45 45 /* COM includes: */ … … 607 607 /* That hack makes sure 'Inaccessible' word is always bold: */ 608 608 { // hack 609 const QString strInaccessibleString( UICommon::tr("Inaccessible", "medium"));609 const QString strInaccessibleString(QApplication::translate("UICommon", "Inaccessible", "medium")); 610 610 const QString strBoldInaccessibleString(QString("<b>%1</b>").arg(strInaccessibleString)); 611 611 strAttachmentInfo.replace(strInaccessibleString, strBoldInaccessibleString); … … 1386 1386 /* Enumerate all the USB devices: */ 1387 1387 foreach (const CUSBDevice &comUsbDevice, comConsole.GetUSBDevices()) 1388 strInfo += e_strTableRow1.arg(u iCommon().usbDetails(comUsbDevice));1388 strInfo += e_strTableRow1.arg(usbDetails(comUsbDevice)); 1389 1389 /* Handle 'no-usb-devices' case: */ 1390 1390 if (strInfo.isNull()) … … 1429 1429 /* Video Memory: */ 1430 1430 const ULONG uVRAMSize = comGraphics.GetVRAMSize(); 1431 const QString strVRAMSize = UICommon::tr("<nobr>%1 MB</nobr>", "details report").arg(uVRAMSize);1431 const QString strVRAMSize = QApplication::translate("UICommon", "<nobr>%1 MB</nobr>", "details report").arg(uVRAMSize); 1432 1432 strInfo += e_strTableRow2 1433 1433 .arg(QApplication::translate("UIIndicatorsPool", "Video memory", "Display tooltip"), strVRAMSize); … … 1447 1447 { 1448 1448 const QString strAcceleration3D = fAcceleration3D 1449 ? UICommon::tr("Enabled", "details report (3D Acceleration)")1450 : UICommon::tr("Disabled", "details report (3D Acceleration)");1449 ? QApplication::translate("UICommon", "Enabled", "details report (3D Acceleration)") 1450 : QApplication::translate("UICommon", "Disabled", "details report (3D Acceleration)"); 1451 1451 strInfo += e_strTableRow2 1452 1452 .arg(QApplication::translate("UIIndicatorsPool", "3D acceleration", "Display tooltip"), strAcceleration3D); … … 1513 1513 RT_FALL_THRU(); 1514 1514 case KVMExecutionEngine_NotSet: 1515 strExecutionEngine = UICommon::tr("not set", "details report (execution engine)");1515 strExecutionEngine = QApplication::translate("UICommon", "not set", "details report (execution engine)"); 1516 1516 break; 1517 1517 } … … 1519 1519 /* Nested Paging feature: */ 1520 1520 const QString strNestedPaging = fNestedPagingEnabled 1521 ? UICommon::tr("Active", "details report (Nested Paging)")1522 : UICommon::tr("Inactive", "details report (Nested Paging)");1521 ? QApplication::translate("UICommon", "Active", "details report (Nested Paging)") 1522 : QApplication::translate("UICommon", "Inactive", "details report (Nested Paging)"); 1523 1523 1524 1524 /* Unrestricted Execution feature: */ 1525 1525 const QString strUnrestrictExec = fUxEnabled 1526 ? UICommon::tr("Active", "details report (Unrestricted Execution)")1527 : UICommon::tr("Inactive", "details report (Unrestricted Execution)");1526 ? QApplication::translate("UICommon", "Active", "details report (Unrestricted Execution)") 1527 : QApplication::translate("UICommon", "Inactive", "details report (Unrestricted Execution)"); 1528 1528 1529 1529 /* CPU Execution Cap feature: */ … … 1534 1534 1535 1535 /* Compose tool-tip: */ 1536 strInfo += e_strTableRow2.arg( UICommon::tr("Execution engine", "details report"), strExecutionEngine);1537 strInfo += e_strTableRow2.arg( UICommon::tr("Nested Paging"), strNestedPaging);1538 strInfo += e_strTableRow2.arg( UICommon::tr("Unrestricted Execution"), strUnrestrictExec);1539 strInfo += e_strTableRow2.arg( UICommon::tr("Execution Cap", "details report"), strCPUExecCap);1540 strInfo += e_strTableRow2.arg( UICommon::tr("Paravirtualization Interface", "details report"), strParavirt);1536 strInfo += e_strTableRow2.arg(QApplication::translate("UICommon", "Execution engine", "details report"), strExecutionEngine); 1537 strInfo += e_strTableRow2.arg(QApplication::translate("UICommon", "Nested Paging"), strNestedPaging); 1538 strInfo += e_strTableRow2.arg(QApplication::translate("UICommon", "Unrestricted Execution"), strUnrestrictExec); 1539 strInfo += e_strTableRow2.arg(QApplication::translate("UICommon", "Execution Cap", "details report"), strCPUExecCap); 1540 strInfo += e_strTableRow2.arg(QApplication::translate("UICommon", "Paravirtualization Interface", "details report"), strParavirt); 1541 1541 1542 1542 /* Add CPU count optional info: */ 1543 1543 const int cCpuCount = comMachine.GetCPUCount(); 1544 1544 if (cCpuCount > 1) 1545 strInfo += e_strTableRow2.arg( UICommon::tr("Processors", "details report"), QString::number(cCpuCount));1545 strInfo += e_strTableRow2.arg(QApplication::translate("UICommon", "Processors", "details report"), QString::number(cCpuCount)); 1546 1546 } 1547 1547 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r104901 r105150 76 76 #include "UITranslationEventListener.h" 77 77 #include "UITakeSnapshotDialog.h" 78 #include "UIUSBTools.h" 78 79 #include "UIVersion.h" 79 80 #include "UIVirtualBoxEventHandler.h" … … 633 634 { 634 635 if (fIsAttached) 635 UINotificationMessage::cannotAttachUSBDevice(error, u iCommon().usbDetails(device), machineName());636 UINotificationMessage::cannotAttachUSBDevice(error, usbDetails(device), machineName()); 636 637 else 637 UINotificationMessage::cannotDetachUSBDevice(error, u iCommon().usbDetails(device), machineName());638 UINotificationMessage::cannotDetachUSBDevice(error, usbDetails(device), machineName()); 638 639 } 639 640 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r105081 r105150 57 57 #include "UISession.h" 58 58 #include "UITextTable.h" 59 #include "UIUSBTools.h" 59 60 #include "UIVersion.h" 60 61 #ifdef VBOX_GUI_WITH_KEYS_RESET_HANDLER … … 1100 1101 if (fSuccess) 1101 1102 { 1102 /// @todo make sure UI Common::usbDetails is checked for errors as well1103 guiUSBDevice.m_strName = u iCommon().usbDetails(comUSBDevice);1103 /// @todo make sure UIUSBTools::usbDetails is checked for errors as well 1104 guiUSBDevice.m_strName = usbDetails(comUSBDevice); 1104 1105 fSuccess = comUSBDevice.isOk(); 1105 1106 } 1106 1107 if (fSuccess) 1107 1108 { 1108 /// @todo make sure UI Common::usbToolTip is checked for errors as well1109 guiUSBDevice.m_strToolTip = u iCommon().usbToolTip(comUSBDevice);1109 /// @todo make sure UIUSBTools::usbToolTip is checked for errors as well 1110 guiUSBDevice.m_strToolTip = usbToolTip(comUSBDevice); 1110 1111 fSuccess = comUSBDevice.isOk(); 1111 1112 } … … 1146 1147 * this stuff requires #include <VBox/com/VirtualBox.h> */ 1147 1148 CUSBDevice comUSBDevice(comHostUSBDevice); 1148 UINotificationMessage::cannotAttachUSBDevice(comConsole, u iCommon().usbDetails(comUSBDevice));1149 /// @todo make sure UI Common::usbDetails is checked for errors as well1149 UINotificationMessage::cannotAttachUSBDevice(comConsole, usbDetails(comUSBDevice)); 1150 /// @todo make sure UIUSBTools::usbDetails is checked for errors as well 1150 1151 } 1151 1152 return fSuccess; … … 1160 1161 { 1161 1162 CUSBDevice comUSBDevice = CConsole(comConsole).FindUSBDeviceById(uId); 1162 UINotificationMessage::cannotDetachUSBDevice(comConsole, u iCommon().usbDetails(comUSBDevice));1163 /// @todo make sure UI Common::usbDetails is checked for errors as well1163 UINotificationMessage::cannotDetachUSBDevice(comConsole, usbDetails(comUSBDevice)); 1164 /// @todo make sure UIUSBTools::usbDetails is checked for errors as well 1164 1165 } 1165 1166 return fSuccess; … … 1204 1205 if (fSuccess) 1205 1206 { 1206 /// @todo make sure UI Common::usbToolTip is checked for errors as well1207 guiWebcamDevice.m_strToolTip = u iCommon().usbToolTip(comHostVideoInputDevice);1207 /// @todo make sure UIUSBTools::usbToolTip is checked for errors as well 1208 guiWebcamDevice.m_strToolTip = usbToolTip(comHostVideoInputDevice); 1208 1209 fSuccess = comHostVideoInputDevice.isOk(); 1209 1210 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIUSBFiltersEditor.cpp
r104313 r105150 39 39 #include "QIToolBar.h" 40 40 #include "QITreeWidget.h" 41 #include "UICommon.h"42 41 #include "UIGlobalSession.h" 43 42 #include "UIIconPool.h" 44 43 #include "UIUSBFilterDetailsEditor.h" 45 44 #include "UIUSBFiltersEditor.h" 45 #include "UIUSBTools.h" 46 46 47 47 /* COM includes: */ … … 163 163 if (!usb.isNull()) 164 164 { 165 QToolTip::showText(pHelpEvent->globalPos(), u iCommon().usbToolTip(usb));165 QToolTip::showText(pHelpEvent->globalPos(), usbToolTip(usb)); 166 166 return true; 167 167 } … … 196 196 { 197 197 CUSBDevice comUsb(comHostUsb); 198 QAction *pAction = addAction(u iCommon().usbDetails(comUsb));198 QAction *pAction = addAction(usbDetails(comUsb)); 199 199 pAction->setCheckable(true); 200 200 m_usbDeviceMap[pAction] = comUsb; … … 401 401 UIDataUSBFilter newFilterData; 402 402 newFilterData.m_fActive = true; 403 newFilterData.m_strName = u iCommon().usbDetails(comUsb);403 newFilterData.m_strName = usbDetails(comUsb); 404 404 newFilterData.m_strVendorId = QString::number(comUsb.GetVendorId(), 16).toUpper().rightJustified(4, '0'); 405 405 newFilterData.m_strProductId = QString::number(comUsb.GetProductId(), 16).toUpper().rightJustified(4, '0');
Note:
See TracChangeset
for help on using the changeset viewer.