mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
undo: switch to dive after replan / profile edit
It is confusing when undoing a command and nothing happens in the UI. Therefore, switch to the corresponding dive when undoing/redoing a replan or profile edit. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
ea0c030770
commit
c5c8bfec65
1 changed files with 4 additions and 0 deletions
|
@ -859,6 +859,8 @@ void ReplanDive::undo()
|
||||||
emit diveListNotifier.cylindersReset(divesToNotify);
|
emit diveListNotifier.cylindersReset(divesToNotify);
|
||||||
emit diveListNotifier.divesChanged(divesToNotify, DiveField::DATETIME | DiveField::DURATION | DiveField::DEPTH | DiveField::MODE |
|
emit diveListNotifier.divesChanged(divesToNotify, DiveField::DATETIME | DiveField::DURATION | DiveField::DEPTH | DiveField::MODE |
|
||||||
DiveField::NOTES | DiveField::SALINITY | DiveField::ATM_PRESS);
|
DiveField::NOTES | DiveField::SALINITY | DiveField::ATM_PRESS);
|
||||||
|
if (!placingCommand())
|
||||||
|
setSelection({ d }, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redo and undo do the same
|
// Redo and undo do the same
|
||||||
|
@ -930,6 +932,8 @@ void EditProfile::undo()
|
||||||
|
|
||||||
QVector<dive *> divesToNotify = { d };
|
QVector<dive *> divesToNotify = { d };
|
||||||
emit diveListNotifier.divesChanged(divesToNotify, DiveField::DURATION | DiveField::DEPTH);
|
emit diveListNotifier.divesChanged(divesToNotify, DiveField::DURATION | DiveField::DEPTH);
|
||||||
|
if (!placingCommand())
|
||||||
|
setSelection({ d }, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redo and undo do the same
|
// Redo and undo do the same
|
||||||
|
|
Loading…
Reference in a new issue