aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/downloadfromdivecomputer.cpp
AgeCommit message (Collapse)Author
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>
2015-01-08Fix missing return valueGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: show useful data in a useful formatGravatar Dirk Hohndel
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>
2015-01-08Dive d/l selection UI: don't close the dialog when we're done downloadingGravatar Dirk Hohndel
The whole point is that we then want to pick and choose which dives to add to the divelist. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: Only try to get the dive list if d/l succeededGravatar Tomaz Canabrava
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>
2015-01-08Dive d/l selection UI: Remove unused variableGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: Add method to remove unused divesGravatar Tomaz Canabrava
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>
2015-01-08Dive d/l selection UI: Hook up OK buttonGravatar Tomaz Canabrava
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>
2015-01-08Dive d/l selection UI: Create a button to download the data from DCGravatar Tomaz Canabrava
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>
2015-01-08Dive d/l selection UI: Fill the checked vector as trueGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: Set the item flagsGravatar Tomaz Canabrava
Now the user can click on the dives that they want to keep. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: Add the setData methodGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: Add the check statesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: Display the downloaded dives in a tableGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI: setImportedDivesIndexes implementationGravatar Tomaz Canabrava
Here we list in the model what are our dives, inside the dive_table. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI:: Constructor, rowCount and ColumnCountGravatar Tomaz Canabrava
Add importedDivesIndexes and Data. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08Dive d/l selection UI:: Add skeleton for the dialogGravatar Tomaz Canabrava
So the user can remove the ones they don't like. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29Only check for update after successfull downloadGravatar Anton Lundin
We check that the logbook download didn't error out before checking if we should remind the user to upgrade the firmware. Otherwise we will check if whatever the current firmware version is, is greater than zero and always remind the user to upgrade the fw. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29Initialize members in the declared orderGravatar Anton Lundin
This closes a compiler warning. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Automatic OSTC firmware update: download file and try to installGravatar Dirk Hohndel
This successfully downloads the hex file. The actuall update of the OSTC fails before it gets started with a crash when the ConfigureDiveComputer object is created. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28OSTC firmware update prompt: use the stable changelog filesGravatar Dirk Hohndel
Heinrichs Weikamp is giving us stable URLs from which we can get the latest stable version. The parsing is a bit simplistic, but it seems to work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-28Progress towards automatic OSTC firmware updatesGravatar Dirk Hohndel
Better parsing of the website data, a simpe dialog that informs the user that they should upgrade their firmware. Still doen't call the right code path to DO the upgrade. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-27Move OSTC firmware check around a bitGravatar Dirk Hohndel
This rearranges the code so we can call it from the download dialog and tell the user if there is a newer version of the firmware available. This needs a proper dialog and needs to be hooked up so that the user can accept the suggestion and go directly to the firmware update code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-12Pass the whole 'device_data_t' to the uemis downloaderGravatar Linus Torvalds
Not only does it make it look more like the libdivecomputer downloaders, but the uemis downloader needs it in order to support all the flags we have. Notably "download into private trip". Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-14Add "download into private trip" dialog checkmarkGravatar Linus Torvalds
This adds a checkbox for the divecomputer download dialog that allows you to tell the download to put the newly downloaded dives into a trip of their own. That in turn will disable the dive merging with any existing dives, which means that you will not mix up your newly downloaded dives with any old dives. That, in turn, is very convenient of you know that some of the dives were done by other divers (or from testing that happened during servicing etc), or the dive dates etc were wrong because the dive computer date had reset due to battery changes etc. Once you have all the dives in a private trip of their own, you can then fix them up (delete dives you don't want to merge etc), and then after all the data is ok you might want to merge the cleaned-up results with previous trips etc, and then manually ask subsurface to merge the dives or whatever. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>