Changeset 2930 in vbox
- Timestamp:
- May 30, 2007 1:32:57 PM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r2917 r2930 1553 1553 case CEnums::HostDriveCaptured: 1554 1554 { 1555 QString description = dvd.GetHostDrive().GetDescription(); 1556 if (description.isEmpty()) 1557 { 1558 name = tr ("Host Drive ", "DVD-ROM tooltip") + 1559 dvd.GetHostDrive().GetName(); 1560 } 1561 else 1562 { 1563 name = tr ("Host Drive ", "DVD-ROM tooltip") + 1564 description; 1565 } 1555 CHostDVDDrive drv = dvd.GetHostDrive(); 1556 QString drvName = drv.GetName(); 1557 QString description = drv.GetDescription(); 1558 QString fullName = description.isEmpty() ? 1559 drvName : 1560 QString ("%1 (%2)").arg (description, drvName); 1561 name = tr ("Host Drive ", "DVD-ROM tooltip") + 1562 fullName; 1566 1563 break; 1567 1564 } 1568 1565 case CEnums::ImageMounted: 1566 { 1569 1567 name = dvd.GetImage().GetFilePath(); 1570 1568 break; 1569 } 1571 1570 case CEnums::NotMounted: 1571 { 1572 1572 name = tr ("not mounted", "DVD-ROM tooltip"); 1573 1573 break; 1574 } 1574 1575 default: 1575 1576 AssertMsgFailed (("Invalid dvd drive state: %d\n", state)); … … 2198 2199 CHostDVDDrive hostDVD = en.GetNext(); 2199 2200 /** @todo set icon */ 2201 QString drvName = hostDVD.GetName(); 2200 2202 QString description = hostDVD.GetDescription(); 2201 int id; 2202 if (description.isEmpty()) 2203 { 2204 id = devicesMountDVDMenu->insertItem ( 2205 tr ("Host Drive ") + hostDVD.GetName() 2206 ); 2207 } 2208 else 2209 { 2210 id = devicesMountDVDMenu->insertItem ( 2211 tr ("Host Drive ") + description 2212 ); 2213 } 2203 QString fullName = description.isEmpty() ? 2204 drvName : 2205 QString ("%1 (%2)").arg (description, drvName); 2206 int id = devicesMountDVDMenu->insertItem ( 2207 tr ("Host Drive ") + fullName); 2214 2208 hostDVDMap [id] = hostDVD; 2215 2209 if (machine_state != CEnums::Running) -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r2917 r2930 881 881 QString p = aDevice.GetProduct(); 882 882 if (m.isEmpty() && p.isEmpty()) 883 details +=883 details = 884 884 tr ("Unknown device %1:%2", "USB device details") 885 885 .arg (QString().sprintf ("%04hX", aDevice.GetVendorId())) 886 886 .arg (QString().sprintf ("%04hX", aDevice.GetProductId())); 887 887 else 888 { 889 if (!m.isEmpty()) 890 details += m; 891 if (!p.isEmpty()) 892 details += " " + p; 893 } 888 details = m + " " + p; 894 889 ushort r = aDevice.GetRevision(); 895 890 if (r != 0) 896 891 details += QString().sprintf (" [%04hX]", r); 897 892 898 return details ;893 return details.stripWhiteSpace(); 899 894 } 900 895 … … 1173 1168 { 1174 1169 CHostDVDDrive drv = dvd.GetHostDrive(); 1170 QString drvName = drv.GetName(); 1175 1171 QString description = drv.GetDescription(); 1176 if (description.isEmpty()) 1177 { 1172 QString fullName = description.isEmpty() ? 1173 drvName : 1174 QString ("%1 (%2)").arg (description, drvName); 1178 1175 item = item.arg (tr ("Host Drive", "details report (DVD)"), 1179 drv.GetName()); 1180 } 1181 else 1182 { 1183 item = item.arg (tr ("Host Drive", "details report (DVD)"), 1184 description); 1185 } 1176 fullName); 1186 1177 break; 1187 1178 } -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h
r2917 r2930 1426 1426 CHostDVDDrive hostDVD = en.GetNext(); 1427 1427 /// @todo (r=dmik) set icon? 1428 QString name = hostDVD.GetName(); 1428 1429 QString description = hostDVD.GetDescription(); 1429 if (description.isEmpty()) 1430 { 1431 cbHostDVD->insertItem (hostDVD.GetName(), id); 1432 } 1433 else 1434 { 1435 cbHostDVD->insertItem (description, id); 1436 } 1430 QString fullName = description.isEmpty() ? 1431 name : 1432 QString ("%1 (%2)").arg (description, name); 1433 cbHostDVD->insertItem (fullName, id); 1437 1434 hostDVDs [id] = hostDVD; 1438 1435 ++ id; … … 1447 1444 QString name = drv.GetName(); 1448 1445 QString description = drv.GetDescription(); 1446 QString fullName = description.isEmpty() ? 1447 name : 1448 QString ("%1 (%2)").arg (description, name); 1449 1449 if (coll.FindByName (name).isNull()) 1450 1450 { … … 1453 1453 * add it to the end of the list with a special mark 1454 1454 */ 1455 if (description.isEmpty()) 1456 { 1457 cbHostDVD->insertItem ("* " + name); 1458 } 1459 else 1460 { 1461 cbHostDVD->insertItem ("* " + description); 1462 } 1455 cbHostDVD->insertItem ("* " + fullName); 1463 1456 cbHostDVD->setCurrentItem (cbHostDVD->count() - 1); 1464 1457 } … … 1466 1459 { 1467 1460 /* this will select the correct item from the prepared list */ 1468 if (description.isEmpty()) 1469 { 1470 cbHostDVD->setCurrentText (name); 1471 } 1472 else 1473 { 1474 cbHostDVD->setCurrentText (description); 1475 } 1461 cbHostDVD->setCurrentText (fullName); 1476 1462 } 1477 1463 rbHostDVD->setChecked (true);
Note:
See TracChangeset
for help on using the changeset viewer.