summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/filterwidget2.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-01-20 21:15:46 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-01-22 10:01:22 +1200
commit14700487730f3d5863ea810452c540d1bb4b9ca8 (patch)
tree49b48757dc517965354d3d43e2104c0e166aa5c9 /desktop-widgets/filterwidget2.cpp
parentb28e0bf0b9bf9ae0613aec25440eff2e2a7e85c3 (diff)
downloadsubsurface-14700487730f3d5863ea810452c540d1bb4b9ca8.tar.gz
Filter: extend range of allowed temperatures
The temperature range 0-100 was inadequate in both supported scales (Celsius and Fahrenheit). Extend the range to encompass all physically meaningful values in both scales. Use the default-values to set the minimum and maximum of the UI-fields. Thus, these values are configurable in a single place. In the future we should use a scale-independent representation (e.g. mkelvin as in the rest of the code base). But this would mean implementing a custom widget with a conversion function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/filterwidget2.cpp')
-rw-r--r--desktop-widgets/filterwidget2.cpp7
1 files changed, 7 insertions, 0 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);