VirtualBox

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


Ignore:
Timestamp:
Oct 20, 2011 4:48:33 PM (13 years ago)
Author:
vboxsync
Message:

Optionally create a floppy drive or skip creating USB controllers in new VM wizard.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp

    r39055 r39064  
    758758    CUSBController usbController = m_Machine.GetUSBController();
    759759    if (   !usbController.isNull()
     760        && type.GetRecommendedUsb()
    760761        && usbController.GetProxyAvailable())
    761762    {
     
    775776    }
    776777
     778    /* Create a floppy controller if recommended */
     779    QString ctrFloppyName = getNextControllerName(KStorageBus_Floppy);
     780    if (type.GetRecommendedFloppy()) {
     781        m_Machine.AddStorageController(ctrFloppyName, KStorageBus_Floppy);
     782        CStorageController flpCtr = m_Machine.GetStorageControllerByName(ctrFloppyName);
     783        flpCtr.SetControllerType(KStorageControllerType_I82078);
     784    }
     785
    777786    /* Create recommended DVD storage controller */
    778787    KStorageBus ctrDvdBus = type.GetRecommendedDvdStorageBus();
     
    877886            if (!m.isOk())
    878887                msgCenter().cannotAttachDevice(m, VBoxDefs::MediumType_DVD, QString(), StorageSlot(ctrDvdBus, 1, 0), this);
     888
     889
     890            /* Attach an empty floppy drive if recommended */
     891            if (type.GetRecommendedFloppy()) {
     892                m.AttachDevice(ctrFloppyName, 0, 0, KDeviceType_Floppy, CMedium());
     893                if (!m.isOk())
     894                    msgCenter().cannotAttachDevice(m, VBoxDefs::MediumType_Floppy, QString(),
     895                                                   StorageSlot(KStorageBus_Floppy, 0, 0), this);
     896            }
    879897
    880898            if (m.isOk())
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