Undo: make "move dive computer to front" undoable

Instead of the elegant solution that just modifies the dive,
keep two copies and add either the old or the new copy. This
is primitive, but it trivially keeps the dives in the right order.
The order might change on renumbering the dive computers.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-05-17 22:22:55 +02:00 committed by Dirk Hohndel
parent f0307abf50
commit eba6e76b96
7 changed files with 106 additions and 23 deletions

View file

@ -74,6 +74,11 @@ void splitDiveComputer(dive *d, int dc_num)
execute(new SplitDiveComputer(d, dc_num));
}
void moveDiveComputerToFront(dive *d, int dc_num)
{
execute(new MoveDiveComputerToFront(d, dc_num));
}
void mergeDives(const QVector <dive *> &dives)
{
execute(new MergeDives(dives));