summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-10-06 21:01:21 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-26 11:36:23 -0700
commitc479c5ca36648e54f58f782d7af2935f77c693b1 (patch)
tree9d9ad8cd3fe04a7542556bbea41ba0ab7927da92
parent7b730602c6ac92c561c5ccb6a0dbf725a70fa963 (diff)
downloadsubsurface-c479c5ca36648e54f58f782d7af2935f77c693b1.tar.gz
Desktop: use undo command when replanning dive
Instead of copying the displayed dive, generate an undo command. This makes the replanning an undoable action and fixes a bug where the dive details have not been updated correctly. Fixes #2280 Reported-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--CHANGELOG.md3
-rw-r--r--qt-models/diveplannermodel.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 58a33ac5b..fa1b6e815 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,7 @@
Mobile: add support for editing the dive number of a dive
+Desktop: make dive replanning undoable
+Desktop: update statistics tab on undo or redo
+Planner: update dive details when replanning dive [#2280]
Export: when exporting dive sites in dive site mode, export selected dive sites [#2275]
Mobile: fix several bugs in the handling of incorrect or unverified cloud credentials
Mobile: try to adjust the UI for cases with large default font relative to screen size
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index b8f8d54a4..d2fe5e84a 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -6,7 +6,6 @@
#include "qt-models/models.h"
#include "core/device.h"
#include "core/qthelper.h"
-#include "core/divelist.h" // for mark_divelist_changed()
#include "core/settings/qPrefDivePlanner.h"
#include "desktop-widgets/command.h"
#include "core/gettextfromc.h"
@@ -1176,8 +1175,7 @@ void DivePlannerPointsModel::createPlan(bool replanCopy)
Command::addDive(&displayed_dive, false, false);
} else {
// we were planning an old dive and rewrite the plan
- mark_divelist_changed(true);
- copy_dive(&displayed_dive, current_dive);
+ Command::replanDive(&displayed_dive);
}
// Remove and clean the diveplan, so we don't delete