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:
Berthold Stoeger 2019-01-27 22:08:13 +01:00 committed by Dirk Hohndel
parent 9e603cbe2b
commit 45ef879546
5 changed files with 67 additions and 12 deletions

View file

@ -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