mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Undo: implement undo of dive site notes editing
Simply copy the code of description editing. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2bb2643ae4
commit
4d183e0d75
7 changed files with 53 additions and 13 deletions
|
@ -159,4 +159,27 @@ void EditDiveSiteDescription::undo()
|
|||
redo();
|
||||
}
|
||||
|
||||
EditDiveSiteNotes::EditDiveSiteNotes(dive_site *dsIn, const QString ¬es) : 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue