diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2013-11-01 14:06:03 -0400 |
---|---|---|
committer | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2013-11-01 14:06:03 -0400 |
commit | 0e96c9f62e3a7030d9208f32e59390cb3fd20bbe (patch) | |
tree | 309804693d8c0b272343c8cd767a01baedb4e33f /qt-ui/diveplanner.cpp | |
parent | 23a193b0d1a94098ebcf1b5bafbc79ed879b5106 (diff) | |
download | subsurface-0e96c9f62e3a7030d9208f32e59390cb3fd20bbe.tar.gz |
Enable undo for the Edit mode on Added Dives.
This enables undo for the edit mode on added dives, it uses the
premade backup to fill the old dive with data. :)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r-- | qt-ui/diveplanner.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index d94e96570..169158987 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1197,6 +1197,16 @@ void DivePlannerPointsModel::createTemporaryPlan() #endif } +void DivePlannerPointsModel::undoEdition() +{ + beginRemoveRows(QModelIndex(), 0, rowCount()-1); + divepoints.clear(); + endRemoveRows(); + Q_FOREACH(const sample &s, backupSamples){ + plannerModel->addStop(s.depth.mm, s.time.seconds, tr("Air"), 0); + } +} + void DivePlannerPointsModel::deleteTemporaryPlan() { deleteTemporaryPlan(diveplan.dp); |