Commit graph

6256 commits

Author SHA1 Message Date
Anton Lundin
f8c418c789 Update strings for Suunto safety levels.
By popular demand, this changes the names of the Suunto Safety levels.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12 08:10:48 -08:00
Dirk Hohndel
71b6de0523 Dive list and filter: when selecting a trip, only select visible dives
Otherwise dives that aren't shown to the user would be included in
statistics or (worse) in edit operations.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:40:36 -08:00
Dirk Hohndel
19ca90f1a0 Embed the information whether a dive is hidden by a filter in the dive
This way other parts of the code can act on the "hidden_by_filter" state.

This also cleans up the way we track if a dive is hidden - do it in the
multi filter instead of the individual filters.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:34:12 -08:00
Tomaz Canabrava
d5ffc16c36 Clean Filters
Code to clean the filters. Maybe I'll also need to call this upon
closing the dialog?

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:09:11 -08:00
Tomaz Canabrava
819d358f8c A bit of code cleanup.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:09:03 -08:00
Tomaz Canabrava
1841eb98b9 Make the close button work
clicking on the close button will close the widget.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:08:01 -08:00
Tomaz Canabrava
d277d4d88e Added buttons to control the multi filter
Buttons to close, minimize and clear were added. We need better icons.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:07:32 -08:00
Tomaz Canabrava
aa44b67d6b Better size for the filter
a bit of extra spacing was necessary to get rid of the scrollbar.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:05:39 -08:00
Tomaz Canabrava
fc39d53232 Better layout for the Extra Info panel
The extra info didn't had a Layout set, this makes the
design hard and not resizable. fixed by using a layout.
I also changed a ScrollArea for a GroupBox, since the
Model already has a ScrollArea.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 13:04:02 -08:00
Lubomir I. Ivanov
200699706e maintab.cpp: use copy_string() instead of strdup()
The .location and .notes fields can end up being NULL,
in which case copy_string() is safer.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 11:59:35 -08:00
Dirk Hohndel
d06cc2c68e Show the number of dives with each tag in the filter panel
This is a rather brute force implementation. It might be worth while
caching this information - but I'd like to do some benchmarking, first.

Sadly this code also shows that there are some bugs hidden in the
selection code when filtering is present. When a trip is selected all
dives in the trip get selected, even those that are not visible under the
current filter.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 02:36:09 -08:00
Dirk Hohndel
f9b9535c69 Add tag helper functions to allow us to count dives with a given tag
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 02:20:13 -08:00
Dirk Hohndel
b51710c01e Remove leftover code for directly parsing Cobalt tank sizes
This should have been ripped out as part of commit 4be7604634 ("Use
libdivecomputer tank size when available").

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 01:43:20 -08:00
Dirk Hohndel
5c69f94bca Fix getting tank information from libdivecomputer
Silly type made us always get tank 0. So tanks 1 through n where wrong
(and repeating tank 0 instead).

Reported-by: Jef Driesen <jef@libdivecomputer.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11 01:41:08 -08:00
Miika Turkia
116615857c Support timedepth mode on UDCF import
Fixes #756

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 21:12:05 -08:00
Tim Wootton
01441ccb45 Text consistency changes
ppO2 represented with 2 as subscript.
Special l symbol for litres.
Capitalisation to bring in line with existing style.

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 14:45:11 -08:00
Dirk Hohndel
8a55006a4e Two small fixes regarding translation texts
Spelling fix for ampoea
Remove bogus HTML string from UI file

And fix the translation sources accordingly

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 13:10:50 -08:00
Dirk Hohndel
2e38b1dbb8 Update translation strings and translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 12:29:26 -08:00
Miika Turkia
4753d5c15c Fix memory leak
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 12:17:37 -08:00
Miika Turkia
9cf7a5d968 Use the new extra data interface for Poseidon import
Rather than overflowing the notes field, let's add all the details from
DC using the extra data API.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 12:17:32 -08:00
willem ferguson
77220cd2c5 Replace XML reference log for Poseidon
The Poseidon xml dive log in the /dives folder is faulty. This patch
replace it with a fully working one.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 12:15:57 -08:00
John Van Ostrand
ab7f61e795 Support for Liquivision version 2 log files.
I was able to test against a v2.0 log file and fixed some
problems.
Also removed a file save that was being done for debug purposes.

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 12:15:18 -08:00
John Van Ostrand
3f707256d9 Removed liquivision unneeded variable and potential segfault.
Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 12:14:56 -08:00
John Van Ostrand
f85e406855 Corrected Liquivision name
And added a missing liquivision item in file open dialog.

Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 12:14:38 -08:00
Dirk Hohndel
02567ec790 Be more careful when restoring a selection in the presence of filters
Try really hard to ensure there remains a valid selection. Only if none of
the dives are selectable should we give up.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10 11:17:58 -08:00
Dirk Hohndel
7cb307cf73 Don't crash when restoring the selection
If we end up trying to restore the selection where the selected dive is no
longer visible (i.e., it's now filtered away), this code caused a crash by
falling first() on an empty list. Let's not do that.

Fixes #758
2014-11-09 21:32:38 -08:00
Dirk Hohndel
fd997c1b15 Fix previous commit to compile with older versions of libdivecomputer
That was silly :-(

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-08 23:03:10 -08:00
Dirk Hohndel
4be7604634 Use libdivecomputer tank size when available
If the gasmix of a tank is not the matching gasmix in the list of
gasmixes, issue a warning (as so far we assume those are always in sync).

This patch removes our own parsing of the sizes because Subsurface 4.3
will require libdivecomputer 0.5 so this should be enabled by the time the
next release comes out, so let's just drop the redundant code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-08 22:26:18 -08:00
Anton Lundin
1990dafda0 Remove leftover last_setpoint
Back in 24c491053c ("Don't overwrite zero setpoints") the filling of
last_setpoint logic was removed. This clears out the last bits left
over.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-08 11:23:28 -08:00
Anton Lundin
3519b75e4a Remove unused unquote function
In previous version of subsurfacesysinfo.cpp which came straight form Qt
the unquote function was used to clean strings.

Since f59b30ca5a ("OS Detection: Use QFile when reading
/etc/os-release") its not needed any longer so this removes that
function.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-08 11:21:08 -08:00
Anton Lundin
df42f78486 Add support for libdivecomputer DC_FIELD_DIVEMODE
libdivecomputer recently gained a api for telling us which mode the
divecomputer was running in, so this uses that to tell us if it was a OC
or CCR dive.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-08 11:20:38 -08:00
Anton Lundin
42d3ed0431 Move calculate_string_hash into DC_FIELD_STRING
The calculate_string_hash is only used if DC_FIELD_STRING is defined, so
this removes a warning for everybody who doesn't build against a
libdivecomputer with DC_FIELD_STRING support.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-08 11:20:04 -08:00
Anton Lundin
a7a022d8db Remove unused variables and code from seabear-csv
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-08 11:17:20 -08:00
Anton Lundin
0b0e5d834f Reorder initializers to be more c++-strict
c++ have some idea about in what order things should be initialized.
This makes us comply with that order.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-08 11:17:11 -08:00
Dirk Hohndel
082e59ea72 Add support for libdivecomputer's new TEMPERATURE fields
Parse air temperature and water temperature if available from the dive
computer. Subsurface happily tracks the temperatures in the dive samples,
but for water temperature in the header ("overall" water temperature) we
currently support only one field. So I ordered the code so that if it is
available, the minimum water temperature will be used, absent a minimum
water temperature we use the maximum water temperature.

Side note:
Since the libdivecomputer maintainer disagrees with the Subsurface
developers regarding a sane way to allow a consumer of his library to
detect if a feature is supported in a particular commit of the library,
the way we decide whether to build this code or not is decidedly hacky.
DC_GASMIX_UNKNOWN happens to be a #define we can check that was added
right around the time the temperature support was added. Sadly there is
no #define that we could check to see if temperature fields are supported.
How insane is that...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 22:55:38 -08:00
Dirk Hohndel
dbc7dbb074 Cleanup liquivision.c
strndup doesn't exist on Windows.
Mark / remove unused variables.
Plus codying style cleanup.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 21:20:02 -08:00
Linus Torvalds
0a27978014 Use the new DC_FIELD_STRING callback if it exists
This recognizes recognize some strigns (serial number and firmware
version), and the ones that it doesn't recognize it adds as extra data
using Dirk's new interface.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 20:55:18 -08:00
Robert C. Helling
cff413f14d The po2 argument of addS_segment is the setpoint, not the pO2 at that time
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:19:18 -08:00
Robert C. Helling
24c491053c Don't overwrite zero setpoints
As we agreed, in memory we don't zero repeated setpoints and thus zero
setpoints don't have to be overwritten by the last setpoint value.

This corrects the deco ceiling with CCR dives that bailout to OC.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:19:08 -08:00
John Van Ostrand
3fe310e529 Cleaned up file list in open and import dialogs
Lists were getting a little jumbled. I sorted the extensions and added
suitable human readable names.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:15:54 -08:00
John Van Ostrand
d4121fb42a Liquivision import fixes
Fixed rounding of temperatures
Fixed compile warnings

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:15:44 -08:00
John Van Ostrand
8136306911 Added import for Liquivision LVD log files
Support includes cylinder pressures and works for v3.0 log files.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:15:38 -08:00
Anton Lundin
09e8adf54e Convert volume calculations into floating point
The basic problem was that for gases containing more than 2147483648 ml
of nitrogen the calculations overflowed. This changes the code into
using floating point math for that calculation which will be more
accurate to.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:12:22 -08:00
Anton Lundin
450093df85 Remove leading spaces in buddy tags
The buddy list generated by the buddy tag logic gets separated by
,<space> so this trims away any leading spaces from the buddy name.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:11:36 -08:00
Dirk Hohndel
df0057d262 Extract some useful extra data from Uemis SDA
This is just a proof of concept for this patch series, mainly designed to
show how the extra data would be used.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:01:58 -08:00
Dirk Hohndel
45251ec724 Show extra data in separate tab on MainTab
This way any extra data probided by the dive computer is visible to the
user (without other processing). This data cannot be edited by the user as
it reflects the information given by the dive computer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:00:58 -08:00
Dirk Hohndel
4ccddf95d7 Load and save extra data in git format
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 13:00:14 -08:00
Dirk Hohndel
d6b4109409 Load and save extra data in Subsurface XML format
Includes test dive to test missing attributes and the overall syntax.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 12:59:15 -08:00
Dirk Hohndel
9aefaa1ec8 Add helper function to add extra_data to dive computer
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07 12:59:08 -08:00
Dirk Hohndel
77621ef7df Add list of string pairs to dive structure
This extra_data is designed to hold unstructured data from the dive
computer. Things like battery voltage. Deco algorithm. Whatever the dive
computer wants to report to us.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-06 22:00:25 -08:00