summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--qt-ui/diveplanner.cpp11
-rw-r--r--qt-ui/diveplanner.h14
-rw-r--r--qt-ui/mainwindow.cpp3
4 files changed, 30 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index f8770d344..17f1dcd1a 100644
--- a/Makefile
+++ b/Makefile
@@ -50,6 +50,7 @@ HEADERS = \
qt-ui/simplewidgets.h \
qt-ui/subsurfacewebservices.h \
qt-ui/divecomputermanagementdialog.h \
+ qt-ui/diveplanner.h \
SOURCES = \
@@ -85,6 +86,7 @@ SOURCES = \
qt-ui/simplewidgets.cpp \
qt-ui/subsurfacewebservices.cpp \
qt-ui/divecomputermanagementdialog.cpp \
+ qt-ui/diveplanner.cpp \
$(RESFILE)
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
new file mode 100644
index 000000000..d8d1bfbfc
--- /dev/null
+++ b/qt-ui/diveplanner.cpp
@@ -0,0 +1,11 @@
+#include "diveplanner.h"
+
+DivePlanner* DivePlanner::instance()
+{
+ static DivePlanner *self = new DivePlanner();
+ return self;
+}
+
+DivePlanner::DivePlanner(QWidget* parent): QGraphicsView(parent)
+{
+}
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h
new file mode 100644
index 000000000..9a7d0859f
--- /dev/null
+++ b/qt-ui/diveplanner.h
@@ -0,0 +1,14 @@
+#ifndef DIVEPLANNER_H
+#define DIVEPLANNER_H
+
+#include <QGraphicsView>
+#include <QGraphicsPathItem>
+
+class DivePlanner : public QGraphicsView {
+ Q_OBJECT
+public:
+ static DivePlanner *instance();
+private:
+ DivePlanner(QWidget* parent = 0);
+};
+#endif
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 06e6b7734..75fb21a64 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -32,6 +32,7 @@
#include "subsurfacewebservices.h"
#include "divecomputermanagementdialog.h"
#include "simplewidgets.h"
+#include "diveplanner.h"
static MainWindow* instance = 0;
@@ -178,6 +179,8 @@ void MainWindow::on_actionExportUDDF_triggered()
void MainWindow::on_actionPrint_triggered()
{
+ // hijacking the print action for a while.
+ DivePlanner::instance()->show();
qDebug("actionPrint");
}