Changeset 28825 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 27, 2010 1:50:46 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp
r28805 r28825 667 667 668 668 /* Create default storage controllers */ 669 QString ctrName = VBoxVMSettingsHD::tr("Storage Controller"); 670 KStorageBus ideBus = KStorageBus_IDE; 671 672 // Add storage controller 673 m_Machine.AddStorageController(ctrName, ideBus); 674 675 // Set storage controller type 676 CStorageController ctr = m_Machine.GetStorageControllerByName(ctrName); 677 KStorageControllerType storageControllerType = type.GetRecommendedStorageController(); 678 ctr.SetControllerType(storageControllerType); 669 QString ctrDvdName = VBoxVMSettingsHD::tr("Storage Controller"); 670 KStorageBus ctrDvdBus = type.GetRecommendedDvdStorageBus(); 671 672 // Add IDE storage controller 673 m_Machine.AddStorageController(ctrDvdName, ctrDvdBus); 674 675 // Set DVD storage controller type 676 CStorageController dvdCtr = m_Machine.GetStorageControllerByName(ctrDvdName); 677 KStorageControllerType dvdStorageControllerType = type.GetRecommendedDvdStorageController(); 678 dvdCtr.SetControllerType(dvdStorageControllerType); 679 680 // Create a storage controller for harddisks if this is not the same as the DVD controller 681 KStorageBus ctrHdBus = type.GetRecommendedHdStorageBus(); 682 KStorageControllerType hdStorageControllerType = type.GetRecommendedHdStorageController(); 683 CStorageController hdCtr; 684 QString ctrHdName; 685 686 if ( ctrHdBus != ctrDvdBus 687 && hdStorageControllerType != dvdStorageControllerType) 688 { 689 ctrHdName = VBoxVMSettingsHD::tr("Storage Controller 1"); 690 m_Machine.AddStorageController(ctrHdName, ctrHdBus); 691 hdCtr = m_Machine.GetStorageControllerByName(ctrHdName); 692 hdCtr.SetControllerType(hdStorageControllerType); 693 694 // Disable the I/O cache if this is not a IDE controller. 695 if (ctrHdBus != KStorageBus_IDE) 696 hdCtr.SetIoBackend(KIoBackendType_Unbuffered); 697 } 698 else 699 { 700 // The Hard disk controller is the same 701 hdCtr = dvdCtr; 702 ctrHdName = ctrDvdName; 703 } 679 704 680 705 // Turn on PAE, if recommended … … 727 752 if (!field("hardDiskId").toString().isNull()) 728 753 { 729 m.AttachDevice(ctr Name, 0, 0, KDeviceType_HardDisk, field("hardDiskId").toString());754 m.AttachDevice(ctrHdName, 0, 0, KDeviceType_HardDisk, field("hardDiskId").toString()); 730 755 if (!m.isOk()) 731 756 vboxProblem().cannotAttachDevice(this, m, VBoxDefs::MediumType_HardDisk, 732 field("hardDiskLocation").toString(), ideBus, 0, 0);757 field("hardDiskLocation").toString(), ctrHdBus, 0, 0); 733 758 } 734 759 735 760 /* Attach empty CD/DVD ROM Device */ 736 m.AttachDevice(ctr Name, 1, 0, KDeviceType_DVD, QString(""));761 m.AttachDevice(ctrDvdName, 1, 0, KDeviceType_DVD, QString("")); 737 762 if (!m.isOk()) 738 vboxProblem().cannotAttachDevice(this, m, VBoxDefs::MediumType_DVD, QString(), ideBus, 1, 0);763 vboxProblem().cannotAttachDevice(this, m, VBoxDefs::MediumType_DVD, QString(), ctrDvdBus, 1, 0); 739 764 740 765 if (m.isOk())
Note:
See TracChangeset
for help on using the changeset viewer.