summaryrefslogtreecommitdiff
path: root/src/gui/setup_video.cpp
diff options
context:
space:
mode:
authorStefan Dombrowski <stefan@uni-bonn.de>2010-10-17 22:16:01 +0200
committerStefan Dombrowski <stefan@uni-bonn.de>2010-10-17 22:16:01 +0200
commitde8317bc5ac2d6ab3d60697a660a7bf49e7dedc5 (patch)
tree65ee10dc45e36c678e630ee92560f54cb5e10223 /src/gui/setup_video.cpp
parentbe599ed0d7b1c1e70cb593dcdfae69fad926e6b7 (diff)
downloadmana-de8317bc5ac2d6ab3d60697a660a7bf49e7dedc5.tar.gz
mana-de8317bc5ac2d6ab3d60697a660a7bf49e7dedc5.tar.bz2
mana-de8317bc5ac2d6ab3d60697a660a7bf49e7dedc5.tar.xz
mana-de8317bc5ac2d6ab3d60697a660a7bf49e7dedc5.zip
Making the setup for lowcpu robust
Reviewed-by: Bertram, Thorbjorn
Diffstat (limited to 'src/gui/setup_video.cpp')
-rw-r--r--src/gui/setup_video.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp
index 1a3d15bf..329b70d1 100644
--- a/src/gui/setup_video.cpp
+++ b/src/gui/setup_video.cpp
@@ -273,6 +273,7 @@ Setup_Video::Setup_Video():
mAlphaSlider->setValue(mOpacity);
mAlphaSlider->setWidth(90);
+ mAlphaSlider->setEnabled(!mLowCPUEnabled);
mFpsLabel->setCaption(mFps > 0 ? toString(mFps) : _("None"));
mFpsLabel->setWidth(60);
@@ -307,6 +308,7 @@ Setup_Video::Setup_Video():
mOpenGLCheckBox->setActionEventId("opengl");
mParticleDetailSlider->setActionEventId("particledetailslider");
mParticleDetailField->setActionEventId("particledetailfield");
+ mLowCPUCheckBox->setActionEventId("lowcpu");
mModeList->addActionListener(this);
mCustomCursorCheckBox->addActionListener(this);
@@ -466,9 +468,8 @@ void Setup_Video::apply()
_("Applying change to OpenGL requires restart."));
}
}
-
// If LowCPU is enabled from a disabled state we warn the user
- if (mLowCPUCheckBox->isSelected())
+ else if (mLowCPUCheckBox->isSelected())
{
if (config.getValue("lowcpu", true) == false)
{
@@ -531,11 +532,13 @@ void Setup_Video::cancel()
mNameCheckBox->setSelected(mNameEnabled);
mNPCLogCheckBox->setSelected(mNPCLogEnabled);
mAlphaSlider->setValue(mOpacity);
+ mAlphaSlider->setEnabled(!mLowCPUEnabled);
mOverlayDetailSlider->setValue(mOverlayDetail);
mParticleDetailSlider->setValue(mParticleDetail);
std::string text = mFpsCheckBox->isSelected() ? toString(mFps) : _("None");
mFpsLabel->setCaption(text);
mLowCPUCheckBox->setSelected(mLowCPUEnabled);
+ mLowCPUCheckBox->setEnabled(!mOpenGLEnabled);
config.setValue("screen", mFullScreenEnabled);
@@ -559,6 +562,7 @@ void Setup_Video::cancel()
config.setValue("opengl", mOpenGLEnabled);
config.setValue("showpickupchat", mPickupChatEnabled);
config.setValue("showpickupparticle", mPickupParticleEnabled);
+ config.setValue("lowcpu", mLowCPUEnabled);
}
void Setup_Video::action(const gcn::ActionEvent &event)
@@ -667,10 +671,17 @@ void Setup_Video::action(const gcn::ActionEvent &event)
mFpsSlider->setValue(mFps);
mFpsSlider->setEnabled(mFps > 0);
}
- else if (id == "opengl")
+ else if (id == "opengl" || id == "lowcpu")
{
// Disable low cpu mode when in OpenGL.
- mLowCPUCheckBox->setEnabled(!mOpenGLCheckBox->isSelected());
+ if (mOpenGLCheckBox->isSelected())
+ {
+ mLowCPUCheckBox->setSelected(false);
+ mLowCPUCheckBox->setEnabled(false);
+ }
+ else{
+ mLowCPUCheckBox->setEnabled(true);
+ }
// Disable gui opacity slider when disabling transparency.
if (mLowCPUCheckBox->isEnabled())
mAlphaSlider->setEnabled(!mLowCPUCheckBox->isSelected());