Commit graph

8 commits

Author SHA1 Message Date
Dirk Hohndel
094264014d Fix helper function
Avoid counting the selected dives - we have that number.
But also don't return 0 because we devide by the total work for the
progress bar.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 22:37:43 -07:00
Dirk Hohndel
1ecc9b0cc0 Address uninitialized member warnings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 10:57:51 -07:00
Gehad elrobey
75263e3d2c Printing: rename the "base" template for consistency
Change the name of the template "base" to "two_dives" as this name
describes it better.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-06-19 21:41:58 +03:00
Gehad elrobey
6c54781e17 Printing: use selected print preferences while printing
Having a pointer to the printing_options struct, it should be
used to privide the selected options while printing.

Print options used ATM:
- number of dives per page
- template file name
- print in colors

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-06-19 21:41:58 +03:00
Gehad elrobey
60c5e3cf25 Printing: pass the print_options struct to TemplateLayout and Printer
As the print_options struct is needed by both TemplateLayout and Printer
class, it can be passed to their constructor.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-06-19 21:41:57 +03:00
Gehad elrobey
1040f0d4e5 Printing: fix rendering bug for odd number of dives
Odd number of dives needs extra space from the buttom, so that when we
scroll to the last page extra whitespace is shown under the last dive
frame, this is fixed by adding a default footer to the base template.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-06-19 21:41:56 +03:00
Gehad elrobey
a820688aeb Printing: Add progress updating ability to print dialog
The progress bar shows the progress of both the rendering part and the
templating part, unfortunately we can't check the progress of Grantlee
templating engine so the progess bar doesn't have a constant pace it
stops a little around 20%.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-04 10:08:09 -07:00
Gehad elrobey
e2ad38189e Printing: Add TemplateLayout class
This is the main class to hold Grantlee engine logic.
TemplateLayout::generate() loads QT5Grantlee and initialize the
templates then returns a QString that contains the rendered HTML by
Grantlee library.

Also this class contains the Dive class which holds the logic that
formats the data before passing it to the templates.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-04 10:07:25 -07:00