Commit graph

584 commits

Author SHA1 Message Date
Dirk Hohndel
0ae57cfe92 Mobile/remember DCs: try to match device names
We only store the address part of the connection name, so don't try to find an
exact match, try to find the sub-string.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-23 11:49:30 -07:00
Dirk Hohndel
a5b56d0ba0 Mobile/settings: add button to forget remembered dive computers
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-23 11:49:30 -07:00
Dirk Hohndel
500f4c44fc Mobile/remember DCs: allow the buttons to flow
The hard grid may look nicer on bigger screens, on smaller screens it's
a problem.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-23 11:49:30 -07:00
Dirk Hohndel
52c70a3594 Mobile/remember DCs: add UI for the mobile app
This uses the same backend as the desktop version.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-23 11:49:30 -07:00
Jocke
5b37d87e2d Update divelist when changing units
We need to explicitly refresh the divelist when switching between
metric and imperial unit systems. Or the changes will not be visible until
we restart the app or scroll outside of what's in the current cache.
This will update both the divelist view and the dive profiles to show the new units.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-09-22 14:44:59 -07:00
Jocke
a63be142b5 Mobile: add units selection to settings page
Add the option for the user to set the desired unit system for
Subsurface-mobile regardless of system locale

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-19 14:41:03 -07:00
Jan Mulder
c11a4e4633 Mobile: rename UI string for webservice
Trivial rename of a UI string. The string "Subsurface GPS data webservice"
reminds me too much of the legacy webservice.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-19 14:05:14 -07:00
jan Iversen
c9122283cc mobile-widgets: replace qmlprefs::theme with qPrefDisplay::theme
Shortcut and use qPrefDisplay::theme() direct

Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-12 20:18:32 -07:00
jan Iversen
51bc41b517 mobile-widgets: remove setTimeThreshold from system
Use qPrefLocationService::set_time_threshold and remove from
qmlprefs.cpp and qmlmanager.cpp

Remark: mobile UI shows time in minutes, while it is stored (and calculated)
in seconds. Therefore a /60 when reading and *60 when setting.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-12 20:18:32 -07:00
jan Iversen
baa828e900 mobile-widgets: move distanceThreshold handling to qPref
Remove distanceThreshold from qmlprefs and use qPref instead
update qml

no user experience change

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-12 20:17:39 -07:00
jan Iversen
c454f6954f mobile-widgets: make show_developer persistent
Remove developer from qmlprefs and use qPref instead
Update qml

show_developer is saved on disk, and thus remembered between starts.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-12 20:16:46 -07:00
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 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
Jocke
02af3463d0 Mobile: add default cylinder UI
Add the UI components to let the user set the default cylinder and select
the chosen cylinder when adding a new dive.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-25 07:01:42 -07:00
Jocke
0fb086a4a5 Mobile: fix saving new dive
With the new setup we need to know which state we are coming from
when we are saving cylinder related info. When we are adding
a new dive we explicitly should save cylinder data to the first cylinder.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-11 11:19:07 -07:00
Jocke
bd8eec5c8e Mobile: fix adding new dive
All the changes to multi cylinder editing broke the option to add a new dive.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-11 11:19:07 -07:00
Jocke
ae70a751c7 Mobile: save pressures
Save start and end pressures for used cylinders.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-11 11:19:07 -07:00
Jocke
891e8acaa8 Mobile: save gasmixes
Same as for cylinder info, we need to make sure that the gasmixes gets saved to the correct cylinder.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-11 11:19:07 -07:00
Jocke
9c9450748b Mobile: display all used gases on the edit page
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-11 11:19:07 -07:00
Jocke
94428b9a18 Mobile: save edited cylinders
Save the edited cylinder in the correct slot.
Since the cylinder number and the used cylinder number need not be
the same we first need to test if the cylinder are used.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-11 11:19:07 -07:00
Jocke
6b93e5fe27 Mobile: Display used cylinders on edit page
This displays the used cylinders in a dive so that they can be edited.
Currently limited to 5 as a POC.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-11 11:19:07 -07:00
Jocke
914b061d8a Mobile: display all used cylinders
Display all used cylinders as a comma separated list.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-11 11:19:07 -07:00
Dirk Hohndel
5cdba2d652 QML UI: don't overwrite good info with bad
If we don't know the vendor or product, let's not overwrite information
that we may have remembered from the last time the user downloaded from
this dive computer.

Note that this doesn't try to associate a specific cable with the
information used last time. We could be smarter here for people who have
multiple dive computers, but for the most typical user with just one
dive computer, this does seem like a good solution.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
fbf94d4a7b QML UI: add callback to run after app is fully initialized
And then use that to check for pending Intents on Android.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
f8d551ac6e QML UI: don't show bogus warning if page stack is reset
As we clear all the pages from the stack, we can briefly have no valid currentItem.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
40ecb179a3 QML UI: don't mangle 'USB device' as device name
We do strip the user friendly name from BT addresses and this mistakenly
mangled 'USB device' to 'device'.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
1a7ada5a90 QML UI: directly access currentText
No need to qualify our own object name.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
9d577e4b80 QML UI: disable connection selection for Atomics Aquatics
This is one of the dive computers that we simply connect to as USB device.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
e19944ce14 QML UI: when triggering download page, set up vendor/product/connection
This only works if the USB device contains enough information to do so.
We need to collect more information to understand what information we
get if those get plugged in. Maybe we'll get only the vendor and need to
leave it to the user to set the product (which we can do by passing an
index of -1 for product).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
593978a473 QML UI: set indices when showing Download page
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
de8359e4f0 QML UI: expose vendor/product/connection index as properties
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
842210c80d QML UI: show download page when device was plugged in
Unless, of course, the user was editing or adding a dive - that would
be annoying to have interrupted (even though, of course, it's the user
plugging in the device which would trigger this in the first place).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
76e81e5d53 QML UI: create separate function to show download page
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
a3ddd823bb QML UI: add property to pass detected device name to UI
If the user plugs in a device on Android we get a device string that
should allow us to figure out which dive computer was plugged in. Make
that string available to the QML UI.

Right now all we do is log it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Martin Měřinský
a12588ad82 Move DC download icons used by mobile app to mobile-widgets/qml/icons/
Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2018-08-07 09:49:20 -07:00
jan Iversen
8d66633fe7 core: make qPref::cloud_status the only version of the enum
add enum to qPref and remove elsewhere
update source core to reference qPref.

the enum cannot be in pref.h because it is to be used in qml and Q_ENUM
need the enum to be defined as part of the class

Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-10 10:30:50 -07:00
Dirk Hohndel
478b5de9e7 QML UI: fix layout of Download page
The info text from the download process wasn't rendered correctly.
maximumWidth ended being a recursive reference and as a result the text
would render as very narrow and super-tall field.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-27 16:28:01 -07:00
Dirk Hohndel
f998b59900 QML UI: don't use anchors within Layouts
Qt 5.11 adds useful warnings when code attempts to use anchors within
Layouts and even tells you how to fix things.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-26 03:56:44 +08:00
jan Iversen
ff88e7ee99 mobile: remove MapWidget from mobile-resources.qrc
remove MapWidget entries from mobile-resources.qrc, and
reference map-widget.qrc in Subsurface-mobile.pro for iOS

Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-21 20:27:58 -07:00
Dirk Hohndel
7f7e7cf51d QML UI: ensure we track vendor/product for download
This is based on something that Anton Ludin sent to the mailing list.
Reading through the code it seemed that there were scenarios in which
DC_vendor and DC_product were not updated correctly. That's one of the
problems of the declarative approach in QML - it can be very hard to
figure out which code is run when in certain situations.

This may help address the issue with FTDI downloads no longer working on
Android.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20 12:07:11 +09:00
Dirk Hohndel
1ccf21f08d QML UI: improve banner in global drawer
The asynchronous load seemed to be (at least one of) the culprit(s) of
the banner occasionally not showing up.
Making the font for the cloud ID smaller looks better (and works much
better for long email addresses).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20 11:50:14 +09:00
Dirk Hohndel
e6835d76cc QML UIL: fix more problems with members moving from manager to prefs
That change clearly would have benefited from better code review.
This is a superset of a change proposed by Jan Iversen.

Closes #1406

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20 09:34:27 +09:00
Murillo Bernardes
2466351a5f mobile: use full icon path.
For some reason Kirigami.Icon mess up icon display when filename
extension is omitted. Because of this a perfectly good, scalable svg
show up as a low resolution scaled up icon.

Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-06-18 06:54:40 +09:00
jan Iversen
cc77046db5 mobile: move call to savePreferences back to manager.
calls to savePreferences was moved to prefs. in
b8eb348f54, but the corresponding
C++ code was not merged.

Revert call to savePreferences to manager.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-18 06:52:59 +09:00
jan Iversen
a24f0d3107 mobile: revert e993d4f005
The commit secured that plotDive was not called before actually being used.
However our (rather fragile) C++ qml interface did not work correctly (ony sometimes).

Revert the previous commit.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-18 06:37:01 +09:00
Dirk Hohndel
ca84d96a50 QML UI: show the cloud credentials in the global drawer banner
This is an additional side-benefit of rolling our own banner.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-18 06:32:23 +09:00
Dirk Hohndel
c8ef3d7924 QML UI: build our own icon and header for global drawer
Kirigami appears to have a bug that makes it fail to show our icon.
With this we can be much more flexible in what we show in the top area
of the global drawer.

Fixes #1331

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-18 06:32:23 +09:00
Dirk Hohndel
238d47710e Whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-18 06:32:23 +09:00
jan Iversen
74ee577357 mobile: add Dark_gps.svg
The blue gps was reused for the dark theme.
Copy Blue_gps.svg and change color to dark.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-17 19:42:16 +09:00
Murillo Bernardes
fed2a283b2 mobile: fix reference to credentialStatus property
Commit b8eb348f moved credentialStatus but missed one spot.

When starting from a fresh install, clicking "No cloud mode” fails because of this.

Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-06-16 04:01:49 -07:00