Align last temperature text end of temperature plot line

The temperature plot line was drawn to the end of the dive, but the last
temperature plot text was printed near the last temperature *sample*.

This was most visible on dives/test27.xml where two "20˚C" were
printed on top of each other at the start of the dive, while nothing
was printed at the end.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Yet another Norwegian translation update

This time with " begin" and " end"

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't re-use the dive computer model string for all downloaded dives

When we download dives with libdivecomputer, we create this strdup'ed
name of the model information, but we then re-use that (single) strdup
allocation for every dive we download.  This works fine *until* you
start freeing those dives (possibly directly after the download because
they are redundant), at which point things go to hell in a handbasket,
since there is just the one allocation for all the different dives.

Fix by just doing another strdup() at the point where we assign the
model information to the dive computer.

Reported-by: Marc Merlin <marc@merlins.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Import MacDive divelogs

This XSLT converts MacDive logs into Subsurface format. It supports both
the current version and the upcoming version of the log format.

Conversion was not tested with Imperial units as no samples were
available of such logs. Thus functionality with Imperial units is not
guaranteed.

Note that the gear inventory is currently discarded.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix German translation of ceiling

Suggested-by: Lutz Vieweg <lvml@5t9.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Updated Finnish translation

 - Translated some missing strings
 - Paraphrased some longer sentences in Finnish
 - Inserted missing whitespaces

Signed-off-by: Tommi Saviranta <wnd@iki.fi>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use GDK methods to retrieve the actual screen DPI

gtk-gui.c:
+ added the method get_screen_dpi() that uses a simple
formula to retrieve the actual screen DPI
display.h:
+ use get_screen_dpi() in the SCALE_PRINT macro

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
print.c: show_dive_header() Reserve more space for strings

Increase the size of "buffer" to 160 bytes. This was causing
a problem with the first call to pango_layout_text(), where
for the "bg_BG" locale, not enought space was allocated for the
month name, the translation of "dive" and the other values.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Some changes to the README file

This is not getting us ready for 3.0, it mostly fixes some of the obvious
errors in there that were correct for Subsurface 2.1 but clearly are no
longer true (like the suggestion to specifically check out libdivecomputer
0.2.0).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Documentation update for driver installation on OSX

Helping people to find the right drivers.

Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Tiny change to German translation

Suggested-by: Lutz Vieweg <lvml@5t9.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Skip XSL transformation for old Subsurface format

Making sure the XSL transformation does not occur on Subsurface's old
XML format. A deeper inspection on the XML content is required as
MacDive and Subsurface (old format) have the same root element (dives).

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Support for Imperial units on MacDive log import

The cylinder size is treated as metric as the samples received indicate
it would be so.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Update "Swedish" translation

This is only slightly better than "Bork bork bork".  I've never done any
diving in Swedish.  It's probably hilarious, but should be mostly
understandable.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Properly de-select dives in collapsed trips that are unselected

We had the logic for the "select" case, but not for the "deselect" case. Ugh.

Reported-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix Uemis downloader to download all matching dive infomration

The Uemis SDA returns the data for each dive from several different
databases. And oddly, the getDive data uses a different key than the
getDivelog data. We have always compensated for that by looking up the
correct key and applying the data to that dive, but unfortunately we
didn't adjust the loop to correctly retrieve the getDive data for the
dives that were downloaded. So depending on how big the offset between
those two keys was we wouldn't get all of the necessary data.

With this change we try one, calculate the offset and then restart the
loop. Insane, but appears to be the only way to make this work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Duration of a dive is the maximum duration from all divecomputers

So far we always used the duration of the first divecomputer. The same fix
needs to be done for some of the other calculations that always use the
first divecomputer.

This commit also removes some obsolete code from the webservice merging.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The 'gasmix' argument to add_segment() is read-only

We'll want to use a 'static const' gasmix for the upcoming no-fly-time
code, so prepare for it by just marking the read-only gasmix argument as
'const'.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Updated Swedish translation

Some updates to the Swedish translation.

Signed-off-by: Fredrik Steen <fredrik@ppo2.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix duration calculation

Some days I'm just a f*cking moron. That code was so stupid that I'm
lacking words. I replaced using the first divecomputer with using the last
divecomputer. When what I wanted was to use the maximum duration.

This looks better.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>