diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-11-08 22:47:38 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-05 10:14:25 -0800 |
commit | 72c6b838662f1fb79a806ac2264c7215efa0aa67 (patch) | |
tree | 8b10fe7ad548a62ed428347c8a35882ee291b41a /core/equipment.h | |
parent | 029c9ccf020fdb73c148da489e0e7b1acd3ca149 (diff) | |
download | subsurface-72c6b838662f1fb79a806ac2264c7215efa0aa67.tar.gz |
Undo: make weight editing undoable
Implement the EditWeight undo command. Since there is common code
(storage of the old weight), this creates a common base class for
RemoveWeight and EditWeight. The model calls directly into the undo
command, which is somewhat unfortunate as it feels like a layering
violation. It's the easy thing to do for now.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/equipment.h')
-rw-r--r-- | core/equipment.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/equipment.h b/core/equipment.h index 77fd9c430..11d6f37c1 100644 --- a/core/equipment.h +++ b/core/equipment.h @@ -83,6 +83,7 @@ extern bool same_weightsystem(weightsystem_t w1, weightsystem_t w2); extern bool same_cylinder(cylinder_t cyl1, cylinder_t cyl2); extern void remove_cylinder(struct dive *dive, int idx); extern void remove_weightsystem(struct dive *dive, int idx); +extern void set_weightsystem(struct dive *dive, int idx, weightsystem_t ws); extern void reset_cylinders(struct dive *dive, bool track_gas); extern int gas_volume(const cylinder_t *cyl, pressure_t p); /* Volume in mliter of a cylinder at pressure 'p' */ extern int find_best_gasmix_match(struct gasmix mix, const struct cylinder_table *cylinders); |