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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
I cannot reproduce the problem, but adding one more call to
unselectDives() should ensure that all dives are marked as not selected
before selecting the last dive that was downloaded.
See #620
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Qt5 got confused about this slot. This does the same as previously but
gets Qt5 happy.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>