If we detected a BT dive computer, we can already set up the vendor and
product for it (as well as the new BT checkbox).
Oddly, in my tests this doesn't set up the product correctly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we find something that looks like a known BT dive computer, set
things up so that we can use it later. If multiple dive computers are
found, simply use the first.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A delegate to display the dives in a better way,
based on the code from DiveList.qml
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
So far all this does is list all the BT devices that it finds
(and I worry if this will have negative battery implications
on a mobile device), but this should allow us to connect to
a standard BT dive computer (but that will of course require
more code to pick the right device).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way they get correctly prepared and derived data fields
get populated. For example, the dive number gets updated if
these are indeed the newest dives.
Fixes#408
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I noticed this in the mobile download code when fixing an unrelated
issue - and then realized that the same was true in the desktop app
as well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The linear search to determine that a just downloaded dive was already
downloaded, started from the oldest dive in the logbook. It is, however
more likely that a just downloaded dive is one of the most recently
downloaded. So, just search backwards. Just a trivial performance
improvement.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Searching why the mobile app also downloads pre existing dives, it appears
that in the mobile app, the preexisting attribute is 0, where it should be the
number of dives before the download. This is easily solved by adding the correct
setting on the download thread. This solves the issue of downloading pre existing
dives.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
When (with mobile on desktop) loading from DC is called and the dive computer
to connect to is not in download mode, the repopulate() function is called
with an empty dive table. This trips the assert (obviously, debug compile only) in
DiveImportedModel::setImportedDivesIndexes(). This simple fix makes things just
more robust.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This already takes into account which of those dives were selected.
Right now all we have is select all or none - this needs actual support
in the UI, but once that's there, it will just work (famous last words).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Commit dec47e11cd introduces a SIGSEGV in case the user has Bluetooth
download selected from its previous sessions. Accessing the "Import from
dive computer" crashes immediately. Reverting a small part of commit
dec47e11cd solves this.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Still to do:
- select the dives to save
- record the downloaded dives
but download is already working. :)
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For this I had to also make the DCDeviceData accessible,
and for that it needed to be a pointer.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Set the descriptor when starting the thread, this removes
code from the desktop code and makes everything in sync always.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Those variables should have local scope, not class scope.
We are using it only inside of pickDump/LogFile metohds.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Keeping the Desktop and QML versions of Subsurface
using the same codebase will keep the code saner,
this change makes the Desktop version use the
DCDeviceData helper sturct that encapsulates
the device_data_t member for easy access on the
QML. This also helped move a bit of initializations
from the UI to the Core - and that's always good.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
this class encapsulates the device_data_t from libdivecomputer
in a way that permit us to use it on QML.
this will be needed to prepare the data for the download thread.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a new action on the drawer to display the
Download from Dive Computer options. Nothing works yet.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
fill_computer_list() creates a Qt friendly
structure that contains all of the necessary
information about dive computers and it's
devices, and it's needed both in Qml and Widgets
to allow the user to download their dives.
This patch makes it possible to use the code
in QML without duplication.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is important to not duplicate code for the Qml
view. Now the DownloadFromDiveComputer widget is mostly
free from important code (that has been upgraded to the
core folder), and I can start coding the QML interface.
There are still a few functions on the desktop widget
that will die so I can call them via the QML code later.
I also touched the location of a few globals (please, let's
stop using those) - because it was declared on the
desktop code and being used in the core.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The *_VERSION_STRING variable has been deprecated in Qt since 5.1.0. Use
the non-deprecated variable instead (which is not a string).
Qt 5.9.0 has a bug in the deprecated variable. Since it's deprecated,
it's probably not going to be fixed until 5.9.1. See
https://bugreports.qt.io/browse/QTBUG-60936
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Replace the figures in the user manual section that deals with preferences
selections.
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Corrected problem where dive profiles would include post dive
surface interval samples.
Added detection for corrupt dives.
Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
First, Ministro (an app to help installing Qt dependencies on
the mobile platform) is not needed in Subsurface context, as all
dependencies are part of the distribution. Secondly, it breaks the
build as the strings (removed here) are also defined in Qt, and
apparently the Gradle build is detecting this double define.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
The used cmake toolkit for building the Android Subsurface-mobile app
(qt-android-cmake) recently moved away from compiling with Ant in favor
of Gradle. The most recent Android SDK will not support Ant any more.
This calls for the addition of the Android SDK BUILDTOOLS_REVISION define
to the cmake of Subsurface-mobile. Without this, the build will fail.
The value has to be set to an existing directory in
.../android-sdk/build-tools/
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>