Undo: implement rudimentary undo of dive-notes editing

Implement a first rudimentary dive-editing command. The main code
resides in a base class Command::Edit, which calls virtual functions
to read / set the fields and extract the field name.

Implement an example: editing of dive notes.

This dose not yet update the UI on undo / redo.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-01-25 18:27:31 +01:00 committed by Dirk Hohndel
parent 8858bfa1f8
commit 9e603cbe2b
7 changed files with 177 additions and 12 deletions

View file

@ -3,6 +3,7 @@
#include "command.h"
#include "command_divelist.h"
#include "command_divesite.h"
#include "command_edit.h"
namespace Command {
@ -128,4 +129,10 @@ void purgeUnusedDiveSites()
execute(new PurgeUnusedDiveSites);
}
// Dive editing related commands
void editNotes(const QVector<dive *> dives, const QString &newValue, const QString &oldValue)
{
execute(new EditNotes(dives, newValue, oldValue));
}
} // namespace Command