mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
printing: properly initialize DPI value
The DPI value in the print_options structure was never initialized. This could lead to random DPI values and crashes. How this ever worked is a mystery. Therefore, read and write the DPI value from the settings just as the other print-options. And initialize the corresponding dialog widget to this value. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
6d93a14d18
commit
0272f118ae
2 changed files with 5 additions and 0 deletions
|
@ -50,6 +50,7 @@ PrintDialog::PrintDialog(QWidget *parent) :
|
||||||
printOptions.color_selected = s.value("color_selected", true).toBool();
|
printOptions.color_selected = s.value("color_selected", true).toBool();
|
||||||
printOptions.landscape = s.value("landscape", false).toBool();
|
printOptions.landscape = s.value("landscape", false).toBool();
|
||||||
printOptions.p_template = s.value("template_selected", "one_dive.html").toString();
|
printOptions.p_template = s.value("template_selected", "one_dive.html").toString();
|
||||||
|
printOptions.resolution = s.value("resolution", 600).toInt();
|
||||||
templateOptions.font_index = s.value("font", 0).toInt();
|
templateOptions.font_index = s.value("font", 0).toInt();
|
||||||
templateOptions.font_size = s.value("font_size", 9).toDouble();
|
templateOptions.font_size = s.value("font_size", 9).toDouble();
|
||||||
templateOptions.color_palette_index = s.value("color_palette", SSRF_COLORS).toInt();
|
templateOptions.color_palette_index = s.value("color_palette", SSRF_COLORS).toInt();
|
||||||
|
@ -150,6 +151,7 @@ void PrintDialog::onFinished()
|
||||||
s.setValue("print_selected", printOptions.print_selected);
|
s.setValue("print_selected", printOptions.print_selected);
|
||||||
s.setValue("color_selected", printOptions.color_selected);
|
s.setValue("color_selected", printOptions.color_selected);
|
||||||
s.setValue("template_selected", printOptions.p_template);
|
s.setValue("template_selected", printOptions.p_template);
|
||||||
|
s.setValue("resolution", printOptions.resolution);
|
||||||
|
|
||||||
// save template settings
|
// save template settings
|
||||||
s.setValue("font", templateOptions.font_index);
|
s.setValue("font", templateOptions.font_index);
|
||||||
|
|
|
@ -38,6 +38,9 @@ void PrintOptions::setup()
|
||||||
ui.printInColor->setChecked(printOptions->color_selected);
|
ui.printInColor->setChecked(printOptions->color_selected);
|
||||||
ui.printSelected->setChecked(printOptions->print_selected);
|
ui.printSelected->setChecked(printOptions->print_selected);
|
||||||
|
|
||||||
|
// resolution
|
||||||
|
ui.resolution->setValue(printOptions->resolution);
|
||||||
|
|
||||||
// connect slots only once
|
// connect slots only once
|
||||||
if (hasSetupSlots)
|
if (hasSetupSlots)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue