diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-07-05 12:01:43 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-05 12:01:43 -0700 |
commit | 9c6a3a7ff387578ddede2e69d8b994a11cf8eaee (patch) | |
tree | 72a08592a24d8d3d1f4fc7d7713da8029bc80c3f /qt-ui/printoptions.cpp | |
parent | 35dc81410518e6d39ba8b3f99348884778bedc5b (diff) | |
parent | cc53dc7acf801f022612678f697e6d76c2443153 (diff) | |
download | subsurface-9c6a3a7ff387578ddede2e69d8b994a11cf8eaee.tar.gz |
Merge branch 'custom-print' of github.com:neolit123/subsurface
Diffstat (limited to 'qt-ui/printoptions.cpp')
-rw-r--r-- | qt-ui/printoptions.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/qt-ui/printoptions.cpp b/qt-ui/printoptions.cpp index e2684b6ed..0e6a0b320 100644 --- a/qt-ui/printoptions.cpp +++ b/qt-ui/printoptions.cpp @@ -1,20 +1,22 @@ #include "printoptions.h" +#include "templateedit.h" #include <QDebug> -PrintOptions::PrintOptions(QWidget *parent, struct print_options *printOpt) +PrintOptions::PrintOptions(QWidget *parent, struct print_options *printOpt, struct template_options *templateOpt) { hasSetupSlots = false; ui.setupUi(this); if (parent) setParent(parent); - if (!printOpt) + if (!printOpt || !templateOpt) return; - setup(printOpt); + templateOptions = templateOpt; + printOptions = printOpt; + setup(); } -void PrintOptions::setup(struct print_options *printOpt) +void PrintOptions::setup() { - printOptions = printOpt; // print type radio buttons switch (printOptions->type) { case print_options::DIVELIST: @@ -34,6 +36,9 @@ void PrintOptions::setup(struct print_options *printOpt) case print_options::TWO_DIVE: ui.printTemplate->setCurrentIndex(1); break; + case print_options::CUSTOM: + ui.printTemplate->setCurrentIndex(2); + break; } // general print option checkboxes @@ -95,5 +100,15 @@ void PrintOptions::on_printTemplate_currentIndexChanged(int index) case 1: printOptions->p_template = print_options::TWO_DIVE; break; + case 2: + printOptions->p_template = print_options::CUSTOM; + break; } } + +void PrintOptions::on_editButton_clicked() +{ + TemplateEdit te(this, printOptions, templateOptions); + te.exec(); + setup(); +} |