summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command_edit.h
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/command_edit.h')
-rw-r--r--desktop-widgets/command_edit.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/desktop-widgets/command_edit.h b/desktop-widgets/command_edit.h
index 9b5923af2..1f627c7ef 100644
--- a/desktop-widgets/command_edit.h
+++ b/desktop-widgets/command_edit.h
@@ -211,6 +211,38 @@ public:
DiveField fieldId() const override;
};
+// Fields we have to remember to undo paste
+struct PasteState {
+ dive *d;
+ dive_site *divesite;
+ QString notes;
+ QString divemaster;
+ QString buddy;
+ QString suit;
+ int rating;
+ int visibility;
+ tag_entry *tags;
+ cylinder_t cylinders[MAX_CYLINDERS];
+ weightsystem_t weightsystems[MAX_WEIGHTSYSTEMS];
+
+ PasteState(dive *d, const dive *data, dive_components what); // Read data from dive data for dive d
+ ~PasteState();
+ void swap(dive_components what); // Exchange values here and in dive
+};
+
+class PasteDives : public Base {
+ dive_components what;
+ std::vector<PasteState> dives;
+ std::vector<OwningDiveSitePtr> ownedDiveSites;
+ dive *current;
+public:
+ PasteDives(const dive *d, dive_components what);
+private:
+ void undo() override;
+ void redo() override;
+ bool workToBeDone() override;
+};
+
} // namespace Command
#endif