aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command_edit.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-01-27 22:08:13 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-12 18:19:07 +0300
commit45ef87954669c765cb7b317384066c6eb88dc5d3 (patch)
treef8ef494e7d440e04a9b1d138e5c6816dc4834f88 /desktop-widgets/command_edit.cpp
parent9e603cbe2bbcae1822859b284c39dd804bf321fb (diff)
downloadsubsurface-45ef87954669c765cb7b317384066c6eb88dc5d3.tar.gz
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>
Diffstat (limited to 'desktop-widgets/command_edit.cpp')
-rw-r--r--desktop-widgets/command_edit.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/desktop-widgets/command_edit.cpp b/desktop-widgets/command_edit.cpp
index f39f9339d..aab3dc791 100644
--- a/desktop-widgets/command_edit.cpp
+++ b/desktop-widgets/command_edit.cpp
@@ -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