mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Undo: implement undo of dive trip editing
This is copying the dive editing code. It uses an OO design with virtual functions for getting and setting the values. It doesn't use templates though, as both fields of strig type. This feels a bit over-engineered, but it is 1) consistent with the dive edit code and 2) the number / types of dive trip fields might increase. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
9fd87fa080
commit
d7d408a99e
8 changed files with 207 additions and 57 deletions
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include <QObject>
|
||||
|
||||
// Dive fields that can be edited.
|
||||
// Dive and trip fields that can be edited.
|
||||
// Use "enum class" to not polute the global name space.
|
||||
enum class DiveField {
|
||||
NR,
|
||||
|
|
@ -29,6 +29,10 @@ enum class DiveField {
|
|||
MODE,
|
||||
NOTES,
|
||||
};
|
||||
enum class TripField {
|
||||
LOCATION,
|
||||
NOTES
|
||||
};
|
||||
|
||||
class DiveListNotifier : public QObject {
|
||||
Q_OBJECT
|
||||
|
|
@ -54,6 +58,9 @@ signals:
|
|||
void cylindersReset(dive_trip *trip, const QVector<dive *> &dives);
|
||||
void weightsystemsReset(dive_trip *trip, const QVector<dive *> &dives);
|
||||
|
||||
// Trip edited signal
|
||||
void tripChanged(dive_trip *trip, TripField field);
|
||||
|
||||
// Selection-signals come in two kinds:
|
||||
// - divesSelected, divesDeselected and currentDiveChanged are finer grained and are
|
||||
// called batch-wise per trip (except currentDiveChanged, of course). These signals
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue