Changeset 101253 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Sep 25, 2023 2:00:59 PM (16 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSTypeII.cpp
r101226 r101253 169 169 return m_strDescription; 170 170 } 171 172 KStorageBus UIGuestOSTypeII::getRecommendedHDStorageBus() const 173 { 174 if (m_comGuestOSType.isOk()) 175 return m_comGuestOSType.GetRecommendedHDStorageBus(); 176 return KStorageBus_Null; 177 } 178 179 ULONG UIGuestOSTypeII::getRecommendedRAM() const 180 { 181 if (m_comGuestOSType.isOk()) 182 return m_comGuestOSType.GetRecommendedRAM(); 183 return 0; 184 } 185 186 KStorageBus UIGuestOSTypeII::getRecommendedDVDStorageBus() const 187 { 188 if (m_comGuestOSType.isOk()) 189 return m_comGuestOSType.GetRecommendedDVDStorageBus(); 190 return KStorageBus_Null; 191 } 192 193 ULONG UIGuestOSTypeII::getRecommendedCPUCount() const 194 { 195 if (m_comGuestOSType.isOk()) 196 return m_comGuestOSType.GetRecommendedCPUCount(); 197 return 0; 198 } 199 200 KFirmwareType UIGuestOSTypeII::getRecommendedFirmware() const 201 { 202 if (m_comGuestOSType.isOk()) 203 return m_comGuestOSType.GetRecommendedFirmware(); 204 return KFirmwareType_Max; 205 } 206 207 bool UIGuestOSTypeII::getRecommendedFloppy() const 208 { 209 if (m_comGuestOSType.isOk()) 210 return m_comGuestOSType.GetRecommendedFloppy(); 211 return false; 212 } 213 214 LONG64 UIGuestOSTypeII::getRecommendedHDD() const 215 { 216 if (m_comGuestOSType.isOk()) 217 return m_comGuestOSType.GetRecommendedHDD(); 218 return 0; 219 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSTypeII.h
r101226 r101253 89 89 const QString &getDescription() const; 90 90 91 /** @name Wrapper getters for CGuestOSType member. 92 * @{ */ 93 KStorageBus getRecommendedHDStorageBus() const; 94 ULONG getRecommendedRAM() const; 95 KStorageBus getRecommendedDVDStorageBus() const; 96 ULONG getRecommendedCPUCount() const; 97 KFirmwareType getRecommendedFirmware() const; 98 bool getRecommendedFloppy() const; 99 LONG64 getRecommendedHDD() const; 100 /** @} */ 101 91 102 bool isOk() const; 92 103 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp
r101244 r101253 454 454 { 455 455 m_pComboVariant->addItem(strVariant); 456 if (strVariant == "Oracle Linux")456 if (strVariant.contains(QRegularExpression("Oracle.*Linux"))) 457 457 iOracleIndex = m_pComboVariant->count() - 1; 458 458 } … … 463 463 } 464 464 m_pComboVariant->blockSignals(false); 465 // AssertPtrReturnVoid(m_pComboFamily);466 467 // /* Lock the signals of m_pComboType to prevent it's reaction on clearing: */468 // m_pComboType->blockSignals(true);469 // m_pComboType->clear();470 471 472 // /* Populate combo-box with OS types related to currently selected family id: */473 // foreach (const UIGuestOSType &guiType, m_types.value(m_strFamilyId))474 // {475 // const int idxItem = m_pComboType->count();476 // m_pComboType->insertItem(idxItem, guiType.typeDescription);477 // m_pComboType->setItemData(idxItem, guiType.typeId, TypeID);478 // }479 480 481 // /* Update all the stuff: */482 // sltTypeChanged(m_pComboType->currentIndex());483 484 // /* Unlock the signals of m_pComboType: */485 // m_pComboType->blockSignals(false);486 465 487 466 /* Notify listeners about this change: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r101237 r101253 149 149 { 150 150 CVirtualBox vbox = uiCommon().virtualBox(); 151 QString strTypeId = m_ comGuestOSType.GetId();151 QString strTypeId = m_guestOSType.getId(); 152 152 153 153 /* Create virtual machine: */ … … 284 284 if (!m_virtualDisk.isNull()) 285 285 { 286 KStorageBus enmHDDBus = m_ comGuestOSType.GetRecommendedHDStorageBus();286 KStorageBus enmHDDBus = m_guestOSType.getRecommendedHDStorageBus(); 287 287 CStorageController comHDDController = m_machine.GetStorageControllerByInstance(enmHDDBus, 0); 288 288 if (!comHDDController.isNull()) … … 296 296 297 297 /* Attach optical drive: */ 298 KStorageBus enmDVDBus = m_ comGuestOSType.GetRecommendedDVDStorageBus();298 KStorageBus enmDVDBus = m_guestOSType.getRecommendedDVDStorageBus(); 299 299 CStorageController comDVDController = m_machine.GetStorageControllerByInstance(enmDVDBus, 0); 300 300 if (!comDVDController.isNull()) … … 317 317 318 318 /* Attach an empty floppy drive if recommended */ 319 if (m_ comGuestOSType.GetRecommendedFloppy()) {319 if (m_guestOSType.getRecommendedFloppy()) { 320 320 CStorageController comFloppyController = m_machine.GetStorageControllerByInstance(KStorageBus_Floppy, 0); 321 321 if (!comFloppyController.isNull()) … … 523 523 } 524 524 525 const CGuestOSType&UIWizardNewVM::guestOSType() const526 { 527 return m_ comGuestOSType;;528 } 529 530 void UIWizardNewVM::setGuestOSType(const CGuestOSType&guestOSType)531 { 532 m_ comGuestOSType= guestOSType;525 const UIGuestOSTypeII &UIWizardNewVM::guestOSType() const 526 { 527 return m_guestOSType; 528 } 529 530 void UIWizardNewVM::setGuestOSType(const UIGuestOSTypeII &guestOSType) 531 { 532 m_guestOSType = guestOSType; 533 533 } 534 534 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r101237 r101253 33 33 34 34 /* GUI includes: */ 35 #include "UIGuestOSTypeII.h" 35 36 #include "UINativeWizard.h" 36 37 … … 40 41 #include "CMedium.h" 41 42 #include "CMediumFormat.h" 42 #include "CGuestOSType.h"43 43 #include "CUnattended.h" 44 44 … … 104 104 void setGuestOSFamilyId(const QString &strGuestOSFamilyId); 105 105 106 const CGuestOSType&guestOSType() const;107 void setGuestOSType(const CGuestOSType&guestOSType);106 const UIGuestOSTypeII &guestOSType() const; 107 void setGuestOSType(const UIGuestOSTypeII &guestOSType); 108 108 109 109 bool installGuestAdditions() const; … … 219 219 QString m_strGuestOSFamilyId; 220 220 /** Holds the VM OS type. */ 221 CGuestOSType m_comGuestOSType;221 UIGuestOSTypeII m_guestOSType; 222 222 223 223 /** True if guest additions are to be installed during unattended install. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPage.cpp
r98103 r101253 206 206 UIWizardNewVM *pWizard = wizardWindow<UIWizardNewVM>(); 207 207 AssertReturnVoid(pWizard); 208 const CGuestOSType &comOSType = pWizard->guestOSType();209 AssertReturnVoid(!comOSType.isNull()); 210 QUuid uMediumId = UIWizardNewVMDiskCommon::getWithFileOpenDialog( comOSType.GetId(),208 const UIGuestOSTypeII &OSType = pWizard->guestOSType(); 209 210 QUuid uMediumId = UIWizardNewVMDiskCommon::getWithFileOpenDialog(OSType.getId(), 211 211 pWizard->machineFolder(), 212 212 this, m_pActionPool); … … 266 266 267 267 LONG64 iRecommendedSize = 0; 268 CGuestOSTypetype = pWizard->guestOSType();269 if (!type.is Null() && !m_userModifiedParameters.contains("SelectedDiskSource"))270 { 271 iRecommendedSize = type. GetRecommendedHDD();268 const UIGuestOSTypeII &type = pWizard->guestOSType(); 269 if (!type.isOk() && !m_userModifiedParameters.contains("SelectedDiskSource")) 270 { 271 iRecommendedSize = type.getRecommendedHDD(); 272 272 if (iRecommendedSize != 0) 273 273 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp
r98898 r101253 148 148 UIWizardNewVM *pWizard = wizardWindow<UIWizardNewVM>(); 149 149 AssertReturnVoid(pWizard); 150 const CGuestOSType &comOSType = pWizard->guestOSType();151 AssertReturnVoid(! comOSType.isNull());152 QUuid uMediumId = UIWizardNewVMDiskCommon::getWithFileOpenDialog( comOSType.GetId(),150 const UIGuestOSTypeII &OSType = pWizard->guestOSType(); 151 AssertReturnVoid(!OSType.isOk()); 152 QUuid uMediumId = UIWizardNewVMDiskCommon::getWithFileOpenDialog(OSType.getId(), 153 153 pWizard->machineFolder(), 154 154 this, m_pActionPool); … … 348 348 349 349 /* Get recommended 'ram' field value: */ 350 const CGuestOSType&type = pWizard->guestOSType();351 ULONG recommendedRam = type. GetRecommendedRAM();350 const UIGuestOSTypeII &type = pWizard->guestOSType(); 351 ULONG recommendedRam = type.getRecommendedRAM(); 352 352 353 353 if (m_pHardwareWidgetContainer) … … 363 363 364 364 /* Set Firmware Type of the widget and the wizard: */ 365 KFirmwareType fwType = type. GetRecommendedFirmware();365 KFirmwareType fwType = type.getRecommendedFirmware(); 366 366 if (!m_userModifiedParameters.contains("EFIEnabled")) 367 367 { … … 371 371 372 372 /* Initialize CPU count:*/ 373 int iCPUCount = type. GetRecommendedCPUCount();373 int iCPUCount = type.getRecommendedCPUCount(); 374 374 if (!m_userModifiedParameters.contains("CPUCount")) 375 375 { … … 380 380 } 381 381 382 LONG64 iRecommendedDiskSize = type. GetRecommendedHDD();382 LONG64 iRecommendedDiskSize = type.getRecommendedHDD(); 383 383 /* Prepare initial disk choice: */ 384 384 if (!m_userModifiedParameters.contains("SelectedDiskSource")) -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMHardwarePage.cpp
r98103 r101253 91 91 if (pWizard && m_pHardwareWidgetContainer) 92 92 { 93 CGuestOSType type = pWizard->guestOSType(); 94 if (!type.isNull()) 93 const UIGuestOSTypeII &type = pWizard->guestOSType(); 94 95 m_pHardwareWidgetContainer->blockSignals(true); 96 if (!m_userModifiedParameters.contains("MemorySize")) 95 97 { 96 m_pHardwareWidgetContainer->blockSignals(true); 97 if (!m_userModifiedParameters.contains("MemorySize")) 98 { 99 ULONG recommendedRam = type.GetRecommendedRAM(); 100 m_pHardwareWidgetContainer->setMemorySize(recommendedRam); 101 pWizard->setMemorySize(recommendedRam); 102 } 103 if (!m_userModifiedParameters.contains("CPUCount")) 104 { 105 ULONG recommendedCPUs = type.GetRecommendedCPUCount(); 106 m_pHardwareWidgetContainer->setCPUCount(recommendedCPUs); 107 pWizard->setCPUCount(recommendedCPUs); 108 } 109 if (!m_userModifiedParameters.contains("EFIEnabled")) 110 { 111 KFirmwareType fwType = type.GetRecommendedFirmware(); 112 m_pHardwareWidgetContainer->setEFIEnabled(fwType != KFirmwareType_BIOS); 113 pWizard->setEFIEnabled(fwType != KFirmwareType_BIOS); 114 } 115 m_pHardwareWidgetContainer->blockSignals(false); 98 ULONG recommendedRam = type.getRecommendedRAM(); 99 m_pHardwareWidgetContainer->setMemorySize(recommendedRam); 100 pWizard->setMemorySize(recommendedRam); 116 101 } 102 if (!m_userModifiedParameters.contains("CPUCount")) 103 { 104 ULONG recommendedCPUs = type.getRecommendedCPUCount(); 105 m_pHardwareWidgetContainer->setCPUCount(recommendedCPUs); 106 pWizard->setCPUCount(recommendedCPUs); 107 } 108 if (!m_userModifiedParameters.contains("EFIEnabled")) 109 { 110 KFirmwareType fwType = type.getRecommendedFirmware(); 111 m_pHardwareWidgetContainer->setEFIEnabled(fwType != KFirmwareType_BIOS); 112 pWizard->setEFIEnabled(fwType != KFirmwareType_BIOS); 113 } 114 m_pHardwareWidgetContainer->blockSignals(false); 117 115 } 118 116 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMSummaryPage.cpp
r98103 r101253 354 354 pNameRoot->addChild(UIWizardNewVM::tr("Machine Folder"), pWizard->machineFolder()); 355 355 pNameRoot->addChild(UIWizardNewVM::tr("ISO Image"), pWizard->ISOFilePath()); 356 pNameRoot->addChild(UIWizardNewVM::tr("Guest OS Type"), pWizard->guestOSType(). GetDescription());356 pNameRoot->addChild(UIWizardNewVM::tr("Guest OS Type"), pWizard->guestOSType().getDescription()); 357 357 358 358 const QString &ISOPath = pWizard->ISOFilePath();
Note:
See TracChangeset
for help on using the changeset viewer.