VirtualBox

Changeset 84880 in vbox for trunk


Ignore:
Timestamp:
Jun 19, 2020 12:07:26 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9515. Using the VCPU count while creating the vm.

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

Legend:

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

    r84874 r84880  
    131131    /* The newer and less tested way of configuring vms: */
    132132    m_machine.ApplyDefaults(QString());
    133     /* correct the RAM size. IMachine::applyDefaults may have overwritten the user setting: */
     133    /* Apply user preferences again. IMachine::applyDefaults may have overwritten the user setting: */
    134134    m_machine.SetMemorySize(field("baseMemory").toUInt());
     135    m_machine.SetCPUCount(field("VCPUCount").toUInt());
    135136    /* Correct the VRAM size since API does not take fullscreen memory requirements into account: */
    136137    CGraphicsAdapter comGraphics = m_machine.GetGraphicsAdapter();
     
    155156    /* RAM size: */
    156157    m_machine.SetMemorySize(field("baseMemory").toInt());
     158    /* VCPU count: */
     159    m_machine.SetCPUCount(field("VCPUCount").toUInt());
     160
    157161
    158162    /* Graphics Controller type: */
     
    375379        case WizardMode_Basic:
    376380        {
    377             UIWizardNewVMPageBasic1 *pPage1 = qobject_cast<UIWizardNewVMPageBasic1*> (page(Page1));
    378             if (pPage1)
    379                 pPage1->cleanupMachineFolder(true);
     381            UIWizardNewVMPageBasic1 *pPage = qobject_cast<UIWizardNewVMPageBasic1*> (page(Page2));
     382            /* Make sure that we were able to find the page that created the folder. */
     383            Assert(pPage);
     384            if (pPage)
     385                pPage->cleanupMachineFolder(true);
    380386            break;
    381387        }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.cpp

    r84879 r84880  
    4747}
    4848
     49int UIWizardNewVMPage2::VCPUCount() const
     50{
     51    if (!m_pVirtualCPUEditor)
     52        return 1;
     53    return m_pVirtualCPUEditor->value();
     54}
     55
    4956UIWizardNewVMPageBasic2::UIWizardNewVMPageBasic2()
    5057    : m_pLabel(0)
     
    7077    /* Register fields: */
    7178    registerField("baseMemory", this, "baseMemory");
     79    registerField("VCPUCount", this, "VCPUCount");
    7280}
    7381
     
    9098    CGuestOSType type = field("type").value<CGuestOSType>();
    9199    m_pBaseMemoryEditor->setValue(type.GetRecommendedRAM());
     100    m_pVirtualCPUEditor->setValue(1);
    92101
    93102    /* 'Ram' field should have focus initially: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.h

    r84879 r84880  
    4242
    4343    int baseMemory() const;
     44    int VCPUCount() const;
    4445
    4546    /* Widgets: */
     
    5354    Q_OBJECT;
    5455    Q_PROPERTY(int baseMemory READ baseMemory);
     56    Q_PROPERTY(int VCPUCount READ VCPUCount);
    5557
    5658public:
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