summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/diveplanner.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-09-03 14:20:19 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-30 10:36:49 -0700
commite49d6213ad129284a45d53c3fcdc03249e84efe2 (patch)
tree2946a666ab38af3375e7bb2b8c5dd887d4a7f9a1 /desktop-widgets/diveplanner.h
parent588abd019fb2ed3f607682f2b6c7fe86a7a5bb90 (diff)
downloadsubsurface-e49d6213ad129284a45d53c3fcdc03249e84efe2.tar.gz
Move qt-ui to desktop-widgets
Since we have now destkop and mobile versions, 'qt-ui' was a very poor name choice for a folder that contains only destkop-enabled widgets. Also, move the graphicsview-common.h/cpp to subsurface-core because it doesn't depend on qgraphicsview, it merely implements all the colors that we use throughout Subsurface, and we will use colors on both desktop and mobile versions Same thing applies for metrics.h/cpp Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/diveplanner.h')
-rw-r--r--desktop-widgets/diveplanner.h104
1 files changed, 104 insertions, 0 deletions
diff --git a/desktop-widgets/diveplanner.h b/desktop-widgets/diveplanner.h
new file mode 100644
index 000000000..b2e03a97b
--- /dev/null
+++ b/desktop-widgets/diveplanner.h
@@ -0,0 +1,104 @@
+#ifndef DIVEPLANNER_H
+#define DIVEPLANNER_H
+
+#include <QGraphicsPathItem>
+#include <QAbstractTableModel>
+#include <QAbstractButton>
+#include <QDateTime>
+#include <QSignalMapper>
+
+#include "dive.h"
+
+class QListView;
+class QModelIndex;
+class DivePlannerPointsModel;
+
+class DiveHandler : public QObject, public QGraphicsEllipseItem {
+ Q_OBJECT
+public:
+ DiveHandler();
+
+protected:
+ void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
+ void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+signals:
+ void moved();
+ void clicked();
+ void released();
+private:
+ int parentIndex();
+public
+slots:
+ void selfRemove();
+ void changeGas();
+private:
+ QTime t;
+};
+
+#include "ui_diveplanner.h"
+
+class DivePlannerWidget : public QWidget {
+ Q_OBJECT
+public:
+ explicit DivePlannerWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
+ void setReplanButton(bool replan);
+public
+slots:
+ void setupStartTime(QDateTime startTime);
+ void settingsChanged();
+ void atmPressureChanged(const int pressure);
+ void heightChanged(const int height);
+ void salinityChanged(const double salinity);
+ void printDecoPlan();
+
+private:
+ Ui::DivePlanner ui;
+ QAbstractButton *replanButton;
+};
+
+#include "ui_plannerSettings.h"
+
+class PlannerSettingsWidget : public QWidget {
+ Q_OBJECT
+public:
+ explicit PlannerSettingsWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
+ virtual ~PlannerSettingsWidget();
+public
+slots:
+ void settingsChanged();
+ void atmPressureChanged(const QString &pressure);
+ void bottomSacChanged(const double bottomSac);
+ void decoSacChanged(const double decosac);
+ void printDecoPlan();
+ void setAscRate75(int rate);
+ void setAscRate50(int rate);
+ void setAscRateStops(int rate);
+ void setAscRateLast6m(int rate);
+ void setDescRate(int rate);
+ void setBottomPo2(double po2);
+ void setDecoPo2(double po2);
+ void setBackgasBreaks(bool dobreaks);
+ void disableDecoElements(int mode);
+
+private:
+ Ui::plannerSettingsWidget ui;
+ void updateUnitsUI();
+ QSignalMapper *modeMapper;
+};
+
+#include "ui_plannerDetails.h"
+
+class PlannerDetails : public QWidget {
+ Q_OBJECT
+public:
+ explicit PlannerDetails(QWidget *parent = 0);
+ QPushButton *printPlan() const { return ui.printPlan; }
+ QTextEdit *divePlanOutput() const { return ui.divePlanOutput; }
+
+private:
+ Ui::plannerDetails ui;
+};
+
+#endif // DIVEPLANNER_H