undo infrastructure: improve undo command texts

For many of the commands it is fairly easy to add information that makes
it easier to figure out what actually happened. That's especially true
for commands operating on dives. Trip and dive site edits haven't been
given these more elaborate undo texts (yet).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-03-05 09:00:00 -08:00
parent 8ce4e10ccb
commit 0212b1b9f7
4 changed files with 63 additions and 20 deletions

View file

@ -172,7 +172,12 @@ public:
// If nothing is to be done, the command will be deleted and false is returned.
bool execute(Base *cmd);
// helper function to create more meaningful undo/redo texts (and get the list
// of those texts for the git storage commit message)
QUndoStack *getUndoStack();
QString diveNumberOrDate(struct dive *d);
QString getListOfDives(const std::vector<dive *> &dives);
QString getListOfDives(QVector<struct dive *> dives);
} // namespace Command