- Timestamp:
- Oct 21, 2024 3:00:09 PM (6 weeks ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.cpp
r105523 r106566 89 89 { 90 90 /* Calculate summary required memory amount in bits: */ 91 uNeedBits += (screenSize.at(i) * /* wi th x height */91 uNeedBits += (screenSize.at(i) * /* width x height */ 92 92 32 + /* we will take the maximum possible bpp for now */ 93 93 8 * _1M) + /* current cache per screen - may be changed in future */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIVideoMemoryEditor.cpp
r105119 r106566 54 54 , m_iMinVRAM(0) 55 55 , m_iMaxVRAM(0) 56 , m_iMaxVRAMVisible(0)57 56 , m_pLayout(0) 58 57 , m_pLabelMemory(0) … … 189 188 if (m_pLabelMemoryMax) 190 189 { 191 m_pLabelMemoryMax->setText(tr("%1 MB").arg(m_iMaxVRAM Visible));190 m_pLabelMemoryMax->setText(tr("%1 MB").arg(m_iMaxVRAM)); 192 191 m_pLabelMemoryMax->setToolTip(tr("Maximum possible video memory size.")); 193 192 } … … 228 227 m_iMinVRAM = comProperties.GetMinGuestVRAM(); 229 228 m_iMaxVRAM = comProperties.GetMaxGuestVRAM(); 230 m_iMaxVRAMVisible = m_iMaxVRAM;231 229 232 230 /* Create main layout: */ … … 255 253 { 256 254 m_pSlider->setMinimum(m_iMinVRAM); 257 m_pSlider->setMaximum(m_iMaxVRAM Visible);258 m_pSlider->setPageStep(calculatePageStep(m_iMaxVRAM Visible));255 m_pSlider->setMaximum(m_iMaxVRAM); 256 m_pSlider->setPageStep(calculatePageStep(m_iMaxVRAM)); 259 257 m_pSlider->setSingleStep(m_pSlider->pageStep() / 4); 260 258 m_pSlider->setTickInterval(m_pSlider->pageStep()); … … 302 300 m_pLabelMemory->setBuddy(m_pSpinBox); 303 301 m_pSpinBox->setMinimum(m_iMinVRAM); 304 m_pSpinBox->setMaximum(m_iMaxVRAM Visible);302 m_pSpinBox->setMaximum(m_iMaxVRAM); 305 303 connect(m_pSpinBox, &QSpinBox::valueChanged, 306 304 this, &UIVideoMemoryEditor::sltHandleSpinBoxChange); … … 320 318 321 319 /* Init visible maximum VRAM: */ 322 m_iMaxVRAMVisible = m_cGuestScreenCount * 32;320 int iMaxVRAMVisible = m_cGuestScreenCount * 32; 323 321 324 322 /* Get monitors count and recommended VRAM: */ … … 326 324 327 325 /* Adjust visible maximum VRAM to be no less than 128MB (if possible): */ 328 if ( m_iMaxVRAMVisible < 128 && m_iMaxVRAM >= 128)329 m_iMaxVRAMVisible = 128;326 if (iMaxVRAMVisible < 128 && m_iMaxVRAM >= 128) 327 iMaxVRAMVisible = 128; 330 328 331 329 #ifdef VBOX_WITH_3D_ACCELERATION … … 335 333 iNeedMBytes = qMax(iNeedMBytes, 128); 336 334 /* Adjust visible maximum VRAM to be no less than 256MB (if possible): */ 337 if ( m_iMaxVRAMVisible < 256 && m_iMaxVRAM >= 256)338 m_iMaxVRAMVisible = 256;335 if (iMaxVRAMVisible < 256 && m_iMaxVRAM >= 256) 336 iMaxVRAMVisible = 256; 339 337 } 340 338 #endif /* VBOX_WITH_3D_ACCELERATION */ 341 339 342 340 /* Adjust visible maximum VRAM to be no less than initial VRAM: */ 343 m_iMaxVRAMVisible = qMax(m_iMaxVRAMVisible, m_iValue);341 iMaxVRAMVisible = qMax(iMaxVRAMVisible, m_iValue); 344 342 /* Adjust visible maximum VRAM to be no less than recommended VRAM: */ 345 m_iMaxVRAMVisible = qMax(m_iMaxVRAMVisible, iNeedMBytes);343 iMaxVRAMVisible = qMax(iMaxVRAMVisible, iNeedMBytes); 346 344 347 345 /* Adjust recommended VRAM to be no more than actual maximum VRAM: */ 348 346 iNeedMBytes = qMin(iNeedMBytes, m_iMaxVRAM); 349 347 /* Adjust visible maximum VRAM to be no more than actual maximum VRAM: */ 350 m_iMaxVRAMVisible = qMin(m_iMaxVRAMVisible, m_iMaxVRAM);348 iMaxVRAMVisible = qMin(iMaxVRAMVisible, m_iMaxVRAM); 351 349 352 350 if (m_pSpinBox) 353 m_pSpinBox->setMaximum( m_iMaxVRAMVisible);351 m_pSpinBox->setMaximum(iMaxVRAMVisible); 354 352 if (m_pSlider) 355 353 { 356 m_pSlider->setMaximum( m_iMaxVRAMVisible);357 m_pSlider->setPageStep(calculatePageStep( m_iMaxVRAMVisible));358 m_pSlider->setWarningHint(1, qMin(iNeedMBytes, m_iMaxVRAMVisible));359 m_pSlider->setOptimalHint(qMin(iNeedMBytes, m_iMaxVRAMVisible), m_iMaxVRAMVisible);354 m_pSlider->setMaximum(iMaxVRAMVisible); 355 m_pSlider->setPageStep(calculatePageStep(iMaxVRAMVisible)); 356 m_pSlider->setWarningHint(1, qMin(iNeedMBytes, iMaxVRAMVisible)); 357 m_pSlider->setOptimalHint(qMin(iNeedMBytes, iMaxVRAMVisible), iMaxVRAMVisible); 360 358 } 361 359 if (m_pLabelMemoryMax) 362 m_pLabelMemoryMax->setText(tr("%1 MB").arg( m_iMaxVRAMVisible));360 m_pLabelMemoryMax->setText(tr("%1 MB").arg(iMaxVRAMVisible)); 363 361 } 364 362 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIVideoMemoryEditor.h
r106061 r106566 130 130 /** Holds the maximum upper limit of VRAM (MiB). */ 131 131 int m_iMaxVRAM; 132 /** Holds the upper limit of VRAM (MiB) for this dialog.133 * @note This value is lower than m_iMaxVRAM to save134 * careless users from setting useless big values. */135 int m_iMaxVRAMVisible;136 132 /** @} */ 137 133
Note:
See TracChangeset
for help on using the changeset viewer.