summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2015-04-02 10:32:14 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-04-02 09:46:10 -0700
commitcc8d6014229dbca15373f6c3d888a6404c0775f1 (patch)
tree13a9934327b877a2c4dda894c170a2f91e3e1270 /qt-ui/diveplanner.cpp
parentcd34fea1db4e3cf118bcc08358bb84df68314700 (diff)
downloadsubsurface-cc8d6014229dbca15373f6c3d888a6404c0775f1.tar.gz
Checkbox and preference for safety stop
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 00a4113ca..4f264030f 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -394,6 +394,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
prefs.display_runtime = s.value("display_runtime", prefs.display_runtime).toBool();
prefs.display_transitions = s.value("display_transitions", prefs.display_transitions).toBool();
prefs.recreational_mode = s.value("recreational_mode", prefs.recreational_mode).toBool();
+ prefs.safetystop = s.value("safetystop", prefs.safetystop).toBool();
prefs.ascrate75 = s.value("ascrate75", prefs.ascrate75).toInt();
prefs.ascrate50 = s.value("ascrate50", prefs.ascrate50).toInt();
prefs.ascratestops = s.value("ascratestops", prefs.ascratestops).toInt();
@@ -416,6 +417,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
ui.display_runtime->setChecked(prefs.display_runtime);
ui.display_transitions->setChecked(prefs.display_transitions);
ui.recreational_mode->setChecked(prefs.recreational_mode);
+ ui.safetystop->setChecked(prefs.safetystop);
ui.bottompo2->setValue(prefs.bottompo2 / 1000.0);
ui.decopo2->setValue(prefs.decopo2 / 1000.0);
ui.backgasBreaks->setChecked(prefs.doo2breaks);
@@ -429,6 +431,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
connect(ui.display_duration, SIGNAL(toggled(bool)), plannerModel, SLOT(setDisplayDuration(bool)));
connect(ui.display_runtime, SIGNAL(toggled(bool)), plannerModel, SLOT(setDisplayRuntime(bool)));
connect(ui.display_transitions, SIGNAL(toggled(bool)), plannerModel, SLOT(setDisplayTransitions(bool)));
+ connect(ui.safetystop, SIGNAL(toggled(bool)), plannerModel, SLOT(setSafetyStop(bool)));
connect(ui.recreational_mode, SIGNAL(toggled(bool)), plannerModel, SLOT(setRecreationalMode(bool)));
connect(ui.ascRate75, SIGNAL(valueChanged(int)), this, SLOT(setAscRate75(int)));
connect(ui.ascRate75, SIGNAL(valueChanged(int)), plannerModel, SLOT(emitDataChanged()));
@@ -478,6 +481,7 @@ PlannerSettingsWidget::~PlannerSettingsWidget()
s.setValue("display_runtime", prefs.display_runtime);
s.setValue("display_transitions", prefs.display_transitions);
s.setValue("recreational_mode", prefs.recreational_mode);
+ s.setValue("safetystop", prefs.safetystop);
s.setValue("ascrate75", prefs.ascrate75);
s.setValue("ascrate50", prefs.ascrate50);
s.setValue("ascratestops", prefs.ascratestops);
@@ -871,6 +875,12 @@ void DivePlannerPointsModel::setRecreationalMode(bool value)
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS -1));
}
+void DivePlannerPointsModel::setSafetyStop(bool value)
+{
+ prefs.safetystop = value;
+ emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS -1));
+}
+
void DivePlannerPointsModel::setDropStoneMode(bool value)
{
prefs.drop_stone_mode = value;