Commit graph

9825 commits

Author SHA1 Message Date
Dirk Hohndel
c41810e5a5 When editing a manually added dive, correctly update max depth
The fixup_dive() function assumes that values that are set already in the
divecomputer and dive structures come from a reliable source - sometimes
dive computers are able to track a maximum depth continuously, so that
value can be larger than the deepest sample and we need to honor that.

But in the case of a manually added dive, the samples define the dive. So
in this case we need to reset the values that were calculated when the
dive was first added so that the user can then edit the dive and reduce
the maximum depth reached in the profile and have that reflected in the
dive list.

Fixes #926

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-11 10:54:05 -07:00
glerch
30f81949a0 Uemis downloader: code optimization
Cleaned up the code in do_uemis_import, this way it should
run a little faster as I am doing the check if the returned
divespot is valid at an earlier point

Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-11 10:29:49 -07:00
glerch
4e64b327f3 Uemis downloader: cleaning up debug bits
At some point I would like to understand the logic behind
the debug bits, so I am not messing around with them.

Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-11 09:21:59 -07:00
Robert C. Helling
654a7be834 Add checkbox to force images to match dives
Give the user the possibility to attach images to a dive even
when the times do not match

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-11 09:18:55 -07:00
Robert C. Helling
5a1c041b78 Don't offer gas selection for the last waypoint in planner
Since the gas selection list on a waypoint refers to a gaschange there
influencing the following segments, there must not be a gas selection
on the last manually entered waypoint since from there the planner
handles the gas selection.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-11 09:15:14 -07:00
Anton Lundin
f93c60fc1e Configure divecomputers: remove unused member
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 15:37:21 -07:00
Anton Lundin
c0c4b5c4b3 Configure divecomputers: add delegates for setpoint configuration
This adds delegates to simplify configuration of setpoint values in the
OSTC's.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 15:37:13 -07:00
Anton Lundin
444d0d6693 Configure divecomputers: access table data the same way as its set
The table data is set via role, so retrieve the data via role too.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 15:37:05 -07:00
Anton Lundin
e70b33a56b Configure divecomputers: fix spelling of First
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 15:36:54 -07:00
Anton Lundin
906cc8804d Be compatible with libgit2 0.22 again
The callback function was introduced in 0.23, so put it behind that
ifdef.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 15:30:12 -07:00
Dirk Hohndel
948c77bfad Get ready for OS X 10.11 El Capitan
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 13:18:43 -07:00
glerch
682e23775c Uemis downloader: bug fix in uemis set dive location
Assuring that ds isn't NULL, had a few cases
that made SubSurface crash. Have not investigated
the root cause but it's likely that it is related to
the Uemis specific code. Nevertheless, checking ds
non NULL is certainly not a bad thing to do.

Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 12:44:12 -07:00
glerch
dc02a7aa6d Uemis downloader: remove memory leaks
Found more memory leaks

Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 12:33:49 -07:00
glerch
6504d97ca8 Uemis downloader: assure empty divespots are not added
If the load_uemis_divespot returns false we must assure
we delete the divespot that was created during process_raw_buffer

Also added some comments

Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 12:33:22 -07:00
glerch
1aa941e754 Uemis downloader: remove code not needed anymore
Cleaning up track_uemis_divespot because this function is not needed
anymore.

As I am loading the divespots now within do_uemis_import, I also adjusted
the memory calculation - this is not completed yet.

Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 12:32:23 -07:00
glerch
8e82e14b1e Uemis downloader: new logic for divespots
Changed the do_uemis_import to load divespots right after matching
the dive details.

Logic implemented to verify that we are not duplicating divespots by
comparing the uuid from get_dive_site_by_uuid(dive->dive_site_uuid)
with the one from get_dive_site_uuid_by_name

Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 12:31:35 -07:00
glerch
e7fa81f9ea Uemis downloader: deleting code because of design change
Deleting unnecessary code to support future design
change coming with the next patch

Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 12:30:29 -07:00
glerch
b4f9d2786d Uemis downloader: new routine to load divespots
Added load_uemis_divespot.
This will be used later in do_uemis_import to improve
the amount of divespots that must be loaded actually.

Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 12:30:24 -07:00
glerch
c0cbafdc93 Uemis downloader: new find divespot by diveid
New routine to support finding a dive spot based on the dive id,
this is needed due to the weird way Uemis is providing data.
This function will be used in the uemis-downloader.c within
do_uemis_import.

Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 12:28:02 -07:00
glerch
bd00c6b83b Uemis downloader: fix bug when creating dive site
Use dive->when when creating a dive site instead of time(NULL) as Dirk
suggested

Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 12:26:51 -07:00
Dirk Hohndel
0dd32d3495 Document simplified web access to cloud storage data
The backend now redirects you to the correct URL once you log in with your
email address and password. So all the user needs to know is to go to
https://cloud.subsurface-divelog.org

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 09:52:21 -07:00
Dirk Hohndel
ae1c4ef21e Cloud storage: add another progress callback
This one sadly only appears to be called with 0% and 100% in my examples.
Not sure what to do about that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 09:41:12 -07:00
Anton Lundin
865c4aedee Save settings in closeEvent, not destructor
This switches to use the closeEvent to save settings and cleanup instead
of the destructor.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-10 09:40:04 -07:00
Miika Turkia
404cfec7dc Fix another memory leak on uemis downloader
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 21:35:20 -07:00
Miika Turkia
dbbf23ed51 Fix memory leak on uemis downloader
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 21:35:18 -07:00
Miika Turkia
33c9cc60ef Initialize variable before use
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 21:34:01 -07:00
Miika Turkia
51ce83ed20 Fix memory leaks in serial ftdi
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 21:33:49 -07:00
Miika Turkia
54eefe2f7f Fix memory leak on serial bluetooth
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 21:33:37 -07:00
Miika Turkia
1533191176 Datatrak parsing
I have some trouble understanding this code, but as there is a clear
bug involved (null dereference), I ask others to verify if I am onto
something. And if datatrak import still works with this patch.

From af2935622b1f00f373ed38c8e3194e25504372b6 Mon Sep 17 00:00:00 2001
From: Miika Turkia <miika.turkia@gmail.com>
Date: Wed, 9 Sep 2015 18:03:45 +0300
Subject: [PATCH] Fix null dereference and parsing logic

Null dereference in the first change is obviously a bug.

The parsing logic I only assume to be wrong and suggest that we discard
dives that are deemed to be bogus.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 17:29:13 -07:00
Dirk Hohndel
7a4b046c76 Whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 17:26:54 -07:00
Salvador Cuñat
a74c06c723 OSTCTools - remove useless pointer ldc_dat
This device_data_t pointer was a remnant from initial work. It is
useless and can be safely removed.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 17:23:39 -07:00
Dirk Hohndel
40af11d2d2 ReleaseNotes: update changes towards Beta 2
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 15:49:22 -07:00
Guillaume GARDET
fea2b52179 Documentation: update french translation of user-manual
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 14:07:09 -07:00
Claudiu Olteanu
813f6f502f Exit with failure if the first dc_open method fails
If the dc_serial_*_open method fails then we should exit with
an error and don't try to open the device using the native
implementation.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 13:05:38 -07:00
Sander Kleijwegt
30a410036b Do not ignore the first tag on autocompletion.
Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 13:05:14 -07:00
Dirk Hohndel
2025bc1b2b Replace the spinner with a progress dialog for cloud storage access
Since the spinner caused all kinds of problems inside VMs, wasn't shown at
all for some people on Win10 and appeared to get stuck a lot and still
left people with the perception that Subsurface was hung, this patch takes
a more traditional approach and gives the user a progress dialog.

An additional benefit of this is that the user now can cancel a hung
transfer.

The slightly weird passing in of the callback allows for the separation of
UI and core logic code...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 13:02:39 -07:00
Lubomir I. Ivanov
2c74a8c315 qthelper.cpp: don't hardcode the Dive m_duration as minutes
get_dive_duration_string() should be used in a similiar way
to socialnetworks.cpp so that the Dive::put_duration()
method sets the variable in the h:min format.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 09:16:15 -07:00
Lubomir I. Ivanov
6ff1837b05 qthelper.cpp: use timeFormat and dateFormat for the Dive class
The Dive class has a method which sets the m_time and m_date
members but it uses a custom format. By using the static
dateFormat and timeFormat variables this helper class now uses
the same date and time format as in the dive list.

Fixes #920

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 09:15:55 -07:00
Miika Turkia
43627922e0 Delay freeing of memory after use
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 09:14:16 -07:00
Miika Turkia
ce608b7ecf Fix a crash on divelogs.de export
Subsurface crashes when multiple dives are selected on divelogs.de
export. The crash occurs on malloc that is called indirectly from
xmlReadMemory().

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 03:05:54 -07:00
Dirk Hohndel
af541f7f6a Translation updates
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 03:04:22 -07:00
Dirk Hohndel
708fd2fe84 Two small string changes
Reported by Ettore Atalan on Trnasifex.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09 02:53:30 -07:00
Anton Lundin
7bbd60a4fd Only use DC_TRANSPORT_* with SSRF_CUSTOM_SERIAL
This if'defs DC_TRANSPORT_* use with SSRF_CUSTOM_SERIAL, because the
enum doesn't exist when building against stock libdivecomputer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-08 13:27:53 -07:00
Anton Lundin
647645d6e4 Better import of libdivecomputer universal xml
This teaches subsurface how to understand more fields in the xml that
libdivecomputers's universal tool generates.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-08 12:30:17 -07:00
Dirk Hohndel
cb1aac0c4d Update the script to build Mac Bundle
This is trying to clean things up quite a bit and make it less specific to
my directory layout.

It still calls the signing script that tries to sign things with my keys,
so it won't work for others without tuning, but this should get you
closer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-08 11:42:14 -07:00
Claudiu Olteanu
a0e33bec71 Disable Bluetooth option from GUI if SSRF_CUSTOM_SERIAL is undefined
The Bluetooth implementation doesn't work if SSRF_CUSTOM_SERIAL
is undefined. Therefore it is a good idea to remove it from
the UI if the libdivecomputer version is wrong.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-08 10:15:35 -07:00
Lubomir I. Ivanov
bb4e34003c Uemis downloader: don't use unknown type u_int32_t
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-08 10:10:23 -07:00
Willem Ferguson
e4c0f3f3e2 User manual update: Location management
1) Add text to cover location management
2) Delete duplicate text for entering dives manually
   and entering dives from a dive computer. The sections dealing
   with location, cylinders, weights, and other items on the Info tab
   were duplicated for these two types of data entry into Subsurface.
   This duplication is now removed.
3) Replace five screen shots

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-08 10:06:10 -07:00
Guillaume GARDET
33831162f1 Documentation: update french translation of user-manual
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-08 09:55:56 -07:00
Dirk Hohndel
a29f897125 Only store dive site uuid in dive if the dive site exists
Don't store stale uuids.
As a side effect this makes it easy to remove dive sites from the XML file
(or the git repository) when duplicates have been added for some reason
and the user wants to restart from scratch.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-08 09:45:09 -07:00