aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/printdialog.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-02-13 22:43:55 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-02-17 07:26:55 -0800
commit42cff9b3a506d2b52739d8714d5698e1a3b2e3f9 (patch)
treef473c21e7d8e056f1630078dc7207c35dd912d54 /desktop-widgets/printdialog.cpp
parent18049bc8d08a4e223a9824efb26b710e6bca1958 (diff)
downloadsubsurface-42cff9b3a506d2b52739d8714d5698e1a3b2e3f9.tar.gz
planner: pass in_planner down to TemplateLayout
The TemplateLayout prints different dives depending on whether the planner is active. Instead of accessing a global variable, pass the status down from the MainWindow. That's all quite convoluted, since there are multiple layers involved. On the positive side, the in_planner() function has now no users an can be removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/printdialog.cpp')
-rw-r--r--desktop-widgets/printdialog.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/desktop-widgets/printdialog.cpp b/desktop-widgets/printdialog.cpp
index 8187dda6e..a4c181c68 100644
--- a/desktop-widgets/printdialog.cpp
+++ b/desktop-widgets/printdialog.cpp
@@ -19,8 +19,9 @@
template_options::color_palette_struct ssrf_colors, almond_colors, blueshades_colors, custom_colors;
-PrintDialog::PrintDialog(QWidget *parent) :
+PrintDialog::PrintDialog(bool inPlanner, QWidget *parent) :
QDialog(parent, QFlag(0)),
+ inPlanner(inPlanner),
printer(NULL),
qprinter(NULL)
{
@@ -174,10 +175,10 @@ void PrintDialog::createPrinterObj()
{
// create a new printer object
if (!printer) {
- qprinter = new QPrinter();
+ qprinter = new QPrinter;
qprinter->setResolution(printOptions.resolution);
qprinter->setOrientation((QPrinter::Orientation)printOptions.landscape);
- printer = new Printer(qprinter, printOptions, templateOptions, Printer::PRINT);
+ printer = new Printer(qprinter, printOptions, templateOptions, Printer::PRINT, inPlanner);
}
}