summaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2013-11-01 11:48:34 -0400
committerGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2013-11-01 11:48:34 -0400
commitf7cd3e780cdc77180ce279c95322de2095192657 (patch)
tree30be9f9d9071be59f74e60fb55c3f67b70f909a4 /qt-ui/maintab.cpp
parentd9afcdc8cb0239d07b0578bbe2b4e4efe87c5958 (diff)
downloadsubsurface-f7cd3e780cdc77180ce279c95322de2095192657.tar.gz
Enable editing a dive that was manually entered.
This patch enables editing a dive that was manually entered, it doesn't cover dive plans yet because on the plan I need to figure out what are the 'user-entered' points, and what are the algorithm point. and I feel lazy. =p One last thing that's missing is to revert the dive to the previous condition if the user cancels the edition, currently canceling and applying ok is the same thing. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r--qt-ui/maintab.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 8d2324382..f88d7c6d0 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -113,7 +113,7 @@ void MainTab::addDiveStarted()
editMode = ADD;
}
-void MainTab::enableEdition()
+void MainTab::enableEdition(EditMode newEditMode)
{
if (selected_dive < 0 || editMode != NONE)
return;
@@ -170,7 +170,8 @@ void MainTab::enableEdition()
notesBackup[mydive].weightsystem[i] = mydive->weightsystem[i];
}
}
- editMode = DIVE;
+
+ editMode = newEditMode != NONE ? newEditMode : DIVE;
}
}
@@ -449,7 +450,7 @@ void MainTab::acceptChanges()
}
}
- if (editMode == ADD) {
+ if (editMode == ADD || editMode == MANUALLY_ADDED_DIVE) {
// clean up the dive data (get duration, depth information from samples)
fixup_dive(current_dive);
if (dive_table.nr == 1)
@@ -563,7 +564,7 @@ void MainTab::rejectChanges()
ui.equipmentButtonBox->hide();
notesBackup.clear();
resetPallete();
- if (editMode == ADD) {
+ if (editMode == ADD || editMode == MANUALLY_ADDED_DIVE) {
// more clean up
updateDiveInfo(selected_dive);
mainWindow()->showProfile();