VirtualBox

Changeset 78292 in vbox for trunk/src


Ignore:
Timestamp:
Apr 25, 2019 10:07:25 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8664. Correcting VRAM size after IMachine::applyDefaults call.

File:
1 edited

Legend:

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

    r78290 r78292  
    115115         * 2. or attach a new (empty) one.
    116116         * Usually we are assigning extra-data values through UIExtraDataManager,
    117          * but in that special case VM was not registered yet, so UIExtraDataManager is unaware of it. */
     117         * but in that special case VM was not registered yet, so UIExtraDataManager is unaware of it: */
    118118        if (field("virtualDiskId").toString().isNull() || !field("virtualDisk").value<CMedium>().isNull())
    119119            m_machine.SetExtraData(GUI_FirstRun, "yes");
    120120    }
    121121
    122 #if 1
    123     /* Configure the newly created vm here in GUI by several calls to API. */
     122#if 0
     123    /* Configure the newly created vm here in GUI by several calls to API: */
    124124    configureVM(strTypeId, type);
    125125#else
    126     /* The newer and less tested way of configuring vms. */
     126    /* The newer and less tested way of configuring vms: */
    127127    m_machine.ApplyDefaults(QString());
    128     /* Check (and correct if need be) RAM size. IMachine::applyDefaults may have overwritten the user setting. */
    129     if (m_machine.GetMemorySize() != field("ram").toUInt())
    130         m_machine.SetMemorySize(field("ram").toUInt());
     128    /* correct the RAM size. IMachine::applyDefaults may have overwritten the user setting: */
     129    m_machine.SetMemorySize(field("ram").toUInt());
     130    /* Correct the VRAM size since API does not take fullscreen memory requirements into account: */
     131    m_machine.SetVRAMSize(qMax(m_machine.GetVRAMSize(), (ULONG)(VBoxGlobal::requiredVideoMemory(strTypeId) / _1M)));
    131132#endif
    132133
     
    170171    if (!usbDeviceFilters.isNull() && comGuestType.GetRecommendedUSB3() && m_machine.GetUSBProxyAvailable())
    171172    {
    172         /* USB 3.0 is only available if the proper ExtPack is installed. */
     173        /* USB 3.0 is only available if the proper ExtPack is installed: */
    173174        CExtPackManager manager = vboxGlobal().virtualBox().GetExtensionPackManager();
    174175        if (manager.IsExtPackUsable(GUI_ExtPackName))
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