Commit graph

2966 commits

Author SHA1 Message Date
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
Lubomir I. Ivanov
4e32a5031f statistics.c: Added missing translation of "<unit>/min"
"<unit>/min" should be OK for most Latin languages, but for Cyrillic
we have to translate "min" as well.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-23 08:23:51 -08:00
Salvador Cuñat
f47813546c Print.c : fixes problem with line height in print_tanks
A "\n" was giving 2 lines height for the layout.
Wipping it out makes unnecesary the *2 divisor.
As there may be wrapped strings in tank we need to take
account of this height. There is no need, really, to get the
height of the gasmix or gas_consumed strings, as they are
"semi-fixed" size, but under some locales and imperial units they
could be wrapped too.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-23 08:21:49 -08:00
Linus Torvalds
0eb53fab52 Flesh out the UDDF xml parsing a bit more
Commit 28aba5a206 ("Flesh out the UDDF xml parsing a bit more")
improved on parsing UDDF files by teaching "percent()" to also handle
pure fractions like UDDF uses. So in a UDDF file, an o2 value of "1.0"
means "100%".

But it turns out that I have a few dives with "1% He", and the "Turn
fractions into percent" logic also turns that into 100%.

So this makes the 'percent()' function a bit smarter. If it actually
finds a percentage-sign after the number, it knows it is already
percent, not a fraction. That disambiguates the two cases: "1.0" is
100%, but "1.0%" (note the explicit percentage sign) is 1%.

So now our native format cannot get confused, because it generally
tries to avoid naked numbers. Good choice.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-22 20:17:39 -08:00
Miika Turkia
48de523f15 JDiveLog import - add ndl=0 when on deco
This patch will add ndl='0:00 min' attribute on all the samples that
have stoptime or stopdepth set when importing from JDiveLog. This hack
ensures that dive computer's deco ceiling is shown.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-22 20:16:48 -08:00
Dirk Hohndel
ce659407a8 Add correct XSLT search path for Windows
And report error if XSLT stylesheet not found

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-22 11:20:46 -08:00
Linus Torvalds
28aba5a206 Flesh out the UDDF xml parsing a bit more
This uses the example UDDF file from Jan Schubert's Heinrichs Weikamp
DR5 dives, and now parses the dive dates, the cylinder mixes and the gas
switch events correctly (or at least partially).

It's not perfect: the gas mix has an "id" field that we ignore, and
instead we just depend on the cylinders being in order (which they seem
to be).  And I have rather limited test-cases, so maybe something else
is messed up too.  But for the six example dives I have, this gives
reasonable data.

Test-data-by: Jan Schubert <Jan.Schubert@gmx.li>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-22 09:13:20 -08:00
Robert C. Helling
e19669a2e5 REDME: update dependencies
We also need libxslt1-dev and zlib1g-dev

Signed-off-by: Robert Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-22 07:23:56 -08:00
Dirk Hohndel
dab04aa3d5 Documentation: correct mis-spelling
It's the Heinrichs Weikamp Frog, not From.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-22 07:08:48 -08:00
Dirk Hohndel
cdef0e4555 Windows: add libzip dll to installer package
This was missing in the first set of Subsurface 3.0 binaries

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-22 07:08:36 -08:00
Dirk Hohndel
697ce2380f Some more tweaks to README and ReleaseNotes
Make the two files more consistent, add list of supported dive computers
to ReleaseNotes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-21 07:29:14 -08:00
Jozef Ivanecký
34197dc7ee Update Slovakian translation
Signed-Off-By: Jozef Ivanecký <dodo.sk@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-21 06:13:29 -08:00
Lubomir I. Ivanov
65b6941e7c Some small changes to the Windows NSI script
- on uninstall, delete all XSLT files and the "$instdir\xslt" folder itself
- manage a desktop icon (i believe we had that before?)
- ignore SVG files, as we are now embedding them as static resources

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-21 05:50:26 -08:00
Dirk Hohndel
678dafbe67 Update MacOS make-package script
The three digit number is needed for the Info.plist, not for the dmg and
volume names.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 22:45:11 -08:00
Dirk Hohndel
78dda16d1c Add missing library to Windows installer
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 22:39:53 -08:00
Dirk Hohndel
7f8c78633b Documentation: minor spelling corrections
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 22:12:24 -08:00
Dirk Hohndel
91c6d57e32 Correctly capitalize JDiveLog
Suggested-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 22:02:40 -08:00
Dirk Hohndel
153670ed4e Disable Croation and Italian translations
About 220 strings are missing from each of them - it's better to give
people a consistent English experience than a half-translated one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 21:55:08 -08:00
Dirk Hohndel
59a39e4901 Updating versions for 3.0
Most of the actual version numbers are derived from the git tag, but we do
have the fallback hard-coded in the Makefile (e.g. for people building
from a source tar-ball).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 21:54:16 -08:00
Miika Turkia
fcb470acad A bit of tweaking on Releasenotes.txt
I like to mention the most important features first (thus the profile is
added to the introductory chapter).

Moving word 'also' to different place on the GPS paragraph to indicate
that map is not the only way of inserting GPS coordinates.

JDivelog import was in 2.1 release so removed from here (it is actually
written JDiveLog - with capital L - should probably be fixed in user
manual).

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 21:45:51 -08:00
Linus Torvalds
bc5f82990d Fix divide-by-zero bug in statistics.c
GET_LOCAL_SAC did not check if the two entries had different time stamps
and could therefore cause a divide-by-zero. x86 doesn't fault on that -
it's still wrong. This now calls a function that does proper checking of
all the values involved in the calculation.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 21:24:08 -08:00
Miika Turkia
49b4f7c4ac Display the filename on error message
Display the filename in error message instead of just text 'ZIP file'

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 20:24:39 -08:00
Miika Turkia
ff1c33401b Divelogs.de import empty value fix
This checks that weight and dive durantion are defined before importing.
(Empty value concatenated with unit gives an error on import.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 20:19:59 -08:00
Lubomir I. Ivanov
dcad3af8b6 parse-xml.c: fixed a small memory leak related to xmlGetProp()
test_xslt_transforms():
xmlGetProp uses strdup(), so we have to clear the memory if a pointer
is returned.

xmlFree() doesn't seem very portable (strangly enought), so we
use free(..) directly.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 17:21:25 -08:00
Lubomir I. Ivanov
ef4a39c613 gps.c: Fixed a small memory leak
osm_gps_map_get_default_cache_directory() uses stdc:strdup to allocate
memory for the returned string. Lets try to free the memory
pointed by 'cachebasedir'.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 17:21:03 -08:00
Lubomir I. Ivanov
61698b9f55 info.c: add a method to clear all GtkListStore allocations
Add a new method in info.c called info_widget_destroy(), which
clears all GtkListStore instances. The method is exposed via
display-gtk.h and called from gtk-gui.c:on_destroy().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 17:20:52 -08:00
Lubomir I. Ivanov
0b4dfd6cff Unref the two GtkTreeStore instances when destroying the divelist
Even if these exists for the heap lifespan, we can call:
g_object_unref(dive_list.treemodel);
g_object_unref(dive_list.listmodel);

in divelist.c:dive_list_destroy()

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 17:20:22 -08:00
Lubomir I. Ivanov
9a5818e92c Fixed a memory leak in the divelist when moving with the keyboard
There were some small leaks before here, related to gtk_tree_iter_copy(),
but there is another one in select_next_dive():
nextiter = gtk_tree_iter_copy(iter);

This now requires a SJ near the epilog where we do the memory cleanup.
Lets call this similar label consistently "free_iter" between
select_prev_dive and select_next_dive.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 17:19:50 -08:00
Lubomir I. Ivanov
26a973cf5f Fixed an incorrect by context translation in bg_BG
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 17:17:52 -08:00
Reinout Hoornweg
2c3327d1b7 Documentation: Consistent spelling of "Buhlmann"
Replaced "Bühlmann" with "Buhlmann".

Signed-off-by: Reinout Hoornweg <reinout@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 17:17:20 -08:00
Reinout Hoornweg
09a70bd40d Release notes: small fixes
- Fixed a typo.
- Changed "Buehlmann" to "Buhlmann".
- Added "Experimental" to the announcement of deco calculation.
- Since most of the text seemed to be written for 76 chars width,
  I did the same for the last few lines that exceeded that.

Signed-off-by: Reinout Hoornweg <reinout@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 17:16:56 -08:00
Henrik Brautaset Aronsen
b354fc67bc Update user documentation with divelogs.de suffix change
divelogs.de use DLD as suffix, not ZIP

Suggested-by: Rainer Mohr <mail@divelogs.de>
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 12:06:34 -08:00
Henrik Brautaset Aronsen
c3c3dd84ac Change divelogs.de export file suffix from .ZIP to .DLD
As Rainer finished up the export function on divelogs.de, he
used DLD as a suffix instead.

Suggested-by: Rainer Mohr <mail@divelogs.de>
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 12:06:08 -08:00
Reinout Hoornweg
9f5a636c6a Documentation: Formatting "Setting up Preferences"
- Reformatted a few lists-used-as-tables in "setting up Preferences"
  to be real tables.

Signed-off-by: Reinout Hoornweg <reinout@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 11:59:21 -08:00
Dirk Hohndel
1c2df4987a Turn the Release Notes into an actual announcement
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 11:57:13 -08:00
Dirk Hohndel
7374f3eaf1 It seems that asciidoc doesn't allow dots in BlockIDs
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 11:23:52 -08:00
Henrik Brautaset Aronsen
7da4bc928c Add divelogs.de export info to the manual
Replaces the FIXME's in Miiko's patch

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 11:00:43 -08:00
Henrik Brautaset Aronsen
0159607c4f Replace "SDE file" with "ZIP file" in translations
Generic naming after adding divelogs.de import.  It needs unzipping
the exact same was as SDE files does.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 11:00:06 -08:00
Henrik Brautaset Aronsen
80539614b4 Add unzip support to divelogs.de exports
Finalize divelog.de import, used with Miiko's divelog.de xslt transform

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 10:59:53 -08:00
Miika Turkia
f6debdc183 Add info on importing divelogs.de to user manual
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 10:59:16 -08:00
Miika Turkia
9b4c251ebe Import divelogs.de
This XSLT converts divelogs.de logs into Subsurface format. Data that is
discarded: weather, water visibility, boat name.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 10:57:24 -08:00
Lubomir I. Ivanov
32761485d1 Indicate to the user a default divelist sorting order
Each time subsurface starts there is supposedly no sorting order
(or divelist column) specified by the UI, yet the actual column is '#'
(or dive number column), since its the *only* column which allows
trips to be visible. If the user selects a different sorting order
then he has no idea which column was the one who had the trips visible.

"Where did all those 'trip' things go?"
This can be a bit confusing...

Lets provide indication by calling gtk_tree_view_column_set_sort_indicator().
Also call gtk_tree_view_column_set_sort_order() to specify a descending
order.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-20 07:24:59 -08:00