diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-02-23 18:17:20 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | 73a230b6e652f4bba1bf08cb21fec112a968ff0d (patch) | |
tree | 118337e811dd93540894d43de7b88eb825d0c125 /desktop-widgets/command_edit.h | |
parent | 92e6e2bba17ae91e1f8e5d63154323586f6ea5a2 (diff) | |
download | subsurface-73a230b6e652f4bba1bf08cb21fec112a968ff0d.tar.gz |
Cleanup: remove EDIT_TEXT and EDIT_VALUE macros in maintab.cpp
These functions are now performed by the edit commands and the
macros have no users. Remove them.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/command_edit.h')
-rw-r--r-- | desktop-widgets/command_edit.h | 32 |
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 |