VirtualBox

Ignore:
Timestamp:
Nov 20, 2008 9:37:06 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
39691
Message:

FE/Qt4: 2883: Structure OS list. Feature request implemented in base designed variant.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk

    r14274 r14437  
    233233        include/QIDialog.h \
    234234        include/VBoxFilePathSelectorWidget.h \
     235        include/VBoxOSTypeSelectorWidget.h \
    235236        include/VBoxUtils.h \
    236237        include/VBoxGlobalSettings.h \
     
    308309        src/QIHelpButton.cpp \
    309310        src/VBoxFilePathSelectorWidget.cpp \
     311        src/VBoxOSTypeSelectorWidget.cpp \
    310312        src/VBoxDefs.cpp \
    311313        src/VBoxGlobalSettings.cpp \
  • trunk/src/VBox/Frontends/VirtualBox4/VirtualBox.qrc

    r14274 r14437  
    1818    <file alias="vm_start_disabled_32px.png">images/vm_start_disabled_32px.png</file>
    1919    <file alias="os_archlinux.png">images/os_archlinux.png</file>
     20    <file alias="os_archlinux_64.png">images/os_archlinux_64.png</file>
    2021    <file alias="os_debian.png">images/os_debian.png</file>
     22    <file alias="os_debian_64.png">images/os_debian_64.png</file>
    2123    <file alias="os_dos.png">images/os_dos.png</file>
    22     <file alias="os_ecs.png">images/os_ecs.png</file>
    23     <file alias="os_fedoracore.png">images/os_fedoracore.png</file>
     24    <file alias="os_fedora.png">images/os_fedora.png</file>
     25    <file alias="os_fedora_64.png">images/os_fedora_64.png</file>
    2426    <file alias="os_freebsd.png">images/os_freebsd.png</file>
     27    <file alias="os_freebsd_64.png">images/os_freebsd_64.png</file>
    2528    <file alias="os_gentoo.png">images/os_gentoo.png</file>
     29    <file alias="os_gentoo_64.png">images/os_gentoo_64.png</file>
    2630    <file alias="os_l4.png">images/os_l4.png</file>
     31    <file alias="os_linux_other.png">images/os_linux_other.png</file>
    2732    <file alias="os_linux22.png">images/os_linux22.png</file>
    2833    <file alias="os_linux24.png">images/os_linux24.png</file>
     34    <file alias="os_linux24_64.png">images/os_linux24_64.png</file>
    2935    <file alias="os_linux26.png">images/os_linux26.png</file>
     36    <file alias="os_linux26_64.png">images/os_linux26_64.png</file>
    3037    <file alias="os_mandriva.png">images/os_mandriva.png</file>
     38    <file alias="os_mandriva_64.png">images/os_mandriva_64.png</file>
    3139    <file alias="os_netbsd.png">images/os_netbsd.png</file>
     40    <file alias="os_netbsd_64.png">images/os_netbsd_64.png</file>
    3241    <file alias="os_netware.png">images/os_netware.png</file>
    3342    <file alias="os_openbsd.png">images/os_openbsd.png</file>
     43    <file alias="os_openbsd_64.png">images/os_openbsd_64.png</file>
    3444    <file alias="os_opensolaris.png">images/os_opensolaris.png</file>
     45    <file alias="os_opensolaris_64.png">images/os_opensolaris_64.png</file>
    3546    <file alias="os_opensuse.png">images/os_opensuse.png</file>
     47    <file alias="os_opensuse_64.png">images/os_opensuse_64.png</file>
     48    <file alias="os_os2_other.png">images/os_os2_other.png</file>
     49    <file alias="os_os2ecs.png">images/os_os2ecs.png</file>
    3650    <file alias="os_os2warp3.png">images/os_os2warp3.png</file>
    3751    <file alias="os_os2warp4.png">images/os_os2warp4.png</file>
    3852    <file alias="os_os2warp45.png">images/os_os2warp45.png</file>
     53    <file alias="os_other.png">images/os_other.png</file>
    3954    <file alias="os_redhat.png">images/os_redhat.png</file>
     55    <file alias="os_redhat_64.png">images/os_redhat_64.png</file>
    4056    <file alias="os_solaris.png">images/os_solaris.png</file>
     57    <file alias="os_solaris_64.png">images/os_solaris_64.png</file>
    4158    <file alias="os_ubuntu.png">images/os_ubuntu.png</file>
    42     <file alias="os_unknown.png">images/os_unknown.png</file>
     59    <file alias="os_ubuntu_64.png">images/os_ubuntu_64.png</file>
     60    <file alias="os_win_other.png">images/os_win_other.png</file>
    4361    <file alias="os_win2k.png">images/os_win2k.png</file>
    4462    <file alias="os_win2k3.png">images/os_win2k3.png</file>
     63    <file alias="os_win2k3_64.png">images/os_win2k3_64.png</file>
    4564    <file alias="os_win2k8.png">images/os_win2k8.png</file>
     65    <file alias="os_win2k8_64.png">images/os_win2k8_64.png</file>
    4666    <file alias="os_win31.png">images/os_win31.png</file>
    4767    <file alias="os_win95.png">images/os_win95.png</file>
     
    5070    <file alias="os_winnt4.png">images/os_winnt4.png</file>
    5171    <file alias="os_winvista.png">images/os_winvista.png</file>
     72    <file alias="os_winvista_64.png">images/os_winvista_64.png</file>
    5273    <file alias="os_winxp.png">images/os_winxp.png</file>
     74    <file alias="os_winxp_64.png">images/os_winxp_64.png</file>
    5375    <file alias="os_xandros.png">images/os_xandros.png</file>
     76    <file alias="os_xandros_64.png">images/os_xandros_64.png</file>
    5477    <file alias="state_aborted_16px.png">images/state_aborted_16px.png</file>
    5578    <file alias="state_discarding_16px.png">images/state_discarding_16px.png</file>
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h

    r14372 r14437  
    474474    /* VBox enum to/from string/icon/color convertors */
    475475
    476     QStringList vmGuestOSTypeDescriptions() const;
    477     QList<QPixmap> vmGuestOSTypeIcons (int aHorizonalMargin, int aVerticalMargin) const;
    478     CGuestOSType vmGuestOSType (int aIndex) const;
    479     int vmGuestOSTypeIndex (const QString &aId) const;
    480     QPixmap vmGuestOSTypeIcon (const QString &aId) const;
    481     QString vmGuestOSTypeDescription (const QString &aId) const;
     476    QList <CGuestOSType> vmGuestOSFamilyList() const;
     477    QList <CGuestOSType> vmGuestOSTypeList (const QString &aFamilyId) const;
     478    QPixmap vmGuestOSTypeIcon (const QString &aTypeId) const;
     479    CGuestOSType vmGuestOSType (const QString &aTypeId,
     480                                const QString &aFamilyId = QString::null) const;
     481    QString vmGuestOSTypeDescription (const QString &aTypeId) const;
    482482
    483483    QPixmap toIcon (KMachineState s) const
     
    986986    QString verString;
    987987
    988     QVector <CGuestOSType> vm_os_types;
    989     QHash <QString, QPixmap *> vm_os_type_icons;
     988    QList <QString> mFamilyIDs;
     989    QList <QList <CGuestOSType> > mTypes;
     990    QHash <QString, QPixmap *> mOsTypeIcons;
    990991    QVector <QColor *> vm_state_color;
    991992
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxNewVMWzd.h

    r13580 r14437  
    4949
    5050    void accept();
    51     void showHardDiskManager();
    52     void showNewHardDiskWizard();
     51    void showMediaManager();
     52    void showNewHDWizard();
     53    void onOSTypeChanged();
    5354    void slRAMValueChanged (int aValue);
    5455    void leRAMTextChanged (const QString &aTtext);
    55     void cbOSActivated (int aItem);
    5656    void revalidate (QIWidgetValidator *aWval);
    5757    void enableNext (const QIWidgetValidator *aWval);
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r14388 r14437  
    12671267VBoxGlobal::~VBoxGlobal()
    12681268{
    1269     qDeleteAll (vm_os_type_icons);
     1269    qDeleteAll (mOsTypeIcons);
    12701270    qDeleteAll (mStateIcons);
    12711271    qDeleteAll (vm_state_color);
     
    13551355
    13561356/**
    1357  *  Returns the list of all guest OS type descriptions, queried from
    1358  *  IVirtualBox.
    1359  */
    1360 QStringList VBoxGlobal::vmGuestOSTypeDescriptions() const
    1361 {
    1362     static QStringList list;
    1363     if (list.empty()) {
    1364         for (int i = 0; i < vm_os_types.count(); i++) {
    1365             list += vm_os_types [i].GetDescription();
    1366         }
    1367     }
    1368     return list;
    1369 }
    1370 
    1371 QList<QPixmap> VBoxGlobal::vmGuestOSTypeIcons (int aHorizonalMargin, int aVerticalMargin) const
    1372 {
    1373     static QList<QPixmap> list;
    1374     if (list.empty())
    1375     {
    1376         for (int i = 0; i < vm_os_types.count(); i++)
    1377         {
    1378             QPixmap image (32 + 2 * aHorizonalMargin, 32 + 2 * aVerticalMargin);
    1379             image.fill (Qt::transparent);
    1380             QPainter p (&image);
    1381             p.drawPixmap (aHorizonalMargin, aVerticalMargin, *vm_os_type_icons.value (vm_os_types [i].GetId()));
    1382             p.end();
    1383             list << image;
    1384         }
    1385     }
    1386     return list;
    1387 }
    1388 
    1389 /**
    1390  *  Returns the guest OS type object corresponding to the given index.
    1391  *  The index argument corresponds to the index in the list of OS type
    1392  *  descriptions as returnded by #vmGuestOSTypeDescriptions().
    1393  *
     1357 *  Returns the list of few guest OS types, queried from
     1358 *  IVirtualBox corresponding to every family id.
     1359 */
     1360QList <CGuestOSType> VBoxGlobal::vmGuestOSFamilyList() const
     1361{
     1362    QList <CGuestOSType> result;
     1363    for (int i = 0 ; i < mFamilyIDs.size(); ++ i)
     1364        result << mTypes [i][0];
     1365    return result;
     1366}
     1367
     1368/**
     1369 *  Returns the list of all guest OS types, queried from
     1370 *  IVirtualBox corresponding to passed family id.
     1371 */
     1372QList <CGuestOSType> VBoxGlobal::vmGuestOSTypeList (const QString &aFamilyId) const
     1373{
     1374    AssertMsg (mFamilyIDs.contains (aFamilyId), ("Family ID incorrect: '%s'.", aFamilyId.toLatin1().constData()));
     1375    return mFamilyIDs.contains (aFamilyId) ?
     1376           mTypes [mFamilyIDs.indexOf (aFamilyId)] : QList <CGuestOSType>();
     1377}
     1378
     1379/**
     1380 *  Returns the icon corresponding to the given guest OS type id.
     1381 */
     1382QPixmap VBoxGlobal::vmGuestOSTypeIcon (const QString &aTypeId) const
     1383{
     1384    static const QPixmap none;
     1385    QPixmap *p = mOsTypeIcons.value (aTypeId);
     1386    AssertMsg (p, ("Icon for type '%s' must be defined.", aTypeId.toLatin1().constData()));
     1387    return p ? *p : none;
     1388}
     1389
     1390/**
     1391 *  Returns the guest OS type object corresponding to the given type id of list
     1392 *  containing OS types related to OS family determined by family id attribute.
    13941393 *  If the index is invalid a null object is returned.
    13951394 */
    1396 CGuestOSType VBoxGlobal::vmGuestOSType (int aIndex) const
    1397 {
    1398     CGuestOSType type;
    1399     if (aIndex >= 0 && aIndex < (int) vm_os_types.count())
    1400         type = vm_os_types.value (aIndex);
    1401     AssertMsg (!type.isNull(), ("Index for OS type must be valid: %d", aIndex));
    1402     return type;
    1403 }
    1404 
    1405 /**
    1406  *  Returns the index corresponding to the given guest OS type ID.
    1407  *  The returned index corresponds to the index in the list of OS type
    1408  *  descriptions as returnded by #vmGuestOSTypeDescriptions().
    1409  *
    1410  *  If the guest OS type ID is invalid, -1 is returned.
    1411  */
    1412 int VBoxGlobal::vmGuestOSTypeIndex (const QString &aId) const
    1413 {
    1414     for (int i = 0; i < (int) vm_os_types.count(); i++) {
    1415         if (!vm_os_types [i].GetId().compare (aId))
    1416             return i;
    1417     }
    1418     return -1;
    1419 }
    1420 
    1421 /**
    1422  *  Returns the icon corresponding to the given guest OS type ID.
    1423  */
    1424 QPixmap VBoxGlobal::vmGuestOSTypeIcon (const QString &aId) const
    1425 {
    1426     static const QPixmap none;
    1427     QPixmap *p = vm_os_type_icons.value (aId);
    1428     AssertMsg (p, ("Icon for type `%s' must be defined", aId.toLatin1().constData()));
    1429     return p ? *p : none;
    1430 }
    1431 
    1432 /**
    1433  *  Returns the description corresponding to the given guest OS type ID.
    1434  */
    1435 QString VBoxGlobal::vmGuestOSTypeDescription (const QString &aId) const
    1436 {
    1437     for (int i = 0; i < (int) vm_os_types.count(); i++) {
    1438         if (!vm_os_types [i].GetId().compare (aId))
    1439             return vm_os_types [i].GetDescription();
     1395CGuestOSType VBoxGlobal::vmGuestOSType (const QString &aTypeId,
     1396             const QString &aFamilyId /* = QString::null */) const
     1397{
     1398    QList <CGuestOSType> list;
     1399    if (mFamilyIDs.contains (aFamilyId))
     1400    {
     1401        list = mTypes [mFamilyIDs.indexOf (aFamilyId)];
     1402    }
     1403    else
     1404    {
     1405        for (int i = 0; i < mFamilyIDs.size(); ++ i)
     1406            list += mTypes [i];
     1407    }
     1408    for (int j = 0; j < list.size(); ++ j)
     1409        if (!list [j].GetId().compare (aTypeId))
     1410            return list [j];
     1411    AssertMsgFailed (("Type ID incorrect: '%s'.", aTypeId.toLatin1().constData()));
     1412    return CGuestOSType();
     1413}
     1414
     1415/**
     1416 *  Returns the description corresponding to the given guest OS type id.
     1417 */
     1418QString VBoxGlobal::vmGuestOSTypeDescription (const QString &aTypeId) const
     1419{
     1420    for (int i = 0; i < mFamilyIDs.size(); ++ i)
     1421    {
     1422        QList <CGuestOSType> list (mTypes [i]);
     1423        for ( int j = 0; j < list.size(); ++ j)
     1424            if (!list [j].GetId().compare (aTypeId))
     1425                return list [j].GetDescription();
    14401426    }
    14411427    return QString::null;
     
    50745060    }
    50755061
    5076     /* initialize guest OS type vector */
     5062    /* Initialize guest OS Type list */
    50775063    CGuestOSTypeCollection coll = mVBox.GetGuestOSTypes();
    50785064    int osTypeCount = coll.GetCount();
     
    50805066    if (osTypeCount > 0)
    50815067    {
    5082         vm_os_types.resize (osTypeCount);
    5083         int i = 0;
    50845068        CGuestOSTypeEnumerator en = coll.Enumerate();
    50855069        while (en.HasMore())
    5086             vm_os_types [i++] = en.GetNext();
    5087     }
    5088 
    5089     /* fill in OS type icon dictionary */
     5070        {
     5071            CGuestOSType os (en.GetNext());
     5072            QString familyId (os.GetFamilyId());
     5073            if (!mFamilyIDs.contains (familyId))
     5074            {
     5075                mFamilyIDs << familyId;
     5076                mTypes << QList <CGuestOSType> ();
     5077            }
     5078            mTypes [mFamilyIDs.indexOf (familyId)].append (os);
     5079        }
     5080    }
     5081
     5082    /* Fill in OS type icon dictionary */
    50905083    static const char *kOSTypeIcons [][2] =
    50915084    {
    5092         {"unknown",     ":/os_unknown.png"},
    5093         {"dos",         ":/os_dos.png"},
    5094         {"win31",       ":/os_win31.png"},
    5095         {"win95",       ":/os_win95.png"},
    5096         {"win98",       ":/os_win98.png"},
    5097         {"winme",       ":/os_winme.png"},
    5098         {"winnt4",      ":/os_winnt4.png"},
    5099         {"win2k",       ":/os_win2k.png"},
    5100         {"winxp",       ":/os_winxp.png"},
    5101         {"win2k3",      ":/os_win2k3.png"},
    5102         {"winvista",    ":/os_winvista.png"},
    5103         {"win2k8",      ":/os_win2k8.png"},
    5104         {"os2warp3",    ":/os_os2warp3.png"},
    5105         {"os2warp4",    ":/os_os2warp4.png"},
    5106         {"os2warp45",   ":/os_os2warp45.png"},
    5107         {"ecs",         ":/os_ecs.png"},
    5108         {"linux22",     ":/os_linux22.png"},
    5109         {"linux24",     ":/os_linux24.png"},
    5110         {"linux26",     ":/os_linux26.png"},
    5111         {"archlinux",   ":/os_archlinux.png"},
    5112         {"debian",      ":/os_debian.png"},
    5113         {"opensolaris", ":/os_opensolaris.png"},
    5114         {"opensuse",    ":/os_opensuse.png"},
    5115         {"fedoracore",  ":/os_fedoracore.png"},
    5116         {"gentoo",      ":/os_gentoo.png"},
    5117         {"mandriva",    ":/os_mandriva.png"},
    5118         {"redhat",      ":/os_redhat.png"},
    5119         {"ubuntu",      ":/os_ubuntu.png"},
    5120         {"xandros",     ":/os_xandros.png"},
    5121         {"freebsd",     ":/os_freebsd.png"},
    5122         {"openbsd",     ":/os_openbsd.png"},
    5123         {"netbsd",      ":/os_netbsd.png"},
    5124         {"netware",     ":/os_netware.png"},
    5125         {"solaris",     ":/os_solaris.png"},
    5126         {"l4",          ":/os_l4.png"},
     5085        {"Other",           ":/os_other.png"},
     5086        {"DOS",             ":/os_dos.png"},
     5087        {"Netware",         ":/os_netware.png"},
     5088        {"L4",              ":/os_l4.png"},
     5089        {"Windows31",       ":/os_win31.png"},
     5090        {"Windows95",       ":/os_win95.png"},
     5091        {"Windows98",       ":/os_win98.png"},
     5092        {"WindowsMe",       ":/os_winme.png"},
     5093        {"WindowsNT4",      ":/os_winnt4.png"},
     5094        {"Windows2000",     ":/os_win2k.png"},
     5095        {"WindowsXP",       ":/os_winxp.png"},
     5096        {"WindowsXP_64",    ":/os_winxp_64.png"},
     5097        {"Windows2003",     ":/os_win2k3.png"},
     5098        {"Windows2003_64",  ":/os_win2k3_64.png"},
     5099        {"WindowsVista",    ":/os_winvista.png"},
     5100        {"WindowsVista_64", ":/os_winvista_64.png"},
     5101        {"Windows2008",     ":/os_win2k8.png"},
     5102        {"Windows2008_64",  ":/os_win2k8_64.png"},
     5103        {"WindowsNT",       ":/os_win_other.png"},
     5104        {"OS2Warp3",        ":/os_os2warp3.png"},
     5105        {"OS2Warp4",        ":/os_os2warp4.png"},
     5106        {"OS2Warp45",       ":/os_os2warp45.png"},
     5107        {"OS2eCS",          ":/os_os2ecs.png"},
     5108        {"OS2",             ":/os_os2_other.png"},
     5109        {"Linux22",         ":/os_linux22.png"},
     5110        {"Linux24",         ":/os_linux24.png"},
     5111        {"Linux24_64",      ":/os_linux24_64.png"},
     5112        {"Linux26",         ":/os_linux26.png"},
     5113        {"Linux26_64",      ":/os_linux26_64.png"},
     5114        {"ArchLinux",       ":/os_archlinux.png"},
     5115        {"ArchLinux_64",    ":/os_archlinux_64.png"},
     5116        {"Debian",          ":/os_debian.png"},
     5117        {"Debian_64",       ":/os_debian_64.png"},
     5118        {"OpenSUSE",        ":/os_opensuse.png"},
     5119        {"OpenSUSE_64",     ":/os_opensuse_64.png"},
     5120        {"Fedora",          ":/os_fedora.png"},
     5121        {"Fedora_64",       ":/os_fedora_64.png"},
     5122        {"Gentoo",          ":/os_gentoo.png"},
     5123        {"Gentoo_64",       ":/os_gentoo_64.png"},
     5124        {"Mandriva",        ":/os_mandriva.png"},
     5125        {"Mandriva_64",     ":/os_mandriva_64.png"},
     5126        {"RedHat",          ":/os_redhat.png"},
     5127        {"RedHat_64",       ":/os_redhat_64.png"},
     5128        {"Ubuntu",          ":/os_ubuntu.png"},
     5129        {"Ubuntu_64",       ":/os_ubuntu_64.png"},
     5130        {"Xandros",         ":/os_xandros.png"},
     5131        {"Xandros_64",      ":/os_xandros_64.png"},
     5132        {"Linux",           ":/os_linux_other.png"},
     5133        {"FreeBSD",         ":/os_freebsd.png"},
     5134        {"FreeBSD_64",      ":/os_freebsd_64.png"},
     5135        {"OpenBSD",         ":/os_openbsd.png"},
     5136        {"OpenBSD_64",      ":/os_openbsd_64.png"},
     5137        {"NetBSD",          ":/os_netbsd.png"},
     5138        {"NetBSD_64",       ":/os_netbsd_64.png"},
     5139        {"Solaris",         ":/os_solaris.png"},
     5140        {"Solaris_64",      ":/os_solaris_64.png"},
     5141        {"OpenSolaris",     ":/os_opensolaris.png"},
     5142        {"OpenSolaris_64",  ":/os_opensolaris_64.png"},
    51275143    };
    5128     for (uint n = 0; n < SIZEOF_ARRAY (kOSTypeIcons); n ++)
    5129     {
    5130         vm_os_type_icons.insert (kOSTypeIcons [n][0],
     5144    for (uint n = 0; n < SIZEOF_ARRAY (kOSTypeIcons); ++ n)
     5145    {
     5146        mOsTypeIcons.insert (kOSTypeIcons [n][0],
    51315147            new QPixmap (kOSTypeIcons [n][1]));
    51325148    }
     
    53355351
    53365352    /* ensure CGuestOSType objects are no longer used */
    5337     vm_os_types.clear();
     5353    mFamilyIDs.clear();
     5354    mTypes.clear();
     5355
    53385356    /* media list contains a lot of CUUnknown, release them */
    53395357    mMediaList.clear();
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxNewVMWzd.cpp

    r13580 r14437  
    6363    connect (mWvalNameAndOS, SIGNAL (validityChanged (const QIWidgetValidator*)),
    6464             this, SLOT (enableNext (const QIWidgetValidator*)));
    65     connect (mCbOS, SIGNAL (activated (int)), this, SLOT (cbOSActivated (int)));
     65    connect (mOSTypeSelector, SIGNAL (osTypeChanged()), this, SLOT (onOSTypeChanged()));
    6666
    6767    /* Memory page */
     
    8989    connect (mHDCombo, SIGNAL (currentIndexChanged (int)),
    9090             mWvalHDD, SLOT (revalidate()));
    91     connect (mPbNewHD, SIGNAL (clicked()), this, SLOT (showNewHardDiskWizard()));
    92     connect (mPbExistingHD, SIGNAL (clicked()), this, SLOT (showHardDiskManager()));
     91    connect (mPbNewHD, SIGNAL (clicked()), this, SLOT (showNewHDWizard()));
     92    connect (mPbExistingHD, SIGNAL (clicked()), this, SLOT (showMediaManager()));
    9393
    9494    /* Summary page */
     
    9696
    9797    /* Name and OS page */
    98     mCbOS->addItems (vboxGlobal().vmGuestOSTypeDescriptions());
    99     cbOSActivated (mCbOS->currentIndex());
    10098
    10199    /* Memory page */
     
    106104    mSlRAM->setRange ((MinRAM / mSlRAM->pageStep()) * mSlRAM->pageStep(),
    107105                      MaxRAM);
    108     /* Initial RAM value is set in cbOSActivated()
     106    /* Initial RAM value is set in onTypeChanged()
    109107     * limit min/max. size of QLineEdit */
    110108    mLeRAM->setFixedWidthByText ("99999");
     
    142140    Ui::VBoxNewVMWzd::retranslateUi (this);
    143141
    144     CGuestOSType type = vboxGlobal().vmGuestOSType (mCbOS->currentIndex());
     142    CGuestOSType type = mOSTypeSelector->type();
    145143
    146144    mTextRAMBest->setText (
     
    170168            "<tr><td><nobr>%5:&nbsp;</nobr></td><td>%6&nbsp;%7</td></tr>")
    171169            .arg (tr ("Name", "summary"), mLeName->text())
    172             .arg (tr ("OS Type", "summary"),
    173                   vboxGlobal().vmGuestOSType (mCbOS->currentIndex()).GetDescription())
     170            .arg (tr ("OS Type", "summary"), type.GetDescription())
    174171            .arg (tr ("Base Memory", "summary")).arg (mSlRAM->value())
    175172            .arg (tr ("MB", "megabytes"));
     
    192189}
    193190
    194 void VBoxNewVMWzd::showHardDiskManager()
     191void VBoxNewVMWzd::showMediaManager()
    195192{
    196193    VBoxMediaManagerDlg dlg (this);
     
    210207}
    211208
    212 void VBoxNewVMWzd::showNewHardDiskWizard()
     209void VBoxNewVMWzd::showNewHDWizard()
    213210{
    214211    VBoxNewHDWzd dlg (this);
    215212
    216     CGuestOSType type = vboxGlobal().vmGuestOSType (mCbOS->currentIndex());
    217213    dlg.setRecommendedFileName (mLeName->text());
    218     dlg.setRecommendedSize (type.GetRecommendedHDD());
     214    dlg.setRecommendedSize (mOSTypeSelector->type().GetRecommendedHDD());
    219215
    220216    if (dlg.exec() == QDialog::Accepted)
     
    228224}
    229225
     226void VBoxNewVMWzd::onOSTypeChanged()
     227{
     228    slRAMValueChanged (mOSTypeSelector->type().GetRecommendedRAM());
     229}
     230
    230231void VBoxNewVMWzd::slRAMValueChanged (int aValue)
    231232{
     
    236237{
    237238    mSlRAM->setValue (aText.toInt());
    238 }
    239 
    240 void VBoxNewVMWzd::cbOSActivated (int aItem)
    241 {
    242     CGuestOSType type = vboxGlobal().vmGuestOSType (aItem);
    243     mPmOS->setPixmap (vboxGlobal().vmGuestOSTypeIcon (type.GetId()));
    244     mSlRAM->setValue (type.GetRecommendedRAM());
    245239}
    246240
     
    324318
    325319    /* OS type */
    326     CGuestOSType type = vboxGlobal().vmGuestOSType (mCbOS->currentIndex());
     320    CGuestOSType type = mOSTypeSelector->type();
    327321    AssertMsg (!type.isNull(), ("vmGuestOSType() must return non-null type"));
    328322    QString typeId = type.GetId();
    329323    mMachine.SetOSTypeId (typeId);
    330324
     325    /* Dsen: move it to Main when implementing 3002: GUI/Main enhancements for 64 bits guests */
    331326    if (typeId == "os2warp3"  ||
    332327        typeId == "os2warp4"  ||
     
    334329        typeId == "ecs")
    335330        mMachine.SetHWVirtExEnabled (KTSBool_True);
     331    /* Dsen: move it to Main when implementing 3002: GUI/Main enhancements for 64 bits guests */
    336332
    337333    /* RAM size */
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsGeneral.cpp

    r14398 r14437  
    100100
    101101    /* Setup initial values */
    102     mCbOsType->insertItems (0, vboxGlobal().vmGuestOSTypeDescriptions());
    103     QList<QPixmap> list = vboxGlobal().vmGuestOSTypeIcons (0, 2);
    104     for (int i=0; i < list.count(); ++i)
    105         mCbOsType->setItemIcon (i, list.at (i));
    106 
    107102    mSlRam->setPageStep (calcPageStep (MaxRAM));
    108103    mSlRam->setSingleStep (mSlRam->pageStep() / 4);
     
    156151
    157152    /* OS type */
    158     QString typeId = aMachine.GetOSTypeId();
    159     mCbOsType->setCurrentIndex (vboxGlobal().vmGuestOSTypeIndex (typeId));
     153    mOSTypeSelector->setType (vboxGlobal().vmGuestOSType (aMachine.GetOSTypeId()));
    160154
    161155    /* RAM size */
     
    296290
    297291    /* OS type */
    298     CGuestOSType type = vboxGlobal().vmGuestOSType (mCbOsType->currentIndex());
    299     AssertMsg (!type.isNull(), ("vmGuestOSType() must return non-null type"));
    300     mMachine.SetOSTypeId (type.GetId());
     292    AssertMsg (!mOSTypeSelector->type().isNull(), ("mOSTypeSelector must return non-null type"));
     293    mMachine.SetOSTypeId (mOSTypeSelector->type().GetId());
    301294
    302295    /* RAM size */
     
    420413    setTabOrder (aWidget, mTabGeneral->focusProxy());
    421414    setTabOrder (mTabGeneral->focusProxy(), mLeName);
    422     setTabOrder (mLeName, mCbOsType);
    423     setTabOrder (mCbOsType, mSlRam);
     415    setTabOrder (mLeName, mOSTypeSelector);
     416    setTabOrder (mOSTypeSelector, mSlRam);
    424417    setTabOrder (mSlRam, mLeRam);
    425418    setTabOrder (mLeRam, mSlVideo);
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxNewVMWzd.ui

    r13580 r14437  
    336336              </property>
    337337              <item>
    338                <layout class="QVBoxLayout" >
    339                 <property name="spacing" >
    340                  <number>0</number>
    341                 </property>
    342                 <item>
    343                  <widget class="QComboBox" name="mCbOS" >
    344                   <property name="sizePolicy" >
    345                    <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
    346                     <horstretch>0</horstretch>
    347                     <verstretch>0</verstretch>
    348                    </sizepolicy>
    349                   </property>
    350                  </widget>
    351                 </item>
    352                 <item>
    353                  <spacer>
    354                   <property name="orientation" >
    355                    <enum>Qt::Vertical</enum>
    356                   </property>
    357                   <property name="sizeType" >
    358                    <enum>QSizePolicy::Expanding</enum>
    359                   </property>
    360                   <property name="sizeHint" >
    361                    <size>
    362                     <width>0</width>
    363                     <height>0</height>
    364                    </size>
    365                   </property>
    366                  </spacer>
    367                 </item>
    368                </layout>
    369               </item>
    370               <item>
    371                <spacer>
    372                 <property name="orientation" >
    373                  <enum>Qt::Horizontal</enum>
    374                 </property>
    375                 <property name="sizeHint" >
    376                  <size>
    377                   <width>0</width>
    378                   <height>0</height>
    379                  </size>
    380                 </property>
    381                </spacer>
    382               </item>
    383               <item>
    384                <widget class="QLabel" name="mPmOS" >
    385                 <property name="text" >
    386                  <string/>
    387                 </property>
    388                 <property name="alignment" >
    389                  <set>Qt::AlignHCenter|Qt::AlignTop</set>
    390                 </property>
    391                </widget>
     338               <widget class="VBoxOSTypeSelectorWidget" name="mOSTypeSelector" />
    392339              </item>
    393340             </layout>
     
    12171164   <extends>QLabel</extends>
    12181165   <header>QILabel.h</header>
     1166  </customwidget>
     1167  <customwidget>
     1168   <class>VBoxOSTypeSelectorWidget</class>
     1169   <extends>QWidget</extends>
     1170   <header>VBoxOSTypeSelectorWidget.h</header>
    12191171  </customwidget>
    12201172  <customwidget>
     
    12381190  <tabstop>mBtnCancel1</tabstop>
    12391191  <tabstop>mLeName</tabstop>
    1240   <tabstop>mCbOS</tabstop>
     1192  <tabstop>mOSTypeSelector</tabstop>
    12411193  <tabstop>mBtnBack2</tabstop>
    12421194  <tabstop>mBtnNext2</tabstop>
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsGeneral.ui

    r14398 r14437  
    6868       </item>
    6969       <item row="1" column="1" >
    70         <layout class="QGridLayout" >
    71          <item row="0" column="0" >
    72           <widget class="QLabel" name="mLbName" >
    73            <property name="text" >
    74             <string>&amp;Name:</string>
    75            </property>
    76            <property name="alignment" >
    77             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    78            </property>
    79            <property name="buddy" >
    80             <cstring>mLeName</cstring>
    81            </property>
    82           </widget>
    83          </item>
    84          <item row="0" column="1" >
    85           <widget class="QLineEdit" name="mLeName" >
    86            <property name="whatsThis" >
    87             <string>Displays the name of the virtual machine.</string>
    88            </property>
    89           </widget>
    90          </item>
    91          <item row="1" column="0" >
    92           <widget class="QLabel" name="mLbOsType" >
    93            <property name="text" >
    94             <string>OS &amp;Type:</string>
    95            </property>
    96            <property name="alignment" >
    97             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    98            </property>
    99            <property name="buddy" >
    100             <cstring>mCbOsType</cstring>
    101            </property>
    102           </widget>
    103          </item>
    104          <item row="1" column="1" >
    105           <widget class="QComboBox" name="mCbOsType" >
    106            <property name="focusPolicy" >
    107             <enum>Qt::StrongFocus</enum>
    108            </property>
    109            <property name="whatsThis" >
    110             <string>Displays the operating system type that you plan to install into this virtual machine (called a guest operating system).</string>
    111            </property>
    112           </widget>
    113          </item>
    114         </layout>
     70        <widget class="VBoxOSTypeSelectorWidget" name="mOSTypeSelector" >
     71         <layout class="QGridLayout" >
     72          <item row="0" column="0" >
     73           <widget class="QLabel" name="mLbName" >
     74            <property name="text" >
     75             <string>&amp;Name:</string>
     76            </property>
     77            <property name="alignment" >
     78             <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     79            </property>
     80            <property name="buddy" >
     81             <cstring>mLeName</cstring>
     82            </property>
     83           </widget>
     84          </item>
     85          <item row="0" column="1" colspan="2" >
     86           <widget class="QLineEdit" name="mLeName" >
     87            <property name="whatsThis" >
     88             <string>Displays the name of the virtual machine.</string>
     89            </property>
     90           </widget>
     91          </item>
     92         </layout>
     93        </widget>
    11594       </item>
    11695       <item row="2" column="0" colspan="2" >
     
    949928 <customwidgets>
    950929  <customwidget>
     930   <class>VBoxOSTypeSelectorWidget</class>
     931   <extends>QWidget</extends>
     932   <header>VBoxOSTypeSelectorWidget.h</header>
     933  </customwidget>
     934  <customwidget>
    951935   <class>VBoxFilePathSelectorWidget</class>
    952936   <extends>QComboBox</extends>
Note: See TracChangeset for help on using the changeset viewer.

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