mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add undo/redo commands for importing dive sites
ImportDiveSites adds the provided dive sites to the core dive site table and stores the source data so it can be undone. Signed-off-by: Doug Junkins <junkins@foghead.com>
This commit is contained in:
parent
c38a86bebf
commit
704ff9f82e
4 changed files with 59 additions and 1 deletions
|
@ -21,10 +21,26 @@ private:
|
|||
|
||||
// Note: we only add one dive site. Nevertheless, we use vectors so that we
|
||||
// can reuse the dive site deletion code.
|
||||
// For redo
|
||||
// For undo
|
||||
std::vector<dive_site *> sitesToRemove;
|
||||
|
||||
// For redo
|
||||
std::vector<OwningDiveSitePtr> sitesToAdd;
|
||||
};
|
||||
|
||||
class ImportDiveSites : public Base {
|
||||
public:
|
||||
// Note: the dive site table is consumed after the call it will be empty.
|
||||
ImportDiveSites(struct dive_site_table *sites, const QString &source);
|
||||
private:
|
||||
bool workToBeDone() override;
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
|
||||
// For undo
|
||||
std::vector<dive_site *> sitesToRemove;
|
||||
|
||||
// For redo
|
||||
std::vector<OwningDiveSitePtr> sitesToAdd;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue