diff options
Diffstat (limited to 'commands/command_edit.h')
-rw-r--r-- | commands/command_edit.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/commands/command_edit.h b/commands/command_edit.h index c23f06094..76b538b4d 100644 --- a/commands/command_edit.h +++ b/commands/command_edit.h @@ -339,16 +339,32 @@ private: bool workToBeDone() override; }; -class RemoveWeight : public EditDivesBase { +class EditWeightBase : public EditDivesBase { +protected: + EditWeightBase(int index, bool currentDiveOnly); + ~EditWeightBase(); + + weightsystem_t ws; + std::vector<int> indexes; // An index for each dive in the dives vector. + bool workToBeDone() override; +}; + +class RemoveWeight : public EditWeightBase { public: RemoveWeight(int index, bool currentDiveOnly); - ~RemoveWeight(); private: - weightsystem_t ws; - std::vector<int> indexes; // An index for each dive in the dives vector. void undo() override; void redo() override; - bool workToBeDone() override; +}; + +class EditWeight : public EditWeightBase { +public: + EditWeight(int index, weightsystem_t ws, bool currentDiveOnly); // Clones ws + ~EditWeight(); +private: + weightsystem_t new_ws; + void undo() override; + void redo() override; }; } // namespace Command |