summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2020-01-19 18:01:29 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-20 15:43:53 -0800
commitb1751ac0c601846d7e2dcf629bfd157bda4d39ef (patch)
tree296641b2468e198f1ac3f8ad57d713a20018e94b /desktop-widgets/diveplanner.cpp
parent851ab68aa27107901c56a2088fdb0df57b11df49 (diff)
downloadsubsurface-b1751ac0c601846d7e2dcf629bfd157bda4d39ef.tar.gz
desktop-widgets: use set/get asc/desc rates in diveplannermodel
The spinboxes are already connected to diveplannermodel set_ functions, remove second connect to plannerShared. Change get functions to use diveplannermodel. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/diveplanner.cpp')
-rw-r--r--desktop-widgets/diveplanner.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp
index 4969a0c16..f3e345d8c 100644
--- a/desktop-widgets/diveplanner.cpp
+++ b/desktop-widgets/diveplanner.cpp
@@ -489,11 +489,6 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
connect(ui.buehlmann_deco, &QAbstractButton::clicked, [=] { disableDecoElements(BUEHLMANN); });
connect(ui.vpmb_deco, &QAbstractButton::clicked, [=] { disableDecoElements(VPMB); });
- connect(ui.ascRate75, QOverload<int>::of(&QSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_ascrate75);
- connect(ui.ascRate50, QOverload<int>::of(&QSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_ascrate50);
- connect(ui.descRate, QOverload<int>::of(&QSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_descrate);
- connect(ui.ascRateStops, QOverload<int>::of(&QSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_ascratestops);
- connect(ui.ascRateLast6m, QOverload<int>::of(&QSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_ascratelast6m);
connect(ui.sacfactor, QOverload<double>::of(&QDoubleSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_sacfactor);
connect(ui.problemsolvingtime, QOverload<int>::of(&QSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_problemsolvingtime);
connect(ui.bottompo2, QOverload<double>::of(&QDoubleSpinBox::valueChanged), plannerShared::instance(), &plannerShared::set_bottompo2);
@@ -521,11 +516,11 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
void PlannerSettingsWidget::updateUnitsUI()
{
- ui.ascRate75->setValue(plannerShared::ascrate75());
- ui.ascRate50->setValue(plannerShared::ascrate50());
- ui.ascRateStops->setValue(plannerShared::ascratestops());
- ui.ascRateLast6m->setValue(plannerShared::ascratelast6m());
- ui.descRate->setValue(lrint(plannerShared::descrate()));
+ ui.ascRate75->setValue(plannerModel->ascrate75Display());
+ ui.ascRate50->setValue(plannerModel->ascrate50Display());
+ ui.ascRateStops->setValue(plannerModel->ascratestopsDisplay());
+ ui.ascRateLast6m->setValue(plannerModel->ascratelast6mDisplay());
+ ui.descRate->setValue(lrint(plannerModel->descrateDisplay()));
ui.bestmixEND->setValue(lrint(get_depth_units(prefs.bestmixend.mm, NULL, NULL)));
}