Commit graph

16524 commits

Author SHA1 Message Date
jan Iversen
5f5d4ffbc9 mobile-widgets/qml: disable global drawer in startpage
Do not show global drawer when user is doing login.

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-24 08:25:51 +09:00
jan Iversen
d92b51352e new mobile login: set save_password_local to true
Save_password_local is default set to false, meaning new users
have to find out how to allow it.

set save_password_local to true for mobile, which is normal behaivour
on mobile apps.

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-24 08:25:51 +09:00
jan Iversen
d48a748a25 mobile-widgets: limit use of QSettings in qmlmanager
Replace QSettings for userName/Password/credentials with proper qPrefCloudStorage calls

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-24 08:25:51 +09:00
Dirk Hohndel
4126409310 Coding style: clarify preference for filenames
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 07:06:25 +09:00
jan Iversen
080def7729 diveplanner: desktop, remove no longer used slots
Remove PlannerSettingsWidget slots, that are directed to plannerShared

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 06:30:57 +09:00
jan Iversen
fb5a67e16a diveplanner: desktop, connect signals direct to plannerShared
Connect the signals for ascent/descent directly to plannerShared

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 06:30:57 +09:00
jan Iversen
dc713000ff desktop-widgets: use share meter/feet funcs. in diveplanner
change the settings variables using UNIT_FACTOR to use
plannerShared instead.

There are no changed functionality, it is simply removing calculations
from the UI.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 06:30:57 +09:00
jan Iversen
f291e5e2d8 core: add convert between meter/feet to plannerShared
qPrefDiveplanner contains settings for ascent and descent in a neutral format.
diveplanner desktop uses a macro UNIT_FACTOR to convert between UI values and
qPref values.

In order not to dublicate these calculation (in C++ and QML) a set of shared
functions are made. The functions are identical to the calculations in diveplanner
desktop.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 06:30:57 +09:00
jan Iversen
0c23e005ea startup mobile: make diveplanner part of Qt type system
Register DivePlanner before starting QML.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 06:30:57 +09:00
jan Iversen
3930cc42a5 build-system: add diveplanner to iOS build
Update iOS project solution file

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 06:30:57 +09:00
jan Iversen
c0069d6aee core: add plannerShared class
Add a plannerShared class, whose purpose is to contain shared
functions between mobile and desktop

This class is the inner workings of the diveplanner not the UI

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 06:30:57 +09:00
Alexander Kjäll
b4eef5548b fixed typo in comment
Signed-off-by: Alexander Kjäll <alexander.kjall@gmail.com>
2019-12-24 06:25:59 +09:00
jan Iversen
7503242914 build-system: Add CMakeLists.txt to mobile-widgets
In order to make the central CMakeLists cleaner and more consistent
add a CMakeLists.txt to mobile-widgets, like in other root directories.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 06:18:36 +09:00
jan Iversen
a17cb6b681 build-system: clean desktop-widgets CMakeLists.txt
The CMakeLists.txt referenced mapwidget which is in another root
directory (and also a seperate library)

Remove mapwidget reference from CMakeLists.txt

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 06:18:36 +09:00
jan Iversen
74755b64b1 build-system: Add CMakeLists.txt to map-widget
In order to make the central CMakeLists cleaner and more consistent
add a CMakeLists.txt to map-widget, like in other root directories.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 06:18:36 +09:00
jan Iversen
41d6ff96c1 build-system: move qmlprofile to profile-widgets/CMakeLists.txt
qmlprofile.* is part of profile-widget, and are now defined in the
the corresponding CMakeLists.txt, and thereby making the central
CMakeLists.txt cleaner.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 06:18:36 +09:00
jan Iversen
d1490776e2 build-system: correct spelling error in build.sh
the location of libdivecomputer is not subsurface/llibdivecomputer

Correct spelling error.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 06:18:36 +09:00
Berthold Stoeger
19b8c9a33a Cleanup: Turn QMLProfile::diveId from QString to int
This property is used to render the profile of a given dive.
Weirdly, even though the diveId is an integer, it was stored
as a string. It is not clear why that is the case. Therefore,
turn into the more natural int and avoid unnecessary conversion.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-24 06:16:39 +09:00
jan Iversen
967f0e56d7 build system: add forgotten directory to xCode project
Add tests to xCode project.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 03:53:04 +09:00
jan Iversen
9ffc8dd2ea release doc: update CHANGELOG.md
add info about qml compiler

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-24 03:52:40 +09:00
jan Iversen
0ab5810a87 build-system: iOS, activate qml compiler
Activate use of qml compiler, which provides:
- more error detection at compile time
- fast qml
- smaller footprint

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-24 03:52:40 +09:00
jan Iversen
9d74b4dc82 mobile-widgets/qml: remove use of eval()
eval() cannot be used in combination with the Qt5 qml compiler,

replace eval() with switch statements.

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-24 03:52:40 +09:00
Dirk Hohndel
636b26ff4b Update libdivecomputer
Add initial support for the Oceanic Pro Plus 4
Fix the Oceanic Geo 4.0 memory layout
Ignore all empty logbook entries
Add a workaround for the hwOS ppO2 firmware bug
Use macros to encode the firmware version
Use symbolic constants for the sample types
Remove the obsolete hwos parameter
Limit the tank pressure workaround to hwOS devices
Fix the OSTC tank pressure decoding
Fix the Scubapro G2 HUD udev rule
Add the Mares Genius to the bluetooth filter
Add firmware upgrade support for the Ratio computers

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-21 14:18:13 -08:00
jan Iversen
7eddaeea21 build-system: iOS, change location of 3rd party builds
move location of 3rd build to follow same pattern as desktop/mobile build

update central .gitignore to silence libdivecomputer/build-ios, this should
really be in libdivecomputer, but it is more easy to put it in a subsurface
controlled file.

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-18 13:29:25 +09:00
jan Iversen
fa8c7ecc58 build-system: iOS, change location of install-root
move from build-ios/install-root/<arch> to
SSRF_CLONE/install-root/ios/<arch>

move fat libraries, include and bin to SSRF_CLONE/install-root/ios

Call "make" and not "make qmake_all" which is just a FORCE dependency.

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-18 13:29:25 +09:00
jan Iversen
543e65e987 build-system: iOS, use ~/Qt
packaging/ios/build.sh expected a link ./Qt to the Qt installation.
scripts/build.sh expect ~/Qt to contain the Qt installation

change to ~/Qt and thus no longer need link

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-18 13:29:25 +09:00
jan Iversen
161bedf58d mobile-widget: use qPref variable
change prefs.cloudUserName to PrefCloudStage.cloud_storage_email.

This is slightly more effective (direct instead of indirect), and
reduces the use of prefs.

This is part of limiting the use of prefs. (which is a precessor to
qPref) to the login process, and ultimately remove it.

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-18 13:26:29 +09:00
jan Iversen
1dd7d9df3a mobile-widget: correct set of default_cylinder
set_default_cylinder is accepted, because it is defined in Qt Meta system,
however the call is never carried out, because the Q_INVOKE macro is missing

Change PrefGeneral.set_default_cylinder(...) which is a function call
to PrefGeneral.default_cylinder = ... which is a builtin assignment

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-18 13:26:29 +09:00
Robert C. Helling
8c0023e151 Stop Compiler Warning: Change struct to class
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-12-16 18:27:37 +01:00
Berthold Stoeger
474fc72e32 Coding style: use std::equal_to instead of lambda
Use std::equal_to instead of lambdas that compare two dive pointers.
One could argue over which version is more readable. For whatever
it's worth, std::equal_to is more compact and expressive.

This removes an old erroneous comment that stated that std::equal_to
is only available since C++14.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-13 07:12:12 -05:00
jan Iversen
bf7954ebe7 core: remove LOG_STP from mobile
LOG_STP is on longer providing the data needed, since a lot of the startup
is indirectly in QML, furthermore using the xcode project and running profiler
gives much more detailed information

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-13 07:04:00 -05:00
jan Iversen
a96be9af68 qt-models: remove LOG_STP from mobile/desktop
LOG_STP is on longer providing the data needed, since a lot of the startup
is indirectly in QML, furthermore using the xcode project and running profiler
gives much more detailed information

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-13 07:04:00 -05:00
jan Iversen
11592ed958 release doc: add to CHANGELOG.md
Upload to dive-share is now available in mobile

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-12 21:35:55 -05:00
jan Iversen
080ddc0df2 mobile/qml: Integrate/activate diveshare in Export
Integrate diveshare in Export
Activate diveshare radio button

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-12 21:35:55 -05:00
jan Iversen
53069fe777 mobile-widgets: activate uploadDiveShare in qmlmanager
Remove "TO BE IMPLEMENTED" and add call doUpload

Connect signal to signal in QMLManager to avoid registring the
upload class.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-12 21:35:55 -05:00
jan Iversen
dd183eaabf mobile/qml: Clear status field in Export
When opening the saveAsDialog a second time, it contains
the last status from first time.

Clear statusText before calling saveAsDialog

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-12 10:10:01 -05:00
jan Iversen
820d9bcd56 core: divehare avoid race problem.
Do reply->readAll() before reply-deleteLater()

With UI deleteLater() seems to happen after the function exist,
but with QML it causes problems.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-12 10:10:01 -05:00
jan Iversen
aefe87112a core: divehare change slot names
change slot names from slot_* to *Slot

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-12 10:10:01 -05:00
jan Iversen
786b0db724 mobile/qml: make close dialog in Connect work
When using Connect, the context is switched, so close()
might or might not work.

Change unqualified close() to qualified uploadDialog.close()

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-12 10:10:01 -05:00
jan Iversen
adedfe5965 mobile/qml: remove empty line
Remove empty line that does not make sense.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-12 10:10:01 -05:00
jan Iversen
8ff19b6d54 core/settings: qPrefCloudStorage, correct diveshare_uid naming
The variable in Q_PROPERTY was wrongly named diveshare_userid

change diveshare_userid to diveshare_uid

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-12 10:10:01 -05:00
jan Iversen
85e6e90559 core: uploadDiveLogsDE::prepareDives no longer need to be public
Integration into desktop-widgets is complete.

Move prepareDives() from public to private

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-12 10:10:01 -05:00
Dirk Hohndel
ebe317d644 build system: make INSTALL_ROOT depend on BUILD_PREFIX as well
This makes things more consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-12 06:56:29 -05:00
Dirk Hohndel
623eb6a16f build system: fix most shellcheck warnings
A couple are still there, but this was the low hanging fruit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-12 06:56:29 -05:00
Dirk Hohndel
2d0cf24efd build system: do something more reasonable if subsurface is a symlink
This actually changes behavior compared to what we did before. But it seems
reasonabel. If ./subsurface is a link to a different directory, then assume
that we want a true out of tree build in the current directory.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-12 06:56:29 -05:00
Dirk Hohndel
24637dc769 build-system: allow shared source across multiple hosts
This attempts to allow sharing a host directory across multiple builds, target
use case is to have a shared source directory on a VM host and be able to build
from that in a number of VMs without those builds stepping on top of each
other.

Instead of subsurface/build, subsurface/mobile-build,
subsurface/libdivecomputer/build, use a prefix path to allow having true out of
tree builds.

The one shortcoming is that the autotools need to be run in the libdivecomputer
directory - that means this will be run on the first system that starts a
build. But that seems to cause no harm in my testing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-12 06:56:29 -05:00
jan Iversen
a2717c558a mobile/qml: close upload dialog if success
Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11 12:36:43 -05:00
jan Iversen
cb252f39d7 core: corrected timeout and error text problem in uploadDiveLogsDE
incorrectly stopped timer before the upload was started.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11 12:36:43 -05:00
jan Iversen
6ccea3c39d desktop-widgets: divelogsDE: integrate shared backend
Use doUpload() from uploadDiveLogsDE

Connect signals from uploadDiveLogsDE to do UI part.

Clean slots to only contain UI.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11 12:36:43 -05:00
jan Iversen
5a4128a8f2 core: add uploadStatus signal to uploadDiveLogsDE
The uploadStatus signal can be used to inform the user about
the process e.g.
- preparing zip file
- starting actual upload

It is a suplement to uploadProgress, that only informs about
the network part.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11 12:36:43 -05:00