Changeset 14437 in vbox for trunk/src/VBox/Frontends/VirtualBox4
- Timestamp:
- Nov 20, 2008 9:37:06 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 39691
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 9 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk
r14274 r14437 233 233 include/QIDialog.h \ 234 234 include/VBoxFilePathSelectorWidget.h \ 235 include/VBoxOSTypeSelectorWidget.h \ 235 236 include/VBoxUtils.h \ 236 237 include/VBoxGlobalSettings.h \ … … 308 309 src/QIHelpButton.cpp \ 309 310 src/VBoxFilePathSelectorWidget.cpp \ 311 src/VBoxOSTypeSelectorWidget.cpp \ 310 312 src/VBoxDefs.cpp \ 311 313 src/VBoxGlobalSettings.cpp \ -
trunk/src/VBox/Frontends/VirtualBox4/VirtualBox.qrc
r14274 r14437 18 18 <file alias="vm_start_disabled_32px.png">images/vm_start_disabled_32px.png</file> 19 19 <file alias="os_archlinux.png">images/os_archlinux.png</file> 20 <file alias="os_archlinux_64.png">images/os_archlinux_64.png</file> 20 21 <file alias="os_debian.png">images/os_debian.png</file> 22 <file alias="os_debian_64.png">images/os_debian_64.png</file> 21 23 <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_fedora core.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> 24 26 <file alias="os_freebsd.png">images/os_freebsd.png</file> 27 <file alias="os_freebsd_64.png">images/os_freebsd_64.png</file> 25 28 <file alias="os_gentoo.png">images/os_gentoo.png</file> 29 <file alias="os_gentoo_64.png">images/os_gentoo_64.png</file> 26 30 <file alias="os_l4.png">images/os_l4.png</file> 31 <file alias="os_linux_other.png">images/os_linux_other.png</file> 27 32 <file alias="os_linux22.png">images/os_linux22.png</file> 28 33 <file alias="os_linux24.png">images/os_linux24.png</file> 34 <file alias="os_linux24_64.png">images/os_linux24_64.png</file> 29 35 <file alias="os_linux26.png">images/os_linux26.png</file> 36 <file alias="os_linux26_64.png">images/os_linux26_64.png</file> 30 37 <file alias="os_mandriva.png">images/os_mandriva.png</file> 38 <file alias="os_mandriva_64.png">images/os_mandriva_64.png</file> 31 39 <file alias="os_netbsd.png">images/os_netbsd.png</file> 40 <file alias="os_netbsd_64.png">images/os_netbsd_64.png</file> 32 41 <file alias="os_netware.png">images/os_netware.png</file> 33 42 <file alias="os_openbsd.png">images/os_openbsd.png</file> 43 <file alias="os_openbsd_64.png">images/os_openbsd_64.png</file> 34 44 <file alias="os_opensolaris.png">images/os_opensolaris.png</file> 45 <file alias="os_opensolaris_64.png">images/os_opensolaris_64.png</file> 35 46 <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> 36 50 <file alias="os_os2warp3.png">images/os_os2warp3.png</file> 37 51 <file alias="os_os2warp4.png">images/os_os2warp4.png</file> 38 52 <file alias="os_os2warp45.png">images/os_os2warp45.png</file> 53 <file alias="os_other.png">images/os_other.png</file> 39 54 <file alias="os_redhat.png">images/os_redhat.png</file> 55 <file alias="os_redhat_64.png">images/os_redhat_64.png</file> 40 56 <file alias="os_solaris.png">images/os_solaris.png</file> 57 <file alias="os_solaris_64.png">images/os_solaris_64.png</file> 41 58 <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> 43 61 <file alias="os_win2k.png">images/os_win2k.png</file> 44 62 <file alias="os_win2k3.png">images/os_win2k3.png</file> 63 <file alias="os_win2k3_64.png">images/os_win2k3_64.png</file> 45 64 <file alias="os_win2k8.png">images/os_win2k8.png</file> 65 <file alias="os_win2k8_64.png">images/os_win2k8_64.png</file> 46 66 <file alias="os_win31.png">images/os_win31.png</file> 47 67 <file alias="os_win95.png">images/os_win95.png</file> … … 50 70 <file alias="os_winnt4.png">images/os_winnt4.png</file> 51 71 <file alias="os_winvista.png">images/os_winvista.png</file> 72 <file alias="os_winvista_64.png">images/os_winvista_64.png</file> 52 73 <file alias="os_winxp.png">images/os_winxp.png</file> 74 <file alias="os_winxp_64.png">images/os_winxp_64.png</file> 53 75 <file alias="os_xandros.png">images/os_xandros.png</file> 76 <file alias="os_xandros_64.png">images/os_xandros_64.png</file> 54 77 <file alias="state_aborted_16px.png">images/state_aborted_16px.png</file> 55 78 <file alias="state_discarding_16px.png">images/state_discarding_16px.png</file> -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h
r14372 r14437 474 474 /* VBox enum to/from string/icon/color convertors */ 475 475 476 Q StringList 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 &a Id) 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; 482 482 483 483 QPixmap toIcon (KMachineState s) const … … 986 986 QString verString; 987 987 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; 990 991 QVector <QColor *> vm_state_color; 991 992 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxNewVMWzd.h
r13580 r14437 49 49 50 50 void accept(); 51 void showHardDiskManager(); 52 void showNewHardDiskWizard(); 51 void showMediaManager(); 52 void showNewHDWizard(); 53 void onOSTypeChanged(); 53 54 void slRAMValueChanged (int aValue); 54 55 void leRAMTextChanged (const QString &aTtext); 55 void cbOSActivated (int aItem);56 56 void revalidate (QIWidgetValidator *aWval); 57 57 void enableNext (const QIWidgetValidator *aWval); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r14388 r14437 1267 1267 VBoxGlobal::~VBoxGlobal() 1268 1268 { 1269 qDeleteAll ( vm_os_type_icons);1269 qDeleteAll (mOsTypeIcons); 1270 1270 qDeleteAll (mStateIcons); 1271 1271 qDeleteAll (vm_state_color); … … 1355 1355 1356 1356 /** 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 */ 1360 QList <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 */ 1372 QList <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 */ 1382 QPixmap 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. 1394 1393 * If the index is invalid a null object is returned. 1395 1394 */ 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(); 1395 CGuestOSType 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 */ 1418 QString 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(); 1440 1426 } 1441 1427 return QString::null; … … 5074 5060 } 5075 5061 5076 /* initialize guest OS type vector*/5062 /* Initialize guest OS Type list */ 5077 5063 CGuestOSTypeCollection coll = mVBox.GetGuestOSTypes(); 5078 5064 int osTypeCount = coll.GetCount(); … … 5080 5066 if (osTypeCount > 0) 5081 5067 { 5082 vm_os_types.resize (osTypeCount);5083 int i = 0;5084 5068 CGuestOSTypeEnumerator en = coll.Enumerate(); 5085 5069 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 */ 5090 5083 static const char *kOSTypeIcons [][2] = 5091 5084 { 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"}, 5127 5143 }; 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], 5131 5147 new QPixmap (kOSTypeIcons [n][1])); 5132 5148 } … … 5335 5351 5336 5352 /* ensure CGuestOSType objects are no longer used */ 5337 vm_os_types.clear(); 5353 mFamilyIDs.clear(); 5354 mTypes.clear(); 5355 5338 5356 /* media list contains a lot of CUUnknown, release them */ 5339 5357 mMediaList.clear(); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxNewVMWzd.cpp
r13580 r14437 63 63 connect (mWvalNameAndOS, SIGNAL (validityChanged (const QIWidgetValidator*)), 64 64 this, SLOT (enableNext (const QIWidgetValidator*))); 65 connect (m CbOS, SIGNAL (activated (int)), this, SLOT (cbOSActivated (int)));65 connect (mOSTypeSelector, SIGNAL (osTypeChanged()), this, SLOT (onOSTypeChanged())); 66 66 67 67 /* Memory page */ … … 89 89 connect (mHDCombo, SIGNAL (currentIndexChanged (int)), 90 90 mWvalHDD, SLOT (revalidate())); 91 connect (mPbNewHD, SIGNAL (clicked()), this, SLOT (showNewH ardDiskWizard()));92 connect (mPbExistingHD, SIGNAL (clicked()), this, SLOT (show HardDiskManager()));91 connect (mPbNewHD, SIGNAL (clicked()), this, SLOT (showNewHDWizard())); 92 connect (mPbExistingHD, SIGNAL (clicked()), this, SLOT (showMediaManager())); 93 93 94 94 /* Summary page */ … … 96 96 97 97 /* Name and OS page */ 98 mCbOS->addItems (vboxGlobal().vmGuestOSTypeDescriptions());99 cbOSActivated (mCbOS->currentIndex());100 98 101 99 /* Memory page */ … … 106 104 mSlRAM->setRange ((MinRAM / mSlRAM->pageStep()) * mSlRAM->pageStep(), 107 105 MaxRAM); 108 /* Initial RAM value is set in cbOSActivated()106 /* Initial RAM value is set in onTypeChanged() 109 107 * limit min/max. size of QLineEdit */ 110 108 mLeRAM->setFixedWidthByText ("99999"); … … 142 140 Ui::VBoxNewVMWzd::retranslateUi (this); 143 141 144 CGuestOSType type = vboxGlobal().vmGuestOSType (mCbOS->currentIndex());142 CGuestOSType type = mOSTypeSelector->type(); 145 143 146 144 mTextRAMBest->setText ( … … 170 168 "<tr><td><nobr>%5: </nobr></td><td>%6 %7</td></tr>") 171 169 .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()) 174 171 .arg (tr ("Base Memory", "summary")).arg (mSlRAM->value()) 175 172 .arg (tr ("MB", "megabytes")); … … 192 189 } 193 190 194 void VBoxNewVMWzd::show HardDiskManager()191 void VBoxNewVMWzd::showMediaManager() 195 192 { 196 193 VBoxMediaManagerDlg dlg (this); … … 210 207 } 211 208 212 void VBoxNewVMWzd::showNewH ardDiskWizard()209 void VBoxNewVMWzd::showNewHDWizard() 213 210 { 214 211 VBoxNewHDWzd dlg (this); 215 212 216 CGuestOSType type = vboxGlobal().vmGuestOSType (mCbOS->currentIndex());217 213 dlg.setRecommendedFileName (mLeName->text()); 218 dlg.setRecommendedSize ( type.GetRecommendedHDD());214 dlg.setRecommendedSize (mOSTypeSelector->type().GetRecommendedHDD()); 219 215 220 216 if (dlg.exec() == QDialog::Accepted) … … 228 224 } 229 225 226 void VBoxNewVMWzd::onOSTypeChanged() 227 { 228 slRAMValueChanged (mOSTypeSelector->type().GetRecommendedRAM()); 229 } 230 230 231 void VBoxNewVMWzd::slRAMValueChanged (int aValue) 231 232 { … … 236 237 { 237 238 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());245 239 } 246 240 … … 324 318 325 319 /* OS type */ 326 CGuestOSType type = vboxGlobal().vmGuestOSType (mCbOS->currentIndex());320 CGuestOSType type = mOSTypeSelector->type(); 327 321 AssertMsg (!type.isNull(), ("vmGuestOSType() must return non-null type")); 328 322 QString typeId = type.GetId(); 329 323 mMachine.SetOSTypeId (typeId); 330 324 325 /* Dsen: move it to Main when implementing 3002: GUI/Main enhancements for 64 bits guests */ 331 326 if (typeId == "os2warp3" || 332 327 typeId == "os2warp4" || … … 334 329 typeId == "ecs") 335 330 mMachine.SetHWVirtExEnabled (KTSBool_True); 331 /* Dsen: move it to Main when implementing 3002: GUI/Main enhancements for 64 bits guests */ 336 332 337 333 /* RAM size */ -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsGeneral.cpp
r14398 r14437 100 100 101 101 /* 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 107 102 mSlRam->setPageStep (calcPageStep (MaxRAM)); 108 103 mSlRam->setSingleStep (mSlRam->pageStep() / 4); … … 156 151 157 152 /* OS type */ 158 QString typeId = aMachine.GetOSTypeId(); 159 mCbOsType->setCurrentIndex (vboxGlobal().vmGuestOSTypeIndex (typeId)); 153 mOSTypeSelector->setType (vboxGlobal().vmGuestOSType (aMachine.GetOSTypeId())); 160 154 161 155 /* RAM size */ … … 296 290 297 291 /* 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()); 301 294 302 295 /* RAM size */ … … 420 413 setTabOrder (aWidget, mTabGeneral->focusProxy()); 421 414 setTabOrder (mTabGeneral->focusProxy(), mLeName); 422 setTabOrder (mLeName, m CbOsType);423 setTabOrder (m CbOsType, mSlRam);415 setTabOrder (mLeName, mOSTypeSelector); 416 setTabOrder (mOSTypeSelector, mSlRam); 424 417 setTabOrder (mSlRam, mLeRam); 425 418 setTabOrder (mLeRam, mSlVideo); -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxNewVMWzd.ui
r13580 r14437 336 336 </property> 337 337 <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" /> 392 339 </item> 393 340 </layout> … … 1217 1164 <extends>QLabel</extends> 1218 1165 <header>QILabel.h</header> 1166 </customwidget> 1167 <customwidget> 1168 <class>VBoxOSTypeSelectorWidget</class> 1169 <extends>QWidget</extends> 1170 <header>VBoxOSTypeSelectorWidget.h</header> 1219 1171 </customwidget> 1220 1172 <customwidget> … … 1238 1190 <tabstop>mBtnCancel1</tabstop> 1239 1191 <tabstop>mLeName</tabstop> 1240 <tabstop>m CbOS</tabstop>1192 <tabstop>mOSTypeSelector</tabstop> 1241 1193 <tabstop>mBtnBack2</tabstop> 1242 1194 <tabstop>mBtnNext2</tabstop> -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsGeneral.ui
r14398 r14437 68 68 </item> 69 69 <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>&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 &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>&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> 115 94 </item> 116 95 <item row="2" column="0" colspan="2" > … … 949 928 <customwidgets> 950 929 <customwidget> 930 <class>VBoxOSTypeSelectorWidget</class> 931 <extends>QWidget</extends> 932 <header>VBoxOSTypeSelectorWidget.h</header> 933 </customwidget> 934 <customwidget> 951 935 <class>VBoxFilePathSelectorWidget</class> 952 936 <extends>QComboBox</extends>
Note:
See TracChangeset
for help on using the changeset viewer.