Commit graph

73 commits

Author SHA1 Message Date
Jan Mulder
3b5375d553 QML UI: Kirigami to 2.2
When first tested this commit, especially the dive list was looking
terrible. However, after including newer SHA's from libkirigami, and
correcting lots of spacing/margin issue, a retest of this commit shows
no strange artifact any more, and the amount of warnings in the log
output is reduced significantly. So now, it appears save to
upgrade.

Notice that main.qml still uses Kirigami 2.0. and is not updated in
this commit. With version 2.2, there is a new way of theming, that
is not (yet) compatible with our current code. Blindly upgrading to
2.2 leads to a almost black dive list, wrong button colors, and
runtime errors in the log, due to the fact the direct setting from
QML Kirigami's Theme colors is not allowed any more.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-19 12:20:43 -08:00
Jan Mulder
f25cc3a67f QML UI: repair long trip headers
Trip headers spanning more than one line where broken at incorrect
locations in the string. Not exactly sure, but I think this came with
the newest Kirigami SHA, and especially the Label change.

Carefully reading the code for the trip heading shows a "strange"
negative margin. So the margin is on the outside. This margin was
used to split the string, allowing for a small invisible part of
the string to present as trip header.

This is solved by this commit.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-27 19:27:47 +02:00
Jan Mulder
a525fff112 QML-UI: repair DiveList
The new SHA for Kirigami did all kinds of nasty things to our DiveList.
This commit tries to repair most of the damage. Nothing more than
some margins, anchors, and even a font that changed.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-18 06:30:51 -04:00
Jan Mulder
d623eccdef mobile: silence deprecated messages in logging about Kirigami.Label
Commit 8f6827ab12 brought a new SHA for Kirigami, but that introduces
a very noisy logging of "Kirigami.Label is deprecated. Use
QtQuickControls2.Label instead".

So, thats what done here.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-17 15:32:27 +02:00
Jan Mulder
e2aaa43d8c QML UI: cleanup some whitespace and string formatting
This addresses some review comment on whitespace and translated
string formatting.

In the string formatting, a tiny additional change is made.
I wanted the email address in the explanation text in a bold
font. Using the HTML <b> for this, removed the /n newline
characters in the output. Apparantly, mixing these two
formatting styles does not work. No problem, replaced the
/n to HTML style too.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29 08:13:25 -07:00
Jan Mulder
dbed88bd81 QML UI: rework single credential page to two pages
This commit tries to implement most of issue #515. It reworks the
one credential page, which its dynamic PIN part, into two pages.
Main driver of selecting one of the two pages is the showPin
boolean. Page 1 contains the email/passwd field (and the
option to use a no cloud setup). Page 2 only contains the PIN
part (and the option to cancel the process).

The Kirigami central button does not seem very handy here. We
need, for example, a cancel, sign-in and register, only register,
etc. buttons, which are not easy to handle in specific icons.
Therefore, normal pushbuttons are chosen to deal with user
interaction, and the Kirigami button is removed from these
pages.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29 08:13:25 -07:00
Jan Mulder
2e91de9d95 mobile: initialize credential data in one place
It appears that the onCompleted of the StartPage item is triggered
before the onCompleted of the rootItem. This is logical as the
Startpage is a child of the rootItem. And, yes, this does matter.
As the divelist also contains the logic for initial cloud
registration (and is the default page shown in a state where
the cloud credentials are valid (CS_VERIFIED state)), we need to
know the correct credential state at start of the app.

The move of this one line of code makes sure of that, in addition
to setting the credential state from the preferences. Now, the
setupActions function can reference correct credential data.

This is further preparation for a better cloud creation
process from mobile.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29 08:13:25 -07:00
Jan Mulder
9a2d503d3b Unify credential states
Having two different enums around with more or less the same
definition has lead to unclear code. After removing two not needed
states on the mobile end, the remaining step to one enum for the
credential state becomes almost is simple rename operation.

Unfortunately, I do not know a way to embed a plain C enum
from pref.h into the QMLManager object. So after this, there
are still 2 enums around, but now identical.

This commit is not changing any functionality.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-04 07:38:30 -07:00
Jan Mulder
190d80e509 mobile: remove superfluous state VALID_EMAIL
This is a no-brainer removal of the VALID_EMAIL state used in QMLManager.
All current usage of this state is "if state is VALID or VALID_EMAIL",
so there is no distinction between the two states.

It is even a little different. The comment suggests "when we can open
a local cloud storage, tied to a cloud account (so explicitly not
the no-cloud status), we have at least a valid email". While this
is formally true, this implies that there is also a cloud account
on the cloud server (ie. the cloud account is in a VERIFIED state).
In other words: currently, there can't exist a valid local storage
that is tied to a valid email adress, without valid cloud account
on the server.

Notice that this touches the discussion on GitHub for commit
e76f527fe5 (pull request #520). Can we implement the creation
of a valid cloud account without data link to the cloud server?
Currently, we need the server to confirm the email address (for
example for uniqueness reasons on server side). Obviously, we could
hack our way out of this, but we have a perfect solution already
in place. Create a no-cloud account, and transfer that later to
a true and valid cloud account.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-04 07:38:30 -07:00
Jan Mulder
50891c838e QML UI: set the title of the right object
Intended was here to set the title of the Dive list with id: page,
instead of the startpage object.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-04 07:38:30 -07:00
Rick Walsh
1409521eb2 DiveList.qml: set detailsWindow index before deleting dive from list
This appears to fix the mystery crashes that can occur when deleting a dive
from the dive list.

Fixes: #497

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-08-10 09:06:44 -07:00
Joakim Bygdell
25fd8c1727 QML UI: use a lighter text color for the selected dive
Use the ligther text color on the secondary row of text when a dive is selcted in the divelist

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 14:13:22 +09:00
Dirk Hohndel
b1f4a2975f QML UI: better icon for download from dive computer
Thanks to Davide for paying for professional icon design.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-08 10:29:10 -07:00
Jan Mulder
d6446569af QML UI: only drag a pull down sync, and not flick it
Fast flicking to the top of the divelist triggers almost certainly a
pull down sync, as the default boundBehavior is DragAndOvershootBounds.
Despite being the default QML action, this leads to unwanted pull
down syncs (even in offline mode).

Setting the boundBehavior to DragOverBounds solves this issue. Now,
the user has to explicitly drag the top down to force a pull down
sync, and a accidental fast flick is stopped at the upper bound.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-29 23:21:55 +09:00
Dirk Hohndel
b459ccbff7 QML UI: DiveList: make download from DC main action
Now that we support this for many dive computers, that seem reasonable.
I'm not happy with the icon, but couldn't figure out a better one in the
breeze icon set.

See #426

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-27 22:18:26 -07:00
Dirk Hohndel
d93280f1dc QML UI: DiveList: add date box to trip header
This way you can tell when a trip happened.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-24 13:13:04 -07:00
Dirk Hohndel
49a368539a QML UI: set opacity of 1 for dive list
Hopefully with this we get exactly the right colors.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-24 11:19:56 -07:00
Dirk Hohndel
e3cd6719c1 QML UI: Davide's colors for the blue theme
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-24 11:18:18 -07:00
Dirk Hohndel
8ba581a088 QML UI: use textColor instead of diveListTextColor
This color is used for more than just the dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 19:49:57 -07:00
Dirk Hohndel
ea218b9d24 QML UI: DiveList: allow trip header to wrap
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-22 04:19:23 -07:00
Rick Walsh
d9cb65cbed QML UI: turn off spinner if pull-down-to-refresh fails
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-22 04:19:23 -07:00
Dirk Hohndel
7b7294d127 QML UI: DiveList: implement pull down to refresh
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 17:20:07 -07:00
Dirk Hohndel
e0f46b033d QML UI: attempt to add dark theme
This isn't great, yet, but a first step to show that this is possible
(and in doing so I found quite a few spots where the colors weren't
correctly propagating, yet).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 17:20:07 -07:00
Dirk Hohndel
4651454557 QML UI: don't reduce opacity for background of selected dive
Now that we have distinct colors for trip header and selected dive, this
is actually counter productive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 11:53:19 -07:00
Dirk Hohndel
02d8c98c93 QML UI: DiveList: always show current trip at the top
This is especially nice for very long dive trips.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 11:48:29 -07:00
Dirk Hohndel
9ddd26ff37 QML UI: redo all the colors
Naming them the same way Davide named them in his emails and assigning the
color values he proposed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 11:05:36 -07:00
Dirk Hohndel
16f16f6818 QML UI: DiveList: fix position of delete button
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 11:01:37 -07:00
Dirk Hohndel
c775fcebec QML UI: DiveList: turn the color blob into a thin line
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 09:55:03 -07:00
Dirk Hohndel
d7be3b21d6 QML UI: DiveList distinguish trip and selected dive
Making the selected dive's background less opaque prevents confusion.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 09:28:40 -07:00
Dirk Hohndel
fd5cd5ebf0 QML UI: DiveList: playing with different colors
Make the accent color much lighter, don't have a solid bar on the left
for dives that are part of a trip.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 16:21:47 -07:00
Dirk Hohndel
157e14e11d QML UI: DiveList: some fine tuning of sizes and spacing
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 10:05:45 -07:00
Dirk Hohndel
712d1e97f3 QML UI: DiveList: remove space below trip heading
That made sense before we had the shaded background, now it just looks terrible.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 09:25:07 -07:00
Dirk Hohndel
edd0d2f2bb QML UI: DiveList: don't show empty trip heading for dives without trip
We need to hide the left bar and background rectangle as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 09:14:05 -07:00
Dirk Hohndel
a93e3b26d6 QML UI: DiveList: show left bar on dives that are part of a trip
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 09:13:12 -07:00
Dirk Hohndel
a6a9eaa998 QML UI: DiveList: add blue bar on the left to trip heading
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 08:29:06 -07:00
Dirk Hohndel
684354ab6e QML UI: re-indent DiveList code
No actual changes besides whitespace.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 07:49:11 -07:00
Dirk Hohndel
e49301ea21 QML UI: DiveList: add background color to trip heading
In order to make it easier to see the changes, the code hasn't been re-indented.
This will be in the next commit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 07:49:11 -07:00
Dirk Hohndel
3d8f61fe6c QML UI: turn DiveList heading into label
This way it will render in the same font as the location of a dive.
This will look like crap until the next commit adds a rectangle with
color around it, but this way it's much easier to see the individual
changes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 07:45:16 -07:00
Dirk Hohndel
3d707dca9a QML UI: make the dive list heading slightly smaller
Again, the goal is to make this list look better and be more space
efficient.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-18 18:05:18 -07:00
Dirk Hohndel
d74ef97228 QML UI: less whitespace around dive list entries
This way we get to show a few more dives per screen.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-18 17:38:03 -07:00
Dirk Hohndel
47a01b1dcd QML UI: improve the dive list layout
Based on Davide's ideas, but with a few tweaks:
I really like the dive number on the far right; that gives a clean
consistent look. I tried it with date on the left and depth/duration in
the middle and liked the result.

This doesn't change the font, just addresses the layout and bold heading
vs smaller sub-heading.

See #427

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-18 17:06:53 -07:00
Dirk Hohndel
8525805f04 Add SPDX header to mobile widgets and QML files
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29 13:32:55 -07:00
Dirk Hohndel
525cd4c9e3 QML UI: correctly render dive list when showing delete button
This fixes the visual artifact that Willem reported.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 13:13:06 -07:00
Dirk Hohndel
8c94fa2676 QML UI: ensure actions are set up for Credentials page
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-03 10:49:07 -07:00
Marco Martin
e4460be8a6 QML UI: use a scrollable page for StartPage
Fixes scrolling of the cloud credentials and simplifies code

Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-03 07:22:56 -07:00
Marco Martin
751626eec5 QML UI: Fully port dive edit to Kirigami2
Completely adapt to the api changes of OverlaySheet in Kirigami2
in order to achieve the same look and behavior for the dive
edits that had with kirigami1

Port most components to QtQuickContrls2, except comboboxes
in the dive edit sheet that will need a new control type

Signed-off-by: Marco Martin <notmart@gmail.com>
2017-04-01 09:35:51 +02:00
Dirk Hohndel
10842b3eb3 QML UI: don't unset the currentIndex in the dive list
It's unclear why this code was added in the first place - removing it
makes the highlight of the selected dive in the dive list work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
fc60f210c4 QML UI: move 'No dives in dive list' down
Otherwise it overlaps with the page title.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-21 17:06:07 -08:00
Dirk Hohndel
14b4c94ded Revert "QML UI: build against latest Kirigami"
This reverts commit a842e44b68.
2017-01-21 14:42:10 -08:00
Dirk Hohndel
a842e44b68 QML UI: build against latest Kirigami
But of course this doesn't work, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-27 01:47:01 -08:00