diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-01-28 21:42:59 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | 512a2e6b684e237c5e6aacd3cba42fb7d2093e0a (patch) | |
tree | 54b065e2a1f29d99be890df5ed2f916bf2c6ce22 /desktop-widgets/command_edit.cpp | |
parent | f11ac405933f2bc124dcff05ec44dd6860cf712c (diff) | |
download | subsurface-512a2e6b684e237c5e6aacd3cba42fb7d2093e0a.tar.gz |
Undo: implement undo of suit editing
This one was trivially modelled after notes editing. Only difference:
the textChanged() signal was replaced by the editingFinished()
signal so that we're not generating undo-commands on every key-press.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/command_edit.cpp')
-rw-r--r-- | desktop-widgets/command_edit.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/desktop-widgets/command_edit.cpp b/desktop-widgets/command_edit.cpp index 5ead59998..80113dbdc 100644 --- a/desktop-widgets/command_edit.cpp +++ b/desktop-widgets/command_edit.cpp @@ -100,6 +100,28 @@ DiveField EditNotes::fieldId() const return DiveField::NOTES; } +// ***** Suit ***** +void EditSuit::set(struct dive *d, QString s) const +{ + free(d->suit); + d->suit = strdup(qPrintable(s)); +} + +QString EditSuit::data(struct dive *d) const +{ + return QString(d->suit); +} + +QString EditSuit::fieldName() const +{ + return tr("suit"); +} + +DiveField EditSuit::fieldId() const +{ + return DiveField::SUIT; +} + // ***** Mode ***** // Editing the dive mode has very peculiar semantics for historic reasons: // Since the dive-mode depends on the dive computer, the i-th dive computer |