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>
This commit is contained in:
Berthold Stoeger 2020-10-25 07:53:40 +01:00 committed by Dirk Hohndel
parent 572e2678a0
commit faebb53909
9 changed files with 140 additions and 1 deletions

View file

@ -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));