diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-02-23 11:43:50 +0100 |
---|---|---|
committer | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-04-07 00:13:34 +0200 |
commit | aa7b0cadb2f737e65d490f4ad026f5df09a394f0 (patch) | |
tree | 8dae2a4a9a002e2e3e7d82e420de62e84d0c8020 /commands/command.cpp | |
parent | 36754d3399dab9155fac50e9451dcd325c7c73c0 (diff) | |
download | subsurface-aa7b0cadb2f737e65d490f4ad026f5df09a394f0.tar.gz |
undo: add cylinder undo commands by copy & paste
Do a simple copy & paste followed by a simple search & replace
to generate cylinder undo commands from weight undo commands.
Obviously, this is still missing the necessary code to keep
the dive-data consistent after cylinder editing.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'commands/command.cpp')
-rw-r--r-- | commands/command.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/commands/command.cpp b/commands/command.cpp index 1fb968778..5d71e6725 100644 --- a/commands/command.cpp +++ b/commands/command.cpp @@ -293,6 +293,21 @@ int editWeight(int index, weightsystem_t ws, bool currentDiveOnly) return execute_edit(new EditWeight(index, ws, currentDiveOnly)); } +int addCylinder(bool currentDiveOnly) +{ + return execute_edit(new AddCylinder(currentDiveOnly)); +} + +int removeCylinder(int index, bool currentDiveOnly) +{ + return execute_edit(new RemoveCylinder(index, currentDiveOnly)); +} + +int editCylinder(int index, cylinder_t cyl, bool currentDiveOnly) +{ + return execute_edit(new EditCylinder(index, cyl, currentDiveOnly)); +} + // Trip editing related commands void editTripLocation(dive_trip *trip, const QString &s) { |