diff options
author | Anton Lundin <glance@acc.umu.se> | 2017-02-13 22:16:03 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-02-14 07:29:52 -0800 |
commit | 78059d401084382235b76d707c85bc637c704f61 (patch) | |
tree | 2b5ca192523f60b577c9ce9fd216f3707e86b86f | |
parent | 78150a4ed58995376bfdf6ba35865d597b1383e5 (diff) | |
download | subsurface-78059d401084382235b76d707c85bc637c704f61.tar.gz |
Update altitude limits on unit change
The limits set in diveplanner.ui is intended for the unit set there,
meters. If we move between units we need to update the limits to.
This fixes #201
Signed-off-by: Anton Lundin <glance@acc.umu.se>
-rw-r--r-- | desktop-widgets/diveplanner.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp index 0eee95ebf..fddc5bb19 100644 --- a/desktop-widgets/diveplanner.cpp +++ b/desktop-widgets/diveplanner.cpp @@ -196,8 +196,12 @@ void DivePlannerWidget::settingsChanged() // Adopt units if (get_units()->length == units::FEET) { ui.atmHeight->setSuffix("ft"); + ui.atmHeight->setMinimum(-300); + ui.atmHeight->setMaximum(10000); } else { ui.atmHeight->setSuffix(("m")); + ui.atmHeight->setMinimum(-100); + ui.atmHeight->setMaximum(3000); } ui.atmHeight->blockSignals(true); ui.atmHeight->setValue((int) get_depth_units((int) (log(1013.0 / plannerModel->getSurfacePressure()) * 7800000), NULL,NULL)); |