undo: add undo command for dive-mode switch

This basically copies the bookmark code, with the addition that
the dive mode is recorded in the text of the undo command.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-03-03 22:54:54 +01:00
parent 7018783f64
commit 33fb6461fb
5 changed files with 19 additions and 4 deletions

View file

@ -1606,10 +1606,7 @@ void ProfileWidget2::addBookmark(int seconds)
void ProfileWidget2::addDivemodeSwitch(int seconds, int divemode)
{
add_event(current_dc, seconds, SAMPLE_EVENT_BOOKMARK, 0, divemode, QT_TRANSLATE_NOOP("gettextFromC", "modechange"));
invalidate_dive_cache(current_dive);
mark_divelist_changed(true);
replot();
Command::addEventDivemodeSwitch(current_dive, dc_number, seconds, divemode);
}
void ProfileWidget2::addSetpointChange(int seconds)