diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2014-11-14 00:57:42 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-13 15:05:11 -0800 |
commit | 7ea728e95ffcc72360d49648d7e332a06faa49ba (patch) | |
tree | cfb07ab36c024febdab25c2e67a90d7eef825b2a /qt-ui/printoptions.cpp | |
parent | b2077dc9c0bb9eeccbf48980d0d22269b621e8c3 (diff) | |
download | subsurface-7ea728e95ffcc72360d49648d7e332a06faa49ba.tar.gz |
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>
Diffstat (limited to 'qt-ui/printoptions.cpp')
-rw-r--r-- | qt-ui/printoptions.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/qt-ui/printoptions.cpp b/qt-ui/printoptions.cpp index 818e89c33..21e299930 100644 --- a/qt-ui/printoptions.cpp +++ b/qt-ui/printoptions.cpp @@ -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 |