diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-01-28 18:35:27 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | f11ac405933f2bc124dcff05ec44dd6860cf712c (patch) | |
tree | 502d7f9880076455324bb762e011555f7f452ae2 /desktop-widgets/command_edit.h | |
parent | 45ef87954669c765cb7b317384066c6eb88dc5d3 (diff) | |
download | subsurface-f11ac405933f2bc124dcff05ec44dd6860cf712c.tar.gz |
Undo: implement undo of dive mode editing
Add a new UndoCommand for dive mode editing. This one is a bit
special, as the mode is associated with a dive computer (DC),
not a dive. Thus the edit command has an additional parameter,
viz. the index of the DC.
This does not fit properly to the EditBase class, as this class
isn't aware of additional parameters and therefore this parameter
is not sent via signals. At the moment this doesn't matter. In
any case, the semantics of editing are weird and therefore let's
do the simple thing (derive from EditBase) and let's see what
the future brings.
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 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/desktop-widgets/command_edit.h b/desktop-widgets/command_edit.h index 5f5924e67..d91121c7d 100644 --- a/desktop-widgets/command_edit.h +++ b/desktop-widgets/command_edit.h @@ -56,6 +56,16 @@ public: DiveField fieldId() const override; }; +class EditMode : public EditBase<int> { + int index; +public: + EditMode(const QVector<dive *> &dives, int indexIn, int newValue, int oldValue); + void set(struct dive *d, int i) const override; + int data(struct dive *d) const override; + QString fieldName() const override; + DiveField fieldId() const override; +}; + } // namespace Command #endif |