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>
This commit is contained in:
Berthold Stoeger 2020-05-27 09:31:26 +02:00 committed by Dirk Hohndel
parent 536fc05dd6
commit 2f5223035a
7 changed files with 184 additions and 0 deletions

View file

@ -9,6 +9,7 @@
#include <vector>
struct DiveAndLocation;
struct FilterData;
// We put everything in a namespace, so that we can shorten names without polluting the global namespace
namespace Command {
@ -133,6 +134,12 @@ void setPictureOffset(dive *d, const QString &filename, offset_t offset);
void removePictures(const std::vector<PictureListForDeletion> &pictures);
void addPictures(const std::vector<PictureListForAddition> &pictures);
// 8) Filter commands
void createFilterPreset(const QString &name, const FilterData &data);
void removeFilterPreset(int index);
void editFilterPreset(int index, const FilterData &data);
} // namespace Command
#endif // COMMAND_H