summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command_divesite.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-03-15 17:41:31 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-12 18:19:07 +0300
commit59239cec02aedda8c2651a04c65c580a9ff190a9 (patch)
tree3aa2ce298c132eb6ccacb77d5b2a508e46aa724c /desktop-widgets/command_divesite.h
parent7c63956ee4798a835794eee8189b73e3df07594d (diff)
downloadsubsurface-59239cec02aedda8c2651a04c65c580a9ff190a9.tar.gz
Undo: make dive site merging undoable
This one was rather trivial, as there is no actual merging done. Quite simply, a number of dive sites are removed and their dive added to a different dive site. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/command_divesite.h')
-rw-r--r--desktop-widgets/command_divesite.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/desktop-widgets/command_divesite.h b/desktop-widgets/command_divesite.h
index b73cc1b5a..58b3aabf5 100644
--- a/desktop-widgets/command_divesite.h
+++ b/desktop-widgets/command_divesite.h
@@ -117,6 +117,23 @@ private:
taxonomy_data value; // Value to be set
};
+class MergeDiveSites : public Base {
+public:
+ MergeDiveSites(dive_site *ds, const QVector<dive_site *> &sites);
+private:
+ bool workToBeDone() override;
+ void undo() override;
+ void redo() override;
+
+ dive_site *ds;
+
+ // For redo
+ std::vector<dive_site *> sitesToRemove;
+
+ // For undo
+ std::vector<OwningDiveSitePtr> sitesToAdd;
+};
+
} // namespace Command
#endif // COMMAND_DIVESITE_H