Planner: don't allow negative depths

This patch allows only non-negative depths in the divepoints table as
negative depths confuse the planenr/deco algortihm. The spinbox appearing
in the table should get a setMinimum(0) but I was not able to find the
correct way to implement that.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Planner: Show gas consumption in pressure units as well and warn if not enough reserve.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
make GPS coordinates autofilling really work

Move the gpsHasChanged() call on selected dive when coordinates have
changed *before* autofilling, otherwise it erases the autofilled values.

Also update displayed_dive when autofilling, otherwise values are stored
but not displayed immediately after saving.

Signed-off-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix picture loading

Signed vs unsigned comparisons are such a pain. Since we want offsets to
be +/- 30 minutes around the dive we need to allow negative offsets - but
duration_t was defined as uint32_t.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
replot() needs to really force a replot

So let's set forceReplot to true to make sure that happens.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Picture handling: make sure pictures are shown after they were added

We need to first replot() to get displayed_dive updated, then call
refreshDisplay() so the picture model gets repopulated which triggers the
pictures to show up.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Considering previous dives for tissue loading

This (hopefully) gets the logic to find dives in the previous 48h for
tissue pre-loading right. In particular it handles the case of a planned
dive which has a number of -1.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove if to save or not save the tags.

The way that we work with tags is a bit weird, we have a global
tag_list pointer and every dive copy the tags from there. the problem
is that the tags_changed() function looks at those two places ( the
global and the dive-local lists ) to see if something was changed,
but we shouldn't add anything at the global taglist untill a tag
is really added, so that function is bogus.

The correct way to check if something changed is to check all the
strings in tags against the strings in the QLineEdit and see if they
are the same, then we can add things to the tag_list.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correctly save the tags on the dive.

Very good patch, lots of removed lines. :)
Only try to add the tags when user accepts, discards the
test to see if the tags were changed or not, delete the
old list and copy the new one always.

only bug that's appearing now: taglist is still empty after save
we need to reselect the dive to make it appear, fixing that
on the next patch.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Put a copy of the tags in the displayed dive upon save.

I don't think this is the right approach, but it makes things work. The
reason that it was not working before it's because upon save we are not
copying the edited dive against the displayed dive for some reason, and I
didn't find the place that should deal with that.

This fixes one of the various issues around tags, but others remain.

Fixes #587

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Refresh display after toggling backgas breaks.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Translation update as of 29f19c37b0de.

Updates translation and correct some typpos.
Includes Planner, Photographs and HTML export.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't try to set a layout on PlannerSettingsWidget

It already got one from its ui-file, and this causes a warning when
starting the application.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Complete GPS coordinates on location focusout.

Introduce on_location_editingFinished() and move the GPS coordinates
completion logic there. This simplifies acceptChanges(), but replaces
the clever code for multidive completion by something a little more
straightforward.

Note the call to on_location_editingFinished() from acceptChanges();
without it, completion only happens *after* the dive has been saved.

[Dirk Hohndel: trivial merge, minor changes for consistency]

Signed-off-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Translations: force UTF-8 encoding

This seems to fix transifex issues with strings containing ₂ (subscript 2)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove HTML from translated strings

In some strings that won't be possible as the translation needs to be
aware of line breaks, etc. But for these strings it seems like the right
thing to do.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Updated the transation files

Authors are tracked at transifex

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Printing: force redrawing of the profile

If the first dive we end up rendering is the dive currently shown, the
info overlay would end up being printed which looks really silly.

See #590

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Printing: scale fonts when printing

This seem to work better, but it misses a couple of items at times (for
example the highest label on some of the axis).

Needs lots more testing.

See #590

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Initial stab at Seabear CSV imports

This adds a preconfigured import setting for Seabear CSV files.

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