summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/preferences
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-12-13 06:50:06 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-20 15:20:44 -0700
commit8585f0698cd1e52ee46bd0d91c5918acf26f3001 (patch)
treedac6648422c4c9193088c1f31bb6765358b38cd0 /desktop-widgets/preferences
parentca336d13e52ccde64f2d0e2962ee7dbd3fbea4f1 (diff)
downloadsubsurface-8585f0698cd1e52ee46bd0d91c5918acf26f3001.tar.gz
Dive filter: reset filter on change of display_invalid_dives flag
The user had to restart the application or manually change the filter if they changed the flag. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/preferences')
-rw-r--r--desktop-widgets/preferences/preferences_log.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/desktop-widgets/preferences/preferences_log.cpp b/desktop-widgets/preferences/preferences_log.cpp
index d9f33e6c7..ccbf566a4 100644
--- a/desktop-widgets/preferences/preferences_log.cpp
+++ b/desktop-widgets/preferences/preferences_log.cpp
@@ -6,6 +6,7 @@
#include "core/settings/qPrefDisplay.h"
#include "core/settings/qPrefCloudStorage.h"
#include "core/settings/qPrefDiveComputer.h"
+#include "core/subsurface-qt/divelistnotifier.h"
#include <QFileDialog>
#include <QProcess>
@@ -85,8 +86,14 @@ void PreferencesLog::syncSettings()
else if (ui->cloudDefaultFile->isChecked())
log->set_default_file_behavior(CLOUD_DEFAULT_FILE);
+ bool displayinvalid_changed = ui->displayinvalid->isChecked() != prefs.display_invalid_dives;
+
qPrefLog::set_show_average_depth(ui->show_average_depth->isChecked());
qPrefDisplay::set_display_invalid_dives(ui->displayinvalid->isChecked());
qPrefLog::set_extraEnvironmentalDefault(ui->extraEnvironmentalDefault->isChecked());
qPrefLog::set_salinityEditDefault(ui->salinityEditDefault->isChecked());
+
+ // TODO: Move to preferences code?
+ if (displayinvalid_changed)
+ emit diveListNotifier.filterReset();
}