VirtualBox

Changeset 27413 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 16, 2010 3:23:16 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: update the visual hints from the memory slider on screen count change

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIAdvancedSlider.cpp

    r26712 r27413  
    222222    m_pSlider->m_minOpt = min;
    223223    m_pSlider->m_maxOpt = max;
     224
     225    update();
    224226}
    225227
     
    228230    m_pSlider->m_minWrn = min;
    229231    m_pSlider->m_maxWrn = max;
     232
     233    update();
    230234}
    231235
     
    234238    m_pSlider->m_minErr = min;
    235239    m_pSlider->m_maxErr = max;
     240
     241    update();
    236242}
    237243
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.cpp

    r27411 r27413  
    5454    /* Setup constants */
    5555    CSystemProperties sys = vboxGlobal().virtualBox().GetSystemProperties();
    56     const uint MinVRAM = sys.GetMinGuestVRAM();
    57     const uint MaxVRAM = sys.GetMaxGuestVRAM();
     56    m_minVRAM = sys.GetMinGuestVRAM();
     57    m_maxVRAM = sys.GetMaxGuestVRAM();
    5858    const uint MinMonitors = 1;
    5959    const uint MaxMonitors = sys.GetMaxGuestMonitors();
    6060
    6161    /* Setup validators */
    62     mLeMemory->setValidator (new QIntValidator (MinVRAM, MaxVRAM, this));
     62    mLeMemory->setValidator (new QIntValidator (m_minVRAM, m_maxVRAM, this));
    6363    mLeMonitors->setValidator (new QIntValidator (MinMonitors, MaxMonitors, this));
    6464    mLeVRDPPort->setValidator (new QRegExpValidator (QRegExp ("(([0-9]{1,5}(\\-[0-9]{1,5}){0,1}),)*([0-9]{1,5}(\\-[0-9]{1,5}){0,1})"), this));
     
    7272
    7373    /* Setup initial values */
    74     mSlMemory->setPageStep (calcPageStep (MaxVRAM));
     74    mSlMemory->setPageStep (calcPageStep (m_maxVRAM));
    7575    mSlMemory->setSingleStep (mSlMemory->pageStep() / 4);
    7676    mSlMemory->setTickInterval (mSlMemory->pageStep());
     
    7979    mSlMonitors->setTickInterval (1);
    8080    /* Setup the scale so that ticks are at page step boundaries */
    81     mSlMemory->setMinimum ((MinVRAM / mSlMemory->pageStep()) * mSlMemory->pageStep());
    82     mSlMemory->setMaximum (MaxVRAM);
     81    mSlMemory->setMinimum ((m_minVRAM / mSlMemory->pageStep()) * mSlMemory->pageStep());
     82    mSlMemory->setMaximum (m_maxVRAM);
    8383    mSlMemory->setSnappingEnabled (true);
    8484    quint64 needMBytes = VBoxGlobal::requiredVideoMemory (&mMachine) / _1M;
    8585    mSlMemory->setErrorHint (0, 1);
    8686    mSlMemory->setWarningHint (1, needMBytes);
    87     mSlMemory->setOptimalHint (needMBytes, MaxVRAM);
     87    mSlMemory->setOptimalHint (needMBytes, m_maxVRAM);
    8888    mSlMonitors->setMinimum (MinMonitors);
    8989    mSlMonitors->setMaximum (MaxMonitors);
     
    310310#endif /* VBOX_WITH_VIDEOHWACCEL */
    311311    mCb3D->setEnabled(cVal == 1 && vboxGlobal().virtualBox().GetHost().GetAcceleration3DAvailable());
    312 }
    313 
     312
     313    /* The memory requirements have changed too. */
     314    quint64 needMBytes = VBoxGlobal::requiredVideoMemory (&mMachine, cVal) / _1M;
     315    mSlMemory->setWarningHint (1, needMBytes);
     316    mSlMemory->setOptimalHint (needMBytes, m_maxVRAM);
     317}
     318
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/vm/VBoxVMSettingsDisplay.h

    r27406 r27413  
    6666    CMachine mMachine;
    6767    QIWidgetValidator *mValidator;
     68
     69    int m_minVRAM;
     70    int m_maxVRAM;
    6871};
    6972
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