Changeset 106571 in vbox
- Timestamp:
- Oct 21, 2024 3:40:30 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIVideoMemoryEditor.cpp
r106570 r106571 40 40 41 41 /* COM includes: */ 42 #include "CPlatformProperties.h" 42 43 #include "CSystemProperties.h" 43 44 … … 182 183 if (m_pLabelMemoryMin) 183 184 { 185 m_pLabelMemoryMin->setText(tr("%1 MB").arg(0)); 184 186 m_pLabelMemoryMin->setToolTip(tr("Minimum possible video memory size.")); 185 187 } … … 314 316 return; 315 317 318 /* Acquire minimum and maximum visible VRAM size on the basis of platform data: */ 319 const KPlatformArchitecture enmArch = optionalFlags().contains("arch") 320 ? optionalFlags().value("arch").value<KPlatformArchitecture>() 321 : KPlatformArchitecture_x86; 322 CPlatformProperties comPlatformProperties = gpGlobalSession->virtualBox().GetPlatformProperties(enmArch); 323 bool f3DAccelerationEnabled = false; 324 #ifdef VBOX_WITH_3D_ACCELERATION 325 f3DAccelerationEnabled = m_f3DAccelerationEnabled; 326 #endif 327 ULONG uMinVRAM = 0, uMaxVRAM = 0; 328 comPlatformProperties.GetSupportedVRAMRange(m_enmGraphicsControllerType, f3DAccelerationEnabled, uMinVRAM, uMaxVRAM); 329 316 330 /* Init recommended VRAM according to guest OS type and screen count: */ 317 331 int iNeedMBytes = UIGuestOSTypeHelpers::requiredVideoMemory(m_strGuestOSTypeId, m_cGuestScreenCount) / _1M; … … 320 334 int iMaxVRAMVisible = m_cGuestScreenCount * 32; 321 335 /* Adjust visible maximum VRAM to be no less than 128MB (if possible): */ 322 if (iMaxVRAMVisible < 128 && m_iMaxVRAM >= 128)336 if (iMaxVRAMVisible < 128 && uMaxVRAM >= 128) 323 337 iMaxVRAMVisible = 128; 324 338 … … 330 344 331 345 /* Adjust visible maximum VRAM to be no less than 256MB (if possible): */ 332 if (iMaxVRAMVisible < 256 && m_iMaxVRAM >= 256)346 if (iMaxVRAMVisible < 256 && uMaxVRAM >= 256) 333 347 iMaxVRAMVisible = 256; 334 348 } … … 336 350 337 351 /* Adjust recommended VRAM to be no more than actual maximum VRAM: */ 338 iNeedMBytes = qMin(iNeedMBytes, m_iMaxVRAM);352 iNeedMBytes = qMin(iNeedMBytes, (int)uMaxVRAM); 339 353 340 354 /* Adjust visible maximum VRAM to be no less than initial VRAM: */ … … 343 357 iMaxVRAMVisible = qMax(iMaxVRAMVisible, iNeedMBytes); 344 358 /* Adjust visible maximum VRAM to be no more than actual maximum VRAM: */ 345 iMaxVRAMVisible = qMin(iMaxVRAMVisible, m_iMaxVRAM);359 iMaxVRAMVisible = qMin(iMaxVRAMVisible, (int)uMaxVRAM); 346 360 347 361 if (m_pSpinBox) … … 351 365 m_pSlider->setMaximum(iMaxVRAMVisible); 352 366 m_pSlider->setPageStep(calculatePageStep(iMaxVRAMVisible)); 353 m_pSlider->setWarningHint(1, qMin(iNeedMBytes, iMaxVRAMVisible)); 354 m_pSlider->setOptimalHint(qMin(iNeedMBytes, iMaxVRAMVisible), iMaxVRAMVisible); 367 m_pSlider->setErrorHint(0, uMinVRAM); 368 m_pSlider->setWarningHint(uMinVRAM, iNeedMBytes); 369 m_pSlider->setOptimalHint(iNeedMBytes, iMaxVRAMVisible); 355 370 } 356 371 if (m_pLabelMemoryMax)
Note:
See TracChangeset
for help on using the changeset viewer.