From ee365b734119be424e48c4a2cef5f54021521cb8 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 10 Sep 2019 15:29:03 +0200 Subject: Plan: introduce function that returns disclaimer The setting of the disclaimer variable was removed inadvertently some time ago, which removed the disclaimer from the printed plan. Instead, introduce a function that returns the disclaimer with the current deco mode. Use that function to generate the dive notes and for printing. Signed-off-by: Berthold Stoeger --- desktop-widgets/mainwindow.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 004d5823d..bed142ecc 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -850,8 +850,10 @@ void MainWindow::updateVariations(QString variations) void MainWindow::printPlan() { #ifndef NO_PRINTING - QString diveplan = plannerDetails->divePlanOutput()->toHtml(); - QString withDisclaimer = QString(" ") + diveplan + QString(disclaimer); + char *disclaimer = get_planner_disclaimer_formatted(); + QString diveplan = QStringLiteral(" ") + + QString(disclaimer) + plannerDetails->divePlanOutput()->toHtml(); + free(disclaimer); QPrinter printer; QPrintDialog *dialog = new QPrintDialog(&printer, this); @@ -885,9 +887,9 @@ void MainWindow::printPlan() QBuffer buffer(&byteArray); pixmap.save(&buffer, "PNG"); QString profileImage = QString("

"; - withDisclaimer = profileImage + withDisclaimer; + diveplan = profileImage + diveplan; - plannerDetails->divePlanOutput()->setHtml(withDisclaimer); + plannerDetails->divePlanOutput()->setHtml(diveplan); plannerDetails->divePlanOutput()->print(&printer); plannerDetails->divePlanOutput()->setHtml(displayed_dive.notes); #endif -- cgit v1.2.3-70-g09d2