From 500fbe499411bfa96192626c8a6213916190aaae Mon Sep 17 00:00:00 2001 From: Jan Darowski Date: Fri, 3 Jul 2015 23:07:58 +0200 Subject: VPM-B: add deco choice to the ui. Removed recreational mode from ui and pref and replaced it with new deco_mode enum. Added radio button ui selection. Set default deco_mode to Buehlmann algorithm. Signed-off-by: Jan Darowski --- qt-models/diveplannermodel.cpp | 6 +++--- qt-models/diveplannermodel.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'qt-models') diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index adbcdba9a..e28b4d146 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -449,10 +449,10 @@ void DivePlannerPointsModel::setDisplayTransitions(bool value) emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1)); } -void DivePlannerPointsModel::setRecreationalMode(bool value) +void DivePlannerPointsModel::setDecoMode(int mode) { - prefs.recreational_mode = value; - emit recreationChanged(value); + prefs.deco_mode = deco_mode(mode); + emit recreationChanged(mode == int(RECREATIONAL)); emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS -1)); } diff --git a/qt-models/diveplannermodel.h b/qt-models/diveplannermodel.h index 422499084..a8524393a 100644 --- a/qt-models/diveplannermodel.h +++ b/qt-models/diveplannermodel.h @@ -78,7 +78,7 @@ slots: void setDisplayRuntime(bool value); void setDisplayDuration(bool value); void setDisplayTransitions(bool value); - void setRecreationalMode(bool value); + void setDecoMode(int mode); void setSafetyStop(bool value); void savePlan(); void saveDuplicatePlan(); -- cgit v1.2.3-70-g09d2