Changeset 78268 in vbox for trunk/src/VBox
- Timestamp:
- Apr 24, 2019 9:34:14 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r77592 r78268 120 120 } 121 121 122 return configureVM(strTypeId, type); 123 } 124 125 bool UIWizardNewVM::configureVM(const QString &strGuestTypeId, const CGuestOSType &comGuestType) 126 { 127 CVirtualBox vbox = vboxGlobal().virtualBox(); 128 122 129 /* RAM size: */ 123 130 m_machine.SetMemorySize(field("ram").toInt()); 124 131 125 132 /* Graphics Controller type: */ 126 m_machine.SetGraphicsControllerType( type.GetRecommendedGraphicsController());133 m_machine.SetGraphicsControllerType(comGuestType.GetRecommendedGraphicsController()); 127 134 128 135 /* VRAM size - select maximum between recommended and minimum for fullscreen: */ 129 m_machine.SetVRAMSize(qMax( type.GetRecommendedVRAM(), (ULONG)(VBoxGlobal::requiredVideoMemory(strTypeId) / _1M)));136 m_machine.SetVRAMSize(qMax(comGuestType.GetRecommendedVRAM(), (ULONG)(VBoxGlobal::requiredVideoMemory(strGuestTypeId) / _1M))); 130 137 131 138 /* Selecting recommended chipset type: */ 132 m_machine.SetChipsetType( type.GetRecommendedChipset());139 m_machine.SetChipsetType(comGuestType.GetRecommendedChipset()); 133 140 134 141 /* Selecting recommended Audio Controller: */ 135 m_machine.GetAudioAdapter().SetAudioController( type.GetRecommendedAudioController());142 m_machine.GetAudioAdapter().SetAudioController(comGuestType.GetRecommendedAudioController()); 136 143 /* And the Audio Codec: */ 137 m_machine.GetAudioAdapter().SetAudioCodec( type.GetRecommendedAudioCodec());144 m_machine.GetAudioAdapter().SetAudioCodec(comGuestType.GetRecommendedAudioCodec()); 138 145 /* Enabling audio by default: */ 139 146 m_machine.GetAudioAdapter().SetEnabled(true); … … 143 150 CUSBDeviceFilters usbDeviceFilters = m_machine.GetUSBDeviceFilters(); 144 151 bool fOhciEnabled = false; 145 if (!usbDeviceFilters.isNull() && type.GetRecommendedUSB3() && m_machine.GetUSBProxyAvailable())152 if (!usbDeviceFilters.isNull() && comGuestType.GetRecommendedUSB3() && m_machine.GetUSBProxyAvailable()) 146 153 { 147 154 /* USB 3.0 is only available if the proper ExtPack is installed. */ … … 155 162 } 156 163 if ( !fOhciEnabled 157 && !usbDeviceFilters.isNull() && type.GetRecommendedUSB() && m_machine.GetUSBProxyAvailable())164 && !usbDeviceFilters.isNull() && comGuestType.GetRecommendedUSB() && m_machine.GetUSBProxyAvailable()) 158 165 { 159 166 m_machine.AddUSBController("OHCI", KUSBControllerType_OHCI); … … 171 178 /* Create a floppy controller if recommended: */ 172 179 QString strFloppyName = getNextControllerName(KStorageBus_Floppy); 173 if ( type.GetRecommendedFloppy())180 if (comGuestType.GetRecommendedFloppy()) 174 181 { 175 182 m_machine.AddStorageController(strFloppyName, KStorageBus_Floppy); … … 179 186 180 187 /* Create recommended DVD storage controller: */ 181 KStorageBus strDVDBus = type.GetRecommendedDVDStorageBus();188 KStorageBus strDVDBus = comGuestType.GetRecommendedDVDStorageBus(); 182 189 QString strDVDName = getNextControllerName(strDVDBus); 183 190 m_machine.AddStorageController(strDVDName, strDVDBus); … … 185 192 /* Set recommended DVD storage controller type: */ 186 193 CStorageController dvdCtr = m_machine.GetStorageControllerByName(strDVDName); 187 KStorageControllerType dvdStorageControllerType = type.GetRecommendedDVDStorageController();194 KStorageControllerType dvdStorageControllerType = comGuestType.GetRecommendedDVDStorageController(); 188 195 dvdCtr.SetControllerType(dvdStorageControllerType); 189 196 190 197 /* Create recommended HD storage controller if it's not the same as the DVD controller: */ 191 KStorageBus ctrHDBus = type.GetRecommendedHDStorageBus();192 KStorageControllerType hdStorageControllerType = type.GetRecommendedHDStorageController();198 KStorageBus ctrHDBus = comGuestType.GetRecommendedHDStorageBus(); 199 KStorageControllerType hdStorageControllerType = comGuestType.GetRecommendedHDStorageController(); 193 200 CStorageController hdCtr; 194 201 QString strHDName; … … 216 223 217 224 /* Turn on PAE, if recommended: */ 218 m_machine.SetCPUProperty(KCPUPropertyType_PAE, type.GetRecommendedPAE());225 m_machine.SetCPUProperty(KCPUPropertyType_PAE, comGuestType.GetRecommendedPAE()); 219 226 220 227 /* Set the recommended triple fault behavior: */ 221 m_machine.SetCPUProperty(KCPUPropertyType_TripleFaultReset, type.GetRecommendedTFReset());228 m_machine.SetCPUProperty(KCPUPropertyType_TripleFaultReset, comGuestType.GetRecommendedTFReset()); 222 229 223 230 /* Set recommended firmware type: */ 224 KFirmwareType fwType = type.GetRecommendedFirmware();231 KFirmwareType fwType = comGuestType.GetRecommendedFirmware(); 225 232 m_machine.SetFirmwareType(fwType); 226 233 227 234 /* Set recommended human interface device types: */ 228 if ( type.GetRecommendedUSBHID())235 if (comGuestType.GetRecommendedUSBHID()) 229 236 { 230 237 m_machine.SetKeyboardHIDType(KKeyboardHIDType_USBKeyboard); … … 234 241 } 235 242 236 if ( type.GetRecommendedUSBTablet())243 if (comGuestType.GetRecommendedUSBTablet()) 237 244 { 238 245 m_machine.SetPointingHIDType(KPointingHIDType_USBTablet); … … 242 249 243 250 /* Set HPET flag: */ 244 m_machine.SetHPETEnabled( type.GetRecommendedHPET());251 m_machine.SetHPETEnabled(comGuestType.GetRecommendedHPET()); 245 252 246 253 /* Set UTC flags: */ 247 m_machine.SetRTCUseUTC( type.GetRecommendedRTCUseUTC());254 m_machine.SetRTCUseUTC(comGuestType.GetRecommendedRTCUseUTC()); 248 255 249 256 /* Set graphic bits: */ 250 if ( type.GetRecommended2DVideoAcceleration())251 m_machine.SetAccelerate2DVideoEnabled( type.GetRecommended2DVideoAcceleration());252 253 if ( type.GetRecommended3DAcceleration())254 m_machine.SetAccelerate3DEnabled( type.GetRecommended3DAcceleration());257 if (comGuestType.GetRecommended2DVideoAcceleration()) 258 m_machine.SetAccelerate2DVideoEnabled(comGuestType.GetRecommended2DVideoAcceleration()); 259 260 if (comGuestType.GetRecommended3DAcceleration()) 261 m_machine.SetAccelerate3DEnabled(comGuestType.GetRecommended3DAcceleration()); 255 262 256 263 /* Register the VM prior to attaching hard disks: */ … … 290 297 291 298 /* Attach an empty floppy drive if recommended */ 292 if ( type.GetRecommendedFloppy()) {299 if (comGuestType.GetRecommendedFloppy()) { 293 300 machine.AttachDevice(strFloppyName, 0, 0, KDeviceType_Floppy, CMedium()); 294 301 if (!machine.isOk()) -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r77592 r78268 61 61 protected: 62 62 63 /* Create VM stuff: */63 /* Create a new VM: */ 64 64 bool createVM(); 65 /* Configure the newly created VM: */ 66 bool configureVM(const QString &strGuestTypeId, const CGuestOSType &comGuestType); 65 67 66 68 /* Who will be able to create virtual-machine: */
Note:
See TracChangeset
for help on using the changeset viewer.