mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
3ee41328f9
Simpler memory management. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
54 lines
1.3 KiB
C++
54 lines
1.3 KiB
C++
// SPDX-License-Identifier: GPL-2.0
|
|
// The profile and its toolbars.
|
|
|
|
#ifndef PROFILEWIDGET_H
|
|
#define PROFILEWIDGET_H
|
|
|
|
#include "ui_profilewidget.h"
|
|
#include "core/subsurface-qt/divelistnotifier.h"
|
|
|
|
#include <vector>
|
|
|
|
struct dive;
|
|
class ProfileWidget2;
|
|
class EmptyView;
|
|
class QStackedWidget;
|
|
|
|
class ProfileWidget : public QWidget {
|
|
Q_OBJECT
|
|
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);
|
|
void cylindersChanged(struct dive *changed, int pos);
|
|
void unsetProfHR();
|
|
void unsetProfTissues();
|
|
void stopAdded();
|
|
void stopRemoved(int count);
|
|
void stopMoved(int count);
|
|
void stopEdited();
|
|
private:
|
|
std::unique_ptr<EmptyView> emptyView;
|
|
std::vector<QAction *> toolbarActions;
|
|
Ui::ProfileWidget ui;
|
|
QStackedWidget *stack;
|
|
void setDive(const struct dive *d, int dcNr);
|
|
void editDive();
|
|
void exitEditMode();
|
|
void rotateDC(int dir);
|
|
std::unique_ptr<dive> editedDive;
|
|
bool placingCommand;
|
|
};
|
|
|
|
#endif // PROFILEWIDGET_H
|