undo: add cylinder undo commands by copy & paste

Do a simple copy & paste followed by a simple search & replace
to generate cylinder undo commands from weight undo commands.
Obviously, this is still missing the necessary code to keep
the dive-data consistent after cylinder editing.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-02-23 11:43:50 +01:00
parent 36754d3399
commit aa7b0cadb2
5 changed files with 240 additions and 1 deletions

View file

@ -293,6 +293,21 @@ int editWeight(int index, weightsystem_t ws, bool currentDiveOnly)
return execute_edit(new EditWeight(index, ws, currentDiveOnly));
}
int addCylinder(bool currentDiveOnly)
{
return execute_edit(new AddCylinder(currentDiveOnly));
}
int removeCylinder(int index, bool currentDiveOnly)
{
return execute_edit(new RemoveCylinder(index, currentDiveOnly));
}
int editCylinder(int index, cylinder_t cyl, bool currentDiveOnly)
{
return execute_edit(new EditCylinder(index, cyl, currentDiveOnly));
}
// Trip editing related commands
void editTripLocation(dive_trip *trip, const QString &s)
{