selection: move current dc logic to profile widget

The current dc global makes no sense on mobile. Therefore,
move the logic of the currently displayed dive computer
to the profile widget and remove the dc_number global
variable.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-09-17 19:07:35 +02:00 committed by bstoeger
parent 19baae449d
commit cad80e5a53
10 changed files with 92 additions and 66 deletions

View file

@ -23,9 +23,14 @@ public:
ProfileWidget();
~ProfileWidget();
std::unique_ptr<ProfileWidget2> view;
void plotDive(struct dive *d, int dc); // Attempt to keep DC number id dc < 0
void plotCurrentDive();
void setPlanState(const struct dive *d, int dc);
void setEnabledToolbar(bool enabled);
void nextDC();
void prevDC();
dive *d;
int dc;
private
slots:
void divesChanged(const QVector<dive *> &dives, DiveField field);
@ -47,8 +52,9 @@ private:
void setDive(const struct dive *d);
void editDive();
void exitEditMode();
void rotateDC(int dir);
std::unique_ptr<dive, DiveDeleter> editedDive;
unsigned int editedDc;
int editedDc;
dive *originalDive;
bool placingCommand;
};