diff options
author | Gehad elrobey <gehadelrobey@gmail.com> | 2015-07-24 14:27:33 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2015-07-28 11:37:33 +0300 |
commit | 2a85be91b1bc3ae80a75e5508ffdfc7b7e4c1daa (patch) | |
tree | 54b98e741b7c25a3d228c5bd59b84291fedf0e5b /qt-ui/printdialog.cpp | |
parent | 2b2c506cb7e5e1659ad68818eca46d14d7840ecd (diff) | |
download | subsurface-2a85be91b1bc3ae80a75e5508ffdfc7b7e4c1daa.tar.gz |
Printing: save/load selected template by QSettings
We save the selected template name on closing the printDialog, We also
load the last selected template from QSettings when initializing the
dialog.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'qt-ui/printdialog.cpp')
-rw-r--r-- | qt-ui/printdialog.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-ui/printdialog.cpp b/qt-ui/printdialog.cpp index bb6643b31..c7ce327f5 100644 --- a/qt-ui/printdialog.cpp +++ b/qt-ui/printdialog.cpp @@ -30,6 +30,7 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f printOptions.print_selected = true; printOptions.color_selected = true; printOptions.landscape = false; + printOptions.p_template = "one_dive.html"; printOptions.type = print_options::DIVELIST; templateOptions.font_index = 0; templateOptions.font_size = 9; @@ -42,6 +43,7 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f printOptions.print_selected = s.value("print_selected").toBool(); printOptions.color_selected = s.value("color_selected").toBool(); printOptions.landscape = s.value("landscape").toBool(); + printOptions.p_template = s.value("template_selected").toString(); qprinter.setOrientation((QPrinter::Orientation)printOptions.landscape); templateOptions.font_index = s.value("font").toInt(); templateOptions.font_size = s.value("font_size").toDouble(); |