aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2014-11-13windows.c: small cleaup in the wrapper functionsGravatar Lubomir I. Ivanov
- use an already defined 'ret' value if available - don't put free() calls in NULL check branches (saves a line) Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-13Add subsurface_access()Gravatar Lubomir I. Ivanov
For our usage the method will acept UTF-8 paths, which are converted to UTF-16 on Win32. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12Show the number of dives with given person / location in the filter panelGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12Update translations stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12Support different salinity in plannerGravatar Anton Lundin
Depth is often mentioned in a length unit, but what we care about is pressure. When diving in fresh water the pressure is lower than the same depth in salt water. This adds support for using different salinities in planning. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12profile.c: fix a bug in calculate_gas_information_new()Gravatar Lubomir I. Ivanov
In a test case loading dives/test35.xml results in a infinite(-like) loop (Note: possibly requires the partial pressure plots enabled). calculate_gas_information_new() has an 'if' branch to update the cylinderindex to a dive's diluent_cylinder_index, but it does not consider that said index can be set previously to -1. This results in a random neighbour memory assigned as &dive->cylinder[-1].gasmix and passed to fill_pressures(..). Following the calculations in the function the He gas, can receive a bad value (e.g. for the test case in the E+6 ranges). Said value is then used in DivePlotDataModel()::pheMax() (defined by MAX_PPGAS_FUNC()) resulting in one of the loops (the 3rd one) in DiveCartesianAxis::updateTicks() to loop indefinitely. Fixes #759 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12Shows an error about wrong permissionsGravatar Salvo 'LtWorf' Tomaselli
If an import fails, the permissions of the device are tested and an error message that mentions permissions is shown to the user. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12Merge branch 'fixFilterSelection'Gravatar Dirk Hohndel
2014-11-12Deselect dives that are no longer shown as the dive list is filteredGravatar Dirk Hohndel
This cleans up the way we ensure that all dives are handled as the dive list is filtered. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12Another update to strings and translationsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12Fix typoGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12Latest strings and translationsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-12Update strings for Suunto safety levels.Gravatar Anton Lundin
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-11Dive list and filter: when selecting a trip, only select visible divesGravatar Dirk Hohndel
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-11Embed the information whether a dive is hidden by a filter in the diveGravatar Dirk Hohndel
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-11Clean FiltersGravatar Tomaz Canabrava
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-11A bit of code cleanup.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11Make the close button workGravatar Tomaz Canabrava
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-11Added buttons to control the multi filterGravatar Tomaz Canabrava
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-11Better size for the filterGravatar Tomaz Canabrava
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-11Better layout for the Extra Info panelGravatar Tomaz Canabrava
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-11maintab.cpp: use copy_string() instead of strdup()Gravatar Lubomir I. Ivanov
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-11Show the number of dives with each tag in the filter panelGravatar Dirk Hohndel
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-11Add tag helper functions to allow us to count dives with a given tagGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11Remove leftover code for directly parsing Cobalt tank sizesGravatar Dirk Hohndel
This should have been ripped out as part of commit 4be760463422 ("Use libdivecomputer tank size when available"). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-11Fix getting tank information from libdivecomputerGravatar Dirk Hohndel
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-10Support timedepth mode on UDCF importGravatar Miika Turkia
Fixes #756 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10Text consistency changesGravatar Tim Wootton
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-10Two small fixes regarding translation textsGravatar Dirk Hohndel
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-10Update translation strings and translationsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10Fix memory leakGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10Use the new extra data interface for Poseidon importGravatar Miika Turkia
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-10Replace XML reference log for PoseidonGravatar willem ferguson
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-10Support for Liquivision version 2 log files.Gravatar John Van Ostrand
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-10Removed liquivision unneeded variable and potential segfault.Gravatar John Van Ostrand
Signed-off-by: John Van Ostrand <john@vanostrand.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10Corrected Liquivision nameGravatar John Van Ostrand
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-10Be more careful when restoring a selection in the presence of filtersGravatar Dirk Hohndel
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-09Don't crash when restoring the selectionGravatar Dirk Hohndel
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-08Fix previous commit to compile with older versions of libdivecomputerGravatar Dirk Hohndel
That was silly :-( Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-08Use libdivecomputer tank size when availableGravatar Dirk Hohndel
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-08Remove leftover last_setpointGravatar Anton Lundin
Back in 24c491053cd9 ("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-08Remove unused unquote functionGravatar Anton Lundin
In previous version of subsurfacesysinfo.cpp which came straight form Qt the unquote function was used to clean strings. Since f59b30ca5ad7 ("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-08Add support for libdivecomputer DC_FIELD_DIVEMODEGravatar Anton Lundin
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-08Move calculate_string_hash into DC_FIELD_STRINGGravatar Anton Lundin
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-08Remove unused variables and code from seabear-csvGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-08Reorder initializers to be more c++-strictGravatar Anton Lundin
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-07Add support for libdivecomputer's new TEMPERATURE fieldsGravatar Dirk Hohndel
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-07Cleanup liquivision.cGravatar Dirk Hohndel
strndup doesn't exist on Windows. Mark / remove unused variables. Plus codying style cleanup. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07Use the new DC_FIELD_STRING callback if it existsGravatar Linus Torvalds
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-07The po2 argument of addS_segment is the setpoint, not the pO2 at that timeGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>