summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/diveplanner.cpp7
-rw-r--r--qt-ui/diveplanner.h1
-rw-r--r--qt-ui/maintab.cpp4
3 files changed, 11 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index ab39d42cb..37005e149 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -444,6 +444,8 @@ void DivePlannerPointsModel::loadFromDive(dive* d)
for(int i = 0; i < d->dc.samples-1; i++){
backupSamples.push_back( d->dc.sample[i]);
}
+ copy_cylinders(current_dive, stagingDive); // this way the correct cylinder data is shown
+ CylindersModel::instance()->setDive(stagingDive);
int lasttime = 0;
Q_FOREACH(const sample &s, backupSamples){
int o2 = 0, he = 0;
@@ -453,6 +455,11 @@ void DivePlannerPointsModel::loadFromDive(dive* d)
}
}
+void DivePlannerPointsModel::copyCylinders(dive *d)
+{
+ copy_cylinders(stagingDive, d);
+}
+
QStringList& DivePlannerPointsModel::getGasList()
{
static QStringList list;
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h
index fcb679f89..8f51c932c 100644
--- a/qt-ui/diveplanner.h
+++ b/qt-ui/diveplanner.h
@@ -37,6 +37,7 @@ public:
void tanksUpdated();
void rememberTanks();
bool tankInUse(int o2, int he);
+ void copyCylinders(struct dive *d);
/**
* @return the row number.
*/
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 005efe496..f53defbbf 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -474,7 +474,9 @@ void MainTab::acceptChanges()
if (notesBackup[curr].tags != ui.tagWidget->text())
saveTags();
- if (editMode != ADD && cylindersModel->changed) {
+ if (editMode == MANUALLY_ADDED_DIVE) {
+ DivePlannerPointsModel::instance()->copyCylinders(curr);
+ } else if (editMode != ADD && cylindersModel->changed) {
mark_divelist_changed(TRUE);
Q_FOREACH (dive *d, notesBackup.keys()) {
for (int i = 0; i < MAX_CYLINDERS; i++) {