Disclaimer included in the printed diveplan

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-04 23:34:09 +02:00 committed by Dirk Hohndel
parent 714fdc7ced
commit 40dd6f4c39
3 changed files with 16 additions and 8 deletions

View file

@ -41,6 +41,7 @@
#include "about.h"
#include "worldmap-save.h"
#include "updatemanager.h"
#include "planner.h"
#ifndef NO_PRINTING
#include "printdialog.h"
#endif
@ -424,13 +425,18 @@ void MainWindow::setPlanNotes(const char *notes)
void MainWindow::printPlan()
{
QString diveplan = ui.divePlanOutput->toHtml();
QString withDisclaimer = diveplan + QString(disclaimer);
QPrinter printer;
QPrintDialog *dialog = new QPrintDialog(&printer, this);
dialog->setWindowTitle(tr("Print runtime table"));
if (dialog->exec() != QDialog::Accepted)
return;
ui.divePlanOutput->setHtml(withDisclaimer);
ui.divePlanOutput->print(&printer);
ui.divePlanOutput->setHtml(diveplan);
}
void MainWindow::on_actionDivePlanner_triggered()