Added 3L Pony tanks to the list of default tanks in equipment.c

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Helpers: add get_cylinder_used_gas_string()

get_cylinder_used_gas_string() retrieves used gas per cylinder
with optional units display.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Profile: use a 10px font when printing profile text

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Print: provide means to print profile tables

This patch adds a couple of classes and some other modifications
in PrintLayout that handle the printing of tables under a profile.

models.h : ProfilePrintModel
The class uses a 'struct *dive' to output all required data
for a certain dive at specific rows and columns. It also handles
font formatting and text alignment.

modeldelagatates.h : ProfilePrintDelegate
The class is used only for drawing a custom grid for profile tables.

PrintLayout::createProfileTable()
The function is used to create and setup the profile table object

PrintLayout::printProfileDives()
The function now has correct padding of dive profiles on a page
and also the printing of actual tables below them.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Print: small adjustments to table printing

PrintLayout::printTable():
- hide the QTableView widget border using a stylesheet
- add a guard to fix the last column extending post the page width
due to rounding
- use 1 extra pixel instead of 2 when grabbing the page region

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Sample dive from APDLogViewer

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Importing salinity and atmospheric pressure from DC.

One cannot expect #ifdef to work with enum values. So the code for
getting the salinity was basically never compiled in. And it was
putting it in the wrong location anyway (in the dive struct instead
of the divecomputer struct where it is expected).

I took the opportunity to add the reading of the atmospheric pressure
as well.

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Bugfix typo in get_gas_used

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix unitialized variable use

I ran subsurface with valgrind and it found a few errors.

[Dirk Hohndel: split this out from a much bigger patch that is still under
               review]

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>