aboutsummaryrefslogtreecommitdiffstats
path: root/core
AgeCommit message (Collapse)Author
2018-09-12serial_ftdi: use Sleep() on Win32Gravatar Lubomir I. Ivanov
Windows doesn't have nanosleep() unless libwinpthread is used. Since the nanosleep() usage in serial_ftdi_sleep(): - does not break in case of EINTR - has input in milliseconds the WINAPI Sleep() should be a good alternative. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-09-12Planner: fix display of "overlapping dives" messageGravatar Berthold Stoeger
1) Add a missing <div> 2) More importantly: recognize html content via <div>-tags instead of <table>-tags. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-09-12DLF import: Remove old debug printGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-09-12DLF import: Decode all sensors, when we got them.Gravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-09-12DLF import: Set initial gas as first cylinderGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-09-12DLF import: Name dive siteGravatar Anton Lundin
The UI doesn't behave all that nice without name on the dive site. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-09-12DLF import: Decode device configuration into extra stringsGravatar Anton Lundin
These save a lot of different info about the computer, so decode them into extra strings. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-09-12DLF import: Create separate solenoid open/close eventsGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-09-12BLE: add Teric to list of auto-detected Shearwater computersGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-12DLF import: record starting battery levelGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-09-12DLF import: use battery_end in preparationGravatar Miika Turkia
Prepare for recording both start and end pressures. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-09-11core/settings: correct UserSurvey -> userSurvey in qPrefDisplayGravatar jan Iversen
QML is quite special, the variables needs to start with lower case in C++ and are used starting with upper case in QML Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11core/settings: optimize base_url functions.Gravatar jan Iversen
Remove unused variable and create of QString. Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11core/settings: use instance() in qPref macrosGravatar jan Iversen
use instance() instead of <class>::instance() Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11core/settings: change bestmixend to int, to allow qml to workGravatar jan Iversen
depth_t is a good struct in C, but bad in QML. Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11core/settings: correct wrong emit in qPrefFacebookGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11core/settings ... : remove qPref* includes in qPref.hGravatar jan Iversen
reduce number of includes by removing qPref* includes in qPref.h Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11core: declare cloud_status in qPrefCloudStorageGravatar jan Iversen
qml declaration of cloud_status (defined in pref.h) does not belong in qPref.h but in qPrefCloudStorage Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11core/tests: change short to int in pref.hGravatar jan Iversen
Simplify structure preferences by removing short. Update test cases to not do (int). Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11core,tests: change qml register functionGravatar jan Iversen
In order to address the C++ object directy in qml, a different registration is needed. qmlRegisterType, registers the C++ class, allowing qml code to inherit from it and make qml objects. This is needed for graphical elemnets like profile and map setContentProperty, registers the C++ object, thus allowing signals to be catched. Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11core: add auto registration to qPref*Gravatar jan Iversen
Instead of having all register calls in subsurface-helper.cpp let qPref.cpp handle all qPref registration, since they also need to be different update subsurface-helper and testqml accordingly. Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11core/settings: add missing empty line.Gravatar jan Iversen
Standard is to have 1 empty line between functions correct missing static in qPrefGeocoding.h Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11core/setting: change *_changed to *Changed for the sake of QML.Gravatar jan Iversen
QML demands signals to be of the form <name>Changed Changing all of qPref REMARK: this commit is not compileable, since it only change qPref and not the rest of the system Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11cleanup[6/6]: remove actual preferencesGravatar Jan Mulder
And finnaly, get rid of the definition in the overall struct. And one usage of the preferences was still around. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-11Cleanup[5/6]: remove unused preferencesGravatar Jan Mulder
Remove all the code to handle the preferences itself. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-11cleanup[4/6], mobile: remove superfluous code from gpslocationGravatar Jan Mulder
Despite the fast that this code is sitting in core, its used mainly from mobile. In 987e221f8e6b7b, the buttons to interact with the GPS webservice were deleted from the UI. Now, delete all the code that was used under these buttons. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-11cleanup[3/6]: do not save the userid any moreGravatar Jan Mulder
Do not save the to be deleted prefences any more. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-11cleanup[2/6]: remove set_userid()Gravatar Jan Mulder
This code is not used any more. Signed-off-by: Jan Mlder <jlmulder@xs4all.nl>
2018-09-11cleanup[1/6]: do not set userid/save_userid_local from storageGravatar Jan Mulder
This the first of a set of cleanups related to the removal of 2 preferences: save_userid_local and userid. The commits are ordered so that a sane running state remains, should a bisect ever lands here. Here, just read a git or XML logbook including the to be removed preferences, as existing users can have this data sitting around. The only thing done here is not to store the possibly read data for the mentioned preferences. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-10prefs: use correct way to set the cloud storage password preferenceGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-10prefs: cloud_new_password is not a preferenceGravatar Dirk Hohndel
It's a mamber of the cloud storage authentication class, used to hold the proposed new password until the backend has accepted it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-10prefs: git_local_only is not a preferenceGravatar Dirk Hohndel
It's the current state of the app, so it should be a global variable, not a preference. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-10Profile: fix SAC calculation for air divesGravatar Berthold Stoeger
Commit f5b11daffd6f240268ce78d72c64be43670988ea changed gasmix arguments and return values to be passed by value instead of using pointers. Notably, get_gasmix() is fed a default-value and returns a new value. In the old code, NULL was passed in in a first loop iteration and non-NULL was always returned in the first iteration. Thus, an equality comparison of passed-in an returned gasmix would always fail in the first loop iteration. The new code passed in air as default. Now if air was also returned, then the matching gases were not calculated in calculate_sac(). To revert to the old behavior, pass in an invalid gasmix. Moreover, give names to the invalid and air gasmixes. Reported-by: tormento <turment@gmail.com> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-09-09Set desktop file name to avoid a broken icon under KDE WaylandGravatar Alexander Wilms
Signed-off-by: Alexander Wilms <f.alexander.wilms@gmail.com>
2018-09-09DLF import: document deco eventGravatar Miika Turkia
These are Deco N2 Low/High and Deco He Low/High events. They all appear to be recorded at the same time, different events at same second. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-09-09DLF import: comment measured HeGravatar Miika Turkia
Measured He is documented (in comment). Will need information if all measurements are needed or just start/end. First case would be added to dive prifle, possibly cluttering it, second would be extra data. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-09-09DLF import: Record battery statusGravatar Miika Turkia
This will record the ending battery status to extra data. Would need info from CCR divers whether this suffices or if we should record also the starting volatage or even every single reading. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-09-07core/settings: only sync values that are actually changedGravatar jan Iversen
Add a variable reflecting the current_state to all DISK_* macros, in order to check if the original variable in struct preferences is changed. Only save to disk if actually changed [Dirk Hohndel: merged Jan's commit and renamed the variable and adjusted the commit message... but fundamentally the commit is still what Jan wrote, so he should get the credit] Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-07qPref: use helper function to ensure key/name groupingGravatar Dirk Hohndel
We had a couple of instances of names being incorrectly merged with their group, this should handle that better. It's a bit of a big hammer to use, but it seems to work (and it makes it easy to then git grep for cases that don't use the new helper function. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-07Cleanup: constify get_units()Gravatar Berthold Stoeger
get_units() returns a pointer to the units struct in the preferences. Callers should not modify the preferences via this struct, therefore make the return value point to const. This is a small step in constifying the global preferences structure. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-09-07Preferences: more missing /Gravatar Jan Mulder
subsurface_webservice_uid ends up in the wrong group due missing /. Notice that this does not fix the issues I mentioned in #1648. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-06Garmin devices - like Shearwater - want random BLE addressingGravatar Linus Torvalds
We had a special-case for the Shearwater case, let's just make it slightly more generic and add Garmin to the list of vendors that want a random BLE address rather than a static one. The Bluez model of having to state this explicitly - but not giving the information to the user - is completely broken and this is all very annoying, credit goes to Wojciech Więckowski for pointing this out. Of course, right now we don't actually know how to parse the BLE stream from the Garmin Descent, but with this (and some libdivecomputer hackery) I actually get connected and start receiving data. That we then can't parse, but that's hopefully just a libdivecomputer update away. Pointed-out-by: Wojciech Więckowski <xplwowi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-06core/settings: add missing / in default_filenameGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-06Revert "core/tests: add loadFromCloud var to qPrefCloudStorage"Gravatar jan Iversen
This reverts commit b7a1bb670ce11b22e52361f4152b4853b97e13f5. Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-06qPref: only save settings that aren't the defaultGravatar Dirk Hohndel
This brings us back to the previous behavior. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-03libdivecomputer: allow a "zero depth" deco stop depthGravatar Linus Torvalds
That just means that we're not in deco, the same way as giving a nonzero NDL value does. But if you don't have NDL, this is a much more convenient way of saying "not in deco". The Garmin Descent gives us stop information, but not necessarily NDL, and really wants this. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-09-03libdivecomputer: add support for DC_SAMPLE_TTS if it existsGravatar Linus Torvalds
libdivecomputer didn't use to have a TTS sample value, but we're adding one, so add conditional support for it if it exists. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-09-03core/windows.c: write logs to the user pathGravatar Lubomir I. Ivanov
Writing logs to the path where the executable is located, might not be possible if the current user doesn't have permissions to write there. Obtain the user path and write the log files to the user path instead - e.g.: c:\users\myuser\appdata\roaming\subsurface\subsurface_*.log Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-09-03code/windows.c: add method for converting from utf16 to utf8Gravatar Lubomir I. Ivanov
Modify the funcion system_default_path_append() to both receive and return wchar_t types. Remove fallback in system_default_path_append() as this is now redundant. Add a function utf16_to_utf8() and use that in places where system_default_path_append() needs to be converted to utf8. Move both utf16_to_utf8*() and utf8_to_utf16*() near the top of the file. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-09-01Cleanup: silence clang missing braces warning in core/color.cppGravatar Berthold Stoeger
C++11 initializer lists should be passed via {{ ... }}. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>