aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/filterwidget2.cpp7
-rw-r--r--qt-models/filtermodels.h11
2 files changed, 14 insertions, 4 deletions
diff --git a/desktop-widgets/filterwidget2.cpp b/desktop-widgets/filterwidget2.cpp
index f1898ca38..66080cfca 100644
--- a/desktop-widgets/filterwidget2.cpp
+++ b/desktop-widgets/filterwidget2.cpp
@@ -10,6 +10,13 @@ FilterWidget2::FilterWidget2(QWidget* parent) : QWidget(parent)
ui.setupUi(this);
FilterData data;
+
+ // Use default values to set minimum and maximum air and water temperature.
+ ui.minAirTemp->setRange(data.minAirTemp, data.maxAirTemp);
+ ui.maxAirTemp->setRange(data.minAirTemp, data.maxAirTemp);
+ ui.minWaterTemp->setRange(data.minWaterTemp, data.maxWaterTemp);
+ ui.maxWaterTemp->setRange(data.minWaterTemp, data.maxWaterTemp);
+
ui.minRating->setCurrentStars(data.minRating);
ui.maxRating->setCurrentStars(data.maxRating);
ui.minVisibility->setCurrentStars(data.minVisibility);
diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h
index f9be3a2ad..1925bc422 100644
--- a/qt-models/filtermodels.h
+++ b/qt-models/filtermodels.h
@@ -20,10 +20,13 @@ struct FilterData {
int maxVisibility = 5;
int minRating = 0;
int maxRating = 5;
- double minWaterTemp = 0;
- double maxWaterTemp = 100;
- double minAirTemp = 0;
- double maxAirTemp = 100;
+ // The default minimum and maximum temperatures are set such that all
+ // physically reasonable dives are shown. Note that these values should
+ // work for both Celcius and Fahrenheit scales.
+ double minWaterTemp = -10;
+ double maxWaterTemp = 200;
+ double minAirTemp = -50;
+ double maxAirTemp = 200;
QDateTime fromDate;
QTime fromTime;
QDateTime toDate = QDateTime::currentDateTime();