Commit graph

2113 commits

Author SHA1 Message Date
Dirk Hohndel
4dfaccccb3 Report error string for libsoup connection to divelogs.de
Just reporting a default string that something went wrong is kind of
pointless...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-11 21:53:29 -07:00
Dirk Hohndel
a55fa0ea9c Update po files without translation changes
This is just tracking the changes caused by the updated .pot file - the
translations are unchanged. Adding this to git will make it easier to spot
differences closer to the 3.1 release.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-11 06:48:19 -07:00
Dirk Hohndel
bbca2c0b96 Update translation changes
Danish, German, Spanish, Finnish, French, Norwegian, Polish, Slovak, and
Swedish.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-11 06:47:37 -07:00
Miika Turkia
1e8a5d6614 Show translated labels for upload and export menu items
The strings were marked for translation on assignment to the variable, but
then the variables were used untranslated.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-11 06:28:57 -07:00
Miika Turkia
89294039a4 Attempt to fix a crash on DM4 import on Windows
This should fix a crash on Windows when importing Suunto DM4 dive logs.
(Timezones are not handled properly.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-09 12:09:00 -07:00
Henrik Brautaset Aronsen
e6130f4c24 Make sure .xsl files are installed
xslt/commonTemplates.xsl was missing from the install targets

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-09 10:21:36 -07:00
Cristian Ionescu-Idbohrn
de101410cf A lame start for a `make release' helper.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-09 08:19:58 -07:00
Robert C. Helling
a5b8687003 Documentation: USB permissions and planner times
Fix permissions on Ubuntu and relative instead of absolute default times
in planner

This contains two changes: One documents the fact that in the planner the
default for time is relative and an absolute time needs an @ sign.

The other hopefully explains how to solve permission problems for USB
devices on Ubuntu: I am told, an USB dongle that pretends to be a serial
port by default does not have the required permissions for the standard
user to write. The transfer then fails with an 'obscure' error message.
The transfer works if subsurface is run by root (which obviously is a bad
idea) or with chmod.  Unfortunately, at least Ubuntu 'fixes' permissions
on reboot. So one either has to fiddle with this (seems to be more
complicated) or add the user to the group 'dialout" which gets write
permissions to serial lines.

This is in theory. I don't have access to an Ubuntu installation to see if
all this is indeed the case. That's why I did not send the patch in the
past. But I think this is still better than what we have so far.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08 12:24:18 -07:00
Dirk Hohndel
6bf55b59d8 Add readme to transifex config
Still not sure if / how to use this, but at least now it's configured.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08 12:21:13 -07:00
Dirk Hohndel
1f8ac19718 Update translations from Transifex
Slovak, Polish and Russian are now complete.
Danish made nice progress and is slowly getting there.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-08 08:08:29 -07:00
Anton Lundin
935af9e8af planning: Add option to have last stop at 6m/20ft
When diving in areas where there are risk of boats passing above you,
its common practise to do the last stop at 6m to better stay out of
harms way. When doing o2-deco, it doesn't matter for the deco time if
you are doing all the time at 6m, due to that you don't have any inert
gas in your breathing gas.

This code is a reintroduction of 0b8462bd lost somehow between
a70a8898..8fae0031

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-03 11:43:50 -07:00
Dirk Hohndel
587856d786 Updates to Croatian, Danish, Spanish, French and Finnish translation
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02 08:43:55 -07:00
Dirk Hohndel
f23297d5a1 Separate pushing a new pot file to Transifex from pulling translations
This avoids all the unnecessary updates to the POT date.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02 08:39:47 -07:00
Miika Turkia
6f750da063 Updating user documentation to reflect current version
Most of the new stuff from UI perspective should now be documented.
Bumped also the doc version number optimistically.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02 08:32:05 -07:00
Miika Turkia
e9ff76429e Do not display error message on cancel
Do not display error message when user cancels upload to divelogs.de.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02 08:31:03 -07:00
Dirk Hohndel
3b1c49e439 Updates to Swedish and Norwegian translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-30 15:49:38 -07:00
Ivan Habunek
8268180df2 Updated Croatian translation
Signed-off-by: Ivan Habunek <ivan.habunek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-30 15:46:24 -07:00
Dirk Hohndel
2af4014c1e Big translation update
This enables all languages for the moment - let's see if we can get them
all ready for the 3.1 release.

It also fixes the use of \% instead of %% in one of the strings.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-30 11:01:13 -07:00
Miika Turkia
172982b860 Display divelogs.de upload status to the user
This shows a dialog indicating the success or failure of divelogs.de
upload. Currently the raw XML returned from the SOAP request is
also displayed.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-27 21:00:11 -07:00
Miika Turkia
5c4a7c7498 Use SSL on divelogs.de upload
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-27 21:00:10 -07:00
Miika Turkia
cc1d661881 A hook for DM4 XML import
This will take the DM4 XSLT into use.

In the future it is quite likely that we will have to start using
something more specific on top of the root element name to identify dive
log formats. But as "Dive" is currently a unique root element name for
us, this suffices for now.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-22 09:07:04 -07:00
Miika Turkia
cfa36448a1 XSLT for importing individual DM4 dives
This XSLT can be used when exporting single dives from DM4 and importing
them to Subsurface.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-22 09:07:00 -07:00
Miika Turkia
a727f55c67 Retain event sort order on restart
The events that had same time stamp were reversed in order on every new
load of the log file. This patch will keep the order static. (Changing
order is annoying when using version control to store the logs.)

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-22 09:06:17 -07:00
Dirk Hohndel
d5af4e2ff9 Simplistic filtering by tags
This only allows for a logical "AND" - so only dives that all of the
selected tags are displayed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-21 17:53:24 -07:00
Dirk Hohndel
2aabcf398a Add Gtk dialog to select the dives tags for which dives are shown
This literally just creates the dialog and does not hook things up with
the dive list.

The idea is to abstract out the idea behind the invalid dives to allow the
user to select / deselect all kinds of dives and then do statistics on
the selected ones.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-21 17:12:35 -07:00
Dirk Hohndel
e4a31e1e41 Move creation of dive and dive trip date string into helper functions
This allows this code to easily be shared by Gtk and Qt UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-21 16:27:42 -07:00
Dirk Hohndel
d25de98b7c Separate Gtk related code from core logic: statistics
Fairly straight forward, so far just one tiny bit of code restructuring,
everything else separated cleanly.

Added statistics-gtk.c and statistics.h

This should make no difference to functionality.

Cherry-picked from Qt branch; fixed merge issues mostly caused by
dive_tags and Makefile changes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-15 21:52:41 -07:00
Dirk Hohndel
4c775289a7 Separate Gtk related code from core logic: info
Surprisingly straight forward, just a couple of places where we really mix
significant logic with UI code (for example setting the window title).

I had to move amount_selected from display-gtk.h to display.h - I guess
the number of dives that are selected is UI independent. But I wonder if
we still will track this as a global variable in a Qt UI (since the Gtk
selection logic is the main reason this existed in the first place).

Added a new info.h files for the necessary declarations.

This should make no difference to functionality.

Cherry-picked from Qt branch; fixed merge issues mostly caused by
dive_tags and Makefile changes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-15 21:49:14 -07:00
Dirk Hohndel
bfe21343ca Remove second dive_trip_list definition and douplicate helper function
dive_trip_list is simply a global variable, declared in dive.h.

The clear_trip_indexes() helper is purely logic and was moved to
divetrip.c - but then not deleted in divetrip-gtk.c

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-15 07:16:36 -07:00
Dirk Hohndel
0a9ad49f0a Fix selection handling for invalid dives
This is the downside of having to track our own selection state. We now
have a class of dives that potentially isn't known to Gtk as we aren't
adding them to the TreeView. So we need to make sure that their selection
state is consistent by deselecting them (either when they are marked as
invalid OR when we change preferences to no longer show invalid dives).

And because Gtk sends out another set of selection events when clearing
the TreeView (not sure why), we also need to make sure that their
selection state isn't reset to selected by mistake when the divelist is
recreated.

A bit of a pain, but it seems to work now and be consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-10 10:04:50 -07:00
Dirk Hohndel
a9055049f1 Add four more tags
Student (training), Instructor (teaching), Photo and Video

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-10 08:49:11 -07:00
Dirk Hohndel
5778d090a4 Only show tags checkboxes if all edited dives have same tags
This is trivially true if there is only one dive.

With this change the logic which tags apply after editing is much easier
to understand.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-10 08:44:25 -07:00
Dirk Hohndel
0a64844abd Turn tag checkboxes code into a simple loop
This makes the code much cleaner and also reuses the strings in the
dtag_names array. This means the tag names are all lower case everywhere,
but that seems like an acceptable trade-off.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Suggested-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-10 08:21:30 -07:00
Henrik Brautaset Aronsen
593a0a7a60 Add missing divelogs check for LIBZIP and XSLT
I forgot that in commit 5f03a6f.  Oops.

Reported-by: Ďoďo <dodo.sk@gmail.com>
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-10 07:37:40 -07:00
Anton Lundin
186c27f17c Add a simple table-based cns calculations
For dives where divecomputers haven't provided us with a cns, we
calculate our cns accumulated during that dive based on a simple table.

We also check if we did a dive in the prior 12 ours and grab the cns
from it and calculate how much of that still affects us.

[Dirk Hohndel: a couple of small changes: remove unnecessary check of cns
               values in the samples of the first dive computer, changed
	       the way we determine the 'previous dive' and used the end
	       time of that previous dive for the decay calculation]

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09 20:42:52 -07:00
Dirk Hohndel
3611b0ae2d Automatically show Freshwater tag (but don't set it)
If the salinity is 10000 we show (but do not set) the Freshwater tag.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09 19:46:05 -07:00
Henrik Brautaset Aronsen
51c4a5335b Add tags for night and freshwater
Also trim the redundant "Dive" text from "Lake Dive", "Pool Dive", ....

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09 16:13:28 -07:00
Dirk Hohndel
83a313f1ee Correctly conditionalize compilation for menu structure
Only call upload_all_dives_divelogs_cb() if we have both libzip and xslt.

Reported-by: Jozef Ivanecký (dodo.sk@gmail.com)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09 16:01:17 -07:00
Pierre-Yves Chibon
7cacbdf762 Add lake and river to the list of supported tags
[Dirk Hohndel: minor cleanups]

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09 13:56:33 -07:00
Henrik Brautaset Aronsen
5f03a6f631 Add menu entry for divelogs.de upload
The menu entry for upload to divelogs.de was missing. Also renamed
the divelogs context menu entry to something less generic.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09 13:27:36 -07:00
Dirk Hohndel
9e4f9fad19 Store the tag names instead of an opaque number
And as we need the names for that, simplify the way we show the tags in the
Dive Info tab (and mark them for translation while we are at it).

In the process I renamed the constants to DTAG_ from DTYPE_ (and made
their nature as being just bits more obvious).

Also mark the box on the Info tab "Dive Tags", not "Dive Type".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09 13:06:30 -07:00
Ďoďo
ed3f67bc33 Add dive tags and support invalid dives
This started out as a way to keep dives in the dive list but being able to
mark them as 'invalid' so they wouldn't be visible (with an option to
disable that feature).

Now it supports an (at this point, fixed) set of tags that can be assigned
to a dive with 'invalid' being just one of them (but one that is special
as it gets some additional support for hiding such dive and marking dives
as (in)valid from the divelist).

[Dirk Hohndel: merged with the latest code and minor changes for coding
	       style and consistency. Ensure divelist is marked as
	       modified when changing 'invalid' tag]

Signed-Off-By: Jozef Ivanecký (dodo.sk@gmail.com)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09 10:31:36 -07:00
Miika Turkia
68545465ba Switch to UTF-8 on .DLD export
Let's use the shiny new UTF-8 encoding on divelogs.de export.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-09 06:25:36 -07:00
Dirk Hohndel
8fae0031bc Forgot to add planner-gtk.c
Oops

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-08 09:38:03 +02:00
Dirk Hohndel
f86b13102c Separate Gtk related code from core logic: planner
Relatively straight forward, just a handful of places where we call
show_error() (a UI function) from the logic code. In the process I noticed
a few places where error returns weren't dealt with correctly.

Added a new planner.h files for the necessary declarations.

This should make no difference to functionality.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-08 09:37:38 +02:00
Dirk Hohndel
a70a889872 Fix some of the gcc-4.8 warnings
Most of the warnings are IMHO false positives:
e.g.: an enum variable is initialized in a switch statement that has a case for
      each possible enum value - yet gcc 4.8 warns that it could be used
      uninitialized;
or:   two variables are initialized together in the code - second one of them
      is previously initialized to -1 at declaration time, both are initialized
      in an if (second one == -1) clause - so they are guaranteed to both be
      initialized...
I did not "fix" those as the code is actually correct.

But there are three spots where it catches things that could indeed go wrong
(with odd input data in one of them).

This commit also adds a check to only call g_type_init() for older versions of
glib as in newer ones it is deprecated.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-07 20:31:49 -07:00
Dirk Hohndel
387dbe510f Merge branch 'cleanup-from-Qt-branch' of github.com:henrik242/subsurface 2013-04-07 09:08:49 -07:00
Dirk Hohndel
07c08eafac Continue to separate Gtk related code from core logic: divelist
Move some more logic out of the divelist-gtk.c file.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-07 17:37:09 +02:00
Dirk Hohndel
983a77780c Separate Gtk related code from core logic: divelist
This is simplistic & brute force: any function that touches Gtk related
data structures is moved to divelist-gtk.c, everything else stays in
divelist.c.

Header files have been adjusted so that this still compiles and appears to
work. More thought is needed to truly abstract this out, but this seems to
be a good point to commit this change.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-04-07 17:37:09 +02:00
Alberto Mardegan
68119c5b54 Move set_filename() calls outside of parse_file()
Remove the boolean parameter from parse_file; the code is more readable
by having an explicit call to set_filename() where necessary, rather
than a boolean parameter.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
2013-04-07 17:37:09 +02:00