summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/maintab.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index e5c2830fc..ce0e77f1a 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -734,6 +734,17 @@ void MainTab::acceptChanges()
}
if (editMode == ADD || editMode == MANUALLY_ADDED_DIVE) {
// clean up the dive data (get duration, depth information from samples)
+ // remove the pressures from the samples (as those prevent the user from
+ // being able to manually set the start and end pressure)
+ struct sample *sample = current_dc->sample;
+ for (int i = 0; i < current_dc->samples; i++, sample++)
+ sample->cylinderpressure.mbar = 0;
+ for (int i = 0; i < MAX_CYLINDERS; i++) {
+ cylinder_t *cyl = &current_dive->cylinder[i];
+ cyl->start.mbar = cyl->sample_start.mbar;
+ cyl->end.mbar = cyl->sample_end.mbar;
+ cyl->sample_end.mbar = cyl->sample_start.mbar = 0;
+ }
fixup_dive(current_dive);
if (dive_table.nr == 1)
current_dive->number = 1;