Changeset 14354 in vbox
- Timestamp:
- Nov 19, 2008 3:53:40 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 39570
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsGeneral.cpp
r14340 r14354 27 27 #include <VBox/x86.h> 28 28 29 #include <QDesktopWidget> 29 30 #include <QDir> 30 31 … … 373 374 { 374 375 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 */; 375 385 376 386 if (mSlRam->value() + mSlVideo->value() > 0.75 * fullSize) 377 387 { 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 " 379 389 "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)); 381 392 return false; 382 393 } else 383 394 if (mSlRam->value() + mSlVideo->value() > 0.5 * fullSize) 384 395 { 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 " 386 397 "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)); 388 408 return true; 389 409 }
Note:
See TracChangeset
for help on using the changeset viewer.