summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pref.h5
-rw-r--r--qt-ui/diveplanner.cpp20
-rw-r--r--qt-ui/plannerSettings.ui6
-rw-r--r--subsurfacestartup.c5
4 files changed, 30 insertions, 6 deletions
diff --git a/pref.h b/pref.h
index c33b55438..fb01d28ef 100644
--- a/pref.h
+++ b/pref.h
@@ -73,6 +73,11 @@ struct preferences {
char *proxy_pass;
bool doo2breaks;
bool drop_stone_mode;
+ bool last_stop;
+ bool verbatim_plan;
+ bool display_runtime;
+ bool display_duration;
+ bool display_transitions;
int bottomsac;
int decosac;
int o2consumption; // ml per min
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 1325b17f2..8262f3dfc 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -388,6 +388,11 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
QSettings s;
QStringList rebreater_modes;
s.beginGroup("Planner");
+ prefs.last_stop = s.value("last_stop", prefs.last_stop).toBool();
+ prefs.verbatim_plan = s.value("verbatim_plan", prefs.verbatim_plan).toBool();
+ prefs.display_duration = s.value("display_duration", prefs.display_duration).toBool();
+ prefs.display_runtime = s.value("display_runtime", prefs.display_runtime).toBool();
+ prefs.display_transitions = s.value("display_transitions", prefs.display_transitions).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();
@@ -404,6 +409,11 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
s.endGroup();
updateUnitsUI();
+ ui.lastStop->setChecked(prefs.last_stop);
+ ui.verbatim_plan->setChecked(prefs.verbatim_plan);
+ ui.display_duration->setChecked(prefs.display_duration);
+ ui.display_runtime->setChecked(prefs.display_runtime);
+ ui.display_transitions->setChecked(prefs.display_transitions);
ui.bottompo2->setValue(prefs.bottompo2 / 1000.0);
ui.decopo2->setValue(prefs.decopo2 / 1000.0);
ui.backgasBreaks->setChecked(prefs.doo2breaks);
@@ -459,6 +469,11 @@ PlannerSettingsWidget::~PlannerSettingsWidget()
{
QSettings s;
s.beginGroup("Planner");
+ s.setValue("last_stop", prefs.last_stop);
+ s.setValue("verbatim_plan", prefs.verbatim_plan);
+ s.setValue("display_duration", prefs.display_duration);
+ s.setValue("display_runtime", prefs.display_runtime);
+ s.setValue("display_transitions", prefs.display_transitions);
s.setValue("ascrate75", prefs.ascrate75);
s.setValue("ascrate50", prefs.ascrate50);
s.setValue("ascratestops", prefs.ascratestops);
@@ -814,30 +829,35 @@ int DivePlannerPointsModel::getSurfacePressure()
void DivePlannerPointsModel::setLastStop6m(bool value)
{
set_last_stop(value);
+ prefs.last_stop = value;
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
}
void DivePlannerPointsModel::setVerbatim(bool value)
{
set_verbatim(value);
+ prefs.verbatim_plan = value;
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
}
void DivePlannerPointsModel::setDisplayRuntime(bool value)
{
set_display_runtime(value);
+ prefs.display_runtime = value;
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
}
void DivePlannerPointsModel::setDisplayDuration(bool value)
{
set_display_duration(value);
+ prefs.display_duration = value;
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
}
void DivePlannerPointsModel::setDisplayTransitions(bool value)
{
set_display_transitions(value);
+ prefs.display_transitions = value;
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
}
diff --git a/qt-ui/plannerSettings.ui b/qt-ui/plannerSettings.ui
index 440fb534a..0951e324f 100644
--- a/qt-ui/plannerSettings.ui
+++ b/qt-ui/plannerSettings.ui
@@ -501,9 +501,6 @@
<property name="text">
<string>Display runtime</string>
</property>
- <property name="checked">
- <bool>true</bool>
- </property>
</widget>
</item>
<item row="1" column="0">
@@ -517,9 +514,6 @@
<property name="text">
<string>Display segment duration</string>
</property>
- <property name="checked">
- <bool>false</bool>
- </property>
</widget>
</item>
<item row="2" column="0">
diff --git a/subsurfacestartup.c b/subsurfacestartup.c
index 62e37f932..ce66aee52 100644
--- a/subsurfacestartup.c
+++ b/subsurfacestartup.c
@@ -45,6 +45,11 @@ struct preferences default_prefs = {
.decopo2 = 1600,
.doo2breaks = false,
.drop_stone_mode = false,
+ .last_stop = false,
+ .verbatim_plan = false,
+ .display_runtime = true,
+ .display_duration = true,
+ .display_transitions = true,
.bottomsac = 20000,
.decosac = 17000,
.o2consumption = 720,