Commit graph

226 commits

Author SHA1 Message Date
Dirk Hohndel
619de80dfd mobile UI: restructure menu
This changes the 'GPS' entry to be called 'Location', moves the 'Map' entry
below that, and reuses the map icon for both the map inside this submenu and
for the main menu item.

It moves the 'About' entry under 'Help' and both 'Export' and 'Dive summary'
under 'Dive management'.

This way we have only five (or with 'Developer' enabled, six) entries in the
main menu making it much more appropriate for really tiny screens.

Additionally, the entrieis moved into sub-menus are ones that are not all that
commonly used.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-13 14:01:34 -08:00
Dirk Hohndel
3bb9b08f33 mobile UI: correctly determine the number of columns when screen size changes
This also deals with a bug we had before where we didn't re-start the calculation
for the various sizes from the assumption of 'at least 21 grid units'. Now you can
rotate the device and the right thing will happen.

Small warning - this checks the orientation of the screen, which is exactly what
you want it to do on your device. When running mobile on desktop this may not be
what you expect. Even if the window has a portrait aspect ratio, your screen is
likely still landscape... so testing this feature in mobile on desktop mode is a
bit harder...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-08 13:58:54 -08:00
Dirk Hohndel
bb123c78fa random white space fix
QtCreator fixes that for me after every edit, I'm getting tired
of manually removing those hunks.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-06 21:45:00 -08:00
Dirk Hohndel
eb410aee55 mobile UI: redo the screen size magic
This still is way to fragile. Ordering of object completion doesn't appear
consistent. Hopefully bringing the properties all into one (now reasonably
named) object will help.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-06 21:45:00 -08:00
Dirk Hohndel
f1a08eb952 mobile: comment out planner references
I don't expect this to be complieted. I'll keep it in the tree
for the moment, but expect to remove all of the related code
eventually.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-06 21:45:00 -08:00
jan Iversen
35de9c49a4 mobile-widgets: switch to new subsurfaceTheme
Remove subsurfaceTheme from main.qml
Replace ThemeNew -> subsurfaceTheme
change registration ThemeNew -> subsurfaceTheme

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-02-03 17:30:35 -08:00
jan Iversen
38120d555f mobile-widgets/qml: secure subsurfaceTheme.initial*
move initialWidth/initialHeight out of subsurfaceTheme to placeHolder,
this secures no change in behaviour.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-02-03 17:30:29 -08:00
jan Iversen
8339384eeb mobile-widgets/qml: move fontMetrics to ThemeTest
fontMetrics is no longer used in production code, but still in the theme test
page.

Isolate fontMetrics in ThemeTest page.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-30 07:52:57 +02:00
jan Iversen
2cc215d3f2 mobile-widgets: move font property to themeInterface
Move setting of font properties used throughout to themeInterface.
Add new settings "currentScale".

The properties are kept in main (subsurfaceTheme) in order not to do
a big search/replace.

Update settings to use currectScale and signal changes in themeinterface.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-30 07:52:14 +02:00
jan Iversen
a3e3a30b70 mobile-widgets: move basePointSize to themeinterface
Check defaultfont and calculate basepointsize in themeinterface instead
of in QML.

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-30 07:51:05 +02:00
jan Iversen
303b5865cd mobile-widgets/qml: add icon to dive summary entry
Add sigma icon to menu entry "dive summary".

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-28 15:34:34 -08:00
jan Iversen
97e2890990 mobile-widgets/qml: integrate DiveSummary in menu.
Add DiveSummary to globalDrawer

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-27 14:25:03 -08:00
jan Iversen
df9164f7e5 mobile-widgets/qml: integrate ThemeNew in qml
Update Settings to use ThemeNew (for theme change)
Reduce subsurfaceTheme in main

Signed-off-by: jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-26 16:42:35 -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
fe8b7e3b72 mobile-widget/qml: add missing colors to dark theme
add missing colors so that dark theme contains the
same colors as "colors in use".

Update the darkTheme() to correctly copy colors from
pink theme

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18 12:44:05 -08:00
jan Iversen
65a0a9c7eb mobile-widget/qml: add missing colors to pink theme
add missing colors so that pink theme contains the
same colors as "colors in use".

Update the pinkTheme() to correctly copy colors from
pink theme

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18 12:44:05 -08:00
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
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
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
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
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
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
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
0974c7524f mobile-widgets/qml: add diveplanner pages to globalDrawer
Add "Dive planner" menu entry in GlobalDrawer/Developer
with 4 subitems one for each diveplanner pages.

Developer is chosen in order to allow interested access to
pages, without raising expectations for the normal user.

That allow a step-by-step implementation

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-26 10:21:16 -08:00
jan Iversen
9c74ac23a5 mobile-widgets/qml: remove console messages
Remove console.log messagees used to test the
split of startpage/divelist.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-27 01:29:30 +09:00
jan Iversen
611c4bb088 mobile UI/login: move startpage to main
StartPage does not belong in divelist.

Remove startPage from diveList and anchor in main.

Make needed functional changes.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 15:53:15 -08:00
jan Iversen
b83dcc4b25 mobile UI/login: make divelist a proper object in main
Instanciate DiveList like all the other pages.

Move DiveList properties set in main to DiveList.qml

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 15:53:14 -08:00
jan Iversen
d1bee58dad mobile UI/login: move onCompleted actions to main
manager.finishSetup() have nothing to do with startpage/divelist,
but belong in main (seeing main as responsible for setup and window layout).

Move onCompleted functionality to main.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 15:53:11 -08:00
jan Iversen
ac28896a5d mobile UI/login: replace use of cloudUserName
Replace prefs.cloudUserName with PrefCloudStorage.cloud_storage_email in QML

Replace QMLPrefs.....cloudUserName with PrefCloudStorage::cloud_storage_email in C++

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 10:22:39 -08:00
jan Iversen
4b713ece96 mobile UI/login: do not revert to old credentials.
If the user asked to change credentials it is equivalent to a signout,
so no need to store old credentials. This simplification allows removal
of the temporary credentials in qmlPrefs.

this commits secures the user is locked in the login page, until one
of 3 things happen:

- enter verified credentials (divelist is loaded from cloud)
- select no-cloud mode (divelist is loaded from local)
- enter new credentials, PIN page shows, enter PIN or
  cancel (back to enter credentials).

This is consistent even if the program is restarted.

Old version had a non consistent way:
A user enters new credentials,
  sees the PIN screen,
  but does not receive the email immediately,
  so works with other applications (causing the mobile app to close)

Having received the email with the PiN,
  the user starts mobile again,
  BUT does not see the PIN screen, instead the old credentials are used.

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24 10:17:45 -08:00
jan Iversen
e92dbe7974 mobile-widgets/qml: clean whitespace in main.qml
Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-25 03:15:52 +09:00
jan Iversen
a4d299e01e mobile-widgets/qml: use showPin/oldStatus consistently
Remove aliases for showPin/oldStatus and reference prefs.showPin/oldStatus directly.

showPin/oldStatus are "temporary" variables, that are not saved in settings,
so they easily be replaced

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-24 08:25:51 +09:00
jan Iversen
5f5d4ffbc9 mobile-widgets/qml: disable global drawer in startpage
Do not show global drawer when user is doing login.

Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-24 08:25:51 +09:00
jan Iversen
5307cbc1c7 mobile-widgets/qml: integrate export page in main.qml
Add export function to GlobalDrawer, allowing the user to
export the divelog.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-03 21:30:39 -08:00
jan Iversen
bd7357238f mobile-widget/qml: correct syntax error introduced in e63257f0e
default parameter values is not supported as this syntax was introduced
in ECMA-262 6th edition while QML only implements the fifth edition
(as of Qt 5.11).

remove default parameter and check for undefined instead.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-11-11 20:44:35 +01:00
Dirk Hohndel
4f0d437f1e Mobile: add ability to directly open support email
This is even easier and more obvious than copying the logs on the About page
and then manually creating an email and pasting those logs.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-10 21:59:32 +01:00
Dirk Hohndel
20fda8afc3 Mobile: reconnect the correct model after changing filter
This caused a blank, unusable dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-08 20:50:05 +01:00
Dirk Hohndel
e63257f0e9 Mobile: allow message argument to showBusy function
When called without arguments, no message is shown.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-08 20:50:05 +01:00
Dirk Hohndel
505ff4032a Mobile: add UI feature tests to Developer menu
Running Subsurface-mobile on iOS, the notification texts are sometimes very
hard to read, and in some situations the busy indicator isn't showing up at
all.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-08 20:50:05 +01:00
Dirk Hohndel
9f34f4f97d Mobile: disconnect model while updating dive list
If the dive list is connected to the model while the model is updated
with the downloaded dives, sometimes the UI hangs completely.

Disconnecting the model and then reconnecting it does add a fairly
noticeable delay on longer dive lists, so there are tradeoffs here.

Of course the obvious solution is to make reconnecting the model
faster...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-03 04:02:00 -08:00
Dirk Hohndel
113cb1acc0 Mobile: use appendTextToLog to get timestamps in logs
This helps tremendously when tracking down some problems. We should
never use console.log.

In the process this also updates a couple of the messages to be clearer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-03 04:02:00 -08:00
Dirk Hohndel
d401271dab Mobile: make the GPS service icon work again
I don't recall when this stopped working.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-27 12:42:38 -07:00