Enable libdivecomputer log or dump from the UI

Pick filenames for these functions as they are selected.
Use the windows-safe fopen function.

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

1) Text about libdivecomputer log and dump files
2) Text about coordinate formats acceptable
3) Text about CSV import
4) Minor reorganisation of TOC

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
UDDF export: save events occurring between samples

UDDF export saved events only if they occurred at exactly same time as a
profile sample. This patch will include events between samples as well.
This assumes that profile samples are recorded in even intervals.

Fixes #385

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't reset panels while editing a dive

MANUALLY_ADDED_DIVE is a different flavor of ADD mode (in both cases we
are in "planner mode"), so bail out for that as well.

See #379

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

Use QStringList::contains instead of iterating the list.

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Display warning that dives won't be downloaded when enabling libdc dump

The warning is only shown once per session.

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

We want to install the Subsurface icon so it can be used e.g. in menus.
(Commit ee5d8e3c moved the icons to resources, but the application icon
is special case, that should be installed globally.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Disable DC device node if it is not needed

This patch disables/enables the DC device node based on what type of
transport the selected DC uses. The only time the device node field is
used is if the selected DC uses a serial transport type. IrDA and USB type
transports do not use the device node.

Signed-off-by: Benjamin Fogel <nystire@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix warning about initialization ordering

I cannot tell what the potential impact of this might be, but the fix is
trivial.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Handle editing a manually added dive consistently

Regardless of whether the user clicks in the info tab, makes a change to
equipment or starts by editing the profile (i.e., clicking on the little
penguin), we should get into the same state and behave the same way.

This means that when editing a manually added dive we are always in
editMode == MANUALLY_ADDED_DIVE - and editMode == DIVE means we are
editing a dive that came from another source.

Fixes #379

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Clear equipment tab for trips display

And prevent the user from editing equipment in trip edit mode (those edits
are both meaningless and of course will be ignored once we save the
changes to the trip).

Also moved some code for setting up tanks, weights, tags, etc, into the
"this is not a trip-edit" part of the updateDiveInfo() function.

Fixes #392

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Allow tracking of more weight systems

I never imagined that people would want to track more than 4
weightsystems, but we just had an enhancement request from a user who
tried to enter a 5th system. Let's hope 6 is enough for everyone.

Fixes #383

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Including alarms and bookmarks on UDDF import

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add depth conversions to XSLT

Convert depth to and from mm.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use bookmark flag when bookmark contains heading

Bookmark with compass heading is named 'heading' and should use the
bookmark icon.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Test dive for events

Dive with test events, can be used to test approximation of depth when
exporting dives.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Generate UDDF waypoints for in-between events

This patch generates a waypoint for events occurring between profile
samples. It approximates the depth of the crafted waypoint linearly
between the recorded sample depths.

Fixes #385

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Support for multiple cylinders on UDDF export

Adding support for multiple cylinders on UDDF export. This also adds a
cylinder reference to the tankdata to enable mix lookups.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Cylinder support improved on UDDF import

This patch adds support for cylinders for UDDF version 3.2.1.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove unnecessary cylinder generation on UDDF

Nowadays cylinder tags are generated based on actual usage. This
includes all the required information on cylinders. Therefore generating
incomplete cylinder tags from all listed cylinders is not needed
anymore.

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