diff options
author | jan Iversen <jani@apache.org> | 2018-07-04 21:45:48 +0200 |
---|---|---|
committer | jan Iversen <jani@apache.org> | 2018-07-12 18:44:31 +0200 |
commit | da61c1714f24d42f5295bcd60d704e65f503b174 (patch) | |
tree | ea323bfd7164a700c5d2b603fdf013ab2967a164 /core/subsurface-qt/SettingsObjectWrapper.cpp | |
parent | d7fed0bcb76cc1742f73577b70df048032f70a61 (diff) | |
download | subsurface-da61c1714f24d42f5295bcd60d704e65f503b174.tar.gz |
core: activate qPrefDisplay in SettingsObjectWrapper
add the prepared class qPrefDisplay to SettingsObjectWrapper and thereby making it active.
As a consequence of the uniform naming standard desktop-widgets/preferences_defaults.cpp and
tests/testpreferences.cpp have been updated.
Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/subsurface-qt/SettingsObjectWrapper.cpp')
-rw-r--r-- | core/subsurface-qt/SettingsObjectWrapper.cpp | 71 |
1 files changed, 1 insertions, 70 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp index 80b9df8ee..416c645b6 100644 --- a/core/subsurface-qt/SettingsObjectWrapper.cpp +++ b/core/subsurface-qt/SettingsObjectWrapper.cpp @@ -1913,75 +1913,6 @@ void GeneralSettingsObjectWrapper::setAutoRecalculateThumbnails(bool value) emit autoRecalculateThumbnailsChanged(value); } -DisplaySettingsObjectWrapper::DisplaySettingsObjectWrapper(QObject *parent) : - QObject(parent) -{ -} - -QString DisplaySettingsObjectWrapper::divelistFont() const -{ - return prefs.divelist_font; -} - -double DisplaySettingsObjectWrapper::fontSize() const -{ - return prefs.font_size; -} - -bool DisplaySettingsObjectWrapper::displayInvalidDives() const -{ - return prefs.display_invalid_dives; -} - -void DisplaySettingsObjectWrapper::setDivelistFont(const QString& value) -{ - - QString newValue = value; - if (value.contains(",")) - newValue = value.left(value.indexOf(",")); - - if (newValue == prefs.divelist_font) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("divelist_font", value); - - if (!subsurface_ignore_font(qPrintable(newValue))) { - free((void *)prefs.divelist_font); - prefs.divelist_font = copy_qstring(newValue); - qApp->setFont(QFont(newValue)); - } - emit divelistFontChanged(newValue); -} - -void DisplaySettingsObjectWrapper::setFontSize(double value) -{ - if (value == prefs.font_size) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("font_size", value); - prefs.font_size = value; - QFont defaultFont = qApp->font(); - defaultFont.setPointSizeF(prefs.font_size); - qApp->setFont(defaultFont); - emit fontSizeChanged(value); -} - -void DisplaySettingsObjectWrapper::setDisplayInvalidDives(bool value) -{ - if (value == prefs.display_invalid_dives) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("displayinvalid", value); - prefs.display_invalid_dives = value; - emit displayInvalidDivesChanged(value); -} - LanguageSettingsObjectWrapper::LanguageSettingsObjectWrapper(QObject *parent) : QObject(parent) { @@ -2194,7 +2125,7 @@ QObject(parent), planner_settings(new DivePlannerSettings(this)), unit_settings(new UnitsSettings(this)), general_settings(new GeneralSettingsObjectWrapper(this)), - display_settings(new DisplaySettingsObjectWrapper(this)), + display_settings(new qPrefDisplay(this)), language_settings(new LanguageSettingsObjectWrapper(this)), animation_settings(new AnimationsSettingsObjectWrapper(this)), location_settings(new LocationServiceSettingsObjectWrapper(this)), |