Commit graph

14631 commits

Author SHA1 Message Date
jan Iversen
d0edc29636 core,tests: change qml register function
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-11 17:22:58 -07:00
jan Iversen
a71afd31ee core: add auto registration to qPref*
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-11 17:22:58 -07:00
jan Iversen
7940e45c4c core/settings: add missing empty line.
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-11 17:22:58 -07:00
jan Iversen
1a130ec461 desktop/profile-widget: update signal from _changed to Changed
Update connect calls to use Changed from qPref, due to QML demands

Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11 17:22:58 -07:00
jan Iversen
c72add5721 core/setting: change *_changed to *Changed for the sake of QML.
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-11 17:22:58 -07:00
Jan Mulder
740fcce338 cleanup[6/6]: remove actual preferences
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-11 15:38:20 -07:00
Jan Mulder
19e8fa4eaf Cleanup[5/6]: remove unused preferences
Remove all the code to handle the preferences itself.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-11 15:38:20 -07:00
Jan Mulder
bb0ac5f778 cleanup[4/6], mobile: remove superfluous code from gpslocation
Despite the fast that this code is sitting in core, its used mainly
from mobile. In 987e221f8e, 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-11 15:38:20 -07:00
Jan Mulder
cc72a606bb cleanup[3/6]: do not save the userid any more
Do not save the to be deleted prefences any more.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-11 15:38:20 -07:00
Jan Mulder
3c8506e1b8 cleanup[2/6]: remove set_userid()
This code is not used any more.

Signed-off-by: Jan Mlder <jlmulder@xs4all.nl>
2018-09-11 15:38:20 -07:00
Jan Mulder
226161ee44 cleanup[1/6]: do not set userid/save_userid_local from storage
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-11 15:38:20 -07:00
jan Iversen
62a8bc7391 test: remove git_local_only from qml test
tst_qPrefCloudStorage.qml still refered to git_local_ony, remove it

Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-11 11:54:07 -07:00
Dirk Hohndel
619a52635a prefs: use correct way to set the cloud storage password preference
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-10 16:26:49 -07:00
Dirk Hohndel
2b3f6c607b prefs: cloud_new_password is not a preference
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-10 16:26:49 -07:00
Dirk Hohndel
ae653703a5 prefs: git_local_only is not a preference
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-10 16:26:49 -07:00
Berthold Stoeger
6e4a253896 Profile: fix SAC calculation for air dives
Commit f5b11daffd 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-10 14:23:59 -07:00
Jan Mulder
c75f53a7a8 CHANGELOG: not UI any more in mobile for GPS webservice
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-10 07:50:50 -07:00
Jan Mulder
987e221f8e Mobile: Remove webservice, remove UI components
This is the first commit related to the removal of the GPS
webservice. It is nothing more then removing 2 buttons from the
menu to upload and download from the server, so technically
a trivial change.

As with the desktop application: Be very careful here as this
forces our users to use Subsurface-mobile, and a online cloud
account as that is the way to transfer GPS data from a mobile
device to the desktop.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-10 07:50:50 -07:00
Dirk Hohndel
dc68c3e7bd Travis: build export-html on Mac and Linux
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-09 19:52:14 -07:00
Dirk Hohndel
889cfb8116 Fix export-html
In commit d815e0c947 ("Parse: pass dive_table argument to parse_file()")
a syntax error was introduced and never caught since we don't test compile
export-html on Travis.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-09 19:52:14 -07:00
Alexander Wilms
12d75001a0 Set desktop file name to avoid a broken icon under KDE Wayland
Signed-off-by: Alexander Wilms <f.alexander.wilms@gmail.com>
2018-09-09 18:44:40 -07:00
Alexander Wilms
bcf568586d Fix appdata
Use correct format, create script to update the version and release date in the
appdata.

[Dirk Hohndel: call said script during the build process]

Signed-off-by: Alexander Wilms <f.alexander.wilms@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-09 18:43:30 -07:00
Jan Mulder
39b52d8abf CHANGELOG: remove GPS import from webservice
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-09 18:28:08 -07:00
Jan Mulder
876e6adf74 Desktop: Remove webservice, remove UI components (2)
Actually remove the Subsurface webservice UI from the source, and
deal with all the fallout.

Notice that a part of the change in subsurfacewebservices.cpp is
a block of code that becomes unused, but might contain some valid
logic to be used later. Very similar code is in core/gpslocation.cpp.
And as I earlier broke something here, the unused code is ifdef-ed for
now.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-09 18:28:08 -07:00
Jan Mulder
90fb34baab Desktop: Remove webservice, remove UI components (1)
The very first part of the full removal of the GPS webservice. This
removes the UI artefacts and a tiny bit fallout. This leaves in place
all the background processing.

Be very careful here as this can break workflow of users that currently
have unapplied GPS coordinates sitting in the webservice, and do upgrade
to the version where this commit goes in. They have no clean UI way any more
to apply those GPS fixes from the desktop.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-09 18:28:08 -07:00
Miika Turkia
97f75472e8 Update changelog
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-09-09 12:26:45 -07:00
Miika Turkia
3c9897d247 DLF import: document deco event
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-09 12:26:45 -07:00
Miika Turkia
dac90e3fde DLF import: comment measured He
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-09 12:26:45 -07:00
Miika Turkia
aae2403ddd DLF import: Record battery status
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-09 12:26:45 -07:00
jan Iversen
a93ecf3912 tests: update qPref* to the shadow variable
The shadow variable causes properties only to be saved when
actual changed, therefore some test cases need update

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-07 14:37:18 -07:00
jan Iversen
ee6b5643b5 core/settings: only sync values that are actually changed
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-07 14:37:18 -07:00
Dirk Hohndel
2ecbea3d24 qPref: use helper function to ensure key/name grouping
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-07 14:37:18 -07:00
Berthold Stoeger
db57a633d5 Cleanup: constify threshold pointers in DiveProfileItem
These were pointers into the global prefs object. The user must
not use these to modify the settings, therefore make them
pointers-to-const.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-09-07 11:03:30 -07:00
Berthold Stoeger
2bd0c2143e Cleanup: constify get_units()
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-07 11:03:30 -07:00
Jan Mulder
2635673c3a Preferences: more missing /
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-07 07:39:35 -07:00
Linus Torvalds
56a77f0fa3 Garmin devices - like Shearwater - want random BLE addressing
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-06 18:35:18 -07:00
jan Iversen
c03c2b5fd7 core/settings: add missing / in default_filename
Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-06 17:14:54 -07:00
jan Iversen
12fc3f1747 Revert "core/tests: add loadFromCloud var to qPrefCloudStorage"
This reverts commit b7a1bb670c.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-06 17:14:48 -07:00
Dirk Hohndel
e71b049498 qPref: only save settings that aren't the default
This brings us back to the previous behavior.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-06 16:13:44 -07:00
jan Iversen
d88f865793 mobile_widgets: correct cloudCredentials save problem
When installing for the first time cloudCredentials needs to be added,
this commit a problem with updating them correctly

this problem was caused by
da6e8a4cd5

Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-06 12:24:17 -07:00
Salvador Cuñat
5ebe4195e5 [smtk-import] Apply arrays to the main smartrak_import() function
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2018-09-06 12:23:51 -07:00
Salvador Cuñat
4c9aeca0df [smtk-import] Remove now unused smtk-value-by-idx()
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2018-09-06 12:23:51 -07:00
Salvador Cuñat
650b198715 [smtk-import] Apply arrays to parsing tables functions
And add a fuction to parse tables that are not "relational", meaning
tables which are directly refered from Dives table.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2018-09-06 12:23:51 -07:00
Salvador Cuñat
856848466a [smtk-import] Add a function to get the size of an array
We can allocate fixed size arrays for smartrak tables as its size can
be known in advance. Simply reading table->num_rows is too dangereous
as smartrak tables have "holes" commonly. This is, they can look like:
            Idx     |       Txt
             1      |       blablabla
             2      |       blebleble
             4      |       blobloblo
table->num_rows would give us 3, but we need to allocate 4 to get an
array like:

            |0|blablabla |1|blebleble |2|     |3|blobloblo

as the idea is to use the table index to reference the array data.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2018-09-06 12:23:51 -07:00
Dirk Hohndel
dd633119bb Travis: use system libgit2 on OpenSUSE for Qt56 build
This is libgit2 0.24 which is new enough for our purposes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-05 21:43:58 -07:00
Dirk Hohndel
11993b59ca build-system: don't show spurious errors looking for qmake
And improve the message if we do indeed not find it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-05 21:43:58 -07:00
Dirk Hohndel
fde266860e Travis: fix qt56 builds
This seems very strange - but it appears that we are missing the 'which'
command.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-05 21:43:58 -07:00
Dirk Hohndel
1509302b46 Another update to libdivecomputer
Parse more Garmin Descent events.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-05 21:39:52 -07:00
Dirk Hohndel
cfb67a78be Update translation source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-05 15:05:43 -07:00
Dirk Hohndel
6d85e730b8 Update CHANGELOG
A couple of updates that hadn't made it into the CHANGELOG.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-05 13:34:51 -07:00