VirtualBox

Changeset 2917 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
May 29, 2007 2:17:19 PM (18 years ago)
Author:
vboxsync
Message:

Updated the host DVD code on Linux to use hal for device detection

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r2868 r2917  
    15521552        {
    15531553            case CEnums::HostDriveCaptured:
    1554                 name = tr ("Host Drive ", "DVD-ROM tooltip") +
    1555                     dvd.GetHostDrive().GetName();
     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                }
    15561566                break;
     1567            }
    15571568            case CEnums::ImageMounted:
    15581569                name = dvd.GetImage().GetFilePath();
     
    21872198        CHostDVDDrive hostDVD = en.GetNext();
    21882199        /** @todo set icon */
    2189         int id = devicesMountDVDMenu->insertItem (
    2190             tr ("Host Drive ") + hostDVD.GetName()
    2191         );
     2200        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        }
    21922214        hostDVDMap [id] = hostDVD;
    21932215        if (machine_state != CEnums::Running)
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r2834 r2917  
    11731173            {
    11741174                CHostDVDDrive drv = dvd.GetHostDrive();
     1175                QString description = drv.GetDescription();
     1176                if (description.isEmpty())
     1177                {
    11751178                item = item.arg (tr ("Host Drive", "details report (DVD)"),
    11761179                                 drv.GetName());
     1180                }
     1181                else
     1182                {
     1183                item = item.arg (tr ("Host Drive", "details report (DVD)"),
     1184                                 description);
     1185                }
    11771186                break;
    11781187            }
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h

    r2915 r2917  
    14261426            CHostDVDDrive hostDVD = en.GetNext();
    14271427            /// @todo (r=dmik) set icon?
    1428             cbHostDVD->insertItem (hostDVD.GetName(), id);
     1428            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            }
    14291437            hostDVDs [id] = hostDVD;
    14301438            ++ id;
     
    14381446                CHostDVDDrive drv = dvd.GetHostDrive();
    14391447                QString name = drv.GetName();
     1448                QString description = drv.GetDescription();
    14401449                if (coll.FindByName (name).isNull())
    14411450                {
     
    14441453                     *  add it to the end of the list with a special mark
    14451454                     */
    1446                     cbHostDVD->insertItem ("* " + name);
     1455                    if (description.isEmpty())
     1456                    {
     1457                        cbHostDVD->insertItem ("* " + name);
     1458                    }
     1459                    else
     1460                    {
     1461                        cbHostDVD->insertItem ("* " + description);
     1462                    }
    14471463                    cbHostDVD->setCurrentItem (cbHostDVD->count() - 1);
    14481464                }
     
    14501466                {
    14511467                    /* this will select the correct item from the prepared list */
    1452                     cbHostDVD->setCurrentText (name);
     1468                    if (description.isEmpty())
     1469                    {
     1470                        cbHostDVD->setCurrentText (name);
     1471                    }
     1472                    else
     1473                    {
     1474                        cbHostDVD->setCurrentText (description);
     1475                    }
    14531476                }
    14541477                rbHostDVD->setChecked (true);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette