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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Looks like commit 807571a588 ("core: update deviceData default from
qml") never actually was tested with dive computer download. This looks
rather like an automatic renaming gone wrong.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
add settings variables/functions to qmlprefs
remove settings variables/functions from qmlmanager
change manager. to prefs. in qml files for setting variables/functions
Signed-off-by: Jan Iversen <jani@apache.org>