Divelist: fix a crash when updating the preferences

Hitting apply in the preferences dialog causes a QList assert.
This led to DiveListView::reloadHeaderActions(), where
we have an out of range access.

Patch makes the column count match the header action count.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
subsurface user manual update

References to literature on gradient factors changed (see dive profile
section, also preferences section)

Section on preference settings added.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make Gnome3 be bearable

The layout of Subsurface on Gnome 3 had a few flaws, since Qt and Gtk
are not really compatible. This implements a CSS that makes the use
of Gnome 3 more pleasant to the eyes.

Fixes #318

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Improve labeling for partial pressure graphs

This backs off a little on what was added in commit c1102a38f359 ("More
gradient on the partial pressure graph.") - the numbers simply got too
busy. I also slightly changed the positioning of the numbers to be a
little more "natural looking".

Fixes #323

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Allow comma separated CSV files

The separator selector in the CSV import dialog was unused. This passes
the value into the xslt and adds ',' as possible value.

I'm sure this could be done much better (pass the actual character instead
of the index), but I couldn't get that to work and this does seem to do
the trick.

Also added a test dive to test this feature.

Fixes #321

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Webservices: fix QString argument for zip_open()

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Add some limits to the GF's

Sets the limit for GF's in the preferences panel to 1<=x<=150 and color
it read if gf > 100. Remove the % in the diveplanner view that was
rejected for the preferences view.
The 150 maximum is needed because QSpinBox defaults to maximum 99.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Cleanup some uninitialized variables

I can't really see any point in passing a local loop variable around,
and copying a uninitialized pointer. Better use local variables there
and let the compiler optimize them away if it feels for doing that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Merge branch 'improve-subsurfaceweb' of git://github.com/thiagomacieira/subsurface
Compile fix

Otherwise errno is undefined (at least for me on Linux).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fixes positioning of the legend in View and Print modes.

This patch makes a better assumption of the location for the
legend in both View and Print modes. It also fixes a few oddities
that we used to have ( like hardcoded spacing ).

We are taking the scene().sceneRect() now into consideration to
better place it on canvas.

Fixes: #322

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Different Icon for a Bookmark Event.

This patch adds a different icon for a Bookmark Event, and it
also cleaned a lot of code. :)

See #300

[Dirk Hohndel: made the two icons slightly bigger]

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Divelogs.de: add actions to the download dialog buttons

Also enable the "Apply" button if download is succesfull.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Divelogs.de: allow import of downloaded dives

Since the DLD file from the website is already downloaded,
we only need to parse it, display eventual errors and
update the divelist and UI.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Divelogs.de: add a divelist context menu item for upload

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Divelogs.de: add code for zipping up all dives

prepare_dives_for_divelogs() comes from the GTK version, originally.
The upload seems to fail at this point with an error.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>