Commit graph

83 commits

Author SHA1 Message Date
Dirk Hohndel
40ecb179a3 QML UI: don't mangle 'USB device' as device name
We do strip the user friendly name from BT addresses and this mistakenly
mangled 'USB device' to 'device'.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
1a7ada5a90 QML UI: directly access currentText
No need to qualify our own object name.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
9d577e4b80 QML UI: disable connection selection for Atomics Aquatics
This is one of the dive computers that we simply connect to as USB device.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
de8359e4f0 QML UI: expose vendor/product/connection index as properties
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-11 11:14:22 -07:00
Dirk Hohndel
478b5de9e7 QML UI: fix layout of Download page
The info text from the download process wasn't rendered correctly.
maximumWidth ended being a recursive reference and as a result the text
would render as very narrow and super-tall field.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-27 16:28:01 -07:00
Dirk Hohndel
f998b59900 QML UI: don't use anchors within Layouts
Qt 5.11 adds useful warnings when code attempts to use anchors within
Layouts and even tells you how to fix things.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-26 03:56:44 +08:00
Dirk Hohndel
7f7e7cf51d QML UI: ensure we track vendor/product for download
This is based on something that Anton Ludin sent to the mailing list.
Reading through the code it seemed that there were scenarios in which
DC_vendor and DC_product were not updated correctly. That's one of the
problems of the declarative approach in QML - it can be very hard to
figure out which code is run when in certain situations.

This may help address the issue with FTDI downloads no longer working on
Android.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20 12:07:11 +09:00
Dirk Hohndel
16d7620e21 QML UI: fix variable reference
Looks like commit 807571a588 ("core: update deviceData default from
qml") never actually was tested with dive computer download. This looks
rather like an automatic renaming gone wrong.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-16 11:19:49 +09:00
jan Iversen
13b9c7a822 Mobile: correct wrong C++ ref in qml
change data() to manager.
correct comboDevice -> comboConnection

Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-11 09:43:32 -07:00
jan Iversen
807571a588 core: update deviceData default from qml
remove setting default in qml to C++

Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-09 21:19:46 +02:00
jan Iversen
487a4b2c32 mobile: correct comboProduct if model changes
update  onModelChanged in comboProduct to read the
current index

Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-07 18:43:56 +02:00
jan Iversen
03f30f6281 mobile: delay combobox selection for download.
Set index of comboboxes in Download screen when the page
becomes visible instead of when it is created.

The pages is created before QBluetoothDeviceDiscoveryAgent on iOS and desktop,
therefore combobox indexes cannot be set during page creation.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-04 10:27:13 -07:00
jan Iversen
571965ec6d mobile: removed setting for libdivecomputer.log
Users need a simple way to report download problems. Asking them
to go into settings, activate logging, and repeat the download
is too much.

libdivecomputer.log will always be generated, but overwritten, with every
download, so the latest log is ready.

The download is very slow due to BT, so there are no impact of having the log
active, neither in terms of size (a concern on small mobiles) or write time.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:57:14 -07:00
jan Iversen
4c8ed5a5ae QML UI: allow changing the connection ID
When downloading with bluetooth, changing connection did not work.
The new selection was not passed to the download thread.

Fixes #1274

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-20 11:35:28 -07:00
Jan Mulder
394054ebc1 QML UI: do not overflow right margin on BT text
Trivial and cosmetics only fix. The width of the rescan button
was forgotten, and this pushed the right margin to the right,
causing the combo menus to overflow the right margin.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-02-19 19:30:26 +01:00
Jan Mulder
65d80d3cd0 Mobile QML UI: fix background colors
For some reason, after the update of the main.qml to version 2.2,
all Kirigami Pages and scrollablePages show up plain white.

So now, set a proper background for these pages.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-02-17 21:05:33 +01:00
Jan Mulder
239974d600 mobile: reset download screen in a sane state
Set download srceen in a sane state after a previous download
session using this screen. The erroneous behavior was very
similar to the one fixed in commit 7fe9bbe295dcf92. For example,
download some dives, quit the screen, go back, and the bottom
buttons are still selectable.

This commit resets some values when leaving the download screen
(ie. not only swiping it away), so that it looks sane at a next
visit.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13 08:23:27 -08:00
Jan Mulder
59f86a06ad mobile: reset Retry button to Download
Reset the Retry button on exit of the Download from divecomputer
page. So, it it not reset wehen swiping this page away, or
cancelling a running download, but resetting it on accepting
downloaded dives.

As we do not have real error reporting (from download failures),
this all is a little arbitrary. Another "fix" could be, not
changing the button text at all.

Further notice, this is not specific iOS, but also Android.

Fixes: #895

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-13 08:23:27 -08:00
Robert C. Helling
1c223b09c3 Show BT device names first
Show them left of address (so they are in the user's view) rather
than on the right.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-07 18:15:40 +01:00
Robert C. Helling
afd46a60f7 Add button to rescan BT devices
Otherwise the divecomputer has to be in pairing mode
at app start time.

Unfortunately, this leaves less space for the progress message.
My time/qml knowledge does not suffice to move that to the next line
(when moving that out of the RowLayout it overlaps with
the buttons).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-05 20:05:16 -08:00
Murillo Bernardes
8f3ac0402c iOS: check for UUID instead of physical address
on iOS the address we display on Connection is an UUID, not
a physical address.

This change the pattern (on iOS) used to enable bluetooth_mode.

Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2017-12-02 08:21:33 -08:00
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
6bd5312dfa QML UI: prevent full overflow of bottom buttons
A not perfect improvement, but way better IMHO. Prevent the list of
downloaded dives to grow over the buttons at the bottom. Just a simple
change by adding a bottomMargin to the list.

Notice that there is still some overlap, but for now I consider this a
trade-off between the scarce screen real-estate and the wish to present
and much as possible dowloaded dives.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-27 19:28:42 +02:00
Jan Mulder
a9b692f0c3 QML-UI: Download screen fixup
Again, mostly related to label change. First, the top button was "glued"
to the top of the screen, so added a little margin there. It
appeared that all the other items on the screen (progressbar,
2 button rows, and the downloaded dive list) where not moving down
due to the add of that little top margin. This was solved by
anchor-ing the items together. Finally, the text of a downloaded
dive was on the top of the delegate lines. Not sure where that came
from, but easily solved by centering it explicitly.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-19 14:55:30 -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
ba4058667a mobile: enable switching BT on/off during session.
This commit implements possible switching BT on and off during a session,
so not needing a restart of the app when the user forgot to switch
it on when starting the app.

For this, the following needed to be done: 1) create a handler that
reacts on local BT device status changes. 2) repopulate the connection
list in the download screen when a BT status change is detected.

Notice the subtile change of the Q_INVOKABLE btEnabled() function
to a Q_PROPERTY. This gives a nice dynamic behaviour when
switching BT on/off with the app open.

Fixes: #556

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-12 09:43:40 +02:00
Dirk Hohndel
0c410aaf5d Adjust signature to match data we need
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-26 12:27:12 -07:00
Joakim Bygdell
9d2c4dcd3c QML UI: replace button on DC download page
Replace the generic buttons on the DC download page with our own.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Dirk Hohndel
04213e1f03 QML UI: Download from DC: tell user if BT is disabled
This makes much more sense than displaying "No dives"

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23 17:51:48 -07:00
Dirk Hohndel
be8eedb773 QML UI: Download from DC: move label next to buttons
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23 17:45:55 -07:00
Dirk Hohndel
442ba66822 QML UI: remove obsolete comment
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23 17:32:21 -07:00
Dirk Hohndel
05a3bbe65c QML UI: Download from DC: remove unused property
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22 16:15:00 -07:00
Jan Mulder
6f8e50f860 QML UI: fix some obvious UI errors
Fixes: #490 items 1) and 2).

1) Reference to isBluetooth.leftPadding is removed as the isBooltooth
checkbox is gone.

2) Do not set background color of downloaded dives. The checkbox is used
to denote "selected or not".

In addition, incorrect references to subsurfaceTheme.PrimaryColor (which
does not exist) are replaced by the correct subsurfaceTheme.primaryColor.

Finally, an obvious copy/paste error width: childrenRect.height. that
is supposed to be width: childrenRect.width.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-19 21:52:22 +09:00
Jan Mulder
619fbaf1e2 QML UI: Allow cancel of ongoing download
This commit adds the capability to cancel a running download from DC.
The actual cancel is fully handled in the underlying libdivecomputer
code. As the user may be interested in the dives downloaded up to
the moment of cancel, do not just close the download screen (as
it was before this commit). Now, the <quit> button changes to
<cancel> when the download is started, and pressing cancel, only
cancels the download and does not close the download screen, but
presents the so far downloaded data. When no download is running,
the <quit> button just quits the screen as before.

Fixes: #485

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-19 21:49:37 +09:00
Dirk Hohndel
bb3387f234 QML UI: Download from DC: remove Bluetooth checkbox
The connection already clearly defines whether this is Bluetooth or not.
No reason for the separate checkbox.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-18 00:49:31 -07:00
Dirk Hohndel
0104d7444e QML UI: Download from DC: smaller font for connection
Also style all three drop downs the same (otherwise the left edge of the
text doesn't align).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-18 00:49:31 -07:00
Dirk Hohndel
025efc12d4 QML UI: remove the Paired Bluetooth Devices virtual vendor
We now actually handle connections in a sane manner and don't need
that workaround anymore.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-18 00:49:31 -07:00
Dirk Hohndel
695be281c0 QML UI: automatically set the Bluetooth checkbox
I wonder if we even need this anymore at all as the connection
clearly determines whether this is a BT download or not.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-17 07:36:44 -07:00
Dirk Hohndel
ec1b22b487 QML UI: only change connection when finding a match
If we can't find a match, just leave it unchanged. This way, if we
mis-recognize a device, the user can correct the product (or even
vendor) without losing the correct connection.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-17 07:35:22 -07:00
Dirk Hohndel
40223c8a5f QML UI: show the connection choices in Download UI
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-16 21:53:44 -07:00
Dirk Hohndel
b7b2e813ad QML UI: only offer BT checkbox if BT is available
Right now we need to restart Subsurface-mobile in order to detect
Bluetooth devices - so simply turning on BT after Subsurface-mobile was
started is not sufficient.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-12 04:16:39 -07:00
Dirk Hohndel
6422932c61 QML UI: correctly wrap devinfo message
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 21:11:37 -07:00
Dirk Hohndel
9111ce01e7 QML UI: show progress messages on the download page
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 16:07:48 -07:00
Dirk Hohndel
8e0895e429 QML UI: Download from DC: disable misleading UI elements
These buttons only work when we successfully downloaded a dive. Also, don't
show a list of dives when there are no dives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 16:07:03 -07:00
Joakim Bygdell
4c4b72853c QML UI: Style the BT download checkbox
Style the checkbox to the themes primary color

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-09 03:06:04 +09:00
Joakim Bygdell
b9a05e501b QML UI: Style DC download buttons
Style the button in the DC download dialog so they follow
the theme colors.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-09 03:06:04 +09:00
Dirk Hohndel
77f545b38e QML UI: Download from DC: move accept button to the right
So it doesn't conflict with the hamburger menu button / opening the
global drawer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-25 16:12:45 -07:00
Dirk Hohndel
4963b27f52 QML UI: Download from DC: avoid assignments of undefined values
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-25 16:12:07 -07:00
Dirk Hohndel
fc2ca3a804 QML UI: DC Download progress indicator
For now just do an indeterminate busy indicator - we can get more fancy
and use the libdivecomputer progress event, later.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-25 15:52: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