diff options
author | Robert C. Helling <helling@atdotde.de> | 2014-06-03 10:06:18 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-03 07:23:43 -0700 |
commit | 6699e3ab3e3f617d5080720733df85cb6a9e2296 (patch) | |
tree | f5ecd9491f29d6dc5451240410dc7a33adbd5a0d /qt-ui/mainwindow.cpp | |
parent | 2785d7bc3eaaf9a2015dc2d281d7bf6136edc2c4 (diff) | |
download | subsurface-6699e3ab3e3f617d5080720733df85cb6a9e2296.tar.gz |
Add print button to planner
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index a49cdc460..d94ec8561 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -20,6 +20,7 @@ #include <QStringList> #include <QSettings> #include <QShortcut> +#include <QPrintDialog> #include <fcntl.h> #include "divelistview.h" #include "starwidget.h" @@ -419,6 +420,17 @@ void MainWindow::setPlanNotes(const char *notes) ui.divePlanOutput->setHtml(notes); } +void MainWindow::printPlan() +{ + QPrinter printer; + QPrintDialog *dialog = new QPrintDialog(&printer, this); + dialog->setWindowTitle(tr("Print runtime table")); + if (dialog->exec() != QDialog::Accepted) + return; + + ui.divePlanOutput->print(&printer); +} + void MainWindow::on_actionDivePlanner_triggered() { if(!plannerStateClean()) |