diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-09-18 23:33:39 -0500 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-09-19 22:54:00 -0500 |
commit | 46b125782ee0e8af84c929deaa1ed34f53e7bcd0 (patch) | |
tree | e9f4eba166841cb50965bb53a851a5bfddba6565 /qt-ui/diveplanner.cpp | |
parent | 5a96389cd3039ac822482232b3102106bbe70a5a (diff) | |
download | subsurface-46b125782ee0e8af84c929deaa1ed34f53e7bcd0.tar.gz |
Hook up adding a dive
This gets things mostly right.
It creates a dive and uses the planner widget to create samples which are
copied into the dive. It fills in some reasonable defaults (DC model,
timestamp), but doesn't allow editing the timestamp (or the temperatures
and air pressure).
On accept the planner gets reset and the dive appears correctly in the
dive list.
Cancel still needs to be handled.
And I bet there are many subtle bugs lurking here and there. But it's a
start.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r-- | qt-ui/diveplanner.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 9a1f0cb3d..fe1342112 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1113,7 +1113,7 @@ struct diveplan DivePlannerPointsModel::getDiveplan() void DivePlannerPointsModel::cancelPlan() { - if(rowCount()){ + if(mode == PLAN && rowCount()){ if (QMessageBox::warning(mainWindow(), tr("Save the Plan?"), tr("You have a working plan, \n are you sure that you wanna cancel it?"), QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok){ @@ -1150,7 +1150,8 @@ void DivePlannerPointsModel::createTemporaryPlan() tempDive = NULL; char *errorString = NULL; plan(&diveplan, &cache, &tempDive, isPlanner(), &errorString); - mainWindow()->information()->updateDiveInfo(get_divenr(tempDive)); + if (mode == ADD) + copy_samples(tempDive, current_dive); #if DEBUG_PLAN dump_plan(&diveplan); #endif |