Add print button to planner

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Robert C. Helling 2014-06-03 10:06:18 +02:00 committed by Dirk Hohndel
parent 2785d7bc3e
commit 6699e3ab3e
5 changed files with 34 additions and 7 deletions

View file

@ -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())