diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp
index 56cd086807..f9d8e1e1d8 100644
--- a/apps/launcher/graphicspage.cpp
+++ b/apps/launcher/graphicspage.cpp
@@ -44,6 +44,7 @@ Launcher::GraphicsPage::GraphicsPage(Files::ConfigurationManager &cfg, Settings:
connect(fullScreenCheckBox, SIGNAL(stateChanged(int)), this, SLOT(slotFullScreenChanged(int)));
connect(standardRadioButton, SIGNAL(toggled(bool)), this, SLOT(slotStandardToggled(bool)));
connect(screenComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(screenChanged(int)));
+ connect(framerateLimitCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotFramerateLimitToggled(bool)));
}
@@ -121,6 +122,17 @@ bool Launcher::GraphicsPage::loadSettings()
customHeightSpinBox->setValue(height);
}
+ float fpsLimit = mEngineSettings.getFloat("framerate limit", "Video");
+ if (fpsLimit != 0)
+ {
+ framerateLimitCheckBox->setCheckState(Qt::Checked);
+ framerateLimitSpinBox->setValue(fpsLimit);
+ }
+ else
+ {
+ framerateLimitSpinBox->setEnabled(false);
+ }
+
return true;
}
@@ -166,6 +178,17 @@ void Launcher::GraphicsPage::saveSettings()
int cScreen = screenComboBox->currentIndex();
if (cScreen != mEngineSettings.getInt("screen", "Video"))
mEngineSettings.setInt("screen", "Video", cScreen);
+
+ if (framerateLimitCheckBox->checkState())
+ {
+ float cFpsLimit = framerateLimitSpinBox->value();
+ if (cFpsLimit != mEngineSettings.getFloat("framerate limit", "Video"))
+ mEngineSettings.setFloat("framerate limit", "Video", cFpsLimit);
+ }
+ else if (mEngineSettings.getFloat("framerate limit", "Video") != 0)
+ {
+ mEngineSettings.setFloat("framerate limit", "Video", 0);
+ }
}
QStringList Launcher::GraphicsPage::getAvailableResolutions(int screen)
@@ -266,3 +289,8 @@ void Launcher::GraphicsPage::slotStandardToggled(bool checked)
customHeightSpinBox->setEnabled(true);
}
}
+
+void Launcher::GraphicsPage::slotFramerateLimitToggled(bool checked)
+{
+ framerateLimitSpinBox->setEnabled(checked);
+}
diff --git a/apps/launcher/graphicspage.hpp b/apps/launcher/graphicspage.hpp
index 9d943d5e29..05915e6805 100644
--- a/apps/launcher/graphicspage.hpp
+++ b/apps/launcher/graphicspage.hpp
@@ -31,6 +31,7 @@ namespace Launcher
private slots:
void slotFullScreenChanged(int state);
void slotStandardToggled(bool checked);
+ void slotFramerateLimitToggled(bool checked);
private:
Files::ConfigurationManager &mCfgMgr;
diff --git a/files/ui/graphicspage.ui b/files/ui/graphicspage.ui
index 0afda6ac7a..1f91fb19d1 100644
--- a/files/ui/graphicspage.ui
+++ b/files/ui/graphicspage.ui
@@ -62,6 +62,13 @@
+ -
+
+
+ Framerate limit
+
+
+
-
-
@@ -143,6 +150,28 @@
+ -
+
+
+ FPS
+
+
+ 1
+
+
+ 1
+
+
+ 999
+
+
+ 15
+
+
+ 300
+
+
+