From df6f01a6f6767ee714fbf355b1e2260dfaa9f68f Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Sun, 15 Dec 2019 09:50:30 +0100 Subject: desktop-widgets: replace vars. qPrefDivePlanner -> plannerShared change local setBailout to plannerShared and update connect. change signals to slots in plannerShared Signed-off-by: Jan Iversen Signed-off-by: Dirk Hohndel --- desktop-widgets/diveplanner.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'desktop-widgets/diveplanner.cpp') diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp index ac08cc14c..a8a05935a 100644 --- a/desktop-widgets/diveplanner.cpp +++ b/desktop-widgets/diveplanner.cpp @@ -450,7 +450,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) ui.bottompo2->setValue(prefs.bottompo2 / 1000.0); ui.decopo2->setValue(prefs.decopo2 / 1000.0); ui.backgasBreaks->setChecked(prefs.doo2breaks); - setBailout(false); + plannerShared::set_dobailout(false); setBailoutVisibility(false); ui.o2narcotic->setChecked(prefs.o2narcotic); ui.drop_stone_mode->setChecked(prefs.drop_stone_mode); @@ -497,7 +497,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) connect(ui.gflow, SIGNAL(valueChanged(int)), plannerModel, SLOT(setGFLow(int))); connect(ui.vpmb_conservatism, SIGNAL(valueChanged(int)), plannerModel, SLOT(setVpmbConservatism(int))); connect(ui.backgasBreaks, SIGNAL(toggled(bool)), this, SLOT(setBackgasBreaks(bool))); - connect(ui.bailout, SIGNAL(toggled(bool)), this, SLOT(setBailout(bool))); + connect(ui.bailout, SIGNAL(toggled(bool)), plannerShared::instance(), SLOT(set_bailout(bool))); connect(ui.o2narcotic, SIGNAL(toggled(bool)), this, SLOT(setO2narcotic(bool))); connect(ui.switch_at_req_stop, SIGNAL(toggled(bool)), plannerModel, SLOT(setSwitchAtReqStop(bool))); connect(ui.min_switch_duration, SIGNAL(valueChanged(int)), plannerModel, SLOT(setMinSwitchDuration(int))); @@ -652,12 +652,6 @@ void PlannerSettingsWidget::setBackgasBreaks(bool dobreaks) plannerModel->emitDataChanged(); } -void PlannerSettingsWidget::setBailout(bool dobailout) -{ - qPrefDivePlanner::instance()->set_dobailout(dobailout); - plannerModel->emitDataChanged(); -} - void PlannerSettingsWidget::setO2narcotic(bool o2narcotic) { qPrefDivePlanner::instance()->set_o2narcotic(o2narcotic); -- cgit v1.2.3-70-g09d2