Commit graph

34 commits

Author SHA1 Message Date
Gehad elrobey
6a692495c0 Printing: add statistics templates to the dialog
Show the existing templates based on the print type selected
by the user.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-22 18:34:34 +03:00
Gehad elrobey
31df69c401 Printing: disable ui elements on statistics print
Disable all the UI elements for "dive list print", disable
all the template settings as well, Template Edit button
will be enabled after statistics print supports color palettes.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
2015-08-15 15:04:34 +03:00
Gehad elrobey
59eddc6259 Printing: export border to templates
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-15 15:04:11 +03:00
Gehad elrobey
1dbe10fe27 Printing: add another color in color palettes
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-15 15:02:30 +03:00
Dirk Hohndel
be47ce6241 Printing: add new default color scheme
This is based on the Subusrface logo colors, keeping the hue and modifying
the saturation and value in order to get what to me looks like a fairly
pleasant color setup.

This is an attempt to come up with a good default. By all means, this is
supposed to be a starting point to make it better, not a decision on what
the colors should be. I would however claim that they are better than the
previously available options :-)

I like the idea of basing this on our existing colors - but even that is
up for modification if someone has a better proposal.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28 10:48:29 -07:00
Gehad elrobey
ed5afc510e Printing: don't name color templates with confusing numbers
Use the color_palette enum instead.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:39:25 +03:00
Gehad elrobey
d41d79b549 Printing: add the "Shades of blue" color theme
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:39:19 +03:00
Gehad elrobey
1dd2518624 Printing: support importing/exporting of templates
Implement 'import/export' features, so it's easier to share
customized printing templates. Also support deleting existing templates.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:38:59 +03:00
Gehad elrobey
b37498d355 Printing: add member function to print options
Get the currently selected template.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:49 +03:00
Gehad elrobey
e8ad4b0c97 Printing: remove "Table" option from print options radio group
"Table" print is now a template, so remove the radio button.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:38 +03:00
Gehad elrobey
2b2c506cb7 Printing: use grantlee templates from the current existing template list
We use templates from the grantlee templates list created and
dynamically. So we don't need static templates anymore.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-28 11:37:30 +03:00
Gehad elrobey
ed09b80c12 Printing: save custom color palette to QSettings
- save custom colors to QSettings.
- load custom colors from QSettings.
- set almond color palette as default palette.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:26 +03:00
Gehad elrobey
ad531c25fb Printing: show colors in edit tab
- Add default color struct
- Init the color struct with default colors
- Show color text in labels
- Preview colors

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:20 +03:00
Gehad elrobey
7ca311ae85 Printing: save only if data is changed in template_options
Check if data is changed before saving the new settings.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:07 +03:00
Gehad elrobey
c44496e23d Printing: move template_options to print_options.h
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:03:04 +03:00
Gehad elrobey
a70cea95e8 Printing: refactor the print options class
-Remove unneeded parameter to member variable
-Check if template_options struct is valid

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:02:49 +03:00
Gehad elrobey
c35092f5c9 Printing: add custom options to the PrintDialog
Add:
-custom.html template
-custom template to print_options struct
-options to the options dialog

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:02:09 +03:00
Gehad elrobey
a600ea5201 Printing: add template_options struct that contains template
The template_options struct holds the settings variables in the code.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:00:25 +03:00
Gehad elrobey
ff594c65e3 Printing: call TemplateEdit when edit is triggered
Edit button should open TemplateEdit dialog.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:00:20 +03:00
Gehad elrobey
17470f6822 Printing: add a "one dive per page" option
Add another printing option to the print dialog.

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
b4e1563d10 Printing: remove the print_options struct from display.h
Move print_options struct to printoptions.h, its more relevant to be
placed here.

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:59 -07:00
Gehad elrobey
a0b8eed612 Printing: Edit the print options widget
Remove obsolete code and add new customizable print code to the options
dialog.

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:50 -07:00
Lubomir I. Ivanov
7ea728e95f Print: add the support to store margins and printer options
All the print options will be stored after the user closes
or "cancels" the print dialog.

There seems to be no good way to store the last
selected page size, because print dialogs are different and
some just list them as strings - A4, A3, etc.

The patch also applies the following changes:
- renames display.h's 'struct options' to 'struct print_options'
as these were really just for the print dialog
- the print_options dialog now stores more options as 'bool'
- demote PrintDialog's 'printOptions' to 'private'

Fixes #653

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13 15:05:11 -08:00
Lubomir I. Ivanov
21585403db Printing: add 1 dive per page option
With this option there is an exception, which makes the notes section of
the profile table occupy half the page. This way dive plans can reasonably
be printed.

Fixes #636

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-24 11:33:28 -07:00
Lubomir I. Ivanov
6e4ebe3c54 Print: remove the height sliders from the PrintOptions class
These were hidden and we don't really support them because
our print layouting is not that flexible in Qt!

Note: printoptions.ui is now converted to UNIX line breaks.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-18 10:20:00 -07:00
Tomaz Canabrava
89816f64c2 Headers cleanup.
Too much noise on the headers, this commit remove uneeded
headers when they are uneeded.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-26 15:47:02 -07:00
Dirk Hohndel
76e6420f6b Massive automated whitespace cleanup
I know everyone will hate it.
Go ahead. Complain. Call me names.
At least now things are consistent and reproducible.
If you want changes, have your complaint come with a patch to
scripts/whitespace.pl so that we can automate it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27 20:09:57 -08:00
Boris Barbulovski
ccb1c33d02 Put include guard to every header
* ensure include guard to every header
* comment endif guard block

Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11 12:37:01 -08:00
Thiago Macieira
8e81d3f100 Make the classes generated by uic be real members of our classes
This means we don't have to new/delete them, which is a waste of
overhead.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 12:13:48 -07:00
Thiago Macieira
f0f76056ac Include the ui_*.h headers in the main headers.
This means we can also remove the forward declarations.

This is the first step in removing the memory allocation for the ui
sub-classes. Without the second step, this commit is just making the
compilation time increase for no good reason :-)

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 12:13:15 -07:00
Lubomir I. Ivanov
af1c55c29d Print: move some header includes to cpp files
We don't really need includes of display.h and dive.h in
printoptions.h and printlayout.h or forward declartions
of 'struct dive' and 'struct options' in there.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-11 00:45:29 +03:00
Lubomir I. Ivanov
74f989bc46 Print: connect all the options widgets to slots
By connecting to slots we always modify values at a previously
set 'struct options' pointer.

Also have the setup of slots and pre-set values in a
separate setup(struct options *) function.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-10 11:06:01 +03:00
Lubomir I. Ivanov
2c7a208bc1 Print: label update on height slider move
The PrintOptions widget has value labels next to the
horizontal sliders. Add slots to update these labels
when a slider moves.

Patch also makes a modification so that the PrintOptions
constructor requires a 'struct options' pointer. If
an options struct is not received we do not set predefined
values and do not connect signals to slots, where
options will be updated immediately.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-10 09:57:24 +03:00
Lubomir I. Ivanov
52534bfb68 Print: add UI for a print dialog
PrintOptions is a QWidget class to be used as an
addition to a future print dialog (possibly based on
QPrintDialog). Currently only contains a couple of
radio buttons.

PrintDialog (printdialog.cpp/h) which is a basic QDialog
is currently added for testing only and it holds
an instance of PrintOptions.

Calling File->Print opens this test dialog for now.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-07-09 21:01:42 +03:00