VirtualBox

Changeset 14354 in vbox


Ignore:
Timestamp:
Nov 19, 2008 3:53:40 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
39570
Message:

FE/Qt4: 2928: Make better default video memory size: Added VM Settings warning about too low video memory assigned to VM for Fullscreen/Seamless modes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsGeneral.cpp

    r14340 r14354  
    2727#include <VBox/x86.h>
    2828
     29#include <QDesktopWidget>
    2930#include <QDir>
    3031
     
    373374{
    374375    ulong fullSize = vboxGlobal().virtualBox().GetHost().GetMemorySize();
     376    QSize desktopRes = QApplication::desktop()->screenGeometry().size();
     377    quint64 needBits = (desktopRes.width() /* display width */
     378                        * desktopRes.height() /* display height */
     379                        * 32 /* will take max possible bpp for now */
     380                        + _1M * 8 /* current cache per screen - may be changed in future */)
     381                        * (mMachine.isNull() ? 1 : mMachine.GetMonitorCount())
     382                        + 4096 * 8 /* adapter info */;
     383    quint64 needBytes = needBits % 8 ? needBits / 8 + _1M :
     384                        needBits / 8 /* to bytes */;
    375385
    376386    if (mSlRam->value() + mSlVideo->value() > 0.75 * fullSize)
    377387    {
    378         aWarning = tr ("You have assigned more than 75% of your computer's memory to "
     388        aWarning = tr ("You have assigned more than 75% of your computer's memory (%1) to "
    379389                       "the virtual machine. Not enough memory is left for your host "
    380                        "operating system. Please select a smaller amount. Error found");
     390                       "operating system. Please select a smaller amount. Error found")
     391                       .arg (vboxGlobal().formatSize (fullSize * _1M));
    381392        return false;
    382393    } else
    383394    if (mSlRam->value() + mSlVideo->value() > 0.5 * fullSize)
    384395    {
    385         aWarning = tr ("You have assigned more than 50% of your computer's memory to "
     396        aWarning = tr ("You have assigned more than 50% of your computer's memory (%1) to "
    386397                       "the virtual machine. Not enough memory might be left for your host "
    387                        "operating system. Continue at your own risk. Problem found");
     398                       "operating system. Continue at your own risk. Problem found")
     399                       .arg (vboxGlobal().formatSize (fullSize * _1M));
     400        return true;
     401    } else
     402    if (mSlVideo->value() * _1M < needBytes)
     403    {
     404        aWarning = tr ("You have assigned less than %1 for video memory. This is the minimum "
     405                       "requirement which allow you to operate the guest in fullscreen & "
     406                       " seamless modes. Continue at your own risk. Problem found")
     407                       .arg (vboxGlobal().formatSize (needBytes));
    388408        return true;
    389409    }
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