summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-03-20 21:46:58 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-12 18:19:07 +0300
commit6f574c53a38ad848bfd364acb0ae16680c3f6c8a (patch)
treef62f5d8c24dc7787d60d161e63640393add7bad8 /desktop-widgets/command.h
parent4cb1ceefff96121331f63e1455d233b32b3d7680 (diff)
downloadsubsurface-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/command.h')
-rw-r--r--desktop-widgets/command.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/desktop-widgets/command.h b/desktop-widgets/command.h
index 3161120fd..9d18f09ae 100644
--- a/desktop-widgets/command.h
+++ b/desktop-widgets/command.h
@@ -59,6 +59,8 @@ void editRating(const QVector<dive *> dives, int newValue, int oldValue);
void editVisibility(const QVector<dive *> dives, int newValue, int oldValue);
void editAirTemp(const QVector<dive *> dives, int newValue, int oldValue);
void editWaterTemp(const QVector<dive *> dives, int newValue, int oldValue);
+void editDiveSite(const QVector<dive *> dives, struct dive_site *newValue, struct dive_site *oldValue);
+void editDiveSiteNew(const QVector<dive *> dives, const QString &newName, struct dive_site *oldValue);
} // namespace Command