Commit graph

3357 commits

Author SHA1 Message Date
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
Lubomir I. Ivanov
739ea9989c gtk-gui: Check if the GTK version is lower than 2.24 for the about dialog
The about dialog URI calls are broken on Windows, therefore we needed
a way to override the default URI method. On versions bellow or equal to
GTK 2.24 this is possible with gtk_about_dialog_set_url_hook(),
which on the other hand is deprecated for newer GTK versions.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 08:34:03 -08:00
Dirk Hohndel
6bc54bd5e7 Update German and Swiss-German translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 08:15:55 -08:00
Dirk Hohndel
d72f90650e Update PO files for 3.0.1
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 08:13:06 -08:00
Miika Turkia
e84ad1b33a Fix GPS import from divinglog
Ticket #63 - divinglog 5.08 import issues
This patch will include the GPS coordinates from divinglog.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 07:50:51 -08:00
Miika Turkia
c1581ef45b Mark some strings for translation
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 07:47:25 -08:00
Dirk Hohndel
fb70834a30 Documentation: correct the meaning of different colors in profile
In commit 0f31b71c3588 ("User documentation - describe the dive profile")
the description of the depth profile coloring was incorrect.

I also fixed some language issue and tried to better describe the zoom
options.

Finally I increased the revision number of the user manual.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 07:40:18 -08:00
Miika Turkia
5927542999 User documentation - describe the dive profile
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-25 07:25:41 -08:00
Linus Torvalds
d753805542 Fix cylinder air size calculations
Commit 90d3c5614a ("Centralising and redefining values as integers")
broke SAC-rate calculations. In particular, it changed "to_ATM()": to
use the centralized SURFACE_PRESSURE helper define, but in the process
it changed a floating point calculation to an integer calculation, and
it threw away all the fractional details. Any user of "to_ATM()"
basically dropped to an accuracy of a single atmosphere.

The good news is that we didn't use to_ATM() for things like depth
calculations, but only for cylinder pressures. As a result, the error
ends up being relatively small, since the pressures involved are big,
and thus the error of rounding to whole atmospheres is usually in the
1% range. The cylinder sizing tends to be off by more than that
anyway. But it was wrong, and not intentional.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-24 15:45:59 -08:00
Linus Torvalds
7b20fb826c Use the improved duration and average depth for everything
The code was written to get the SAC rate correct, but we probably do
want to have the duration and mean depth of the dive always be shown for
the non-surface-time.

So move the code from the sac-rate calculation to the generic dive fixup
part.  This makes the dive list and statistics all show the duration as
the under-water duration, which is not necessarily the same as
"difference between beginning and end of dive".

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-24 11:48:29 -08:00
Linus Torvalds
b62e63650a Fix SAC calculations for dives without any samples
We computed a made-up average depth based on the maximum depth, and used
that.  That's questionable even if we didn't have any explicit average
depth to begin with, but it's particularly wrong if we did have an
explicit average depth to use.

Now, admittedly we have no way to actually create fake dives like this
with a particular average depth, so this really doesn't make any
difference in real life.  But we should do this right.

Also, make the XML be in the format that subsurface actually saves
things in (mainly things like cylinder sizes having an extra decimal
place, but also ordering of XML elements).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-24 11:25:44 -08:00
Linus Torvalds
6d548d2028 Correctly calculate SAC rate in the presense of surface events
This assumes that you are not breathing your cylinders while at the
surface, which may or may not be correct, but is usually the right
thing.  Regardless, we're better off giving a conservative (higher) SAC
rate estimate for a diver that breathes his cylinder at the surface too
than giving an artificially low one because the diver ended up using his
snorkel and we didn't take that into account.

NOTE! This basically calculates a better duration and average depth than
the ones we end up showing in the dive list.  Maybe we should actually
show this "no-surface-time" duration and average depth instead of the
ones we do show?

That's a separate question, though.

Added a test-case for the surface case to the sac-test.xml dives.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-24 11:09:52 -08:00
Linus Torvalds
f4bf16d5db Fix up SAC calculations for ATM/bar confusion
We even documented that we did SAC in bar*l/min, but the "S" in SAC
stands for "Surface".  So we should normalize SAC rate to surface
pressure, not one bar.

It's a tiny 1% difference, and doesn't actually matter in practice, but
it's noticeable when you want to explicitly test for SAC-rate by
creating a test-dive that averages exactly 10m.  Suddenly you don't get
the round numbers you expect.

[ Side note: 10m is not _exactly_ one extra atmosphere according to our
  calculations, but it's darn close in sea water: the standard salinity
  of 1.03 kg/l together with the standard acceleration of 9.81m/s^2
  gives an additional pressure of 1.01 bar, which is within a fraction
  of a percent of one ATM.

  Of course, divers have likely chosen that value exactly for the math
  to come out that way, since the true average salinity of seawater is
  actually slightly lower ]

So here's a few test-dives, along with the SAC rate fixup to make them
look right.

(There's also a one-liner to dive.c that makes the duration come out
right if the last sample has a non-zero depth, and the previous sample
did not: one of my original test-dives did the "average 10m depth" by
starting at 0 and ending at 20m, and dive.c got a tiny bit confused
about that ;)

[ The rationale for me testing our SAC rate calculations in the first
  place was that on snorkkeli.net user "Poltsi" reported that our SAC rate
  calculations differ from the ones that Suunto DM4 reports. So I wanted
  to verify that we did things right.

  Note that Poltsi reported differences larger than the difference of
  BAR/ATM, so this is not the cause. I'll continue to look at this. ]

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-24 10:49:26 -08:00
Miika Turkia
1f20d5feed XSLT for UDDF import
This XSLT imports the UDDF logs that I have received samples of. This
includes kenzooid and Heinrichs Weikamp's DR5.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-24 08:52:58 -08:00
Lubomir I. Ivanov
afac4e71f4 Remove rounding of the value for minutes when editing dive date/time
For the "Edit dive date/time" dialog, (time->tm_min / 5)*5)
with integers can lose precision due to truncation, showing for example
a value of 55, where 59 is the actual previsouly stored value.

Reported-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-24 08:50:49 -08:00
Cristian Ionescu-Idbohrn
69062034b3 Remove more useless quotes.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-24 06:43:40 -08:00
Cristian Ionescu-Idbohrn
9ceb65a3ce Use a posix equivalent solution instead of the pattern substitution bashism.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-24 06:43:25 -08:00
Cristian Ionescu-Idbohrn
77a6b18a71 Replace the '==' bashism with the posix equivalent '='.
The quotes are not needed either (nothing to expand there).

Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-24 06:42:14 -08:00
Dirk Hohndel
069c36c95c Expand the version magic even more
Someone who is better at shell script writing needs to review this.

Here's what it's supposed to do. Create version strings with three or four
values for darwin or win, respectively, that we can use as the versions of
the bundle or installer. The version that Subsurface reports isn't
affected by this. So in a way this is automating something that's mostly
cosmetic.

If we have a 2 digit version number (like 3.0), do the same the old script
did - add just zeroes if we are on a tag, otherwise add the number of
commits since the tag (and a last 0 if on win).

If we have a 3 digit version numner (like 3.0.1), leave it alone on mac
and add either the number of commits since the tag or a zero if we are on
the tag on win.

Now this can create the same version number for two different versions on
darwin: the first commit after 3.0 and the version tagged as 3.0.1 will
both get the same number. That's kinda silly but remember - the non-tagged
versions aren't supposed to be widely distributed (and the third digit in
them should be much larger than anything we'd ever release; we are
already on commit 16 since the last tag and hopefully will never release a
3.0.16 as tagged release). And of course the full version as displayed in
the About box is always able to tell things apart because of the SHA added
at the end if it's a non-tagged version.

So why all this magic? The reason we do this is so that during development
we are able to create Mac and Windows installers and they get reasonable
version numbers, based on the versioning that these vendors suppose. And
without manual intervention.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-23 20:45:29 -08:00
Dirk Hohndel
1be9467231 Mac bundle: include the XSLT files
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-23 16:20:19 -08:00
Robert C. Helling
e5b73d9cb7 Planner: fix wait time calculations
The problem is that when we reach the gas change depth and compute the
stop time, no gas change event is created yet but time_at_last_depth tries
to determine the gas for the stop from events.

So instead we pass o2 and he as parameters of that function and calculate
the wait time based on that information.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-23 16:15:18 -08:00
Dirk Hohndel
39fb9244a4 Remove substitute icons for Import and Download
Apparently at least in Unity on Ubuntu 12.10 using those icons causes the
default Menu text to be displayed (Back instead of Import).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-23 16:06:56 -08:00
Lubomir I. Ivanov
c209fae4ab Small context fix in the bg_BG translation
statistics.c required a small context (gender related) fix
for msgid "Shortest".

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-23 15:23:41 -08:00
Lubomir I. Ivanov
dd5e181890 statistics.c: Fix a potential compiler bug triggered in gcc 3.4.5
This may look as a simple formatting change and won't make much sense
to the C programmer. It is an actual bug fix in Subsurface for the
target compiler, since it introduces bogus instructions.

The "month" variable ends up being incremented up to 72 for a single
"month++" call (if inside offset brackets).

gcc -v
Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld
--with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads
--disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry
--disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt
--without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter
--enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw-vista special r3)

OS: Windows 7 [6.1.7601] - x64

Better explained here:
http://lists.hohndel.org/pipermail/subsurface/2013-February/003967.html

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-23 15:22:34 -08:00
Dirk Hohndel
bf5a48a32c Add uddf extension to file selector filter
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-23 11:48:16 -08:00