VirtualBox

Changeset 91616 in vbox


Ignore:
Timestamp:
Oct 7, 2021 10:50:28 AM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: 9996. Fixing several initialization issues on hardware parameters.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
Files:
2 edited

Legend:

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

    r91593 r91616  
    313313    ULONG recommendedRam = type.GetRecommendedRAM();
    314314
    315     /* Set memory size of the widget and (through signals) wizard: */
    316     if (m_pHardwareWidgetContainer && !m_userModifiedParameters.contains("MemorySize"))
    317         m_pHardwareWidgetContainer->setMemorySize(recommendedRam);
    318 
    319 
    320     KFirmwareType fwType = type.GetRecommendedFirmware();
    321     if (m_pHardwareWidgetContainer && !m_userModifiedParameters.contains("EFIEnabled"))
     315    if (m_pHardwareWidgetContainer)
    322316    {
    323317        m_pHardwareWidgetContainer->blockSignals(true);
    324         m_pHardwareWidgetContainer->setEFIEnabled(fwType != KFirmwareType_BIOS);
     318
     319        /* Set memory size of the widget and the wizard: */
     320        if (!m_userModifiedParameters.contains("MemorySize"))
     321        {
     322            m_pHardwareWidgetContainer->setMemorySize(recommendedRam);
     323            pWizard->setMemorySize(recommendedRam);
     324        }
     325
     326        /* Set Firmware Type of the widget and the wizard: */
     327        KFirmwareType fwType = type.GetRecommendedFirmware();
     328        if (!m_userModifiedParameters.contains("EFIEnabled"))
     329        {
     330            m_pHardwareWidgetContainer->setEFIEnabled(fwType != KFirmwareType_BIOS);
     331            pWizard->setEFIEnabled(fwType != KFirmwareType_BIOS);
     332        }
     333
     334        /* Initialize CPU count:*/
     335        int iCPUCount = type.GetRecommendedCPUCount();
     336        if (!m_userModifiedParameters.contains("CPUCount"))
     337        {
     338            m_pHardwareWidgetContainer->setCPUCount(iCPUCount);
     339            pWizard->setCPUCount(iCPUCount);
     340        }
    325341        m_pHardwareWidgetContainer->blockSignals(false);
    326342    }
     343
    327344    LONG64 iRecommendedDiskSize = type.GetRecommendedHDD();
    328 
    329345    /* Prepare initial disk choice: */
    330346    if (!m_userModifiedParameters.contains("SelectedDiskSource"))
     
    766782    AssertReturnVoid(wizardWindow<UIWizardNewVM>());
    767783    wizardWindow<UIWizardNewVM>()->setCPUCount(iCount);
     784    m_userModifiedParameters << "CPUCount";
    768785}
    769786
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMHardwarePage.cpp

    r91474 r91616  
    8484        if (!type.isNull())
    8585        {
     86            m_pHardwareWidgetContainer->blockSignals(true);
    8687            if (!m_userModifiedParameters.contains("MemorySize"))
    8788            {
    8889                ULONG recommendedRam = type.GetRecommendedRAM();
    8990                m_pHardwareWidgetContainer->setMemorySize(recommendedRam);
     91                pWizard->setMemorySize(recommendedRam);
    9092            }
    9193            if (!m_userModifiedParameters.contains("CPUCount"))
     
    9395                ULONG recommendedCPUs = type.GetRecommendedCPUCount();
    9496                m_pHardwareWidgetContainer->setCPUCount(recommendedCPUs);
     97                pWizard->setCPUCount(recommendedCPUs);
    9598            }
    9699            if (!m_userModifiedParameters.contains("EFIEnabled"))
     
    98101                KFirmwareType fwType = type.GetRecommendedFirmware();
    99102                m_pHardwareWidgetContainer->setEFIEnabled(fwType != KFirmwareType_BIOS);
     103                pWizard->setEFIEnabled(fwType != KFirmwareType_BIOS);
    100104            }
     105            m_pHardwareWidgetContainer->blockSignals(false);
    101106        }
    102107    }
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