VirtualBox

Changeset 23025 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Sep 15, 2009 9:38:15 AM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: fix the RAMSlider for many host RAM

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

Legend:

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

    r22865 r23025  
    7979        }
    8080#endif /* Q_WS_MAC */
    81         if (mMinOpt != -1 &&
    82             mMaxOpt != -1)
     81        if ((mMinOpt != -1 &&
     82             mMaxOpt != -1) &&
     83            mMinOpt != mMaxOpt)
    8384        {
    8485            int posMinOpt = QStyle::sliderPositionFromValue (opt.minimum, opt.maximum, mMinOpt, available);
     
    8687            p.fillRect (ticks.x() + posMinOpt, ticks.y(), posMaxOpt - posMinOpt + 1, ticks.height(), mOptColor);
    8788        }
    88         if (mMinWrn != -1 &&
    89             mMaxWrn != -1)
     89        if ((mMinWrn != -1 &&
     90             mMaxWrn != -1) &&
     91            mMinWrn != mMaxWrn)
    9092        {
    9193            int posMinWrn = QStyle::sliderPositionFromValue (opt.minimum, opt.maximum, mMinWrn, available);
     
    9395            p.fillRect (ticks.x() + posMinWrn, ticks.y(), posMaxWrn - posMinWrn + 1, ticks.height(), mWrnColor);
    9496        }
    95         if (mMinErr != -1 &&
    96             mMaxErr != -1)
     97        if ((mMinErr != -1 &&
     98             mMaxErr != -1) &&
     99            mMinErr != mMaxErr)
    97100        {
    98101            int posMinErr = QStyle::sliderPositionFromValue (opt.minimum, opt.maximum, mMinErr, available);
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGuestRAMSlider.cpp

    r21347 r23025  
    142142        mMaxRAMOpt = (uint)(0.90 * fullSize);
    143143    }
     144    /* Now check the calculated maximums are out of the range for the guest
     145     * RAM. If so change it accordingly. */
     146    mMaxRAMAlw  = RT_MIN (mMaxRAMAlw, mMaxRAM);
     147    mMaxRAMOpt  = RT_MIN (mMaxRAMOpt, mMaxRAM);
    144148
    145149    setPageStep (calcPageStep (mMaxRAM));
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