aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command_edit.h
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/command_edit.h')
-rw-r--r--desktop-widgets/command_edit.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/desktop-widgets/command_edit.h b/desktop-widgets/command_edit.h
index d23860283..0ba3d1a14 100644
--- a/desktop-widgets/command_edit.h
+++ b/desktop-widgets/command_edit.h
@@ -29,6 +29,7 @@ namespace Command {
class EditDivesBase : public Base {
protected:
EditDivesBase(bool currentDiveOnly);
+ EditDivesBase(dive *d);
std::vector<dive *> dives; // Dives to be edited.
// On undo, we set the selection and current dive at the time of the operation.
@@ -50,6 +51,7 @@ protected:
public:
EditBase(T newValue, bool currentDiveOnly);
+ EditBase(T newValue, dive *d);
protected:
// Get and set functions to be overriden by sub-classes.
@@ -174,6 +176,15 @@ public:
DiveField fieldId() const override;
};
+class EditNumber : public EditBase<int> {
+public:
+ using EditBase<int>::EditBase; // Use constructor of base class.
+ void set(struct dive *d, int number) const override;
+ int data(struct dive *d) const override;
+ QString fieldName() const override;
+ DiveField fieldId() const override;
+};
+
// Fields that work with tag-lists (tags, buddies, divemasters) work differently and therefore
// have their own base class. In this case, it's not a template, as all these lists are base
// on strings.