aboutsummaryrefslogtreecommitdiffstats
path: root/core
AgeCommit message (Collapse)Author
2016-11-01Use default prefs for the prefs that where missingGravatar Tomaz Canabrava
This patch fixes all the cases that I didn't checked for the default prefs. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01use GET_* macros for getting settingsGravatar Tomaz Canabrava
Those macros are nice because they take into consideration the default preferences. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01Load use_system_languageGravatar Tomaz Canabrava
Forgot to load use_system_language, wich borked the preferences. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01Remember to load the languageGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01Fix bug where the Font setting was ignoredGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01Preferences tests: fix Update Manager date loadingGravatar Tomaz Canabrava
Date loading was incorrect, this unittest + fix deals with that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-01Preferences tests: location updates & bug fixGravatar Tomaz Canabrava
Fixed loading the location preferences. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-28Correctly load the language based prefsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-28Load system LanguageGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-28Fix default file behavior testsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-28Remember to look for the GroupGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-27ToolTipItem: show gf line based on correct gradient factor preferencesGravatar Rick Walsh
Calculate gfline using the gradient factor that is set by the planner preferences when in the planner, and by the general prefs when not in the planner. This is achieved by doing the gradient factor calculation in dive.c, where buehlmann_config is defined. Previously, the gfline was calculated using the general preferences gfhigh and gflow, even when in the planner. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-18Added language testcaseGravatar Tomaz Canabrava
Also, added a missing method / property Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-18Tests for Units PreferencesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-15Make all current written tests passGravatar Tomaz Canabrava
Fixes a couple of issues with the tests. Also, a type in prefs.h is "short" while it's actually a boolean, this made me write the wrong testcase for this. Fixed this by setting the Qt wrapper to bool, but I didn't changed the c implementation because I tought I could break something. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-15Update a few tests, implement PlannerGravatar Tomaz Canabrava
Also, fixed a typo that caused a bug. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-15Test planner settingsGravatar Tomaz Canabrava
Plus: fix a typo. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-15Test geologationGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-11Add preference to change deco modelGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-11No gas change event on merging dives with same gasGravatar Miika Turkia
When merging dives, this will skip the gas change event if both dives use same gas. Fixes #1099 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-10-03Compute weighted Buehlmann coefficients for all deco modelsGravatar Robert C. Helling
... as those are needed for the heatmap and not only for Buehlmann ceilings. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-25Clean up group handling in SettingsObjectWrapperGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-25Make sure we remember the dive computer vendor and modelGravatar Dirk Hohndel
Preferences work best if you not only write them, but read them again as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24Separate VPM-B conservatism preference for planner and profileGravatar Rick Walsh
Separate the VPM-B conservatism preference into diveplan.vpmb_conservatism for planning dives and prefs.vpmb_conservatism for profile ceiling display of saved dives. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-24Rename conservatism_level to vpmb_conservatismGravatar Rick Walsh
Make the variable purpose less ambiguous Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-22Correctly pick up the UI language from settingsGravatar Dirk Hohndel
While Linux can set the locale from the language text, Windows needs the correct locale value (which makes more sense to use, anyway - that's why we save it). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-22Revert "Add a simple cp2130 libusb driver"Gravatar Dirk Hohndel
This reverts commit 93ef223a3131db838abc7c390ddce3fae8be5f7c.
2016-09-20Language preference: once we figure out the locale, remember itGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-20Don't look up the setting againGravatar Dirk Hohndel
This caused us to do the wrong thing if the setting wasn't set at all. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-20Preferences: remember both the locale name and the user friendly textGravatar Dirk Hohndel
Currently we are confused which it is we are looking at and so setting the language is broken. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-20Second attempt to fix crashGravatar Dirk Hohndel
Linus pointed out that it might be another call site (and looking at his proposed patch I noticed a logic error in my earlier attempt) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-20Prevent possible NULL pointer dereferenceGravatar Dirk Hohndel
Not sure if this will fix the crash for Henrik, but it's worth a try. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-18Fix compile error on WindowsGravatar Dirk Hohndel
We need to return a DC_STATUS here. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-18Add a simple cp2130 libusb driverGravatar Anton Lundin
This adds a simple cp2130 userspace driver. Its probably unusable in the real world but its a great base to build upon. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-18Fix warning about incompatible pointerGravatar Anton Lundin
The set_halfduplex function takes a unsigned int, not a int. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17Rewrite libdivecomputer custom serial codeGravatar Anton Lundin
This rewrites the custom serial code to use the new api which I implemented in the Subsurface-branch of libdivecomputer. This is a bit to big patch but I haven't had the time to break it down into more sensible patches. This rewrite enables us to support more ftdi based divecomputer communication and is tested with both a OSTC3, OSTC2N and a Suunto Vyper, all over the libftdi driver. The bluetooth code paths are tested to, and should work as before. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17QML UI: deal with multiple buddies correctlyGravatar Joakim Bygdell
When editing adive in Subsurface-mobile we can only handle one buddy due to the limitations of the combobox. To prevent loss of data when editing a dive with more than one buddy we display "Multiple Buddies" in the buddy field. This creates a special case where no changes are written to the buddy field unless the user changes buddy for that dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17Compute total tissue saturation for all deco modelsGravatar Robert C. Helling
... and not just for Buehlmann. This makes the saturation graphs meaningful for VPM-B. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-17Cosmetic changes to Buehlmann codeGravatar Robert C. Helling
Change runtime table string from ZHL-16B to ZHL-16C to reflect he fact that we use 5min as half-time for the fastest compartment rather than 4min. Further more trade pow(2.0, ...) for exp(). Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04Fix some warningsGravatar Dirk Hohndel
At least the warnings about size potentially being uninitialized seem correct and valid. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04iOS build: Fix compile failureGravatar Dirk Hohndel
Without this moc_SubsurfaceObjectWrapper doesn't compile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04Stop trying to fix up pressure sensor indexesGravatar Linus Torvalds
This removes 'fixup_dc_cylinder_index()', which was added to fix up the pressure sensor indexes from the Atomic Cobalt dive computer. Even for the Cobalt it really shouldn't matter, because the libdivecomputer backend for the Cobalt actually tries to do the right thing. See for example commit 8853a1ccd422 ("Associate the pressure samples with the primary tank.") in libdivecomputer. Some historical digging shows that the subsurface sample pressure index code came in from commit e32ba4d6d811 ("Improve tank handling for Cobalt"), dated Tue Oct 28 13:48:15 2014. And the libdivecomputer "use the right cylinder" code was around the same time (Fri Oct 10 20:29:17 2014 +0200). So I suspect that subsurface needed the fixup based on an older version of libdivecomputer. Jef's patch is a couple of weeks before, but we may not have tracked libdivecomputer religiously. The reason to remove this code is because it can (and does) mess up the sensor index when it is actually reliable, like in the multi-sensor case of the Suunto EON Steel. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04Remove hacks regarding multiple gasmixes and cylindersGravatar Joakim Bygdell
Enabling cylinder edit in Subsurface-mobile our previous hacks regarding multiple cylinders and gasmixes must be removed. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04QML UI: Enable cylinder editGravatar Joakim Bygdell
This adds the option to select a cylinder when adding or editing a dive. Due to limited screen size we restrict the editing to the first cylinder only. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04Settings fixup: gflow and gfhigh are intGravatar Rick Walsh
With the recent setting cleanup, gradient factors were set to bool, so were saved as 1/1, rather than say 50/80. This commit fixes that. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-29Teach 'interpolate()' about zero-sized rangesGravatar Linus Torvalds
No, they don't make sense. We should normally not have multiple samples that are on the same second. But they seem to happen on the EON Steel under some circumstances, and instead of dividing by zero when trying to interpolate across such a sample, do something sane. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-29Make sure DC_FIELD_TANK starts from a clean slate for each cylinderGravatar Linus Torvalds
We used to clear the 'dc_tank_t' for each dive, but then only clear the volume field in between each cylinder. That means that if the libdivecomputer back-end does not touch a field, it might contain the stale value from the previous tank information. I'm not sure this is actually much of an issue, since I'd expect back-ends do seem to initialize the fields fully (at least the EON Steel back-end does). But it's inconsistent. Also, the code was actually buggy because of the odd indentation: it would only ask for new tank information up to 'ntanks' tanks, but because of the final fixup that was done outside of the conditional, it would actually update the cylinder begin/end pressure data *beyond* 'ntanks', and just re-use the last libdivecomputer data for the rest of the cylinders. Again, in practice, that probably never really happened, but it is a real bug. The fixed-up code actually looks better too, imho, and is one line shorter because of the initialization now being done in one place rather than two. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-29Hacky workaround for multiple gas pressures per sampleGravatar Linus Torvalds
In subsurface, we only have one cylinder pressure per sample (well, technically two: we have a separate o2 pressure for rebreather diving). Which makes things "interesting" if the dive computer can actually have multiple pressure sensors, and can report them all concurrently. Like the Suunto EON Steel. We used to just take the last one (each sensor reading would just overwrite any previous ones), and this quick hack just changes the logic to prefer the "current" cylinder instead. It's wrong, and it's stupid, but it's the best we can do without major surgery. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-28Settings update: Fix git_local_only loadingGravatar Tomaz Canabrava
Thanks to the unittesting. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-28Settings update: Fix cloud_git_urlGravatar Tomaz Canabrava
I was freeing data segment, sigh. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>