Commit graph

45 commits

Author SHA1 Message Date
Dirk Hohndel
43798702ff Only enable Bluetooth support if building against Qt5.4 or newer
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>
2015-07-20 09:35:00 -07:00
Claudiu Olteanu
dff4e5f33e Add a dialog for remote Bluetooth devices selection
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-06 08:36:42 -07:00
Claudiu Olteanu
b4c4d95ea4 Add a checkbox and a button for Bluetooth download mode
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-07-06 08:34:39 -07:00
Dirk Hohndel
578e9c22af Dive d/l selection UI: clear table when retrying
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-11 07:46:21 -08:00
Dirk Hohndel
762f33bd13 Dive d/l UI: redo the states, the flow, the buttons
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-09 15:06:25 -08:00
Dirk Hohndel
a92484e4ed Dive d/l selection UI: remove setData() method
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-09 12:42:09 -08:00
Dirk Hohndel
80af8e7fa2 Dive d/l selection UI: update checkmark state correctly
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-09 12:42:09 -08:00
Dirk Hohndel
0dd8d11a18 Dive d/l selection UI: hook up select / unselect all
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 12:54:53 -08:00
Dirk Hohndel
e6b5a00e35 Dive d/l selection UI: allow clicking anywhere in a row
It seemed silly to only be allowed to click the tiny checkbox.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 11:39:34 -08:00
Dirk Hohndel
d143527732 Dive d/l selection UI: show reasonable column headers
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 10:12:43 -08:00
Tomaz Canabrava
f5f0938d8c Dive d/l selection UI: Add method to remove unused dives
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-08 07:46:41 -08:00
Tomaz Canabrava
25323c2717 Dive d/l selection UI: Hook up OK button
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-08 07:45:58 -08:00
Tomaz Canabrava
09d6d4f5de Dive d/l selection UI: Create a button to download the data from DC
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-08 07:45:30 -08:00
Tomaz Canabrava
f8af0239ce Dive d/l selection UI: Set the item flags
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-08 07:43:38 -08:00
Tomaz Canabrava
797bf49129 Dive d/l selection UI: Add the setData method
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:43:01 -08:00
Tomaz Canabrava
55cc16d77d Dive d/l selection UI: Add the check states
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 07:42:25 -08:00
Tomaz Canabrava
db367ae0a2 Dive d/l selection UI:: Add skeleton for the dialog
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>
2015-01-08 07:40:33 -08:00
Dirk Hohndel
52084c80f7 Move OSTC firmware check around a bit
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-12-27 08:31:51 -08:00
Tomaz Canabrava
89816f64c2 Headers cleanup.
Too much noise on the headers, this commit remove uneeded
headers when they are uneeded.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-26 15:47:02 -07:00
Anton Lundin
d14a531510 Rework slot to quiet down Qt5 warning
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>
2014-05-26 06:25:00 -07:00
Dirk Hohndel
047032ee46 Divecomputer download: try to offer only those devices that make sense
If the user selects a Uemis divecomputer, don't show serial devices.
If the user selects a serial divecomputer, don't show the Uemis
filesystem.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-19 20:12:55 +09:00
Dirk Hohndel
76e6420f6b Massive automated whitespace cleanup
I know everyone will hate it.
Go ahead. Complain. Call me names.
At least now things are consistent and reproducible.
If you want changes, have your complaint come with a patch to
scripts/whitespace.pl so that we can automate it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27 20:09:57 -08:00
Dirk Hohndel
48c4c21b9f Implement the '...' search button for Uemis dive computers
Right now the search button isn't connected for any device (clearly an
oversight). At least for the Uemis I think I have a sane implementation of
what that should do.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-18 17:20:35 -08:00
Boris Barbulovski
ccb1c33d02 Put include guard to every header
* ensure include guard to every header
* comment endif guard block

Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11 12:37:01 -08:00
Boris Barbulovski
a3d82bf9b1 Update #include statement for QStringListModel
Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11 12:36:53 -08:00
Boris Barbulovski
449c6fc6f2 DownloadFromDCWidget class cleanup
Remove static DownloadFromDCWidget::instance() method

Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-09 08:17:08 -08:00
Benjamin
31854f50a4 Disable DC device node if it is not needed
This patch disables/enables the DC device node based on what type of
transport the selected DC uses. The only time the device node field is
used is if the selected DC uses a serial transport type. IrDA and USB type
transports do not use the device node.

Signed-off-by: Benjamin Fogel <nystire@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-27 11:04:35 -08:00
Dirk Hohndel
5fca06c9e6 Display warning that dives won't be downloaded when enabling libdc dump
The warning is only shown once per session.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-26 09:18:57 -08:00
Dirk Hohndel
d42cc5a40c Enable libdivecomputer log or dump from the UI
Pick filenames for these functions as they are selected.
Use the windows-safe fopen function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-24 16:26:00 -08:00
Lubomir I. Ivanov
819bd109e5 downloadfromdivecomputer.h: remove a forward declaration
The forward declaration of 'struct device_data_t' is not
needed as it already comes from '../libdivecomputer.h'.

Reported by the program cppcheck.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11 16:30:10 +01:00
Dirk Hohndel
50a1ed8d6e When the user cancels a download, reject already downloaded dives
This seems like the more logical behavior, anyway. Cancel means you didn't
want the result...

Fixes #341

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 06:33:46 +01:00
Thiago Macieira
8e81d3f100 Make the classes generated by uic be real members of our classes
This means we don't have to new/delete them, which is a waste of
overhead.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 12:13:48 -07:00
Thiago Macieira
f0f76056ac Include the ui_*.h headers in the main headers.
This means we can also remove the forward declarations.

This is the first step in removing the memory allocation for the ui
sub-classes. Without the second step, this commit is just making the
compilation time increase for no good reason :-)

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03 12:13:15 -07:00
Danilo Cesar Lemes de Paula
a8d33f80b0 implement device probe in C
It's an attempt to build auto-completion for the dive-computers
based on unpublished code inside libdivecomputer[1]

[1] -
http://git.libdivecomputer.org/?p=libdivecomputer.git;a=commitdiff;h=d44053a99435fb9fc1f408fb3f1629a54c938afc

Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
2013-09-16 22:40:47 -03:00
Danilo Cesar Lemes de Paula
3f8e183008 improve DownloadDialog's error handling
shows an error message when libdivecomputer returns
an error.

Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
2013-09-10 14:45:25 -03:00
Danilo Cesar Lemes de Paula
59da382613 improve DownloadDialog UI control
* Removes the InterfaceThread
  which is basically an unecessary proxy between the MainThread and
  the DownloadThread.

* Use a state machine to control the DownloadWidget UI logic.

Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
2013-09-10 14:45:25 -03:00
Danilo Cesar Lemes de Paula
ab649e21ba fix DownloadDialog behavior
The DownloadDialog behavior was broken in a way it allows the user
to make changes on the dialog while the download is happening.

Also, clicking on "Cancel" breaks/hangs the UI sometimes, as libdivingcomputer
doesn't always cancels the download right away. That's a bug that
still needs to be fixed.

Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
2013-08-29 19:20:34 -03:00
Dirk Hohndel
07a16574e9 Consistently use slots / signals
We started out using Q_SLOTS and Q_SIGNALS but then changed our mind.
Let's make this consistent again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-06-19 10:20:56 -07:00
Dirk Hohndel
2a4d981d09 Fixed running the Download dialog multiple times
We never reset the 'downloading' variable.

Solved-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-30 18:21:08 +09:00
Dirk Hohndel
f32e86eb32 Hook up the Download dialog
The download already worked, but we didn't display the new dives. This
introduces a new slot for MainWindow that updates what is displayed in
Subsurface after files were imported.

With this change we can successfully download ONCE - but when trying to
download a second dive the dialog doesn't appear to get refreshed the
right way - the OK button doesn't appear to work anymore (Cancel however
does).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-30 18:02:29 +09:00
Dirk Hohndel
115e5e5fbc The never ending, futile fight for whitespace consistency
I just need to write a tool that does this...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22 21:31:45 -07:00
Dirk Hohndel
246fbd0333 Implement rudimentary divecomputer download
Small changes to the names of elements the divecomputer download UI and
very simplistic first stab at populating the device_data_t structure.

This is lacking lots of things
- it should remember the last vendor / product used
- it should figure out which device (mount point) to offer
- it needs proper error handling

But it's a step in the right direction.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-20 21:55:56 -07:00
Tomaz Canabrava
f4acbb02e4 Populate the Vendor && Dive computer information.
This uses the QStringListModel to populate the items
of the QComboBoxes. I used a QHash to hold every Computer
of a particular Vendor. so, products[vendor] gives me
the full list of products from each vendor.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-20 17:58:06 -03:00
Tomaz Canabrava
a542b25bde Added code to cancel the thread.
I think it's self explanatory - When user clicks on
'Cancel', the interface will wait for the trhead to quit
then will close itself.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-20 17:02:17 -03:00
Tomaz Canabrava
c7a5d0490f Skeleton code for a non-blocking UI thread for downloading dives from the DC
This is the skeleton code for a non-blocking ui-thread
It already creates the first-thread ( 'do not block the ui' )
and the second thread ('download from the dive computer')
We can in the future merge both in the same place - I didn't
want to do that now because the download function is written
in the libdivecomputer.c code, and I cant just transform that
to a QThread and use signals, so I used two threads for that.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-20 16:43:33 -03:00