mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Undo: update notes field if changed by undo commands
To keep the UI in a consistent state, update the notes field if it is changed by an undo command. To that purpose, add a new signal to diveListNotifier with a list of dives and a field-id as payload. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
9e603cbe2b
commit
45ef879546
5 changed files with 67 additions and 12 deletions
|
@ -57,6 +57,8 @@ void EditBase<T>::undo()
|
|||
|
||||
std::swap(old, value);
|
||||
|
||||
emit diveListNotifier.divesEdited(QVector<dive *>::fromStdVector(dives), fieldId());
|
||||
|
||||
mark_divelist_changed(true);
|
||||
}
|
||||
|
||||
|
@ -90,4 +92,9 @@ QString EditNotes::fieldName() const
|
|||
return tr("notes");
|
||||
}
|
||||
|
||||
DiveField EditNotes::fieldId() const
|
||||
{
|
||||
return DiveField::NOTES;
|
||||
}
|
||||
|
||||
} // namespace Command
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue