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>
This is some very early and hacky code to be able to access BLE-enabled
dive computers that use the GATT protocol to send packets back and forth
(which seems to be pretty much all of them: a vendor-specific GATT
service with a write characteristic and a notification characteristic
for reading).
For testing only. But it does successfully let me download dives from
my EON Steel and my Scubapro G2.
NOTE! There are several very hacky pieces in here, including just
"knowing" that the write characteristic is the first one, and the
notification characteristic is second. The code should actually check
the properties rather than have those kinds of hardcoded assumptions.
It also checks "vendor specific" by looking at the UUID string
representation, and knowing that the standard ones start with zero.
Crazily, there doesn't seem to be any normal way to test for this,
although I guess that maybe the uuid.minimumSize() function could be
used.
There are other nasty corners. Don't complain, send me patches.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Restyle construction of toast message and enable translation for it.
Further, removed newline characters as they break the lines at
non-logical positions.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
I don't know why we are setting lastIndex to -1. That seems odd.
But for now this workaround will have to do.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Let's have names for the colors in each theme and assign those
named values to the theme colors when switching themes. This
way other pages can access the colors that are not in the current
theme (for example for a theme switcher).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This code is based on code from Marco Martin from the Kirigami Android
sample app. In order to simplify the QML code the QMLManager function is
there for all OSs, but it's a no-op on anything but Android.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of being "custom serial", it's a IO model that allows serial or
packet modes, independently of each other (ie you can have a bluetooth
device that does serial over BT rfcomm and packet-based communication
over BLE GATT with the same serial operations that describe both cases).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This way in the en_US locale we no longer get shown the odd "dive(s)"
and instead get correct singular and plural forms.
Most of the patch is just a reindentation as it removes the if clause
that used to do the special case of NOT loading a translation for the
en_US case.
Right now we start with a trivial en_US translation file. My guess is
that this will be overwritten once we do the next round of "new strings,
new translations".
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Currently, only a small number of dive computers can be downloaded from
the mobile app. Only present the supported ones to the user. So, currently
restricted to classic BT. Not sure about FTDI support at this point.
Version 2 of the same commit after review from Dirk. Fundamentally,
support is as follows: Android: BT, BLE, and FTDI. iOS: BLE only. For
all other OSses, this commit has no changes. As the BLE backend is
not yet ready, no support on iOS yet.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
I don't quite understand why this isn't correctly substituted to lrand48()
by the header file, but patching it in the source is easy enough.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Way back in time this code was copied from downloadfromdcthread, so
de-duplicate and call that code instead.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
6963b52d introduced a cmake option, COMMANDLINE to enable building a
pure command line version of smtk2ssrf importer, but then the
#define COMMANDLINE=1 forces building CLI mode.
This patch allows building GUI or CLI versions depending on selection of
the COMMANDLINE option.
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
This way the user can scroll up the page to see all of the notes without
having them covered by the action button.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Occasionally I see errors in the log where we would access modelData.dive
with modelData = null. This patch addresses a couple of the spaces where
this happens, but also simplifies the code by using the existing alias.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
By making the assignments to the Kirigami Theme colors Qt bindings
things get correctly updated when switching.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>