Undo: implement undo of dive trip editing

This is copying the dive editing code. It uses an OO design with
virtual functions for getting and setting the values. It doesn't
use templates though, as both fields of strig type. This feels
a bit over-engineered, but it is 1) consistent with the dive edit
code and 2) the number / types of dive trip fields might increase.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-02-24 21:22:33 +01:00 committed by Dirk Hohndel
parent 9fd87fa080
commit d7d408a99e
8 changed files with 207 additions and 57 deletions

View file

@ -4,6 +4,7 @@
#include "command_divelist.h"
#include "command_divesite.h"
#include "command_edit.h"
#include "command_edit_trip.h"
namespace Command {
@ -205,4 +206,14 @@ void pasteDives(const dive *d, dive_components what)
execute(new PasteDives(d, what));
}
void editTripLocation(dive_trip *trip, const QString &s)
{
execute(new EditTripLocation(trip, s));
}
void editTripNotes(dive_trip *trip, const QString &s)
{
execute(new EditTripNotes(trip, s));
}
} // namespace Command