From 17470f68220902bc4acff8aa4e8f3ffa7472be46 Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Thu, 11 Jun 2015 20:13:10 +0200 Subject: Printing: add a "one dive per page" option Add another printing option to the print dialog. Signed-off-by: Gehad elrobey Signed-off-by: Lubomir I. Ivanov --- qt-ui/printoptions.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'qt-ui/printoptions.cpp') diff --git a/qt-ui/printoptions.cpp b/qt-ui/printoptions.cpp index 50ca8b7c2..e2684b6ed 100644 --- a/qt-ui/printoptions.cpp +++ b/qt-ui/printoptions.cpp @@ -1,4 +1,5 @@ #include "printoptions.h" +#include PrintOptions::PrintOptions(QWidget *parent, struct print_options *printOpt) { @@ -26,6 +27,14 @@ void PrintOptions::setup(struct print_options *printOpt) ui.radioStatisticsPrint->setChecked(true); break; } + switch (printOptions->p_template) { + case print_options::ONE_DIVE: + ui.printTemplate->setCurrentIndex(0); + break; + case print_options::TWO_DIVE: + ui.printTemplate->setCurrentIndex(1); + break; + } // general print option checkboxes if (printOptions->color_selected) @@ -75,3 +84,16 @@ void PrintOptions::printSelectedClicked(bool check) { printOptions->print_selected = check; } + + +void PrintOptions::on_printTemplate_currentIndexChanged(int index) +{ + switch(index){ + case 0: + printOptions->p_template = print_options::ONE_DIVE; + break; + case 1: + printOptions->p_template = print_options::TWO_DIVE; + break; + } +} -- cgit v1.2.3-70-g09d2