Commit graph

1148 commits

Author SHA1 Message Date
jan Iversen
f17aeb92e3 mobile-widget/qml: add missing colors to blue theme
add missing colors so that blue theme contains the
same colors as "colors in use".

Update the blueTheme() to correctly copy colors from
blue theme

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18 12:44:05 -08:00
jan Iversen
5c2e08199f mobile-widgets/qml: secure block of used colors is correct
move contrastAccentColor, lightDrawerColor
to block of used colors in order to avoid confusion.

move darkDrawerColor to dark theme.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18 12:44:05 -08:00
jan Iversen
bcfe505f09 mobile-widgets/qml: remove M126 warnings in main.qml
changed != --> !==
and == --> ===
to make QML happy.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18 12:44:05 -08:00
jan Iversen
2d12d251b7 mobile-widgets/qml: columnWidth undefined
Remove reference to columnWidth, because it is
not defined in main.qml (subsurfaceTheme).

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18 12:44:05 -08:00
jan Iversen
b25e791d13 mobile-widgets/qml: main reference qPrefGeneral.default_cylinder wrongly
change qPrefGeneral.default_cylinder -> qPrefEquipment.default_cylinder

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-17 08:51:04 -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
Dirk Hohndel
de846bad96 whitespace cleanup
Since writing the file with QtCreator in the previous commit
pointed all these out...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
Dirk Hohndel
e1cd055111 code cleanup: add empty table structures
It seemed to make sense to combine all three types in one commit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10 02:37:03 +09:00
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