diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-09-10 15:29:03 +0200 |
---|---|---|
committer | Robert C. Helling <helling@atdotde.de> | 2019-09-10 21:31:21 +0200 |
commit | ee365b734119be424e48c4a2cef5f54021521cb8 (patch) | |
tree | 65751a173a73e01a5fd05b0d437bf4070dfaa511 /desktop-widgets/mainwindow.cpp | |
parent | 4706b0f11ae335c1d23e1334b3530fce1a2c9279 (diff) | |
download | subsurface-ee365b734119be424e48c4a2cef5f54021521cb8.tar.gz |
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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("<img height=50 src=\":subsurface-icon\"> ") + diveplan + QString(disclaimer); + char *disclaimer = get_planner_disclaimer_formatted(); + QString diveplan = QStringLiteral("<img height=50 src=\":subsurface-icon\"> ") + + 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("<img src=\"data:image/png;base64,") + byteArray.toBase64() + "\"/><br><br>"; - 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 |