VirtualBox

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


Ignore:
Timestamp:
Feb 13, 2009 1:41:04 PM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4-OVF: Displays the OS types as menu with submenus.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxImportAppliance.h

    r16617 r16736  
    2727#include "QIWithRetranslateUI.h"
    2828#include "QIDialog.h"
    29 
    30 #include <QSortFilterProxyModel>
    3129
    3230class CAppliance;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxImportAppliance.cpp

    r16728 r16736  
    2525#include "VBoxProblemReporter.h"
    2626#include "VBoxFilePathSelectorWidget.h"
     27#include "VBoxOSTypeSelectorButton.h"
    2728
    2829#include <QItemDelegate>
     30#include <QSortFilterProxyModel>
    2931#include <QHeaderView>
    3032#include <QLineEdit>
    3133#include <QSpinBox>
    3234#include <QComboBox>
    33 #include <QPushButton>
    3435
    3536class ModelItem;
     
    388389                case KVirtualSystemDescriptionType_OS:
    389390                {
    390                     QComboBox *e = new QComboBox (aParent);
    391                     /* Create a list of all possible OS types */
    392                     QList <CGuestOSType> families = vboxGlobal().vmGuestOSFamilyList();
    393                     QList <CGuestOSType> types;
    394                     foreach (const CGuestOSType& family, families)
    395                         types << vboxGlobal().vmGuestOSTypeList (family.GetFamilyId());
    396                     /* Fill the combobox */
    397                     foreach (const CGuestOSType& type, types)
    398                         e->addItem (vboxGlobal().vmGuestOSTypeIcon (type.GetId()), type.GetDescription(), type.GetId());
     391                    VBoxOSTypeSelectorButton *e = new VBoxOSTypeSelectorButton (aParent);
     392                    /* Fill the background with the highlight color in the case
     393                     * the button hasn't a rectangle shape. This prevents the
     394                     * display of parts from the current text on the Mac. */
     395                    e->setAutoFillBackground (true);
     396                    e->setBackgroundRole (QPalette::Highlight);
    399397                    editor = e;
    400398                    break;
     
    472470        {
    473471            case KVirtualSystemDescriptionType_OS:
     472            {
     473                if (VBoxOSTypeSelectorButton *e = qobject_cast<VBoxOSTypeSelectorButton*> (aEditor))
     474                {
     475                    e->setOSTypeId (mConfigValue);
     476                    fDone = true;
     477                }
     478                break;
     479            }
    474480            case KVirtualSystemDescriptionType_HardDiskControllerIDE:
    475481            {
     
    539545        {
    540546            case KVirtualSystemDescriptionType_OS:
     547            {
     548                if (VBoxOSTypeSelectorButton *e = qobject_cast<VBoxOSTypeSelectorButton*> (aEditor))
     549                {
     550                    mConfigValue = e->osTypeId();
     551                    fDone = true;
     552                }
     553                break;
     554            }
    541555            case KVirtualSystemDescriptionType_HardDiskControllerIDE:
    542556            {
     
    687701    {
    688702        QSize size = QItemDelegate::sizeHint (aOption, aIndex);
    689         size.setHeight (RT_MAX (24, size.height()));
     703#ifdef Q_WS_MAC
     704        int h = 28;
     705#else /* Q_WS_MAC */
     706        int h = 24;
     707#endif /* Q_WS_MAC */
     708        size.setHeight (RT_MAX (h, size.height()));
    690709        return size;
    691710    }
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