VirtualBox

Changeset 106566 in vbox for trunk/src


Ignore:
Timestamp:
Oct 21, 2024 3:00:09 PM (6 weeks ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10767: VM settings / Display page: Cleanup for VRAM editor; No need to cache max VRAM visible size as we are using it in one place only.

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  
    8989    {
    9090        /* Calculate summary required memory amount in bits: */
    91         uNeedBits += (screenSize.at(i) * /* with x height */
     91        uNeedBits += (screenSize.at(i) * /* width x height */
    9292                     32 + /* we will take the maximum possible bpp for now */
    9393                     8 * _1M) + /* current cache per screen - may be changed in future */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIVideoMemoryEditor.cpp

    r105119 r106566  
    5454    , m_iMinVRAM(0)
    5555    , m_iMaxVRAM(0)
    56     , m_iMaxVRAMVisible(0)
    5756    , m_pLayout(0)
    5857    , m_pLabelMemory(0)
     
    189188    if (m_pLabelMemoryMax)
    190189    {
    191         m_pLabelMemoryMax->setText(tr("%1 MB").arg(m_iMaxVRAMVisible));
     190        m_pLabelMemoryMax->setText(tr("%1 MB").arg(m_iMaxVRAM));
    192191        m_pLabelMemoryMax->setToolTip(tr("Maximum possible video memory size."));
    193192    }
     
    228227    m_iMinVRAM = comProperties.GetMinGuestVRAM();
    229228    m_iMaxVRAM = comProperties.GetMaxGuestVRAM();
    230     m_iMaxVRAMVisible = m_iMaxVRAM;
    231229
    232230    /* Create main layout: */
     
    255253            {
    256254                m_pSlider->setMinimum(m_iMinVRAM);
    257                 m_pSlider->setMaximum(m_iMaxVRAMVisible);
    258                 m_pSlider->setPageStep(calculatePageStep(m_iMaxVRAMVisible));
     255                m_pSlider->setMaximum(m_iMaxVRAM);
     256                m_pSlider->setPageStep(calculatePageStep(m_iMaxVRAM));
    259257                m_pSlider->setSingleStep(m_pSlider->pageStep() / 4);
    260258                m_pSlider->setTickInterval(m_pSlider->pageStep());
     
    302300                m_pLabelMemory->setBuddy(m_pSpinBox);
    303301            m_pSpinBox->setMinimum(m_iMinVRAM);
    304             m_pSpinBox->setMaximum(m_iMaxVRAMVisible);
     302            m_pSpinBox->setMaximum(m_iMaxVRAM);
    305303            connect(m_pSpinBox, &QSpinBox::valueChanged,
    306304                    this, &UIVideoMemoryEditor::sltHandleSpinBoxChange);
     
    320318
    321319    /* Init visible maximum VRAM: */
    322     m_iMaxVRAMVisible = m_cGuestScreenCount * 32;
     320    int iMaxVRAMVisible = m_cGuestScreenCount * 32;
    323321
    324322    /* Get monitors count and recommended VRAM: */
     
    326324
    327325    /* 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;
    330328
    331329#ifdef VBOX_WITH_3D_ACCELERATION
     
    335333        iNeedMBytes = qMax(iNeedMBytes, 128);
    336334        /* 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;
    339337    }
    340338#endif /* VBOX_WITH_3D_ACCELERATION */
    341339
    342340    /* 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);
    344342    /* Adjust visible maximum VRAM to be no less than recommended VRAM: */
    345     m_iMaxVRAMVisible = qMax(m_iMaxVRAMVisible, iNeedMBytes);
     343    iMaxVRAMVisible = qMax(iMaxVRAMVisible, iNeedMBytes);
    346344
    347345    /* Adjust recommended VRAM to be no more than actual maximum VRAM: */
    348346    iNeedMBytes = qMin(iNeedMBytes, m_iMaxVRAM);
    349347    /* 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);
    351349
    352350    if (m_pSpinBox)
    353         m_pSpinBox->setMaximum(m_iMaxVRAMVisible);
     351        m_pSpinBox->setMaximum(iMaxVRAMVisible);
    354352    if (m_pSlider)
    355353    {
    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);
    360358    }
    361359    if (m_pLabelMemoryMax)
    362         m_pLabelMemoryMax->setText(tr("%1 MB").arg(m_iMaxVRAMVisible));
     360        m_pLabelMemoryMax->setText(tr("%1 MB").arg(iMaxVRAMVisible));
    363361}
    364362
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIVideoMemoryEditor.h

    r106061 r106566  
    130130        /** Holds the maximum upper limit of VRAM (MiB). */
    131131        int  m_iMaxVRAM;
    132         /** Holds the upper limit of VRAM (MiB) for this dialog.
    133           * @note This value is lower than m_iMaxVRAM to save
    134           *       careless users from setting useless big values. */
    135         int  m_iMaxVRAMVisible;
    136132    /** @} */
    137133
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