mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
4706b0f11a
commit
ee365b7341
3 changed files with 21 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue