Commit graph

1140 commits

Author SHA1 Message Date
jan Iversen
c77bad6c3e mobile-widgets/qml: secure text on ascent/descend get updated
When changing METERS <-> FEET, the text change automatically
between "m/min" and "ft/min".

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
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
342a8db93a mobile-widgets/qml: switch between m/min and ft/min
Set the text of ascent/descent rates.

This shows the correct speed units when the user switches between metric and imperial.

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-04 10:44:02 -08:00
jan Iversen
6d6a4278c4 mobile-widgets/qml: reintroduce showPin
but the proper way, as a direct check on
PrefCloudStorage.

This secures PrefCloudStorage is only tested once and not
n times. As a sideeffect it saves typing and control.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2020-01-02 06:36:18 +09:00
jan Iversen
d7f87ee93c mobile-widgets/qml: add spinbox values to planner setup
(planning is excluded, due to not finished UI).

Connect all spinboxes with plannerShared.

This change allows live testing and compare with the desktop version.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31 07:44:51 +09:00
jan Iversen
d83c74606d mobile-widgets/qml: add checkbox values
(planning is excluded, due to not finished UI).

Connect all checkboxes with plannerShared.

This change allows live testing and compare with the desktop version.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31 07:44:51 +09:00
jan Iversen
360add37a8 mobile-widgets: remove qmlprefs.*
class is not longer used, remove it.
(also from qml)

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
e268af0d9f mobile-widgets: use oldStatus in qmlmanager
Switch oldStatus from qmlprefs to qmlmanager

This is the last use of QMLPrefs, which can later be safely removed.

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
3d6d71aa9f mobile-widgets: add oldStatus variable to qmlmanager
oldStatus() is kept in qmlPrefs during the login process to allow
for a couple of special cases:
- if a user have added dives in NO_CLOUD mode and changes to use the
  cloud these dives are copied to the Cloud, instead of being lost.
- if a user does a bailout from the login process (this should not
  happen anymore) the old status is restored.

The pure solution would be to have oldStatus at the top level (e.g.
a property in qml) and only change it when actually being in the
login process, however due to way the qmlmanager is written it proved
very difficult and not worth the effort.

In order to be able to remove qmlPrefs, oldStatus are moved to
qmlManager.

This commit only contain the creation of the variable and the supporting
code.

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
25e17443f9 mobile-widgets: remove showPin from qmlprefs
showPin is no longer used so remove it.

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
a729d1a576 mobile-widgets: remove showPin from qmlmanager
Setting showPin is no longer needed, so remove it.

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
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
5b3ecea4a0 mobile-widgets: remove setCredentialStatus() from qmlprefs
Remove no longer used function setCredentialStatus() from qmlprefs.

This is done to secure there are no missing setCredentialStatus calls
in the code.

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
1fd6b59a21 mobile-widgets: remove second setCredentialStatus()
call setOldStatus() and set_filename().

saveCredentials() will adjust email and password.

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
6084a27229 mobile-widgets: remove first setCredentialStatus() in finishSetup()
This setCredentialStatus() will never do anything, because qPrefCloudStorage
is identical to prefs.cloud_verification_status, and can thus be
safely removed.

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
0c840ba22a mobile-widgets: remove setCredentialStatus() from saveCloudCredentials()
Revert to the divelist by setting oldStatus() directly to
set_cloud_verification_status()

This is done to further limit the use of setCredentialStatus() and
prepare to remove qmlPrefs.

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
814f6b3579 mobile-widgets: remove setCredentialStatus from revertToNoCloudIfNeeded
Update revertToNoCloudIfNeeded() to not use setCredentialStatus() by adding an
extra call to setOldStatus()

setOldStatus() is called in setCredentialStatus together with
set_cloud_verification_status() therefore these 2 calls need to added when
removing setCredentialStatus().

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
dc98b0a2ac mobile-widgets: replace simple setCredentialStatus
qmlprefs::setCredentialStatus() basically only does something when called with
CS_NOCLOUD.

A number of setCredentialStatus() calls happen where status cannot be
CS_NOCLOUD, and therefore setCredentialStatus() can be safely replaced with
set_cloud_verification_status()

This limits the use of qmlprefs::setCredentialStatus(), but there are still a
couple of more complicated calls.

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
beacc00f2d mobile-widgets: remove m_cloudCredentialStatus in qmlpref
Remove m_credentialStatus in qmlpref, but let the setter/getter
stay, using qPrefCloudStorage::cloud_verification_status()
instead.

This change ensures that qmlPrefs:credentialStatus() returns the
same as qPrefCloudStorage::cloud_verification_status(), and the
setter/getter of credentialStatus can later be removed safely.

This is a "checkpoint" to ensure everything works without a temporary
credentialStatus. No code part depend on the difference between
qmlPrefs::credentialStatus() and
qPrefCloudStorage::cloud_verification_status(), but the code reference
both.

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
e80c27a2bd mobile-widgets/qml: correct missing parm in saveCredentials() call
Add missing empty pin ("") in saveCredentials() call.

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-28 08:36:55 -08:00
jan Iversen
07ad455ea2 mobile-widgets/qml: prefs.credentialStatus -> PrefCloudStorage
Remove use of prefs. (apart from instanciating the object) in
main.qml

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-28 08:36:55 -08:00
jan Iversen
7e0e489d45 mobile-widgets/qml: "Add dive manually" is always allowed
Since the divelist is only visible if online/offline (CS_VERIFIED/CS_NOCLOUD),
there is no need to check that to enable "Add dive manually".

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-28 08:36:20 -08:00
jan Iversen
a73ce80eee mobile-widgets/qml: don't offer manual sync to cloud in no-cloud mode
Manual sync was enabled both for CS_VERIFIED (online) and CS_NOCLOUD (offline)
and then in the trigger CS_NOCLOUD lead to a login screen, potentially
confusing the user.

Only enable manual sync with verified cloud credentials.

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-28 08:35:45 -08:00
jan Iversen
bdbaf72d27 mobile-widgets/qml: remove use of prefs. in DiveList.qml
prefs. is only important during the signin process, so use the standard
PrefCloudStorage variable

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
3cca6b9e9b mobile-widgets: remove cloudPin from qmlprefs
cloudPin is no longer used, remove it.

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
e3a9166f46 mobile-widgets: remove cloudPin() from qmlmanager
cloudPin does only have the values "" and NULL, so replace cloudPin()
with "" in csa->backend() call

remove setting of cloudPin to ""

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
f1a48d7f79 mobile-widget: simplify saveCredentials() in qmlmanager
cloudPin is only set to "" and NULL, therefore and "if" checking if
cloudPin is not empty will never have affect.

Remove else part.

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
3155b03917 mobile-widgets: make verifyCredentials() an internal function
Move verifyCredentials() from public slots to private, eliminating
the need to MOC and making the C++/QML interface on function less
complicated.

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
096f9773f0 mobile-widgets: make saveCredentials() an atom
Add pin parameter to saveCredentials() thereby having all info about
credentials in one function call.

Add "" as pin in saveCredentials() - main.qml, when verifying
credentials.

replace verifyCredentials() with saveCredentials() in the register
button on the pin page.

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
ad1c3892f9 mobile-widgets: remove clearCredentials()
clearCredentials() was only called from one place (in the same file), copy
functionality and remove function.

It was declared as a public slot, so this saves a little bit of overhead too.

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
e944a93050 mobile-widgets: remove cancelCredentialsPinSetup() from qmlprefs
cancelCredentialsPinSetup() is no longer used, so remove it.

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
de4e1c1efa mobile-widgets/qml: don't call cancelCredentialsPinSetup()
Copy functionality from cancelCredentialsPinSetup() into Cancel in
CloudCredentials.qml, this is part of the general qmlprefs cleanup.

Remove rootItem.returnTopPage() since the user stays on this page
(sees credentials again).

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
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
944455a821 mobile-widgets/qml: remove property credentialStatus
Property is unused, remove it.

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-28 08:34:56 -08:00
Dirk Hohndel
a2246753d8 mobile UI: add menu item for cloud password reset
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29 01:16:23 +09:00
Dirk Hohndel
ab93e0f55c mobile UI: restructure help/support menu
Instead of having two entries on the main menu, move them into a sub menu.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29 01:16:23 +09:00
Dirk Hohndel
69f06f7043 mobile: small whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29 01:16:23 +09:00
Dirk Hohndel
56d959f733 mobile UI: add support and account icons
These were again copied from the material design icon set and will be used to
differentiate the various help topics.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29 01:16:23 +09:00
Dirk Hohndel
5c0b864a55 mobile UI: add back button to planner menu
Otherwise you are stuck in there.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29 01:16:23 +09:00
Dirk Hohndel
602f49e012 mobile UI: remove confusing gDrawer id
The global drawer already has a name that can be referenced. This was adding
confusion as now both names were used in the menu structure.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29 01:16:23 +09:00
jan Iversen
25d2f9b84d mobile-widgets/qml: add "forgot password" button
The user is most likely to find out, that he does not remember
the password, when asked for it.

Add "forgot password" button in the signin dialog
(both credentials and pin dialog).

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-29 01:05:44 +09:00
jan Iversen
9e3d85f0e2 mobile-widgets: correct faulty connect.
1) add comment line (signal to signal)
2) correct spelling error in comment
3) correct connect

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-28 06:53:29 +09:00
jan Iversen
2d353a756b mobile-widgets/qml: correct first view of divelist
pageStack.initPage cannot be used as a function and causes an error

Replace with showDiveList()

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-28 02:21:20 +09:00
jan Iversen
af1ca2af81 mobile-widget/qml: avoid binding loop in GlobalDrawer
rightPadding seems defined in Kirigami and the default value
causes a binding loop.

set rightPadding directly.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-28 02:21:20 +09:00
jan Iversen
52b8a1304f mobile-widgets: remove envelope of saveCredentials
Remove QML saveCredentials since it only calls manager.saveCredentials

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-26 10:24:55 -08:00
jan Iversen
e9d519444d mobile-widgets/qml: correct Pin page
Did not switch to divelog page.

call verifyCredentials() not saveCredentials when checking pin

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-26 10:24:55 -08:00
jan Iversen
c4952b0dcb mobile-widgets: correct switch to no-cloud mode.
saveCredentials() missed parameters

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-26 10:24:55 -08:00
jan Iversen
b58d403906 mobile-widgets/qml: diveplannersetup graphical layout
Add graphical layout to setup page

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-26 10:21:30 -08:00