Undo: implement undo of depth and duration editing

This was a bit different from the other editing commands:
1) Only the current dive is edited not all selected dives.
   Therefore, create a function that turns the current dive
   into a one-element list.
2) The profile has to be replot. Here, likewise, create a
   function to do that.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-02-10 17:37:06 +01:00 committed by Dirk Hohndel
parent 02d572226d
commit c82f4487f9
7 changed files with 113 additions and 30 deletions

View file

@ -165,6 +165,16 @@ void editWaterTemp(const QVector<dive *> dives, int newValue, int oldValue)
execute(new EditWaterTemp(dives, newValue, oldValue));
}
void editDepth(const QVector<dive *> dives, int newValue, int oldValue)
{
execute(new EditDepth(dives, newValue, oldValue));
}
void editDuration(const QVector<dive *> dives, int newValue, int oldValue)
{
execute(new EditDuration(dives, newValue, oldValue));
}
void editDiveSite(const QVector<dive *> dives, struct dive_site *newValue, struct dive_site *oldValue)
{
execute(new EditDiveSite(dives, newValue, oldValue));