VirtualBox

Ignore:
Timestamp:
Jul 15, 2008 3:21:03 PM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: Add the os type icon to the combobox in the vm general settings.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h

    r10439 r10670  
    209209
    210210    QStringList vmGuestOSTypeDescriptions() const;
     211    QList<QPixmap> vmGuestOSTypeIcons (int aHorizonalMargin, int aVerticalMargin) const;
    211212    CGuestOSType vmGuestOSType (int aIndex) const;
    212213    int vmGuestOSTypeIndex (const QString &aId) const;
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r10515 r10670  
    4646#include <QProcess>
    4747#include <QThread>
     48#include <QPainter>
    4849
    4950#ifdef Q_WS_X11
     
    857858        for (int i = 0; i < vm_os_types.count(); i++) {
    858859            list += vm_os_types [i].GetDescription();
     860        }
     861    }
     862    return list;
     863}
     864
     865QList<QPixmap> VBoxGlobal::vmGuestOSTypeIcons (int aHorizonalMargin, int aVerticalMargin) const
     866{
     867    static QList<QPixmap> list;
     868    if (list.empty())
     869    {
     870        for (int i = 0; i < vm_os_types.count(); i++)
     871        {
     872            QPixmap image(32 + 2*aHorizonalMargin, 32 + 2*aVerticalMargin);
     873            image.fill (Qt::transparent);
     874            QPainter p(&image);
     875            p.drawPixmap (aHorizonalMargin, aVerticalMargin, *vm_os_type_icons.value (vm_os_types [i].GetId()));
     876            p.end();
     877            list << image;
    859878        }
    860879    }
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsGeneral.cpp

    r10649 r10670  
    101101
    102102    /* Setup initial values */
    103 
    104103    mCbOsType->insertItems (0, vboxGlobal().vmGuestOSTypeDescriptions());
     104    QList<QPixmap> list = vboxGlobal().vmGuestOSTypeIcons (0, 2);
     105    for (int i=0; i < list.count(); ++i)
     106        mCbOsType->setItemIcon (i, list.at (i));
    105107
    106108    mSlRam->setPageStep (calcPageStep (MaxRAM));
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