aboutsummaryrefslogtreecommitdiffstats
path: root/templatelayout.h
AgeCommit message (Collapse)Author
2015-08-31QML UI: Remove unneeded MobileDive classGravatar Grace Karanja
The MobileDive class in divelistmodel.h is a duplication of the Dive class in templatelayout.h. This patch moves the Dive to the qthelper file. [Dirk Hohndel: merged with upstream master - let's hope I didn't mess anything up] Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-22Printing: generate a Grantlee statistics templateGravatar Gehad elrobey
As there are two types of templates, Grantlee need to support both. This commit adds the support to generating a statistics HTML code from a statistics template. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22Printing: export a statistics data structure to the Grantlee backendGravatar Gehad elrobey
Add a YearInfo class which represents a year statistics. Export the class to the Grantlee backend, also export all it's members to the printing backend. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15Printing: export border to templatesGravatar Gehad elrobey
As there is a problem with sizing the borders in QWebView, "vw" sizing is not working as supposed with border-width, As a workaround we export border-width dynamically, so that border-width is relatively the same for all page sizes. The border-width is equal to the page width / 1000 which gives a nice range for borders for A0 - A5 papers, Also prevent drawing zero pixel borders and use 1 px borders as the minimum border. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15Printing: add another color in color palettesGravatar Gehad elrobey
Add another color 'Table cells 2' to the color palette, make all the backgrounds solid white by default. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15Printing: export more dive details with Grantlee backendGravatar Gehad elrobey
Add SAC, tags, used gas and dive rating to dive data fields exported with Grantlee backend. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-07-28Printing: fix dive lookup for profile generationGravatar Dirk Hohndel
The existing code (and templates) looked up dives by number and then used that as index into the dive table. This worked exactly in one case: if all dives were numbered consecutively starting with 1. While that is not an entirely unreasonable case, it's of course not an acceptable assumption to make. This commit adds the necessary changes to instead look up dives by their unique id. That's what it's there fore, after all. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28Printing: search for grantlee templates in the templates directoryGravatar Gehad elrobey
We need to dynamically look up for all the existing templates in the template directory. A grantlee template can be named any name but we ignore files ending with '~'. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: export grayscale filter value to templateGravatar Gehad elrobey
Export grayscale value to Grantlee template, So we must declare print_options as QMetatype. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20Printing: export color settings to grantleeGravatar Gehad elrobey
Export color palette selected to grantlee backend. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: move template_options to print_options.hGravatar Gehad elrobey
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: add functions that read/write a templateGravatar Gehad elrobey
Read/write templates from files. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: export template_options struct to Grantlee engineGravatar Gehad elrobey
Add template_options to Grantlee lookup section and export the struct fields. -font: is the font type used, must be selcted from 5 different types. -font-size: is a user selection from 9 - 18 then it is scaled to a range from 1 to 2 of the displaying view port. -color-palette: is the colors used in the template, all used colors must be referenced from here.(not yet implemented) -line-spacing: is the distance between two consecutive lines in the dive notes text. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: pass the template_options struct to TemplateLayoutGravatar Gehad elrobey
The template_options struct needs to be passed to TemplateLayout constructor. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05Printing: print all dives if 'print selected' is uncheckedGravatar Gehad elrobey
User can choose either to print all dives or print selected dives only. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-06-19Printing: pass the print_options struct to TemplateLayout and PrinterGravatar Gehad elrobey
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-19Printing: fix rendering bug for odd number of divesGravatar Gehad elrobey
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-04Printing: Add progress updating ability to print dialogGravatar Gehad elrobey
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-04Printing: Add TemplateLayout classGravatar Gehad elrobey
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>