Include pressure data on UDDF import

Importing pressure samples on UDDF import was missing. This patch adds
that bit of information to our import.

See #499

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
make git save commit messages more informative

Instead of just having "Created by subsurface <version>", put the number
of dives and the location of the last dive in the message.  That makes
things like "gitk" show a much more useful view of what actually got
saved.

We still save the subsurface version in the body of the message, because
that is interesting and relevant information.  It's just not the
*primary* relevant information.

Anyway, with this, a git commit message might looke something like

    dive 474: North West Point (Christmas Island)

    Created by subsurface 4.0.96-17-g649e9ed89d9d

which is much more relevant for the common case of adding new dives at
the end.

Of course, if the reason for the save is that you edited old dives, the
relevance of the commit message telling you the number of dives you have
in the log and the dive number is questionable.  But then you have to
look at the actual diff to see what's going on.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Only auto-fill coordinates for non-empty location strings

When editing the location string we try to be smart and automatically add
the correct coordinates (assuming we have a location of this name already
in the dive list). So if you return to the same dive spot you'll get the
correct coordinates by default. But this creates bogus result if we allow
an empty location to be matched, as it makes no sense to assume that all
dives without a location name were at the same coordinates.

Fixes #498

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make heartrate grid less confusing

Having all the grid lines in the same color made things visually
confusing. To clean this up a little make the heartrate lines a light gray
color.

Fixes #484

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When scrolling to dive, scroll to trip first

The behavior at startup is actually very annoying: we select the latest
dive, and expand the trip it is in, but since we use "scrollTo()" on
just the dive, and it's not initially visible, the startup will make the
first dive be at the top of the list view.

Which means that the actual _trip_ detail is not visible at all, since
it will have been scrolled off the list view entirely.

Fix this by first scrolling to the trip, and only then scrolling to the
actual dive (using the default "EnsureVisible" policy).  Obviously, if
it's a trip with lots of dives, scrolling to the dive may end up
scrolling away from the trip header again, but at least that never
happens at startup, and at that point you have to scroll away from the
trip just to show the dive.

Do this same dance when changing the dive selection (mainly noticeable
when picking dives on the globe view).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Set minpressure from manually added cylinders

This includes minimum pressure from manually added cylinders to be taken
into account on scaling. Without this, manually added cylinders might
lead to pressure dropping below the Y axis 0 line (e.g. when first
"computerized" cylinder is 220->140 and second, manually added cylinder,
200->50 bar).

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Updated translations

I'm not the author, that's tracked on Transifex

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Properly identify siblings on UDDF export

UDDF export used all samples in the export when detecting previous
sample. This resulted in a very slow processing as we had to go through
massive amount of data for each event that's time was to be
approximated. The detection of previous sample was also erroneous
resulting in incorrect depth samples for the events in some occasions.
This patch should address these issues. And along with patch that
included pressure data on import this will fix the bug #499.

Well, the performance after the patch is still not stellar, but still
quite a difference with such a small change. The sample set of 8 dives
(with one event each) takes now less than 5 seconds instead of the
original 36 seconds (measured by doing the conversion with xsltproc).

Fixes #499

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
User manual: Minor updates

Minor update of manual for consistency in terminology and improved style
including the section describing the companion app. No images were affected.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
User manual: formatting changes

- Add hyperlinks to references to Appendices A and B in the text

- Be consistent with use of numbered lists and bullets:

-- Use numbered lists where order is important (e.g. a set of instructions)

-- Use bullets where isn't doesn't matter (e.g. a list of features)

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
User manual: add latest html

This updates the rendered html file for people who build from source but
don't have asciidoc installed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Explicitly include needed include file

The Q_DECLARE_TR_FUNCTIONS macro is defined in QCoreApplication, so let's
make sure that's included.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Show translated event names in tooltip

In order for this to work we need to compare against the event type
instead of the event name - which makes much more sense to do, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix test for "air" in tooltip display of gaschange

The "is_air()" test works when we have the gases in permille, but not in
percent. In that case we can just check for He == 0 and O2 == 21.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add export CSV to user manual

Mention the option to export in CSV format in our user manual.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Improve header wording for CSV export

Duration is better term than time for the length of the dive. Also
remove the repetitive word dive from some of the header fields.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make Subsurface with a British accent work

Our workaround for the lack of a US-English translation breaks en-GB. With
this the British version of Subsurface should work as well.

Reported-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Tell Qt4 that we really meant Utf8 when we said Utf8

How strange. Telling Qt4 to assume that all C strings are Utf8 apparently
isn't enough to convince tr() that the C strings we pass to it are Utf8.
You need to set that codec separately.

Fixes #503

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix type in German translation

This prevented the download link in the update response from working.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Getting ready for 4.1 Beta 2

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