Commit graph

2181 commits

Author SHA1 Message Date
Miika Turkia
cc96860165 MacDive import improvement
MacDive reports non-existent values as zero and in Imperial units it
would be 32F. This patch will try to make an educated guess whether we
have the proper temperature and pressure readings and ignore the zero
fields if it seems that there are no real samples from the dive
computer.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-27 09:03:17 -08:00
Linus Torvalds
b54dacbeb2 Ensure all strings stored in XML are escaped correctly
This does escaping / quoting for everything I found. Some of it was safe
(the divecomputer model is supplied from libdivecomputer, and none of them
have single quotes _yet_, afaik), but with this there are no '%s' strings
left except for the ones used by the helper functions (for "pre" and
"post" strings).

It also takes some of our existing uses of show_utf8(), and removes
the redundant "check if the string is NULL or empty". show_utf8() does
that internally.

Fixes #73

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-27 08:27:20 -08:00
Cristian Ionescu-Idbohrn
eb3376d612 Suppress the "/bin/sh: 1: cannot open version.h: No such file" noise.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-27 07:44:10 -08:00
Cristian Ionescu-Idbohrn
6a29da800b Add target `all' to avoid "target order is important" confusion.
Signed-off-by: Cristian Ionescu-Idbohrn <cii@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-27 07:43:57 -08:00
Cristian Ionescu-Idbohrn
1c290ebe5b Unused variable warning when building without libosmgpsmap.
info.c: In function 'dive_info_widget':
info.c:759:48: warning: unused variable 'image' [-Wunused-variable]

Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-27 07:42:55 -08:00
Cristian Ionescu-Idbohrn
f04d9c5656 Small typo correction.
One 'r' removed.

Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-27 07:41:40 -08:00
Miika Turkia
ecdb4cd522 Fix MacDive import to convert Imperial temperature
MacDive import needs to convert temperatures to Celcius. However, it
seems that MacDive reports no reading as 32F (and probably 0C when using
Metric). There is no way of knowing whether we have no reading or
the temperature is actually zero, so we use the given temperature
currently as 0C is a valid temperature...

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-27 06:44:34 -08:00
Dirk Hohndel
4b0d7ac72f Update ReleaseNotes for 3.0.1
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 13:29:23 -08:00
Jan Schubert
16d9f3007f Documentation: fixed some typos in bluettoth part of user manual
[Dirk Hohndel: some fixes of the fixes...]

Signed-off-by: Jan Schubert <Jan.Schubert@GMX.li>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 13:03:54 -08:00
Dirk Hohndel
fd9a927ded Update versions to 3.0.1
almost forgot

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 12:57:59 -08:00
Jan Schubert
bd6a33f4bc Documentation: add pictures for Bluetooth setup
Signed-off-by: Jan Schubert <Jan.Schubert@GMX.li>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 12:50:39 -08:00
Dirk Hohndel
ea57927554 Documentation: update formatting
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 12:44:41 -08:00
Jan Schubert
e687e81ca4 extend user manual for setting up bluetooth communication.
This extends the user manual for setting up bluetooth communication.

Signed-off-by: Jan Schubert <Jan.Schubert@GMX.li>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 12:39:09 -08:00
Kévin Raymond
3c58e7071f French translations update
Signed-off-by: Kévin Raymond <shaiton@fedoraproject.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 12:25:13 -08:00
Dirk Hohndel
1fd2091759 Get make to rebuild Subsurface by default again
To quote Linus:

  Move the rule for the new version thing down.

  Plain "make" will try to make the first target in the Makefile.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 12:19:01 -08:00
Dirk Hohndel
881baafc26 DivingLog import: keep the dive computer name around
We simply set up the model attribute.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 11:51:35 -08:00
Dirk Hohndel
6d69325185 For divecomputers without samples don't lose other data for profile
We create a fake divecomputer in order to draw a reasonable profile, but
when setting that up we used an empty divecomputer instead of starting
with the one that we have. This lost data (e.g., the model name of the
dc).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 11:44:24 -08:00
Dirk Hohndel
5cea16ec50 Another update to DivingLog import
This fixes two bugs:
- we overwrote the max depth that we read from an XML file with 0 if there
  are no samples
- we didn't parse the DepthAvg tag in the DivingLog XML

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 11:16:41 -08:00
Cristian Ionescu-Idbohrn
42fa5a6368 Generate/update a version.h header file.
This is dedicated to Lubomir ;)

Should work (tm).  Not sure though if you want target
'gen_version_file' as a pre-requisite to $(NAME) or some other target.

[Dirk Hohndel: minor adjustments to make it work with gtk-gui.c]

Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 10:47:04 -08:00
Miika Turkia
686a27aee9 UDCF import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 10:16:49 -08:00
Jan Schubert
906803b80f Documentation: add information for Bluetooth connected devices
[Dirk Hohndel: did some reformatting and rewriting]

Signed-off-by: Jan Schubert <Jan.Schubert@GMX.li>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 10:04:09 -08:00
Dirk Hohndel
0b5c48ee4e Documentation: DivingLog needs to be set to Metric prior to export
Since their XML file gives us no information as to the measurement system
used we need to ask the user to explicitly set it to metric before they
create the XML file.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 09:26:09 -08:00
Miika Turkia
826d27711e Test dives
On Tue, Feb 26, 2013 at 6:19 PM, Dirk Hohndel <dirk@hohndel.org> wrote:
> Miika Turkia <miika.turkia@gmail.com> writes:
>
>> On Tue, Feb 26, 2013 at 5:54 PM, Dirk Hohndel <dirk@hohndel.org> wrote:
>>> Miika Turkia <miika.turkia@gmail.com> writes:
>>>
>>>> On Tue, Feb 26, 2013 at 6:45 AM, Dirk Hohndel <dirk@hohndel.org> wrote:
>>>>> I added a few test dives exported from other software (Dm3, DiveLog 5.08,
>>>>> JDiveLog 10.2 from Mac - last one doesn't parse because of encoding... Also
>>>>> a composed XML zip file from DiveLog isn't supported, yet)
>>>>> Find them under dives
>>>>
>>>> Now this gets interesting. Is there ANY logic in the units in the
>>>> dives/TestDiveDiveLog5.08.xml? It seems that some of the temperatures
>>>> are in C (Airtemp and Watertemp) and some in F (samples). Otherwise I
>>>> would guess we are talking metric here, but I do not see any specs
>>>> (another log I have seen from DivingLog had all the units in metric,
>>>> as far as I could guess). BTW is the Weight in kg or lb?
>>>
>>> I have purchased DivingLog and should be able to create any combination
>>> of data for the test file that we could possibly want. I'll do a set in
>>> a moment that describe what SHOULD be there in their notes, maybe that
>>> will clear things up.
>>>
>>> That said, I really want to release 3.0.1 in the next couple of hours,
>>> so this may have to wait for 3.0.2 (if we end up needing that) or 3.1.
>>>
>>>> The divelogs.de UDCF format looks like it shouldn't take long to write
>>>> support for. I'll look into it this evening.
>>>
>>> It is evening for you, right? No pressure, just making sure I understand
>>> what may be coming in in patches in the next hour or two
>>
>> I currently have one version of the DivingLog XSLT. So a bit of
>> verification and that could possibly be used as is. However, this
>> could use a bit more testing than a new support to make sure things
>> are not going to be any worse than they currently are.
>>
>> I have not started with the UDCF yet, but that could be reasonably
>> fast to implement. However, no guarantees. (And yes, it is evening for
>> me)
>
> I can hold off 3.0.1 a couple hours longer if that is a realistic thing
> to do. I don't see the UDCF as that important since we have a different
> format from them that we support. So I think the best possible DivingLog
> support would be my preference.
>
> I'll add a few more exported dives from DivingLog next (and fix the
> naming of the existing ones).

In that case, here is the DivingLog XSLT if anyone can give it a test.

miika

From 4a62058f4f6fd4780f04bce6e1fe45e20abcf33f Mon Sep 17 00:00:00 2001
From: Miika Turkia <miika.turkia@gmail.com>
Date: Tue, 26 Feb 2013 17:46:53 +0200
Subject: [PATCH] XSLT for DivingLog

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 08:50:05 -08:00
Dirk Hohndel
b90400876f Update DivingLog 5.08 export files
Two XML files, one all imperial, one all metric
Quick inspection shows that there is no indication whatsoever on metric vs
imperial in the file. That is of course completely moronic and makes
automated import more or less impossible.

I also added a different zip file from DivingLog - quick analysis shows
that this is simply the corresponding xml file, wrapped in a zip
container. So this should be trivial to add.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 08:39:09 -08:00
Jozef Ivanecký
e65a4a7f08 Updated Slovakian translation
Signed-off-by: Jozef Ivanecký <dodo.sk@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 08:06:24 -08:00
Salvador Cuñat
e11fa034fc Spanish update traslation of User Manual
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 08:00:08 -08:00
Reinout Hoornweg
6a43bea915 Update to the Dutch translation
Signed-off-by: Reinout Hoornweg <reinout@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 07:59:36 -08:00
Lubomir I. Ivanov
8c0b1ae1b0 Added missing translation for "User Manual" in bg_BG
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 07:58:15 -08:00
Fredrik Steen
f43757c7f0 New translated strings for sv_SE
Signed-off-by: Fredrik Steen <fredrik@ppo2.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-26 07:57:59 -08:00
Miika Turkia
edc48455b5 Latest addition to fi_FI
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 22:14:05 -08:00
Dirk Hohndel
47f0c6b722 Add two more versions of this dive from divelogs.de
The DLD is imported perfectly, the udcf is not.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 22:07:05 -08:00
Dirk Hohndel
41e704bce2 Add the same test dive in a number of different formats
Suuntu DM3
DiveLog 5.08 XML
DiveLog 5.08 UDDF
DiveLog 5.08 UDCF
DiveLog 5.08 compressed zip (we don't support that)
JDiveLig 10.2 from Mac (fails because of ecoding)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 20:28:58 -08:00
Dirk Hohndel
0aa5909c11 Update German and Swiss-German translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 17:33:12 -08:00
Dirk Hohndel
157281d534 Update PO files. AGAIN.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 17:32:21 -08:00
Dirk Hohndel
f6673ab359 Add link to user manual to Help menu
Yes, we could try and bundle the user manual with the executables and open
a local copy of it - but this seemed much easier and safer to do. It does,
of course, add another string...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 17:31:02 -08:00
Salvador Cuñat
8de8d6733f Spanish translations updated again
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 17:10:55 -08:00
Linus Torvalds
308d71ec39 Take incompressibility of gas into account at higher pressures
This creates a helper function called "gas_volume()" that takes the
cylinder and a particular pressure, and returns the estimated volume of
the gas at surface pressure, including proper approximation of the
incompressibility of gas.

It very much is an approximation, but it's closer to reality than
assuming a pure ideal gas.  See for example compressibility at

    http://en.wikipedia.org/wiki/Compressibility_factor

Suggested-by: Jukka Lind <jukka.lind@iki.fi>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 16:48:16 -08:00
Lubomir I. Ivanov
d53bedbed6 Updated bg_BG translation
- missing strings from parse-xml.c
- translation for "No Events"
- small uppercase fix

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 14:28:58 -08:00
Dirk Hohndel
e8d6d0e4de parse-xml.c: add parsing for DivingLog divetime and depthavg
I have a sample file where the time is given as minutes.seconds instead of
minutes:seconds.

Fixes #69

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 14:28:35 -08:00
Dirk Hohndel
ab7e877715 Update German and Swiss-German translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 13:59:31 -08:00
Dirk Hohndel
88966adaff Updated PO files, again
This time for the new string in the Events Filter dialog adden in commit
66cb5ae00b68 ("Show a "No Events" label when there are no events in the
filter dialog")

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 13:57:30 -08:00
Lubomir I. Ivanov
aa5f1f0ce2 Show a "No Events" label when there are no events in the filter dialog
Uses profile.c:evn_foreach() to retrieve the number of events, which
if zero, no table is added in the dialog and the label is added instead.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 13:56:22 -08:00
Dirk Hohndel
31b2a6ffa8 Fix uninitialized memory access in webservice download
In download_dialog_release_xml() we check if state->xmldata is non-NULL
and free it. But we don't set it to NULL anywhere, so if the user hits
cancel the variable is undefined.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 13:38:18 -08:00
Dirk Hohndel
a635c30564 Work around yet another Gtk bug: gtk_show_uri doesn't work on Mac
Instead use the native function to open the URL.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 13:22:33 -08:00
Salvador Cuñat
fadf2f4432 Spanish translations updated for 3.1
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 12:57:52 -08:00
Lubomir I. Ivanov
04ad50cb75 Improvements to the "Download from Webservice" dialog
- Added a help button that links to the online API page and should provide
a sufficient start to the new user.
- Use download_dialog_response_cb as a callback for most dialog reponses
instead of waiting for gtk_dialog_run() and using goto e.g. in the case
of GTK_RESPONSE_HELP.
- Fixed some integer signedness warnings in download_dialog_traverse_xml()

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 12:56:59 -08:00
Lubomir I. Ivanov
cd5c61e102 Don't use gtk_show_about_dialog() for the about dialog
There is a bug in GTK 2.2x where the links in the about dialog
(and URI's in general) do not work on Windows. To solve that
we add the OS specific method subsurface_launch_for_uri().
But to dispatch URI requests from the about dialog we need to
set a hook either with gtk_about_dialog_set_url_hook() (which is
deprecated from 2.24) or using signals like "activate-link".

One problem with the "activate-link" signal thought is that
we need to have a reference of an about dialog to pass to
g_signal_connect(). So instead of using gtk_show_about_dialog()
let's manage a dialog ourself with gtk_about_dialog_new(),
gtk_dialog_run(), gtk_widget_destroy().

Other changes:
- for GTK _bellow_ (but not including) 2.24 use
gtk_about_dialog_set_url_hook()
- use g_object_set() which is a convenient replacement for
the varargs list in gtk_show_about_dialog() (also makes the diff smaller).

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 11:08:47 -08:00
Reinout Hoornweg
9f8bbeb0cf Update Dutch translation
Signed-off-by: Reinout Hoornweg <reinout@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 11:08:13 -08:00
Dirk Hohndel
5bc56c9c7e Documentation: add brief section about DivingLog export
Fixes #63

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 09:23:39 -08:00
Miika Turkia
693ff07db6 Update fi_FI translation
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 08:36:14 -08:00