diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-03-11 17:36:49 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-03-11 17:41:41 -0700 |
commit | 751c76a5787c4072da836c27f1af913dc671a52e (patch) | |
tree | 28ec33a385c18f6c2ba16b935543498a53d06a82 /qt-ui/preferences.cpp | |
parent | 9f37bac07a06870bc3e5d1c150496ed347a4de99 (diff) | |
download | subsurface-751c76a5787c4072da836c27f1af913dc671a52e.tar.gz |
Support save / load for the Animation Speed on the Preferences
User can now fine-tune the animation speed on the preferences,
a value of zero disables it completely.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/preferences.cpp')
-rw-r--r-- | qt-ui/preferences.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index 03123858b..e2473d66b 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -105,6 +105,11 @@ void PreferencesDialog::setUiFromPrefs() QModelIndexList languages = m->match(m->index(0, 0), Qt::UserRole, s.value("UiLanguage").toString()); if (languages.count()) ui.languageView->setCurrentIndex(languages.first()); + + s.endGroup(); + s.beginGroup("Animations"); + int animVelocity = s.value("animation_speed",500).toInt(); + ui.velocitySlider->setValue(animVelocity); } void PreferencesDialog::restorePrefs() @@ -218,6 +223,8 @@ void PreferencesDialog::syncSettings() s.setValue("UiLanguage", ui.languageView->currentIndex().data(Qt::UserRole)); s.endGroup(); + s.beginGroup("Animations"); + s.setValue("animation_speed",ui.velocitySlider->value()); loadSettings(); emit settingsChanged(); } @@ -289,6 +296,10 @@ void PreferencesDialog::loadSettings() prefs.font_size = defaultFont.pointSizeF(); GET_INT("displayinvalid", display_invalid_dives); s.endGroup(); + + s.beginGroup("Animations"); + int animVelocity = s.value("animation_speed",500).toInt(); + ui.velocitySlider->setValue(animVelocity); } void PreferencesDialog::buttonClicked(QAbstractButton *button) |