mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Print: add the support to store margins and printer options
All the print options will be stored after the user closes or "cancels" the print dialog. There seems to be no good way to store the last selected page size, because print dialogs are different and some just list them as strings - A4, A3, etc. The patch also applies the following changes: - renames display.h's 'struct options' to 'struct print_options' as these were really just for the print dialog - the print_options dialog now stores more options as 'bool' - demote PrintDialog's 'printOptions' to 'private' Fixes #653 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b2077dc9c0
commit
7ea728e95f
7 changed files with 83 additions and 30 deletions
|
@ -1,7 +1,7 @@
|
|||
#include "printoptions.h"
|
||||
#include "../display.h"
|
||||
|
||||
PrintOptions::PrintOptions(QWidget *parent, struct options *printOpt)
|
||||
PrintOptions::PrintOptions(QWidget *parent, struct print_options *printOpt)
|
||||
{
|
||||
hasSetupSlots = false;
|
||||
ui.setupUi(this);
|
||||
|
@ -12,21 +12,21 @@ PrintOptions::PrintOptions(QWidget *parent, struct options *printOpt)
|
|||
setup(printOpt);
|
||||
}
|
||||
|
||||
void PrintOptions::setup(struct options *printOpt)
|
||||
void PrintOptions::setup(struct print_options *printOpt)
|
||||
{
|
||||
printOptions = printOpt;
|
||||
// print type radio buttons
|
||||
switch (printOptions->type) {
|
||||
case options::PRETTY:
|
||||
case print_options::PRETTY:
|
||||
ui.radioSixDives->setChecked(true);
|
||||
break;
|
||||
case options::TWOPERPAGE:
|
||||
case print_options::TWOPERPAGE:
|
||||
ui.radioTwoDives->setChecked(true);
|
||||
break;
|
||||
case options::ONEPERPAGE:
|
||||
case print_options::ONEPERPAGE:
|
||||
ui.radioOneDive->setChecked(true);
|
||||
break;
|
||||
case options::TABLE:
|
||||
case print_options::TABLE:
|
||||
ui.radioTablePrint->setChecked(true);
|
||||
break;
|
||||
}
|
||||
|
@ -61,33 +61,33 @@ void PrintOptions::setup(struct options *printOpt)
|
|||
// print type radio buttons
|
||||
void PrintOptions::radioSixDivesClicked(bool check)
|
||||
{
|
||||
printOptions->type = options::PRETTY;
|
||||
printOptions->type = print_options::PRETTY;
|
||||
}
|
||||
|
||||
void PrintOptions::radioTwoDivesClicked(bool check)
|
||||
{
|
||||
printOptions->type = options::TWOPERPAGE;
|
||||
printOptions->type = print_options::TWOPERPAGE;
|
||||
}
|
||||
|
||||
void PrintOptions::radioOneDiveClicked(bool check)
|
||||
{
|
||||
printOptions->type = options::ONEPERPAGE;
|
||||
printOptions->type = print_options::ONEPERPAGE;
|
||||
}
|
||||
|
||||
void PrintOptions::radioTablePrintClicked(bool check)
|
||||
{
|
||||
printOptions->type = options::TABLE;
|
||||
printOptions->type = print_options::TABLE;
|
||||
}
|
||||
|
||||
// general print option checkboxes
|
||||
void PrintOptions::printInColorClicked(bool check)
|
||||
{
|
||||
printOptions->color_selected = (int)check;
|
||||
printOptions->color_selected = check;
|
||||
}
|
||||
|
||||
void PrintOptions::printSelectedClicked(bool check)
|
||||
{
|
||||
printOptions->print_selected = (int)check;
|
||||
printOptions->print_selected = check;
|
||||
}
|
||||
|
||||
// ordering
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue