summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command_divesite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/command_divesite.cpp')
-rw-r--r--desktop-widgets/command_divesite.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/desktop-widgets/command_divesite.cpp b/desktop-widgets/command_divesite.cpp
index b3a4911e5..5d32a902d 100644
--- a/desktop-widgets/command_divesite.cpp
+++ b/desktop-widgets/command_divesite.cpp
@@ -159,4 +159,27 @@ void EditDiveSiteDescription::undo()
redo();
}
+EditDiveSiteNotes::EditDiveSiteNotes(dive_site *dsIn, const QString &notes) : ds(dsIn),
+ value(notes)
+{
+ setText(tr("Edit dive site notes"));
+}
+
+bool EditDiveSiteNotes::workToBeDone()
+{
+ return value != QString(ds->notes);
+}
+
+void EditDiveSiteNotes::redo()
+{
+ swap(ds->notes, value);
+ emit diveListNotifier.diveSiteChanged(ds, LocationInformationModel::NOTES); // Inform frontend of changed dive site.
+}
+
+void EditDiveSiteNotes::undo()
+{
+ // Undo and redo do the same
+ redo();
+}
+
} // namespace Command