Commit graph

2966 commits

Author SHA1 Message Date
Linus Torvalds
c6da79e1b0 Improve the code handling air temperature
Better helper functions make for easier to understand code.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-15 01:11:14 -08:00
Salvador Cuñat
b4c2fcc802 Modify table print for using pango_layout_get_extents()
1.-  On draw_table() we now set the layout, make the scaling *0.5, and the
     make traslations row by row.
2.-  Wipe out print_table_header and print_table as they now don't make
     anything but call show_table which now we can call directly from
     draw_table.
3.-  Modify show_table to get account of the height of the higher column
     and return it.
4.-  The frame is now plot with an auxiliar func. directly from draw_table.

With this changes we have a variable height pattern which lets us have
complete the more sensible info  (date, time, location, ...) without
wrapping it to fit in the predefined width of the layout.

The printout is tighter than old one so we can print 35 dives in a page,
leaving enough room at the bottom to fit some extra-large (three lines or
more) dives' info.  Have increased *1.2 the size of the fonts as they got
too little with the change in DPI.  Wrap the header strings to limit the
impact of different string sizes in the different supported languages.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-15 00:55:44 -08:00
Krzysztof Arentowicz
b472712162 Add Polish translation
Some acronyms like MOD, SAC etc are left 'as is' as they
are widely known and used in polish diving community
so thinking up a polish version would be plain confusing.

Most strings are translated but there are some that do not show
in my poedit (like "select events" / "gaschange") or I was
not sure about.

Signed-off-by: Krzysztof Arentowicz <k.arentowicz@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-14 13:07:54 -08:00
Reinout Hoornweg
7163248627 Updated Dutch translation
New strings from planner.c translated.

Signed-off-by: Reinout Hoornweg <reinout@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-14 11:59:28 -08:00
Pierre-Yves Chibon
01a82d4256 The Subsurface icon has been renamed, the .desktop must be adjusted.
This commit simply adjust the .desktop file to reflect the change in the name for the
icon (from subsurface.svg to subsurface-icon.svg).

Fixes #55

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-14 09:57:13 -08:00
Dirk Hohndel
869edfbe39 Merge branch 'airtemp-fix' 2013-02-14 09:47:15 -08:00
Dirk Hohndel
23cfd907de Better handling of manually edited air temperature
We now load and save this in the XML file, we do the right thing when
merging dives and show the edited air temperature in the Dive Info
notebook when a divecomputer doesn't have an air temperature.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-14 09:44:18 -08:00
Dirk Hohndel
adf135ad38 Merge branch 'mac-app-signing' 2013-02-14 09:21:11 -08:00
Dirk Hohndel
249482cf2f Add support for signing Mac applications to the Makefile
Maybe I should comment out the target that requires my private key to work...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-14 09:19:28 -08:00
Fredrik Steen
ca19578e40 Update for Swedish translation
New strings translated and some updated for Swedish.

Signed-off-by: Fredrik Steen <fredrik@ppo2.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-14 08:04:58 -08:00
Sergey Starosek
15b4209bd8 Update for Russian translation.
New strings translated, several spelling fixes, event strings
shortened.

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-14 08:04:26 -08:00
Miika Turkia
4f1b204015 New terms translated to Finnish
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-14 07:55:15 -08:00
Lubomir I. Ivanov
1cf0abccce Updated bg_BG translation
- added translation for new planner warning strings
- fixed a small typo in the tranlation for the word "maintain"
- translated (mbar) text in parentheses

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-14 07:54:53 -08:00
Dirk Hohndel
6b458ad7fa Ensure that planner warnings get shown before calculations are run
Linus pointed out that the warning wasn't shown until the main loop got
control back, so even a gtk_widget_show_all() doesn't really help to make
sure that things are shown right then.

This commit adds a little loop to handle all pending gtk_events before
exiting the show_error() function. Now the warning should be shown BEFORE
a potentially slow calculation gets started.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-14 07:51:25 -08:00
Pierre-Yves Chibon
29bc1e12a4 Update French translation
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-14 00:56:26 -08:00
Robert C. Helling
3f4e4bac25 Another patch for the German expressions.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-14 00:56:03 -08:00
Henrik Brautaset Aronsen
6efae15583 Another Norwegian translation update for 3.0!
Who would have thought :)

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-14 00:29:21 -08:00
Dirk Hohndel
c85ba7204c German and Swiss-German translations for the new strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-13 23:42:11 -08:00
Dirk Hohndel
4198e0fbc4 Update PO files for planner.c changes
Sorry, ten new strings.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-13 23:39:18 -08:00
Dirk Hohndel
06e03e83e8 Merge branch 'planner-fix' 2013-02-13 23:38:14 -08:00
Dirk Hohndel
d1ee250524 Make planner.c warning consistent
Just a tiny change to make them look more consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-13 23:14:55 -08:00
Dirk Hohndel
fd703f3ca0 Support deeper stops and longer dive notes in planner
Since we now support dives all the way down to 400m we should also support
deeper stops. And of course this can create insanely long dive plans, so
make sure there is plenty of space for those.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-13 23:02:05 -08:00
Dirk Hohndel
0cde0eff10 Rewriting the error handling in planner.c
Printf is not a way to issue warnings and errors. This is a very late
addition but seems necessary for a viable release of the planner.

This also adds one artificial limit and two warnings:

a) no dives deeper than 400m
b) warning of potentially very long calculation times for dives longer
   than 3h (180min) before the ascent and dives deeper than 150m

It also creates quite a number of new strings that need to be translated
(and marks a few existing ones for translation as well).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-13 23:02:00 -08:00
Miika Turkia
69af7887e0 Fix msgfmt error on po/FR.po
po/fr_FR.po:316: `msgid' and `msgstr' entries do not both end with '\n'
msgfmt: found 1 fatal error

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-13 21:40:02 -08:00
Pierre-Yves Chibon
5d6ee63f77 Update french translation for release 3.0.0
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Signed-off-by: Kévin Raymond <shaiton@fedoraproject.org>
Signed-off-by: Jean-Noel Rouchon <jnoel@sissiou.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-13 15:04:55 -08:00
Dirk Hohndel
81603510b2 Small update to README and add preliminary ReleaseNotes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-13 15:02:42 -08:00
Dirk Hohndel
5a540fb9d1 Remove rounded O2 in air
To quote Linus, gentle as always:

 Stuff like this is just BS.

 Don't do it. You already fixed the bug with matching gas change events,
 so adding this idiotic workaround no longer fixes anything, and its
 confusing and actively misleading.

 It's not even percent. It's still permille, just rounded. So it's a
 nonsensical number and a misleading name. Just delete it as the abortion
 it is. It is only going to cause more problems later.

 Just use the correct value.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 22:28:31 -08:00
Miika Turkia
883acc68d1 fi_FI translation
On Tue, Feb 12, 2013 at 9:54 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> 2013/2/12 Miika Turkia <miika.turkia@gmail.com>:
>> There are a few words that should still be translated properly. I just don't
>> know what would be proper translation for them.
>>  msgid "membrane"
>>  msgid "Bailing out to OC"
>>  msgid "CC SetPoint"
>
> From the Suunto DX Finnish manual at
>
>     http://ns.suunto.com/Manuals/DX/Userguides/Suunto_DX_UserGuide_FI.pdf
>
> you can see some of the terms at least Suunto uses for CC/OC (closed
> circuit and open circuit) (and suunto more commonly uses CCR: Closed
> Circuit Rebreather instead of just CC). They talk about bailing out to
> OC on page 100: "... suljetun kierron sukellus muuttuu avoimen kierron
> sukellukseksi. Tämä ominaisuus on käyttökelpoinen
> pelastautumistilanteessa." But I have no idea how to phrase that
> "Bailing out to OC". For "SetPoint" they use "asetuspiste" (see a page
> earlier).
>
> "membrane" is the crazy Uemis suit-thickness selection. Which would be
> about a trilam drysuit with no inherent insulation in itself. I
> suspect the best you can do is "laminaatti", because from looking
> around, I can't find anything better. Sure, it's about the material
> itself rather than the thinness, but whatever. It doesn't really
> matter.

Thanks, the attached patch should now be close enough to proper
translation for these terms. Understanding (more or less) what the
terms mean is a lot easier than actually translating them...

miika

From 96cf543e7464e72212ab26c965f1e8844da5d7b3 Mon Sep 17 00:00:00 2001
From: Miika Turkia <miika.turkia@gmail.com>
Date: Wed, 13 Feb 2013 06:32:13 +0200
Subject: [PATCH] Tuning up fi_FI translation

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 21:17:39 -08:00
Dirk Hohndel
5e93469f35 Fix gas handling in planner
Two separate bugs.

a) Air cylinders were created with o2=209 and no other value set.
sanitize_gasmix() turned that into o2=0 which meant that this cylinder was
now identified as "nodata", i.e., unset.
We now set a fake cylinder name to deal with that issue.

b) the gaschange event is inherited from libdivecomputer and therefore
only supports 1 percent granularity for o2 and h2. Since we didn't round
when assigning the value we ended up with air being stored as o2=20 he=0
which of course then didn't match air anymore (which we have defined as
208 <= o2 <= 210).
We now use o2=210 for air in the planner and carefully round the permille
values whenever we convert into percent - and compare gases with percent
granularity as well.

A better fix for b) would be to change the Subsurface event to not simply
copy the libdivecomputer behavior and use percent granularity but support
permille instead. But this closely before the 3.0 release that seemed like
a far too invasive change to make - the changes to the planner should have
no impact outside the planner module.

Reported-by: Chris Lewis <chrislewis915@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 21:12:17 -08:00
Dirk Hohndel
1b548c071b Set maxdepth correctly for dives with no samples
This showed up when suddenly some of the test dives no longer got merged
when loaded twice. As I moved maxdepth up into the dive structure and
added the code to fixup the data from what is in the divecomputer I missed
the part where the function is exited early if there are no samples. This
patch corrects that oversight.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 12:34:22 -08:00
Miika Turkia
9fa9ebcff2 fi_FI translation
There are a few words that should still be translated properly. I just don't
know what would be proper translation for them.
 msgid "membrane"
 msgid "Bailing out to OC"
 msgid "CC SetPoint"

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 11:15:04 -08:00
Dirk Hohndel
6b7ffb3a8b Small update to German translation plus attempt to update Swiss-German
Since Swiss-German is based on the German translation I attempted to bring
many of the improvements from there to the Swiss-German translation as
well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 10:06:25 -08:00
Robert C. Helling
8c14a69a7b Update to DE translation
Some typos, some hyphens, some changes to more idiomatic expressions.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 08:51:19 -08:00
Fredrik Steen
c5ff5a8bc3 Updated Swedish translation.
Updated swedish translation.

Signed-off-by: Fredrik Steen <fredrik@ppo2.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 08:43:04 -08:00
Reinout Hoornweg
868dc07065 Update to Dutch translation
Added translation for "Use right click to mark dive location at cursor".

Signed-off-by: Reinout Hoornweg <reinout@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 08:43:04 -08:00
Henrik Brautaset Aronsen
8e673e4618 Let's do another Norwegian translation update for 3.0
Added one string, improved some of the others after inspecting
the source code locations.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 08:43:04 -08:00
Miika Turkia
cbc818ddfe Include SDE files on file selector
Include SDE files on the file selectors if zip support is enabled.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 08:42:46 -08:00
Henrik Brautaset Aronsen
b1c01f62ea Add libzip to MacPorts dependencies
This adds support for SDE imports.  The website documentation should
be updated as well.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 08:37:07 -08:00
Lubomir I. Ivanov
d2305b0c01 Updated bg_BG translation
+ new string for map widget
+ fixed missing dot after shortened word

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 08:31:28 -08:00
Sergey Starosek
1dcde35c9e Updated Russian translation for latest strings
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 08:30:47 -08:00
Jozef Ivanecký
75490b22ec Finished and fixed sk_Sk
Signed-Off-By: Jozef Ivanecký <dodo.sk@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-12 08:23:17 -08:00
Dirk Hohndel
f50ae3a689 Update German and Swiss-German translations for latest strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-11 20:19:33 -08:00
Dirk Hohndel
9166dab702 Another strings update
This should re-enable to text for "Gas Used" and introduces the new text
for the map window title from commit 21401578c620 ("Add instructions to
GPS map window title").

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-11 19:54:43 -08:00
Dirk Hohndel
4ed41dd49f Add instructions to GPS map window title
This is not what I really wanted (which was the ability to add text to the
map itself), but it should be at least somewhat better than what we have
today (which is a complete lack of instructions).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-11 19:52:44 -08:00
Lubomir I. Ivanov
c92d5d2e66 print.c: Attempt a gettext() fix when printing translated "Gas Used"
print_tanks():
It seems the macro call NC_("Amount","Gas Used") generates an entry in the
.po file that then isn't matched at run time, which makes the bg_BG print
have "Gas Used" in english instead of the translated text (which is
already present in other places).

On the other hand if we use N_ here (only mark it), the printed text
is translated correctly.

[Dirk Hohndel: added GETTEXT comment in code and rephrased commit message]

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-11 11:33:04 -08:00
Lubomir I. Ivanov
3cb51b948a print.c: Fix more buffer lengths
print.c has a lot of defined buffer sizes, which do not consider
UTF-8 expansion. gettext() with UTF-8 can inflate a string up to
2x the length (with 2byte characters).
So if you set a buffer with length, say 20 bytes, lets see what happens:

divenr[20];
snprintf(divenr, sizeof(divenr), _("Dive #%d - "), dive->number);

But wait, in Russian "Dive" (which in latin text is "Pogrugenie")
ends up with 10 cyrilic characters (20 bytes), so there is already
buffer overflow here and snprintf() kicks in to corrupt the string.

In matters of truncation snprintf() isn't UTF-8 safe.
So if the buffer size happens to be less of the requested string
to be put in there, the truncation can corrupt a trailing unicode
character.

For now, lets try fixing these by expanding the buffer sizes.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-11 11:27:21 -08:00
Lubomir I. Ivanov
02f9df4271 bg_BG.po: Small reformating of a (Dive# - data, time) string for print.c
In printed dives (6x per page) the <Dive # - data, time> string
had an extra comma after the hyphen.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-11 11:25:04 -08:00
Sergey Starosek
9d21f6a670 New translations and several bug fixes for Russian.
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-11 09:30:33 -08:00
Dirk Hohndel
e5985b9657 Remove "target ring" in map display
This could easily lead to confusion that this is where a dive spot would
be marked (instead of the location of the mouse during right click).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-10 12:48:41 -08:00
Linus Torvalds
05990b107d Fix saving of changed GPS entry
We can't use gps_changed() in the gps_map_callback function, because that
will actually change the GPS data in the dive being edited, which in turn
will then cause us to later (when we *really* want to change it) not match
the master dive data any more, and think we shouldn't edit the dive at
all.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-10 12:10:26 -08:00