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.cpp | |
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.cpp')
-rw-r--r-- | desktop-widgets/command.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/desktop-widgets/command.cpp b/desktop-widgets/command.cpp index 7336a5b62..7eff9a4c1 100644 --- a/desktop-widgets/command.cpp +++ b/desktop-widgets/command.cpp @@ -135,4 +135,9 @@ void editNotes(const QVector<dive *> dives, const QString &newValue, const QStri execute(new EditNotes(dives, newValue, oldValue)); } +void editMode(const QVector<dive *> dives, int index, int newValue, int oldValue) +{ + execute(new EditMode(dives, index, newValue, oldValue)); +} + } // namespace Command |