mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
f11ac40593
commit
512a2e6b68
6 changed files with 45 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue