mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile/undo: create EditDive command
Command that just swaps two dives. This is rather complex, as for example a dive site might be created. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2009321894
commit
57b96490b2
7 changed files with 218 additions and 67 deletions
|
@ -375,6 +375,33 @@ private:
|
|||
void redo() override;
|
||||
};
|
||||
|
||||
#ifdef SUBSURFACE_MOBILE
|
||||
// Edit a full dive. This is used on mobile where we don't have per-field granularity.
|
||||
// It may add or edit a dive site.
|
||||
class EditDive : public Base {
|
||||
public:
|
||||
EditDive(dive *oldDive, dive *newDive, dive_site *createDs, dive_site *editDs, location_t dsLocation); // Takes ownership of newDive
|
||||
private:
|
||||
dive *oldDive; // Dive that is going to be overwritten
|
||||
OwningDivePtr newDive; // New data
|
||||
int changedFields;
|
||||
|
||||
dive_site *siteToRemove;
|
||||
OwningDiveSitePtr siteToAdd;
|
||||
|
||||
dive_site *siteToEdit;
|
||||
location_t dsLocation;
|
||||
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
bool workToBeDone() override;
|
||||
|
||||
void exchangeDives();
|
||||
void editDs();
|
||||
};
|
||||
|
||||
#endif // SUBSURFACE_MOBILE
|
||||
|
||||
} // namespace Command
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue