Also remove the quick hack from commit 947fda14c5 ("Bluetooth support:
quick build fix for Qt5.2"). I should have thought this through before
pushing that commit, but oh well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Implement a dialog which can be used for remote Bluetooth devices
selection and to control the local Bluetooth device.
Functionalities of the widget:
- expose information about the local BT device
- scan for remote BT devices
- pair/unpair with a remote BT device
- turn on/off the local BT device
- logging
- save the selected BT device
The selection dialog is created when the bluetoothMode checkbox
is enabled.
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The checkbox will be used to enable the Bluetooth
downloading mode. The button will be used to create
a dialog selection where the user will be able to
scan and select remote devices.
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Models.h now is quite minimal, I'll keep it like that for now, until it
grows huge again. I've also cleaned a bit the headers that are using it so
only the ones that actually need the stuff that I've left behind will
actually include this file.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Oops, we left the (UEMISSDA) in the path. This can never have worked
without the user manually correcting it to just show the drive letter.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we run out of space in the Uemis filesystem we return an error. The
user could reasonably unplug the SDA, insert it again and then retry to
continue the download (that's what we tell them to do). In that case we
need to make sure we start at the correct dive otherwise the same dives
keep getting downloaded over and over again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The dialog didn't accept "OK" and store the dives downloaded / selected so
far if there had been an error. Especially with partial downloads from the
Uemis SDA this is something that is quite reasonable to want to do, so
allow exiting the dialog with OK even after an error.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we run out of space in the Uemis filesystem we return an error. The
user could reasonably unplug the SDA, insert it again and then retry to
continue the download (that's what we tell them to do). In that case we
need to make sure we start at the correct dive otherwise the same dives
keep getting downloaded over and over again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The dialog didn't accept "OK" and store the dives downloaded / selected so
far if there had been an error. Especially with partial downloads from the
Uemis SDA this is something that is quite reasonable to want to do, so
allow exiting the dialog with OK even after an error.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It's now set up from the mainwindow.cpp file.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Last index was not included in the selecting or unselecting the
downloaded dives.
Fixes#819
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Lots and lots and lots of header files were being included without being
needed. This attempts to clean some of that crud up.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I could have sworn we did this at some point. The vendors are already
sorted, but the products for each vendor should be sorted, too.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After a partial download (because the user hits cancel or because there
was an error, if the user hits Retry the list of dives downloaded so far
should be cleared because we will simply try to re-download the same dives
again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is bigger and more invasive then I wanted, but it's hard to break it
down into smaller pieces. Here's what it does:
The former "Download" button becomes the "Download", "Cancel download" and
"Retry" button. So this button controls your interaction with the dive
computer.
The other two buttons are now purely "OK" and "Cancel" for the dialog.
"Cancel" discards what happened (much easier now that we download into a
different table), and "OK" adds the dives that were selected in our
selection UI (by default all downloaded dives) to the real dive_table.
And while redoing all this, I also redid some of the state machine
underlying the dialog. The biggest change that the user will see is that
partial downloads (after canceling or after an error) will still offer the
dives that were completely downloaded up to that point in the selection
menu.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We pass a different table to libdivecomputer (and the uemis code) and have
that table filled. And then we simply copy the dives from that table into
the real dive_table when the user accepts the download.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we now track all clicks on the row, having the setData() actually
neutralized the action that we took on the clicked() signal.
Now you can select / deselect a dive, regardless where in the row you
click.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Yet another bug because the indices are inclusive. We need to start off
with the last being smaller than first and we need to adjust the row
count. It might be easier to just fix thing to make last be exclusive...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This fixes the issue where there was no visual feedback when clicking on
the second or third column in the grid. It would actually change the
checked state of the checkmark internally (and you would see the new state
once you clicked on another dive), but it wouldn't give immediate visual
feedback.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The array we allocated was one entry too small.
On the flip side, let's just make sure we cannot call this with a negative
range. That would be bad, too.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We don't get location data from the dive computer (at least not from
99.99% of the dive computers today). And we really need to show the data
in a human readable format.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This fixes a crash where we tried to get the data without actually having
downloaded anything.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This tries to relete from the dive list the dives that shouldn't be
imported.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Create an on_ok_clicked that will do the actuall parsing of choosen dives.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now, ok should close the dialog, and not download the dives from the DC,
this way the user can choose what happens.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>