VirtualBox

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


Ignore:
Timestamp:
Nov 26, 2008 9:19:35 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
39973
Message:

Main & FEs: 3002: GUI/Main enhancements for 64 bits guests implemented.

Location:
trunk/src/VBox/Frontends
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r14646 r14664  
    318318    {
    319319        RTPrintf("VBoxManage createvm         -name <name>\n"
     320                 "                            [-ostype <ostype>]\n"
    320321                 "                            [-register]\n"
    321322                 "                            [-basefolder <path> | -settingsfile <path>]\n"
     
    13451346    Bstr settingsFile;
    13461347    Bstr name;
     1348    Bstr osTypeId;
    13471349    RTUUID id;
    13481350    bool fRegister = false;
     
    13721374            name = argv[i];
    13731375        }
     1376        else if (strcmp(argv[i], "-ostype") == 0)
     1377        {
     1378            if (argc <= i + 1)
     1379                return errorArgument("Missing argument to '%s'", argv[i]);
     1380            i++;
     1381            osTypeId = argv[i];
     1382        }
    13741383        else if (strcmp(argv[i], "-uuid") == 0)
    13751384        {
     
    13991408        if (!settingsFile)
    14001409            CHECK_ERROR_BREAK(virtualBox,
    1401                 CreateMachine(baseFolder, name, Guid(id), machine.asOutParam()));
     1410                CreateMachine(name, osTypeId, baseFolder, Guid(id), machine.asOutParam()));
    14021411        else
    14031412            CHECK_ERROR_BREAK(virtualBox,
    1404                 CreateLegacyMachine(settingsFile, name, Guid(id), machine.asOutParam()));
     1413                CreateLegacyMachine(name, osTypeId, settingsFile, Guid(id), machine.asOutParam()));
    14051414
    14061415        CHECK_ERROR_BREAK(machine, SaveSettings());
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxNewVMWzd.ui.h

    r13580 r14664  
    291291    CVirtualBox vbox = vboxGlobal().virtualBox();
    292292
     293    /* OS type */
     294    CGuestOSType type = vboxGlobal().vmGuestOSType (cbOS->currentItem());
     295    AssertMsg (!type.isNull(), ("vmGuestOSType() must return non-null type"));
     296    QString typeId = type.GetId();
     297
    293298    /* create a machine with the default settings file location */
    294299    if (mMachine.isNull())
    295300    {
    296         mMachine = vbox.CreateMachine (QString(), leName->text(), QUuid());
     301        mMachine = vbox.CreateMachine (leName->text(), typeId, QString::null, QUuid());
    297302        if (!vbox.isOk())
    298303        {
     
    308313    }
    309314
    310     /* name is set in CreateMachine() */
    311 
    312     /* OS type */
    313     CGuestOSType type = vboxGlobal().vmGuestOSType (cbOS->currentItem());
    314     AssertMsg (!type.isNull(), ("vmGuestOSType() must return non-null type"));
    315     QString typeId = type.GetId();
    316     mMachine.SetOSTypeId (typeId);
    317 
    318     if (typeId == "os2warp3"  ||
    319         typeId == "os2warp4"  ||
    320         typeId == "os2warp45" ||
    321         typeId == "ecs")
    322         mMachine.SetHWVirtExEnabled (KTSBool_True);
    323 
    324315    /* RAM size */
    325316    mMachine.SetMemorySize (slRAM->value());
    326 
    327     /* add one network adapter (NAT) by default */
    328     {
    329         CNetworkAdapter cadapter = mMachine.GetNetworkAdapter (0);
    330 #ifdef VBOX_WITH_E1000
    331         /* Default to e1k on solaris */
    332         if (typeId == "solaris" ||
    333             typeId == "opensolaris")
    334             cadapter.SetAdapterType (KNetworkAdapterType_I82540EM);
    335 #endif /* VBOX_WITH_E1000 */
    336         cadapter.SetEnabled (true);
    337         cadapter.AttachToNAT();
    338         cadapter.SetMACAddress (QString::null);
    339         cadapter.SetCableConnected (true);
    340 
    341     }
    342317
    343318    /* register the VM prior to attaching hard disks */
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r14652 r14664  
    52625262    {
    52635263        CGuestOSTypeEnumerator en = coll.Enumerate();
     5264
     5265        /* Here we assume 'Other' type is always the first, so we
     5266         * remember it and will append it to the list when finish */
     5267        CGuestOSType otherType (en.GetNext());
     5268        QString otherFamilyId (otherType.GetFamilyId());
     5269
     5270        /* Fill the lists with all the available OS Types except
     5271         * the 'Other' one type, it will be appended. */
    52645272        while (en.HasMore())
    52655273        {
     
    52735281            mTypes [mFamilyIDs.indexOf (familyId)].append (os);
    52745282        }
     5283
     5284        /* Append the 'Other' OS Type to the end of list */
     5285        if (!mFamilyIDs.contains (otherFamilyId))
     5286        {
     5287            mFamilyIDs << otherFamilyId;
     5288            mTypes << QList <CGuestOSType> ();
     5289        }
     5290        mTypes [mFamilyIDs.indexOf (otherFamilyId)].append (otherType);
    52755291    }
    52765292
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxNewVMWzd.cpp

    r14442 r14664  
    303303    CVirtualBox vbox = vboxGlobal().virtualBox();
    304304
     305    /* OS type */
     306    CGuestOSType type = mOSTypeSelector->type();
     307    AssertMsg (!type.isNull(), ("vmGuestOSType() must return non-null type"));
     308    QString typeId = type.GetId();
     309
    305310    /* Create a machine with the default settings file location */
    306311    if (mMachine.isNull())
    307312    {
    308         mMachine = vbox.CreateMachine (QString(), mLeName->text(), QUuid());
     313        mMachine = vbox.CreateMachine (mLeName->text(), typeId, QString::null, QUuid());
    309314        if (!vbox.isOk())
    310315        {
     
    320325    }
    321326
    322     /* OS type */
    323     CGuestOSType type = mOSTypeSelector->type();
    324     AssertMsg (!type.isNull(), ("vmGuestOSType() must return non-null type"));
    325     QString typeId = type.GetId();
    326     mMachine.SetOSTypeId (typeId);
    327 
    328     /* Dsen: move it to Main when implementing 3002: GUI/Main enhancements for 64 bits guests */
    329     if (typeId == "os2warp3"  ||
    330         typeId == "os2warp4"  ||
    331         typeId == "os2warp45" ||
    332         typeId == "ecs")
    333         mMachine.SetHWVirtExEnabled (KTSBool_True);
    334     /* Dsen: move it to Main when implementing 3002: GUI/Main enhancements for 64 bits guests */
    335 
    336327    /* RAM size */
    337328    mMachine.SetMemorySize (mSlRAM->value());
     
    340331    mMachine.SetVRAMSize (qMax (type.GetRecommendedVRAM(),
    341332                                (ULONG) (VBoxGlobal::requiredVideoMemory() / _1M)));
    342 
    343     /* Add one network adapter (NAT) by default */
    344     {
    345         CNetworkAdapter cadapter = mMachine.GetNetworkAdapter (0);
    346 #ifdef VBOX_WITH_E1000
    347         /* Default to e1k on solaris */
    348         if (typeId == "solaris" ||
    349             typeId == "opensolaris")
    350             cadapter.SetAdapterType (KNetworkAdapterType_I82540EM);
    351 #endif /* VBOX_WITH_E1000 */
    352         cadapter.SetEnabled (true);
    353         cadapter.AttachToNAT();
    354         cadapter.SetMACAddress (QString::null);
    355         cadapter.SetCableConnected (true);
    356     }
    357333
    358334    /* Register the VM prior to attaching hard disks */
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