mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
2f4b415e91
commit
e27653374d
5 changed files with 20 additions and 17 deletions
|
@ -1,5 +1,6 @@
|
||||||
core: fix bug when save sea water salinity given by DC
|
core: fix bug when save sea water salinity given by DC
|
||||||
desktop: add column for dive notes to the dive list table
|
desktop: add column for dive notes to the dive list table
|
||||||
|
desktop: Add an option for printing in landscape mode
|
||||||
desktop: fix bug when printing a dive plan with multiple segments
|
desktop: fix bug when printing a dive plan with multiple segments
|
||||||
desktop: fix remembering of bluetooth address for remembered dive computers (not MacOS)
|
desktop: fix remembering of bluetooth address for remembered dive computers (not MacOS)
|
||||||
desktop: fix bug in bailout gas selection for CCR dives
|
desktop: fix bug in bailout gas selection for CCR dives
|
||||||
|
|
|
@ -155,6 +155,7 @@ void PrintDialog::onFinished()
|
||||||
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);
|
s.setValue("resolution", printOptions.resolution);
|
||||||
|
s.setValue("landscape", printOptions.landscape);
|
||||||
|
|
||||||
// save template settings
|
// save template settings
|
||||||
s.setValue("font", templateOptions.font_index);
|
s.setValue("font", templateOptions.font_index);
|
||||||
|
|
|
@ -37,6 +37,7 @@ void PrintOptions::setup()
|
||||||
// general print option checkboxes
|
// general print option checkboxes
|
||||||
ui.printInColor->setChecked(printOptions.color_selected);
|
ui.printInColor->setChecked(printOptions.color_selected);
|
||||||
ui.printSelected->setChecked(printOptions.print_selected);
|
ui.printSelected->setChecked(printOptions.print_selected);
|
||||||
|
ui.printLandscape->setChecked(printOptions.landscape);
|
||||||
|
|
||||||
// resolution
|
// resolution
|
||||||
ui.resolution->setValue(printOptions.resolution);
|
ui.resolution->setValue(printOptions.resolution);
|
||||||
|
@ -45,9 +46,16 @@ void PrintOptions::setup()
|
||||||
if (hasSetupSlots)
|
if (hasSetupSlots)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
connect(ui.printInColor, SIGNAL(clicked(bool)), this, SLOT(printInColorClicked(bool)));
|
connect(ui.printInColor, &QCheckBox::clicked, this, [this](bool value) {
|
||||||
connect(ui.printSelected, SIGNAL(clicked(bool)), this, SLOT(printSelectedClicked(bool)));
|
printOptions.color_selected = value;
|
||||||
connect(ui.resolution, QOverload<int>::of(&QSpinBox::valueChanged), [this](int 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;
|
printOptions.resolution = value;
|
||||||
});
|
});
|
||||||
hasSetupSlots = true;
|
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)
|
void PrintOptions::on_printTemplate_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
printOptions.p_template = ui.printTemplate->itemData(index).toString();
|
printOptions.p_template = ui.printTemplate->itemData(index).toString();
|
||||||
|
|
|
@ -78,8 +78,6 @@ private:
|
||||||
|
|
||||||
private
|
private
|
||||||
slots:
|
slots:
|
||||||
void printInColorClicked(bool check);
|
|
||||||
void printSelectedClicked(bool check);
|
|
||||||
void on_radioStatisticsPrint_toggled(bool check);
|
void on_radioStatisticsPrint_toggled(bool check);
|
||||||
void on_radioDiveListPrint_toggled(bool check);
|
void on_radioDiveListPrint_toggled(bool check);
|
||||||
void on_printTemplate_currentIndexChanged(int index);
|
void on_printTemplate_currentIndexChanged(int index);
|
||||||
|
|
|
@ -93,6 +93,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="printLandscape">
|
||||||
|
<property name="text">
|
||||||
|
<string>Page orientation landscape</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
|
|
Loading…
Add table
Reference in a new issue