Commit graph

75 commits

Author SHA1 Message Date
jan Iversen
f424f9292e mobile-widget/qml/Settings.qml: correct theme switches
Replace subsurfaceTheme with ThemeNew, since there are still 2 objects
subsurfaceTheme in main.qml and ThemeNew in themeinterface.*

Replace theme color references with ThemeNew, as they are no longer available
in main.qml (subsurfaceTheme).

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-28 11:05:45 -08:00
jan Iversen
97376eb382 mobile-widgets/qml: add radiobuttons for single units.
For METRIC and IMPERIAL, show the radiobuttons disabled
For PERSONALIZED, allow user to select individual units.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-24 10:55:04 -08:00
jan Iversen
cc5b856280 mobile-widgets: use radiobuttons for Units
Change to radiobuttons for units, and add a third choice (personalize).

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-24 10:55:04 -08:00
Dirk Hohndel
51a242a1db mobile UI: add ability to unset the default cylinder
This was requested in a 'bug report' by a user.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20 15:39:22 -08:00
jan Iversen
75fe59b0da mobile-widgets/qml: use strongly typed units in QML
Change Settings and DivePlannerSetup to use the strongly typed enums

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20 09:49:36 -08:00
jan Iversen
11c6851c74 mobile-widgets: move rest of gridlayout to section advanced
Create section advanced around the remaining gridlayouts, and adjust.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:59:48 -08:00
jan Iversen
5bce4895cc mobile-widgets/qml: create units section and move unit_settings
Move gridlayout unit_settings to TemplateSection units, without changing
anything (apart from adding a visible: attribute).

Removed first label in units_settings, since it is the title of the section

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:59:04 -08:00
jan Iversen
0443d7f2c9 mobile-widgets/qml: create theme section and move themesettings
Move gridlayout themesetting to TemplateSection theme and use the
TemplateTitle.  Also switch from using PrefDisplay.mobile_scale to
subsurfaceTheme.currentScale

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:56:13 -08:00
jan Iversen
ba7a8f68bc mobile-widgets/qml: move dive computers to general section.
move gridlayout divecomputers to TemplateSection general, without changing
anything (apart from adding a visible: attribute and replacing the Rectangle
used to draw a line at the bottom with a TemplateLine on top.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:54:54 -08:00
jan Iversen
3d239a7903 mobile-widgets/qml: move default cylinder to general section.
move gridlayout defaultCylinder to TemplateSection general, without changing
anything (apart from adding a visible: attribute and replacing the Rectangle
used to draw a line at the end with a TemplateLine at the top).

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:53:45 -08:00
jan Iversen
bf7464788e mobile-widgets/qml: move cloudSettings to general section.
move gridlayout cloudSettings to TemplateSection general, without changing
anything (apart from adding a visible: attribute and removing the rectangle
used to create a line).

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:52:47 -08:00
jan Iversen
12631ef2bb mobile-widgets/qml: add General section to Settings
ColumnLayout does not work well with TemplateSection,
so change to Column

Add TemplateSection "General Settings"

"General Settings" are open when visiting page first time.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:52:13 -08:00
jan Iversen
8ee39aa6b6 mobile-widgets/qml: bump versions for settings
bump import versions to reflect Qt 5.12
and remove unused imports

remark QtQuick 1 and QtQuick.Controls 1 are depreciated since Qt 5.12

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:51:56 -08:00
jan Iversen
96ec585179 mobile-widgets/qml: settings Control.TextEdit -> TemplateTextEdit
Replace Control.TextEdit with TemplateTextEdit, in order to use
common font/color scheme.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:51:48 -08:00
jan Iversen
ee1d5ba94e mobile-widgets/qml: settings Control.comboBox -> TemplateComboBox
Replace Control.ComboBox with TemplateComboBox, in order to use
common font/color scheme.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:51:19 -08:00
jan Iversen
2ce32277db mobile-widgets/qml: settings Control.label -> TemplateLabel
Replace Control.label with TemplateLabel, in order to use
common font/color scheme.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19 11:51:06 -08:00
jan Iversen
93c3a18db7 mobile-widgets/qml: use strongly typed CloudStatus
Replace CloudStatus.<value> with backend.<value> as part
of making enum sharing between C/C++ and QML more robust.

Replace PrefCloudStorage.verification_status with
backend.verification_status to use the strongly typed function.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-18 17:35:16 -08:00
jan Iversen
59d72474d6 mobile-widgets/qml: change PrefGeneral -> PrefEquipment
default_cylinder was moved from PrefGeneral to PrefEquipment,
but Settings was not updated

update Settings.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-17 08:51:04 -08:00
jan Iversen
d000cb2b0d mobile-widgetes/qml: standardize QML/C++ interface
Do not use a.set_b(value); it works, but it introduces yet another way of using
the QML/C++ interface, furthermore the function might not be called set_b in
some future, which is the reason the function is define in Q_PROPERTY

Use a.b = value, that respects Q_PROPERTY, and is slightly more performant,
most importantly it's like all the other settings so noone starts wondering why
this is special.

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-04 10:56:55 -08:00
jan Iversen
b92c2d280c mobile-widgets/qml: remove prefs.showPin
prefs.showpin is the same as
PrefCloudStorage.cloud_verification_status === CloudStatus.CS_NEED_TO_VERIFY
but is actually implemented as a separate variable.

Removing showPin in order to limit use of QMLPrefs, which is the overall goal.

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29 12:20:19 -08:00
jan Iversen
783332561a mobile-widgets: credentialStatus() -> cloud_verification_status()
Replace all credentialStatus() with cloud_verification_status()

Where both prefs.credentialStatus and
PrefCloudStorage.cloud_verification_status are being set, remove
prefs.credentialStatus.

These replacements are valid since credentialStatus() is a simple
envelope over cloud_verification_status().

Also remove qmlPrefs::credentialStatus() from qmlPrefs (mostly to ensure no
replacements was forgotten).

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29 12:20:19 -08:00
jan Iversen
dc018cd77d mobile-widgets/qml: remove cancelCredentialsPinSetup() from Settings
For now just copy the functionality into Settings.qml, this is part
of the qmlprefs cleanup.

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-28 08:34:56 -08:00
jan Iversen
baec098eb3 mobile-widgets/qml: correct reference to credentialStatus
PrefCloudStorage uses cloud_verification_status where qmlprefs uses
credentialStatus

Corrected reference.

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-28 08:34:56 -08: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
Dirk Hohndel
1b058d58f7 Mobile: make it clear that 'all BT devices' setting is temporary
Making this persistant creates a very unpleasant user experience.
And if a dive computer needs this setting, we really want people
to report this to us so we can fix it.

Fixes: #2358

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-22 16:53:29 -08:00
Paul Buxton
65ec16e59d Fix text in darkmode on mobile app.
Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com>
2019-10-06 11:39:46 -07:00
Dirk Hohndel
9d582c5512 Mobile: only show dive computers in the Bluetooth connection list
And offer an option to show all devices in the settings. This is intentionally
not stored in the preferences as this should never be needed. We don't support
BT or BLE dive computers that we don't recognize. This is a last resort in case
a new firmware were to change the name or some other weird issue causes us not
to recognize a dive computer - and that should be fixed instead of worked
around.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-14 09:05:58 -08:00
Dirk Hohndel
c0540d7682 Mobile/filtering: add Settings options for filtering
Toggle case sensitive and whether or not to include the notes in full text search.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Jocke
b29f6ef2c0 Mobile: remove all related data when forgetting DCs
We need to delete all related data when forgetting dive computers or we will
have an issue if we connect a DC from the same vendor but of a different model.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-10-02 18:40:47 +02:00
Jan Mulder
9b199602c6 Mobile QML UI: bump Kirigami imports to 2.4
Primarily for reasens of keeping up with upstream. And hopefully
bugfixes and added functionality.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-01 05:29:46 -07:00
Jan Mulder
0ad7df9859 mobile, QML UI: Settings page scalability
A relatively big change for such a simple page. Most relevant
changes are:

1) Do not use Kirigami.Header anymore. It appears that this header
has word wrapping on (and we cannot override that). This is
annoying on this page, as headings seems randomly be split over
2 lines, even in cases where there is more than enhough room to
display it on one line. And as the Kirigami.Header is just a
trivial wrapper of a Text field, we can simple replace it.

2) A lot of the toplevel GridLayouts had width properties set. These
are not needed (and confused my debugging code), so they are removed
withput any visual change. As a general rule, do not try to set
properties that are not needed. In general, it can only lead to
binding loops or undefined behavior.

3) Add a font size to our Theme. The step from regular to title size
was a little too big.

4) And, obviously, numerous font.pointSize lines are added to actually
resize the font.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-27 06:36:22 -07:00
Jan Mulder
b332dd108a mobile, QML: scale font from the buttons
After the work in the previous commit, it gets very simple to implement
font scaling. Just assign a the new desired font scale to the used
font metrics. The QML engine does all the work.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-25 16:01:39 +02:00
Dirk Hohndel
be0468b706 QML UI: add settings for scale factor
The visual feels backwards as the selected one is grayed out...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-25 15:58:17 +02:00
Jocke
2d3777ce87 Mobile/settings: clear all of qPrefDiveComputer.vendor
To prevent stale data in the download DC path we need to clear the entire
 qPrefDiveComputer.vendor() object when the user purges the used DCs.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-09-25 15:35:25 +02:00
Jocke
3b8f36ff13 Mobile/Settings: Disable unusable option
Disable the "Forget DCs" button when there is no DCs saved. 

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-09-25 15:35:02 +02: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
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
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
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
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
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
Dirk Hohndel
238d47710e Whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-18 06:32:23 +09:00