mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Undo: be smarter about dive computer shown after deletion
When deleting a dive computer, don't just show the first dive computer, but the next one in the list (if it exists). Moreover, on undo jump to the previously shown dive computer. Do this by keeping track of the before and after dive computer number in the undo command. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
4fe9b39cdb
commit
a124198275
2 changed files with 8 additions and 5 deletions
|
|
@ -244,7 +244,7 @@ class DiveComputerBase : public DiveListBase {
|
|||
protected:
|
||||
// old_dive must be a dive known to the core.
|
||||
// new_dive must be new dive whose ownership is taken.
|
||||
DiveComputerBase(dive *old_dive, dive *new_dive);
|
||||
DiveComputerBase(dive *old_dive, dive *new_dive, int dc_nr_after);
|
||||
private:
|
||||
void undoit() override;
|
||||
void redoit() override;
|
||||
|
|
@ -254,6 +254,7 @@ protected:
|
|||
// For redo and undo
|
||||
DivesAndTripsToAdd diveToAdd;
|
||||
DivesAndSitesToRemove diveToRemove;
|
||||
int dc_nr_before, dc_nr_after;
|
||||
};
|
||||
|
||||
class MoveDiveComputerToFront : public DiveComputerBase {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue