summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command_divesite.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-03-12 23:51:39 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-12 18:19:07 +0300
commit0e1b0cf1da697851b0db4f8b860da8ac3a509d17 (patch)
treeeea365971c6f509121efcd0277f352c6c88a1f31 /desktop-widgets/command_divesite.h
parent8e1f736d2b608784e1ea942ec8579d2361691c43 (diff)
downloadsubsurface-0e1b0cf1da697851b0db4f8b860da8ac3a509d17.tar.gz
Undo: Implement undo of dive site name editing
Implement an undo command that edits the name of a dive site. Connect it to the dive site table, so that names can be edited directly in the table. Send signals on undo / redo so that the dive site table and the dive site edit widget can be updated. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/command_divesite.h')
-rw-r--r--desktop-widgets/command_divesite.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/desktop-widgets/command_divesite.h b/desktop-widgets/command_divesite.h
index 9c4f93058..692e5c109 100644
--- a/desktop-widgets/command_divesite.h
+++ b/desktop-widgets/command_divesite.h
@@ -16,14 +16,26 @@ public:
DeleteDiveSites(const QVector<dive_site *> &sites);
private:
bool workToBeDone() override;
+ void undo() override;
+ void redo() override;
// For redo
std::vector<dive_site *> sitesToRemove;
// For undo
std::vector<OwningDiveSitePtr> sitesToAdd;
+};
+
+class EditDiveSiteName : public Base {
+public:
+ EditDiveSiteName(dive_site *ds, const QString &name);
+private:
+ bool workToBeDone() override;
void undo() override;
void redo() override;
+
+ dive_site *ds;
+ QString value; // Value to be set
};
} // namespace Command