summaryrefslogtreecommitdiffstats
path: root/commands/command.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-10-25 07:53:40 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-10-25 13:59:04 -0700
commitfaebb539091ca5550bb6b60280d692c50d547bc0 (patch)
tree785284eedbc783bfd0f02318c05cabf48712e8ed /commands/command.cpp
parent572e2678a0c5e1a9c2a947e4a9a86f35cec125eb (diff)
downloadsubsurface-faebb539091ca5550bb6b60280d692c50d547bc0.tar.gz
undo: add device related undo commands
Add commands for deleting devices and editing device nicknames to include the device-handling in the undo system. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'commands/command.cpp')
-rw-r--r--commands/command.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/commands/command.cpp b/commands/command.cpp
index 6ce7f18bd..4125d994b 100644
--- a/commands/command.cpp
+++ b/commands/command.cpp
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include "command.h"
+#include "command_device.h"
#include "command_divelist.h"
#include "command_divesite.h"
#include "command_edit.h"
@@ -380,6 +381,16 @@ void addPictures(const std::vector<PictureListForAddition> &pictures)
execute(new AddPictures(pictures));
}
+void removeDevice(int idx)
+{
+ execute(new RemoveDevice(idx));
+}
+
+void editDeviceNickname(int idx, const QString &nickname)
+{
+ execute(new EditDeviceNickname(idx, nickname));
+}
+
void createFilterPreset(const QString &name, const FilterData &data)
{
execute(new CreateFilterPreset(name, data));