diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-03-20 21:46:58 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | 6f574c53a38ad848bfd364acb0ae16680c3f6c8a (patch) | |
tree | f62f5d8c24dc7787d60d161e63640393add7bad8 /desktop-widgets/tab-widgets/maintab.h | |
parent | 4cb1ceefff96121331f63e1455d233b32b3d7680 (diff) | |
download | subsurface-6f574c53a38ad848bfd364acb0ae16680c3f6c8a.tar.gz |
Undo: implement undo of dive site editing
This one is a bit more tricky. There are two modes: set dive site
and set newly created dive site. This is realized using an OO model
with derived classed. Quite convoluted - but it seems to work.
Moreover, editing a dive site is not simply setting a value,
but the list of dives in a dive site has to be kept up to date.
Finally, we have to inform the dive site list of the changed
number of dives. Therefore add a new signal diveSiteDivesChanged.
To send only one signal per dive site, hook into the undo() and
redo() functions and call the functions of the base class there.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tab-widgets/maintab.h')
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.h b/desktop-widgets/tab-widgets/maintab.h index 805618857..4bff215ce 100644 --- a/desktop-widgets/tab-widgets/maintab.h +++ b/desktop-widgets/tab-widgets/maintab.h @@ -69,11 +69,11 @@ slots: void updateNotes(const struct dive *d); void updateMode(struct dive *d); void updateDateTime(struct dive *d); + void updateDiveSite(struct dive *d); void updateDepthDuration(); void acceptChanges(); void rejectChanges(); void on_location_diveSiteSelected(); - void on_location_textChanged(); void on_divemaster_textChanged(); void on_buddy_textChanged(); void on_suit_editingFinished(); @@ -126,7 +126,6 @@ private: dive_trip_t *currentTrip; dive_trip_t displayedTrip; bool acceptingEdit; - struct dive_site *updateDiveSite(struct dive_site *pickedDs, dive *d); QList<TabBase*> extraWidgets; }; |