Add printing option for page orientation

Strangely enough, half of the infrastructure was
already there, it just wasn't hooked up to a UI
element

Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
Robert C. Helling 2023-03-18 18:23:33 +01:00 committed by Dirk Hohndel
parent 2f4b415e91
commit e27653374d
5 changed files with 20 additions and 17 deletions

View file

@ -37,6 +37,7 @@ void PrintOptions::setup()
// general print option checkboxes
ui.printInColor->setChecked(printOptions.color_selected);
ui.printSelected->setChecked(printOptions.print_selected);
ui.printLandscape->setChecked(printOptions.landscape);
// resolution
ui.resolution->setValue(printOptions.resolution);
@ -45,9 +46,16 @@ void PrintOptions::setup()
if (hasSetupSlots)
return;
connect(ui.printInColor, SIGNAL(clicked(bool)), this, SLOT(printInColorClicked(bool)));
connect(ui.printSelected, SIGNAL(clicked(bool)), this, SLOT(printSelectedClicked(bool)));
connect(ui.resolution, QOverload<int>::of(&QSpinBox::valueChanged), [this](int value) {
connect(ui.printInColor, &QCheckBox::clicked, this, [this](bool value) {
printOptions.color_selected = value;
});
connect(ui.printSelected, &QCheckBox::clicked, this, [this](bool value) {
printOptions.print_selected = value;
});
connect(ui.printLandscape, &QCheckBox::clicked, this, [this](bool value) {
printOptions.landscape = value;
});
connect(ui.resolution, QOverload<int>::of(&QSpinBox::valueChanged), this, [this](int value) {
printOptions.resolution = value;
});
hasSetupSlots = true;
@ -109,18 +117,6 @@ void PrintOptions::on_radioStatisticsPrint_toggled(bool check)
}
}
// general print option checkboxes
void PrintOptions::printInColorClicked(bool check)
{
printOptions.color_selected = check;
}
void PrintOptions::printSelectedClicked(bool check)
{
printOptions.print_selected = check;
}
void PrintOptions::on_printTemplate_currentIndexChanged(int index)
{
printOptions.p_template = ui.printTemplate->itemData(index).toString();