summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-05-17 22:22:55 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-05-20 21:23:16 -0700
commiteba6e76b963115a77b5f8607bc6c3ea1040a466f (patch)
treee926eb7112a902561c1b66f4d6a342ec2a7134b5 /desktop-widgets/command.cpp
parentf0307abf50397da79671ce79707eb4ce1f78acd0 (diff)
downloadsubsurface-eba6e76b963115a77b5f8607bc6c3ea1040a466f.tar.gz
Undo: make "move dive computer to front" undoable
Instead of the elegant solution that just modifies the dive, keep two copies and add either the old or the new copy. This is primitive, but it trivially keeps the dives in the right order. The order might change on renumbering the dive computers. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/command.cpp')
-rw-r--r--desktop-widgets/command.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/desktop-widgets/command.cpp b/desktop-widgets/command.cpp
index e5244e92a..b6283ec8d 100644
--- a/desktop-widgets/command.cpp
+++ b/desktop-widgets/command.cpp
@@ -74,6 +74,11 @@ void splitDiveComputer(dive *d, int dc_num)
execute(new SplitDiveComputer(d, dc_num));
}
+void moveDiveComputerToFront(dive *d, int dc_num)
+{
+ execute(new MoveDiveComputerToFront(d, dc_num));
+}
+
void mergeDives(const QVector <dive *> &dives)
{
execute(new MergeDives(dives));