Commit graph

6489 commits

Author SHA1 Message Date
Anton Lundin
bf20c251ab Don't rely on malloc to return NULL for zero size
We rely on samples being NULL if a dc have no samples. Its completely
legal for malloc to return a valid pointer to nowhere for zero sized
malloc, which you can't follow and read what its pointing at. Its only
viable to call free() on.

In other code, if samples is a valid pointer, we dereference it and look
at the first sample.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-12 07:04:26 -08:00
Anton Lundin
46bd71a184 Initialize alloc_samples in copy_samples
We rely on alloc_samples in prepare_sample. If alloc_samples weren't
initialized prepare_sample would wreak havoc on the samples list.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-12 07:01:16 -08:00
Willem Ferguson
e7698beea7 User manual: Eight more figures replaced
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-11 04:20:44 -07:00
Martin Long
71949b20d4 Add 'trip' support to UDDF export
Currently repetition groups are used to group dives into trips. This
is not really correct. Repetition groups should really represent a
group of dives where tissue loading needs to be preserved between
dives (typically the same day).

UDDF has support for trips, using the <divetrip> tags. This is a
bidirectional link between the dives and the trips.

This patch adds support for these trips. However, it leaves in the
repetition groups. Repetition groups may need further consideration.

Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 15:51:05 -07:00
Dirk Hohndel
719cfe0ece Trivial white space fix
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 15:49:12 -07:00
Dirk Hohndel
c76cb59aa0 More temperature plot position tuning
Depending on the options shown, the latest change appears to have moved
the temperature graph a bit too low. This seems to work better in my
experiments.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 15:48:19 -07:00
Martin Long
434f19cf56 Aggregate multiple weights into UDDF export.
Sum together all of the weights recored on a dive to use in the
<leadquantity> tag in UDDF export.

Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 14:49:39 -07:00
Martin Long
18aa6f5ed8 Support buddies with only a first name, no surname.
The previous patch would not fill the first name field if there was
no second name. This rectifies that.

Signed-Off-By: Martin Long <martin@longhome.co.uk>

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 14:49:32 -07:00
Dirk Hohndel
c9f927d547 Updates to Ubuntu package building process
Marble can't be static, so instead we build a shared library but give it a
different name so it can be installed in parallel with the "real"
libmarblewidget.so.

Also make sure that the correct libusb is installed so that Atomics Aquatics
dive computers are supported.

Fixes #782

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 13:08:35 -08:00
Dirk Hohndel
4ee59bc1b7 Updated translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 10:58:21 -07:00
Miika Turkia
54d8cee3d8 Allow more flexible GPS coordinates for CSV import
This theoretically allows one to use format like
1°36'11.711"N 124°46'00.368"E for GPS coordinates. However, in practice
this is not allowed without properly parsing this format in C/C++ side.

This patch changes the export format to UTF8 and improves the location
import by allowing either gps or location attributes to be imported.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 10:51:57 -07:00
Dirk Hohndel
18159b6265 Minor tweak to Ubuntu package building
12.04 can't build our Qt5 based package, so let's just drop it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 09:45:53 -07:00
Joakim Bygdell
6653d98e67 Rearrange the vertical positions to better accomodate the temperature graph.
Fixes #778

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 09:39:53 -07:00
Tomaz Canabrava
7e2f7747d6 Organize string-lists alphabetically for completion
This micro patch adds the ability to sort the lists alphabetically
for user interaction. Dirk asked me to do this for location, but
this actually changes for location, divemaster, buddy and suit.

Seems a good thing for all.

Fixes #780

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 09:12:49 -07:00
Martin Long
7ea27a2d88 Fixed airtemperature in UDDF export.
The XSLT didn't expect the temperature tag to be within the
<divecomputer> element in the source, so the selection wasn't finding
it.

Signed-off-by: Marton Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 08:15:07 -07:00
Martin Long
f460ef581a Added <leadquantity> to UDDF export, showing weight used.
Signed-off-by: Marton Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 08:14:53 -07:00
Martin Long
721760e532 Split last_name and first_name for buddies in UDDF export
Signed-off-by: Marton Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 08:14:49 -07:00
Martin Long
7367ccfb09 Fix gasdefinitons in UDDF export
Selection of <cylinder> elements wasn't working where dives are
part of a trip. Change the selection so that it will select all
cylinders whether or not the dive is part of a trip.

Signed-off-by: Marton Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 08:14:44 -07:00
Martin Long
24ac35e107 Prevent UserID from being 'stuffed' into the start of UDDF export.
Due to there being no xsl template for the userID, it ended up getting
inserted at the start of the output. This adds an empty template to
map the <settings> element, preventing this erronious insertion.

Signed-off-by: Marton Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 08:14:34 -07:00
Martin Long
aa74cd8802 Update dive site structure in UDDF export to match UDDF 3.2.0 specification.
The dive site structure in the UDDF export was using an old structure
where each site is simply listed as a <dive_site>.

The new structure requires a single <divesite> containing at least one
<divebase> - a base location where you are diving from, and at least one
<site>.

As subsurface only tracks sites, I've created a single divebase to be
referenced by all of the sites.

Note: although profiles in Subsurface can be grouped into trips, these
are groupings of profiles, not sites, and the mapping may not be
simple. e.g. on different trips the sames sites may be visited but a
different base used. Or, different bases may be used on a single trip.

Signed-off-by: Marton Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 08:14:22 -07:00
Martin Long
b462a8da35 Separate out buddies into individual entities when exporting to UDDF.
Part of a series bringing UDDF export closer to the UDDF standard, as
per www.uddf.org.

Currently when exporting to UDDF buddy entities are created
one-per-unique-combination. This means that a group of buddies on a dive
are exported as a single buddy, with the names comma separated.

This patch identifies all unique buddies, whether used independently or
along with other buddies on a dive. They are then linked independently
on each profile.

It also uses the UDDF standard <link ref=""> instead of
<buddy_ref ref="">

Signed-off-by: Marton Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-10 08:13:54 -07:00
Dirk Hohndel
3f34af4bed Make filter for filter criteria case insensitive
When opening the filter dialog we allow the user to filter the choices
that are shown. The text that they enter in that filter for filter
criteria should be treated as case insensitive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-09 21:23:12 -07:00
Dirk Hohndel
4029c87ec7 Hide any pictures shown when closing divelog
Fixes #776

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-09 21:16:34 -07:00
Dirk Hohndel
b575069638 Don't skip the first tag when filtering
No idea why this code was there... but what it caused was an invalid
access to checkState[-1] when a dive had that first tag. This explains why
sometimes the dives that had that tag were shown, regardless of whether
the selected filter criteria should have excluded them or not.

Fixes #769

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-09 20:55:31 -07:00
Dirk Hohndel
6f231c67a0 Close and clear filters when closing divelog
Otherwise non-sensical information stays behind.

Fixes #777

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-09 20:16:39 -07:00
Salvador Cuñat
55253cc5f7 Update spanish translation of user manual to english b851146
Includes Extra data tab, show cylinders button,  and Dc configuration.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-09 15:40:25 -07:00
willem ferguson
f152f9e54e Update user manual figures: Ubuntu to Fedora
Replace four more figures.
Replacement complete up to end of section:
Import data from dive computer.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-09 11:45:48 -07:00
Miika Turkia
6ef011a0f6 Quote picture file names when saving XML
Fixes #775

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-09 11:10:39 -07:00
Dirk Hohndel
bae5e7cb17 Preparing for 4.2.91 aka 4.3 RC
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 19:49:01 -07:00
Dirk Hohndel
2802202aae Another update of strings and translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 14:35:50 -07:00
Dirk Hohndel
b92a10ea98 Mark new string for translation
This needs to be the same string as used for the entry in the Import
dialog... since translate() is a macro in this .c file and defined to have
only two arguments, I'm using the NOOP3 macro to get this correctly added
to the translation sources, including the comment. That makes the code a
little odd, but seems to work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 14:30:08 -07:00
Miika Turkia
b8511467b3 Fix symbolic links for user manual
Let's use implicit anchor for the Appendix A. This will get rid of
compilation error when trying to create PDF version of the user manual.
(Otherwise all the other links to Appendix A would have to be updated.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 12:34:36 -08:00
Dirk Hohndel
d9be07670c Don't ignore when we can't parse a file
We are quite inconsistent when it comes to reporting back errors.
One case where this caused somewhat unexpected behavior was when the
user would try to open a .csv file by passing it as command line
argument. The file was silently ignored, but treated as if it had been
opened successfully.

Now we issue a somewhat reasonable error message.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 11:28:23 -08:00
Dirk Hohndel
77664e7150 Latest translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 10:41:31 -08:00
Miika Turkia
5831af3fe2 Fix a crash on CSV import
Seems that there was not enough space reserved for the whole mem buffer
when adding XML tags around CSV file. When unlucky, the metadata of
memory allocation was overwritten.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 08:49:12 -08:00
Lubomir I. Ivanov
19c75b878c main.cpp: rework the libgit2 version check
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 08:47:45 -08:00
Miika Turkia
dd135d0e6c Unify spelling of DivingLog on user manual
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 08:41:39 -08:00
Miika Turkia
3a704fc93b Typo fixes on user manual
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 08:41:27 -08:00
Willem Ferguson
b6efcce383 User manual: new images taken from Fedora 20 KDE.
Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 08:40:28 -08:00
willem ferguson
7e228a6031 User manual update
This update concerns:
  Import of dive logs from Suunto DM5
  Configuration of dive computers
  Description of main menu items

One figure has been added

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 08:39:24 -08:00
Anton Lundin
d6f417b5bf Read and write alarm time correctly for Stinger
The Stinger stores the alarm time in seconds, instead of minutes as the
Vyper does it. This corrects for that.

Reported-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 08:39:02 -08:00
Anton Lundin
ac207ee5ff Emit the successful message the right way
The successful message was emitted in a some what older way then the
other messages so it was always emitted, even on error.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 08:38:50 -08:00
Anton Lundin
a696da9146 Make sure the device open error reaches the user
This is a bit ugly fix to make sure the right error message reaches the
user in case of being unable to open the device.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-08 08:38:31 -08:00
Anton Lundin
5a81746797 Style cleanup
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-07 09:46:38 -06:00
Miika Turkia
af418a9c0b Include some extra information on Shearwater import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-07 09:46:07 -06:00
Miika Turkia
b03423dd96 Samples should be inside divecomputer on Shearwater import
Data read from a divecomputer is moved inside the divecomputer tag

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-07 09:46:03 -06:00
Miika Turkia
4dc99a0b56 Add cylinder support for Shearwater XML import
This tries to grab the used cylinders when in open circuit mode.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-07 09:45:58 -06:00
Miika Turkia
d7d5c296dd Record ppO2 only when on CCR mode
Shearwater describes the current mode with tag currentCircuitSetting,
thus we should record the ppO2 only when in CCR mode.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-07 09:45:46 -06:00
Robert C. Helling
8cd5d08ba9 In diveplan differentiate between last printed depth and last depth
In the decision if a dive segment should lead to a line in the
diveplan, we need to differentiate between the lastdepth (the
depth of the last dp to tell if we are currently stopping) and
the last depth that we printed a line for (needed for gaschange
lines). Without this patch, no stops without gas changes were
listed anymore in the diveplan.

Like the last patch for the diveplan: I hope this time I got this
logic right.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-07 09:45:25 -06:00
Miika Turkia
bac2b92860 Add utopic and precise to Ubuntu packaging
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-07 09:42:14 -06:00