aboutsummaryrefslogtreecommitdiffstats
path: root/commands/command.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-05-27 09:31:26 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-09-29 16:13:03 -0700
commit2f5223035a9d43b933b0baf64823dab84b5d8cea (patch)
tree91a75c82f307076079e247f68f19b04ea0ccc529 /commands/command.cpp
parent536fc05dd6acd67a459fe6decbd67071ad388df0 (diff)
downloadsubsurface-2f5223035a9d43b933b0baf64823dab84b5d8cea.tar.gz
filter: add filter preset undo commands
Add undo commands to add / edit / delete filter presets. These are styled after the other undo commands: On changes, the UI is informed by DiveListNotifier signals. Editing is a simple std::swap of values. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'commands/command.cpp')
-rw-r--r--commands/command.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/commands/command.cpp b/commands/command.cpp
index 7c154ee24..f04d5cc7a 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_filter.h"
#include "command_pictures.h"
namespace Command {
@@ -377,4 +378,19 @@ void addPictures(const std::vector<PictureListForAddition> &pictures)
execute(new AddPictures(pictures));
}
+void createFilterPreset(const QString &name, const FilterData &data)
+{
+ execute(new CreateFilterPreset(name, data));
+}
+
+void removeFilterPreset(int index)
+{
+ execute(new RemoveFilterPreset(index));
+}
+
+void editFilterPreset(int index, const FilterData &data)
+{
+ execute(new EditFilterPreset(index, data));
+}
+
} // namespace Command