Commit graph

3653 commits

Author SHA1 Message Date
Tomaz Canabrava
68053a1150 Close the dive site edit when accepting/rejecting it
Return to the default mainwindow state when the user accepts
or rejects the dive site edit.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25 13:52:33 -07:00
Tomaz Canabrava
1aaa37e511 Re-enable the dive site edit
Since now we found the perfect way to deal with dive site handling on the
dive, we can reenable this widget.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25 13:51:44 -07:00
Dirk Hohndel
a05e37188b QML UI: make sure the dive list is empty before loading dives
When testing subsurface-mobile on the desktop from an account that had a
default file set up in the Subsurface preferences that file would already
be loaded creating rather confusing output.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-24 13:18:30 -07:00
Rick Walsh
292982cdd5 Spell rebreather with an h
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-24 09:43:24 -07:00
Dirk Hohndel
9a68e356af Make password change asynchronous
This isn't perfect (if you make multiple requests things could go badly),
but it's better than just slapping the new password into the settings,
even if the update failed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 15:06:57 -07:00
Miika Turkia
aa9c2b7384 Add sample pressure to be auto-filled on Seabear import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:57:47 -07:00
Miika Turkia
f4799e67b8 Always use "csv" parsing for Seabear
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:22:12 -07:00
Miika Turkia
0a69c35501 Strip unit from Seabear sample interval value
XSLT parsing treats this as numeric value, thus we need to strip out the
" s" part.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:22:05 -07:00
Miika Turkia
c9a98a4f7b Add a known type for second DC on APD import
This patch adds importing of sensor values from the second DC on APD log
import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:21:50 -07:00
Miika Turkia
ac4871c699 Import sensor values for autodetected APD files
If APD Log Viewer format is automatically detected, we should set the
sensor values to be imported properly. These need to be added to the
firstline and since we convert the number 2 from column headers to
subscript, this step must be skipped for the APD import.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:21:43 -07:00
Miika Turkia
bf45eddceb CSV import test wrong values
We need to test for the sensor values on CSV import, not the po2.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:21:34 -07:00
Miika Turkia
6ab87a7420 Clean hard coded values on divelog CSV import
Hard coding the values of known imports is quite awkward if we add
these. Thus switching to use enum and names instead.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:21:16 -07:00
Dirk Hohndel
ce008f52db Cloud storage: enable password update
This now allows the user to set a new password for the cloud service.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:10:40 -07:00
Dirk Hohndel
3ba3de8daf Add UI for cloud password change
This isn't hooked up yet, just the UI elements.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 07:34:36 -07:00
Miika Turkia
b28517b9b0 Add setpoint support for CSV import
The import of setpoint values is tested with Seabear data.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-21 07:34:24 -07:00
Miika Turkia
19b54dc9ef Default to first tab on export
The divelog export dialog was changed to default to the HTML export when
changing the layout to resemble other dialogs (commit 42acaa40).
However, the default tab should be the first one with most of the export
formats and options.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-21 07:33:31 -07:00
Tomaz Canabrava
8856753faf Use correct colors on selection
I was wondering why the colors where wrong on mac, it took
me a while to find the correct spot to fix. It seems that
the Brush is not used to paint the fonts, but the Pen is.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 21:43:20 -07:00
Tomaz Canabrava
e8d4bdff59 Try to fix paint issues on windows
Davide complained about a flickr on windows, I think it
has to do with the QPainter now knowing the right
size of it's paint rect. this should fix it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 21:43:03 -07:00
Tomaz Canabrava
ae03ece7fa Code uneeded because the drawControw does this by itself
Removing dead code. the call above this does that already.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 21:42:44 -07:00
Miika Turkia
4b09cd469e Add tooltip for geolocation lookup
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 10:37:30 -07:00
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
Dirk Hohndel
947fda14c5 Bluetooth support: quick build fix for Qt5.2
The InvalidBluetoothAdapterError error code wasn't introduced until Qt5.3,
so let's not test for it on older versions of Qt.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 07:09:07 -07:00
Dirk Hohndel
e3a8ff7493 Merge branch 'custom-print' of github.com:neolit123/subsurface 2015-07-20 06:14:19 -07:00
Claudiu Olteanu
6608b4c7a9 Update the message shown on pairing erorrs
Advice the user to use his operating system for the pairing
step if the remote device requires a custom PIN code.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 05:52:10 -07:00
Claudiu Olteanu
5fd0c7dd43 Fix typos on Bluetooth selection widget
Fix "lable" typos from Bluetooth selection widget.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 05:52:10 -07:00
Claudiu Olteanu
aaf61c52d8 Hide the local BT combobox if there is only one device
If there is only one local Bluetooth adapter, then hide the
selection combobox and the label.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 05:52:10 -07:00
Claudiu Olteanu
8d2b6142c6 Don't close the BT selection Widget if the local BT adapter is invalid
Don't close the Bluetooth selection widget if the default local
Bluetooth adapter is invalid. Maybe there is a problem with the default
Bluetooth device and the user has another one (a BT dongle) which can be used.

If the selected device is invalid then update the UI information,
disable the available buttons and announce the user about the problem.
Also move the device changed logging message before we call the
update information method. In this way the logging message with
the problem will not be overwritten.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 05:39:43 -07:00
Claudiu Olteanu
5ccf3e81eb Log errors which occur during Bluetooth device discovery
Register to the signal emmited when an error occurs during
Bluetooth device discovery and log a description of the
error which can be used to identify problem's cause.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 05:39:43 -07:00
Claudiu Olteanu
0cf5214c15 Reinitialize the BT discovery agent when a new adapter is selected
Reinitialize the Bluetooth device discovery agent when the user
selects a new local Bluetooth adapter using the address
of the selected device.

Before this patch the agent was always using the local default
Bluetooth adapter.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 05:39:43 -07:00
Claudiu Olteanu
b5ac3a3fa8 Add combobox for Bluetooth local device selection
Add a combobox which can be used to list/select the available
local Bluetooth devices. In this way, if a user has more
than one local Bluetooth devices (integrated, dongles, etc.)
he can choose which one he wants to use.

Before this patch, only the default local Bluetooth device
could be used.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 05:39:43 -07:00
Claudiu Olteanu
000c202d7d Don't block the save button for Bluetooth device selection
After commit 619e97ee4f ("Stop the SDP agent if the Clear/Save button
was pressed") we don't need to block the save button anymore for scanning
completion because the SDP agent will be stopped manually if the Save
button was pressed.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 05:38:56 -07:00
Gehad elrobey
1ae1a11c22 Printing: add default case to switch
Add default case to fix switch warning.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:45 +03:00
Gehad elrobey
7575bb169b Printing: change 'Discard' to 'Cancel' button
Cancel button is more relevant to the dialog message.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:42 +03:00
Gehad elrobey
f8f6453988 Printing: add custom color palette
We can use custom color palette to edit current color palette.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:40 +03:00
Gehad elrobey
ed09b80c12 Printing: save custom color palette to QSettings
- save custom colors to QSettings.
- load custom colors from QSettings.
- set almond color palette as default palette.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:26 +03:00
Gehad elrobey
e1dda8df63 Printing: implement edit buttons in color tab
Add button group and attached edit buttons to it.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:23 +03:00
Gehad elrobey
ad531c25fb Printing: show colors in edit tab
- Add default color struct
- Init the color struct with default colors
- Show color text in labels
- Preview colors

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:20 +03:00
Gehad elrobey
dcedc8ebea Printing: add colors tab to edit window
Select custom colors for print templates, by default there are
five colors that can be used dynamically in prints.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:17 +03:00
Gehad elrobey
18282aa30e Printing: update preview on field changes
- Trigger re-rendering on the QPixmap if fields changed.
- Change template selection to custom if template text changed.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:15 +03:00
Gehad elrobey
d705cb34bb Printing: update preview on apply settings
On update call Printer to render on the QPixmap.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:12 +03:00
Gehad elrobey
f1615e725c Printing: add apply button to TemplateEdit class
Add apply button to the dialog, Update the preview after applying
the new settings.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:10 +03:00
Gehad elrobey
7ca311ae85 Printing: save only if data is changed in template_options
Check if data is changed before saving the new settings.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:07 +03:00
Gehad elrobey
d4382c7c4b Printing: add preview to TemplateEdit dialog
Show QPixmap in QLabel, Use Printer class to render the Preview on
the QPixmap.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:03 +03:00
Gehad elrobey
3a69638366 Printing: check for different printing modes
Add PRINT/PREVIEW print modes, check for printing modes before
casting.

We must pass a QPaintDevice with type QPixmap for previewing and
with type QPrinter for actual printing.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:27:56 +03:00
Gehad elrobey
c90d5b891d Printing: show confirmation message before overwriting the template
Before overwriting the new template show confirmation message.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:27:23 +03:00
Claudiu Olteanu
8f8002b8d1 Use itemClicked signal instead of itemActivated for BT device selection
On Android platforms the system is configured to raise the
itemActivated signal when the user double clicks an item.
Since the items are small it is pretty hard to double click
them. Therefore use the itemClicked signal instead of the
itemActivated signal.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-19 05:50:33 -07:00
Claudiu Olteanu
619e97ee4f Stop the SDP agent if the Clear/Save button was pressed
If the Cancel button was pressed then we should stop the
SDP agent. The same thing happens when the Save button
was pressed. We don't need to add new BT remote devices
to the list if the widget was closed or if the list with
the discovered BT devices was cleared.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-19 05:50:08 -07:00
Dirk Hohndel
05109b2d6c Don't hide location completion when user types space
Odd that I never noticed this until several people pointed it out to me.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-18 13:39:19 -07:00
Dirk Hohndel
bd4629b293 Add nr of dives at the site to completion string
I'm not convinced that this is useful enough to keep, but let's give it a
try and see what people think.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-18 13:34:05 -07:00
Dirk Hohndel
021a151f03 Location completion: remove space between '~' and distance
Just a minor visual improvement.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-18 13:06:33 -07:00