Commit graph

2543 commits

Author SHA1 Message Date
Miika Turkia
2120bc3a9e More events from Suunto DM4 added
I got a few more events from a new sample database. Bookmark heading is
now shown if such information is stored. Also the unknown events display
the event number for easier identification.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-07 10:21:55 -08:00
Lubomir I. Ivanov
30e10183ca windows.c: Use a zeroed buffer when retrieving the module path
There is a small API note on GetModuleFileName(), which says:
"Windows XP: The string is truncated to nSize characters
and is not null-terminated."

Which means that on XP it will be only safe if we pass a zeroed
buffer to it, otherwise the next call to wcsrchr (which is
a strchr for wchar_t) may not find a relative terminating \0 in
the buffer, returning a wrong pointer and resulting in a corrupted
string.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-05 12:27:32 -08:00
Dirk Hohndel
07b2c204c9 Remove ancient (and unwanted) Debian packaging directory
The Debian maintainers prefer this to be separate from the upstream
sources

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-05 12:05:42 -08:00
Lubomir I. Ivanov
4cd222eae7 windows.c: Change the current process path to the module path
When an executable is started on Windows, it has a "Working
directory". This directory for a program shortcut stored on the
Desktop can be different than the actual executable directory.
This also applies if a shell extension is registered to that
executable (in the case of Subsurface that could be a .DLD file).

When another process simply "executes" a file with a certain extension
(e.g. when you double click on a .DLD file), a method ShellExecute
is called, which without explicit parameters sets the "Working
directory" to the .DLD file directory. This can be a bit of a trouble
if the executed module depends on relative paths (e.g. ./xslt, ./share).

To solve that we obtain our module full path and filename using
GetModuleFileName(), strip the filename from it (e.g. subsurface.exe)
and then pass the resulted string to SetCurrentDirectory(), which
updates the "Working directory".

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-05 12:04:26 -08:00
Miika Turkia
08f438a2c9 Suunto DM4 sample dive
Both in .db and exported XMK format.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-05 11:08:08 -08:00
Miika Turkia
6d181e05f8 Add .jlb and .udcf as supported file types
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-05 09:55:47 -08:00
Amit Chaudhuri
f3e7b1ad68 Trivial change to documentation
The user-manual.txt file limits its own scope to usage and points to a
non-existant "build manual." Make clear that we really mean the README file.

Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-05 07:43:41 -08:00
Miika Turkia
a94f7807f8 Limited support for Suunto DM4 import
Basic functionality is implemented but at least support for multiple
cylinders is missing. Event/alarm support is only partial.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-04 22:08:03 -08:00
chrislewis915@gmail.com
a6a487306e Some Small Documentation Changes
- Made a few small changes to user-manual.txt to inprove readability
  in English
- Made reference to Map Provider selection in 'Preferences'

Signed-off-by: chris <chrislewis915@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-04 22:06:57 -08:00
Sergey Starosek
bbaf77ba63 Update Russian translation
Updated for version 3.0.2 (unfortunatelly not in time)

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-04 10:38:46 -08:00
Sylvestre Ledru
134355cb63 Fix the permission of the ICONFILE and the locale files
Lintian, the Debian package static analyzer, was complaining about the
"wrong" permissions on these files.

Signed-off-by: Sylvestre Ledru <sylvestre@debian.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-04 09:11:56 -08:00
Robert C. Helling
c13a10986e Improve pane position saving code
We should test for being in PANE_THREE mode in save_pane_position() and
replace the if()'s testing against window geometry. This eliminates some
code duplication and, more importantly, save_pane_position() is also
called from save_window_geometry() whose calling pattern is not obvious.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-04 00:26:32 -08:00
Dirk Hohndel
a5a3e0a72e Update README, ReleaseNotes and Makefile for 3.0.2
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-03 23:49:32 -08:00
Dirk Hohndel
1a69a845e1 Saving individual dives should not change the exiting filename
The current data file is not the same as the file to which individual
dives were saved.

Reported-by: Jan Schubert <Jan.Schubert@GMX.li>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-03 23:31:24 -08:00
Dirk Hohndel
280405d9b6 Fix scaling problem in scrolled edit dialog
With this change resizing the dive edit dialog once again has its content
resize as well. So now we have the best of both worlds: if the content
grows we add scroll bars (so things stay usable on small screens), yet
when we resize the window, the notes area gets nice and big (which is
great on big screens).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-03 22:30:55 -08:00
Dirk Hohndel
d8811e2e40 Only store pane positions if we currently display "View Three"
We tried to detect this without needing a global variable but that clearly
was too dependent on decorations that the window manager might add. This
code works reliably.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-03 21:07:09 -08:00
Dirk Hohndel
0129192958 Try to capture some more potential buffer overflows caused by localization
A couple of these could clearly cause a crash just like the one fixed by
commit 00865f5a1e1a ("equipment.c: Fix potential buffer overflow in
size_data_funct()").

One would append user input to fixed length buffer without checking.

We were hardcoding the (correct) max path length in macos.c - replaced by
the actual OS constant.

But the vast majority are just extremely generous guesses how long
localized strings could possibly be.

Yes, this commit is likely leaning towards overkill. But we have now been
bitten by buffer overflow crashes twice that were caused by localization,
so I tried to go through all of the code and identify every possible
buffer that could be affected by this.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-03 20:18:23 -08:00
Jan Schubert
93eeb03d67 Extending user manual
Adding UDDF support for DR5, kenozooid and in general, fixed some things, updated to 3.0.2

Signed-off-by: Jan Schubert <Jan.Schubert@GMX.li>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-03 16:01:49 -08:00
Lubomir I. Ivanov
b0df54071e equipment.c: Fix potential buffer overflow in size_data_funct()
strcpy() with buffer[10], could overflow on most languages.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-03 15:33:24 -08:00
Robert C. Helling
9fcb28a6f5 Fix pane position bug
Argh. Maxint is not at the bottom or at the right. We have to check
against the size of the window to determine we are not saving a maximized
position.  Here is a fix.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-03 11:56:51 -08:00
Sergey Starosek
0e7f0cc1ed Fix ESC key handling in Save dialog.
Closing unsaved dive raises Save dialog with Yes/No/Cancel buttons.
Pressing ESC dismisses dialog without saving changes.

This commit adds GTK_RESPONSE_DELETE_EVENT response code check in order
to fix that behavior.

Reported-by: Jan Schubert <Jan.Schubert@GMX.li>
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-03 10:45:11 -08:00
Dirk Hohndel
950436eba9 Don't duplicate gpsfixes if downloading them multiple times
Simply clear out the table (and free the "dives" that were created).

Reported-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-02 14:09:53 -08:00
Dirk Hohndel
0ddc77ed9d Recognize another name for auto created fixes from companion app
We need to have this be one well defined string -> this requires a change
to the companion app as well.

This commit also hides the (untranslated) debug message if no dives in the
dive table match a gpsfix downloaded from the webservice.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-02 14:00:10 -08:00
Dirk Hohndel
d85b4e6462 Webservice: only mark divelist changed if we actually modified it
If no new gps fixes or new location names were obtained from the
webservice there is no need to save the datafile on exit.

Reported-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-02 13:28:15 -08:00
Robert C. Helling
0e3c6f7517 Save window pane positions
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-02 09:10:34 -08:00
Lubomir I. Ivanov
3443abea72 windows.c: Fix broken subsurface_unset_conf()
windows.c has be revisited so many times, yet just now I've noticed
that we aren't deleting/unsetting a configuration value ever.
What has went strangely unnoticed is that subsurface_unset_conf()
needs RegDeleteValue instead of RegDeleteKey. "keys" in the Windows
registry are like folders which contain files (or "values").
So in this case we need to delete a "file" and not a "folder" using
RegDeleteValue().

This ended up  being a problem with the new prefs.c logic, where there
is a check if a config value is the default value and then it will be
unset/deleted.

There was potential for a crash, where a NULL value can reach
pango_font_description_from_string() for the divelist font.
It also wasn't possible to change the divelist font back to the default font
(e.g. Sans 8), once a different font was selected.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-02 08:45:42 -08:00
Miika Turkia
aa02798e2a Dive computer import improvements
Parse dive computer information or divelog generator information and
include it as divecomputerid and divecomputer as appropriate.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-02 08:42:54 -08:00
Cristian Ionescu-Idbohrn
e89c2fd656 Another unused variable warning when building without libosmgpsmap.
gtk-gui.c: In function 'preferences_dialog':
gtk-gui.c:670:30: warning: unused variable 'map_provider' [-Wunused-variable]

Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-02 08:42:48 -08:00
Miika Turkia
0f9142b4e3 Grab a bit more info from UDDF import
otu and po2 are now grabbed. The po2 value comes from setpo2 tag. Also
divecomputerid is constructed from the generator information.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-01 23:49:09 -08:00
Dirk Hohndel
51d2088021 Merge branch 'map-providers' 2013-03-01 23:11:41 -08:00
Dirk Hohndel
d1c394e51f Make the map provider choice a preference
Not all of the providers seem to work for me (Yahoo Satellite doesn't
appear to give me any data), but for now I'll leave most of them in.
We can later decide to offer only some of them.

It might be more fun to be able to pick the provider directly from the map
widget. But for now I kept this in the preferences which seemed to be a
good place for it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-01 23:09:12 -08:00
Robert C. Helling
f7d373bae6 Remember window pane positions
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-01 16:22:29 -08:00
Linus Torvalds
36422d2f9e Fix saving of po2 values
It was very broken, although it just happened to work for the values
dirk had in his own XML file (0 and 0.800 bar).  Because of confusion
with number of digits it would save 1.080 bar as 1.80 bar.

Use our "show_milli()" helper for showing things that are in milli-units
(which is what we tend to use for most of our values: mK, mbar, mm, ml)

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-01 08:02:21 -08:00
Lubomir I. Ivanov
c3b3ab9af7 windows.c: use ANSI for subsurface_unset_conf()
We may not write config variables with UTF-8 characters so the wchar_t
conversation in subsurface_unset_conf() is not needed.

This patch also attempts to improve subsurface_get_conf_bool()
and subsurface_get_conf_int() or better consitentcy with the other OS
files. For both functions return -1 if config key is not found.
Previouosly there was a check for that in  function get_from_registry().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-03-01 08:01:31 -08:00
Lubomir I. Ivanov
b2ba7917ab Request a minimal height for the notes in the dive edit dialog
This sould give the notes text box around 8 lines of text.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 19:57:50 -08:00
Lubomir I. Ivanov
0fc089c669 windows.c: Added support for "int" configuration storage
This patch addes body to the functions subsurface_get_conf_int()
and subsurface_set_conf_int().

It also makes some small changes:
- subsurface_get_conf_bool() now uses subsurface_get_conf_int()
- for retrieving DWORDS we would only need RegQueryValueEx,
thus the wchar_t conversations aren't really needed, unless
we start storing integers in keys with UTF-8 characters in the name.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 19:56:37 -08:00
Lubomir I. Ivanov
c0c88ba69d Added support for a scrollable area in the dive info dialog
This patch puts the contents of the dive edit dialog inside
a scroll container, with a minimal size equal to the default dialog
size when no equipment is added. If more tanks and weights entries
are added, a scrollbar will appear on the right and the dialog
will become scrollable.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 16:21:21 -08:00
Henrik Brautaset Aronsen
b24d0f2f60 Add MacOS support to window geometry save/restore
Also make sure the config is flushed to disk.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 15:39:49 -08:00
Amit Chaudhuri
d742d7b391 Remember window size
This commit has gone through a few iterations and I trimmed it down to
what I consider the "conservative minimum" - so this only stores window
size, not window position. And in my mind that's the more relevant part,
anyway. Have your window manager position the window at a "smart" spot on
your screen...

Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com>
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 15:36:27 -08:00
Kévin Raymond
cfdde3ff63 Move translations to transifex.com
Translation management is done through Transifex now for easy translations.
Translators should note that fuzzy strings are not used any more since
Transifex does not handle it (by choice).

In order to pull translations, you need a transifex.com account.

Signed-off-by: Kévin Raymond <shaiton@fedoraproject.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 15:25:47 -08:00
Dirk Hohndel
381bde5fad Better editing of existing dives
This change makes it possible to edit date and time of a dive from the
normal dive edit dialog (it turns the label at the top of the dialog into
a button and allows the user to change the time from there - this seems
much more obvious than the 'right-click in the divelist' approach).

Additionally, if the dive has only one divecomputer and no samples (which
likely means that the dive was manually entered in Subsurface or imported
from another divelog where it was manually entered) then we allow editing
of duration, max depth and avg depth as well.

This fixes #75  (well, with the exception of water temperature.... we
don't allow editing of that at all... I guess that should become a new
trac item...)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 15:02:35 -08:00
Sergey Starosek
a186944a64 Update Russian translation
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 07:51:12 -08:00
Dirk Hohndel
e5f2f3e65f Better Bluetooth device support on Mac
We now show the correct device name for Bluetooth connected dive computers in
the drop down menu in the Download dialog.

This also updates the corresponding chapter in user manual.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 07:43:31 -08:00
Dirk Hohndel
6855be0f1c OSX: also need to add the CoreServices framework to linker
We had this before - it appears that some versions of OSX need us to explicitly
list the frameworks we are using during the linking stage while others are
perfectly happy without that. But since listing them doesn't appear to hurt
this commit should be safe.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 05:56:23 -08:00
Amit Chaudhuri
92fbbd4c22 Fix compilation problem with LaunchServices on OSX
You cannot include the LSOpen.h directly on OSX - it is too far down in
the System hierarchy to locate. Instead we include the umbrella header
CoreServices.h which finds it for us.

Signed off by Amit Chaudhuri <amit.k.chaudhuri@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 05:52:29 -08:00
Dirk Hohndel
11a3f3f7f7 Change layout of dive editing dialog
We had a report that on small screen systems like netbooks with a vertical
screen resolution of only 600 pixels Subsurface has usability issues, as
the dive editing dialog is taller than the screen.

While on some OSs the dialog can at least be moved around so the user can
fill it out and click OK or Cancel, on others (Windows XP) that does not
appear to be the case.

This small change simply takes the equipment part of this dialog and
positions it next to the dive info part instead of below it. This appears
to solve the immediate issue - but by adding the maximum number of tanks
and weight systems the dialog can still grow beyond 600 pixels vertically,
so we may have to add a scroll widget in here as well.

But for now this should be a nice improvement (and I find it reasonably
pleasing on a large display as well).

Fixes #67

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 05:48:03 -08:00
Eduardo Ramalho
834dc9f5cb Add Portuguese translation
Most of the translated phrases have more characters than in english. But I
verified the Subsurface user interface, and there are no strange side effects.

I had just a doubt about "trip" translation. I used portuguese word
equivalent to "expedition". Some of the diving related words we don't
translate. Even "buddy" is the word used on local diving boats!

Signed-off-by: Eduardo Ramalho <eduardo.ramalho@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 05:38:41 -08:00
Dirk Hohndel
a12320f145 Revert "Add Portuguese translation"
This reverts commit af9ba96da4.

I had applied this to directory with work-in-progress code that was now
mixed up with Eduardo's translation work. I'll re-apply just his
translation instead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 05:36:01 -08:00
Robert C. Helling
026c351b36 Svedish translation glitch
This patch fixes a Unicode mishap in the Svedish localization that breaks
the build process.

Signed-off-by: Robert Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 05:30:39 -08:00
Jan Schubert
4dc14c9051 Documentation: Add Mac related info to the bluetooth section
Signed-off-by: Jan Schubert <Jan.Schubert@GMX.li>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-02-28 05:25:50 -08:00