diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-03-03 22:42:51 +0100 |
---|---|---|
committer | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-04-07 00:13:35 +0200 |
commit | 7018783f64f664af97032da4ba4d357c05b52aaf (patch) | |
tree | 7b9d8b3e6156be1fe63b9bbbf66c382071fe73ab /commands | |
parent | 30c7499a3c656784cc45825b4b1b2fca61081308 (diff) | |
download | subsurface-7018783f64f664af97032da4ba4d357c05b52aaf.tar.gz |
undo: replot profile if event changed
Add a DiveListNotifer::eventsChanged signal, which is emitted when
the events changed. This is very coarse, at it doesn't differentiate
between signal addition / editing / deletion. We might want to
be finer in the future.
Catch the signal in the profile-widget to replot the dive if this
is the currently displayed dive. Reuse the cylindersChanged() slot,
but rename it to the now more appropriate profileChanged().
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/command_event.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/commands/command_event.cpp b/commands/command_event.cpp index ea35402e4..d945fbb02 100644 --- a/commands/command_event.cpp +++ b/commands/command_event.cpp @@ -23,6 +23,7 @@ void AddEventBase::redo() eventToRemove = eventToAdd.get(); add_event_to_dc(dc, eventToAdd.release()); // return ownership to backend invalidate_dive_cache(d); + emit diveListNotifier.eventsChanged(d); } void AddEventBase::undo() @@ -32,6 +33,7 @@ void AddEventBase::undo() eventToAdd.reset(eventToRemove); // take ownership of event eventToRemove = nullptr; invalidate_dive_cache(d); + emit diveListNotifier.eventsChanged(d); } AddEventBookmark::AddEventBookmark(struct dive *d, int dcNr, int seconds) : |