summaryrefslogtreecommitdiffstats
path: root/commands/command.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-14 22:07:00 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-05-06 13:58:09 -0700
commite61641c79cd57bfa55d2371615a7eef7c73b4eb7 (patch)
tree85333dfed1630b1d968498495d1d1c151570e015 /commands/command.cpp
parentebdb3e3c3029d3762207e8dcadfa3a61bf0a9293 (diff)
downloadsubsurface-e61641c79cd57bfa55d2371615a7eef7c73b4eb7.tar.gz
undo: implement undo of setting a picture time by drag&drop
Even though the functionality is seemingly trivial, this is a bit invasive, as the code has to be split into two distinct parts: 1) Post undo command 2) React to changes to the divelist Don't compile that code on mobile. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'commands/command.cpp')
-rw-r--r--commands/command.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/commands/command.cpp b/commands/command.cpp
index 33c866e72..8195fbd22 100644
--- a/commands/command.cpp
+++ b/commands/command.cpp
@@ -6,6 +6,7 @@
#include "command_edit.h"
#include "command_edit_trip.h"
#include "command_event.h"
+#include "command_pictures.h"
namespace Command {
@@ -359,4 +360,11 @@ void addGasSwitch(struct dive *d, int dcNr, int seconds, int tank)
execute(new AddGasSwitch(d, dcNr, seconds, tank));
}
+// Picture (media) commands
+
+void setPictureOffset(dive *d, const QString &filename, offset_t offset)
+{
+ execute(new SetPictureOffset(d, filename, offset));
+}
+
} // namespace Command