summaryrefslogtreecommitdiffstats
path: root/qt-ui/downloadfromdivecomputer.cpp
AgeCommit message (Collapse)Author
2015-10-07Bugfix for checkboxes in DC download window GUI repaint delay.Gravatar pestophagous
Bug was due to incorrect use of QAbstractItemModel::index. The arguments should be in (row, col) sequence but we were mistakenly passing in (col, row). Fixes #820 Signed-off-by: K. Heller <pestophagous@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-19Uemis downloader: start downloading using the correct dive IDGravatar Linus Torvalds
The logic to pick the initial dive ID for the uemis downloader was very confused, and did not work at all when restarting a download when the Uemis filled up, and the "Force download all dives" flag was set. It also required a rather odd Uemis-specific callback from the download UI because of how it picked the initial ID. This changes the logic to just look at the list of downloaded dives when restarting, which simplifies the logic a lot, gets rid of the odd special callback, and also means that the whole "Force download" issue just goes away. It seems to work now. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-08Only use DC_TRANSPORT_* with SSRF_CUSTOM_SERIALGravatar Anton Lundin
This if'defs DC_TRANSPORT_* use with SSRF_CUSTOM_SERIAL, because the enum doesn't exist when building against stock libdivecomputer. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-08Disable Bluetooth option from GUI if SSRF_CUSTOM_SERIAL is undefinedGravatar Claudiu Olteanu
The Bluetooth implementation doesn't work if SSRF_CUSTOM_SERIAL is undefined. Therefore it is a good idea to remove it from the UI if the libdivecomputer version is wrong. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-07Reset the index of the device if the Bth mode is disabledGravatar Claudiu Olteanu
If the Bluetooth download mode was disabled then remove the Bth address from the device or mount point section and reset the index. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-07Save Bluetooth download mode settingsGravatar Claudiu Olteanu
Save the dive computer download mode flag. In this way, if the user used Bluetooth mode to download its dives on his last session he doesn't need to open the Bth selection dialog if he wants to use the same device. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-05More style and readability changesGravatar Tim Wootton
Changes to capitalisation to comply with coding style Changes to make some blocks of english sound a bit better Signed-off-by: Tim Wootton <tim@tee-jay.org.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-02Translate strings for Bluetooth download modeGravatar Claudiu Olteanu
Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20Use the address of the BTH device if its name is emptyGravatar Claudiu Olteanu
There are moments when the name of the device is not collected properly and it is unavailable. Instead of showing an empty string then print the address of the device. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20Only enable Bluetooth support if building against Qt5.4 or newerGravatar Dirk Hohndel
Also remove the quick hack from commit 947fda14c5d1 ("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>
2015-07-06Add a dialog for remote Bluetooth devices selectionGravatar Claudiu Olteanu
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>
2015-07-06Add a checkbox and a button for Bluetooth download modeGravatar Claudiu Olteanu
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>
2015-05-29Fewer rebuilds triggered by changes in models.hGravatar Tomaz Canabrava
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>
2015-05-21Merge branch 'v4.4-branch' into newmasterGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-30Uemis downloader: clean up the path for Windows mount pointGravatar Dirk Hohndel
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>
2015-04-30Uemis downloader: allow continuing download by clicking RetryGravatar Dirk Hohndel
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>
2015-04-30Download dialog: we can accept a partial download after an errorGravatar Dirk Hohndel
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>
2015-04-20Uemis downloader: allow continuing download by clicking RetryGravatar Dirk Hohndel
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>
2015-04-20Download dialog: we can accept a partial download after an errorGravatar Dirk Hohndel
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>
2015-02-22Revert "Update Qt4 patch"Gravatar Dirk Hohndel
This reverts commit 762315e7eef47c1a5357e9c8691676707e3c630e. Oops, this was supposed to update the patch, not update and apply it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-19Update Qt4 patchGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-15downloadfromdivecomputer.cpp: fix initializer list order warningGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove the ProfileWidget from mainwindow.uiGravatar Tomaz Canabrava
It is now in mainwindo.cpp Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove the DiveList from the mainwindow.uiGravatar Tomaz Canabrava
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>
2015-01-26Fix crash when no dives were selected for downloadingGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-26Fix (un)selecting of downloaded divesGravatar Miika Turkia
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>
2015-01-17Clean up the header filesGravatar Dirk Hohndel
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>
2015-01-13Dive download UI: sort the dive computer dropdownGravatar Dirk Hohndel
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>
2015-01-13Attempt a better layout for the download dialogGravatar Dirk Hohndel
This seems to work well and provides a lot less wasted space. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-11Dive d/l selection UI: clear table when retryingGravatar Dirk Hohndel
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>
2015-01-09Dive d/l UI: redo the states, the flow, the buttonsGravatar Dirk Hohndel
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>
2015-01-09Now use our table when downloading from the dive computerGravatar Dirk Hohndel
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>
2015-01-09Add a private table for downloaded divesGravatar Dirk Hohndel
This still isn't actually used, just puts it in place. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09Dive d/l selection UI: remove setData() methodGravatar Dirk Hohndel
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>
2015-01-09Dive d/l selection UI: fix the row count rangesGravatar Dirk Hohndel
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>
2015-01-09Dive d/l selection UI: update checkmark state correctlyGravatar Dirk Hohndel
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>
2015-01-09Dive d/l selection UI: the indices are inclusive, allocate enough spaceGravatar Dirk Hohndel
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>
2015-01-09Dive d/l selection UI: only allow one download for nowGravatar Dirk Hohndel
We may reconsider this as this might replace the Retry function that's currently completely broken. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09Dive d/l selection UI: don't setup the model if there are no divesGravatar Dirk Hohndel
Setting things up for zero dives will cause all kinds of weird corner cases. Just don't do it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Use setEnabled() instead of setDisabled()Gravatar Dirk Hohndel
I don't like mixing setEnabled() and setDisabled()... let's just always use setEnabled(). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: hook up select / unselect allGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: allow clicking anywhere in a rowGravatar Dirk Hohndel
It seemed silly to only be allowed to click the tiny checkbox. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: fix more array access errorsGravatar Dirk Hohndel
The checked array is zero based, reflecting the rows shown. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: brute force size optimizationsGravatar Dirk Hohndel
This is horrible, but it gets something in place and hopefully we can clean this up soon. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: show reasonable column headersGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Random whitespace cleanupGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: fix check if things were checkedGravatar Dirk Hohndel
Math is hard. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: close the dialog when doneGravatar Dirk Hohndel
This is where we need to call accept() Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: Only show checkbox on the first columnGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: disable OK until things are downloadedGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>