Commit graph

8571 commits

Author SHA1 Message Date
Claudiu Olteanu
8c373f419d Use SPP's uuid to connect to a device on Apple platforms
Use the uuid of the Serial Port Profile service to connect to a remote
Bluetooth device on OS X (and iOS) platforms with a Qt version greater
than 5.5.0.

In the future the same section should be used for BT connectivity on
Linux platforms. Currently there is a problem with the SDP discovery
and it doesn't work as expected.

[Dirk Hohndel: modified OS check for consistency]

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-20 05:51:38 -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
599920c6cf Printing: export grayscale filter value to template
Export grayscale value to Grantlee template, So we must declare
print_options as QMetatype.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:29:05 +03:00
Gehad elrobey
d2bc70a570 Printing: add css filter to templates
Filter HTML body with grayscale value, add background-color to div
inside body so filter can be applied to it.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:59 +03:00
Gehad elrobey
cea79b4e0a Printing: transfer profile to QImage if grayscale
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:57 +03: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
c18e5ec795 Printing: make templates support custom colors
Use template_options colors instead of static colors.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:37 +03:00
Gehad elrobey
b67e06ee7b Printing: export color settings to grantlee
Export color palette selected to grantlee backend.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:28:34 +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
142fd950c8 Printing: change QPrinter to parent class QPaintDevice
Use general class QPaintDevice to be used for printing and
previewing instances, printing uses a QPrinter object while
previewing uses a QPixmap instance. We use static_cast to use the
needed object.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:27:41 +03:00
Gehad elrobey
4e1a5d954b Printing: refactoring printer class
- Render specific number of pages only.
- Move printer related code to print().

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:27:39 +03:00
Gehad elrobey
51e36fa158 Printing: handle memory leak in printer class
Don't initialize new webview each time we print.
Delete the QWebView object in the destructor.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:27:36 +03:00
Gehad elrobey
85bce0fa0d Printing: enhance the one_dive per page template
- fix the layout
- prevent the notes from expanding
- don't overflow the text

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:27:31 +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
Gehad elrobey
c56b1c1114 Printing: overwrite the old custom template file
Change the new file size after inserting the new template to overwrite
the old one.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-20 15:26:41 +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
Anton Lundin
db0da1656d Remove now unneeded define
This removes the extra Q_OS_ANDROID define to prevent a redefined
warning.

Somehow, the qt headers didn't define Q_OS_ANDROID previously, but how
does.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-18 06:40:04 -07:00
Dirk Hohndel
8590c6dc33 Remove cmake hack that wasn't supposed to go upstream
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-18 06:03:12 -07:00
Dirk Hohndel
d595f5c167 Merge branch 'devel' of https://github.com/gracie89/subsurface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-17 12:00:38 -07:00
Grace Karanja
0c9756c5d7 QML UI: Implement showing of the dive profile on QML
Link the QMLProfile class to the DiveList.qml file. The profile is
displayed above the dive details.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-17 12:00:38 -07:00
Grace Karanja
59232ca172 QML UI: Add QMLProfile class
Add a C++ class to render the dive profile. The rendered image is then
passed on to QML.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-17 12:00:29 -07:00
Tomaz Canabrava
76e61bd8d9 Make sure we don't pass the wrong info
We were returning false here which meant that we were
overriding the information with the wrong value later.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-17 10:27:52 -07:00
Tomaz Canabrava
392973dbe4 Remove buggy code
This code is already implemented as a signal-connection
on the maintab.cpp / globe.cpp

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-17 10:25:12 -07:00
Grace Karanja
df1a1f7034 QML UI: Implement saving of dives
This implements saving of some dive details to the cloud service. When the
user closes an open dives, any changed details will be cached, and when they
click on the 'Save Changes' button is pressed, the changes will be saved to
the cloud.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-17 19:12:39 +03:00
Grace Karanja
aae27629c4 QL UI: Add DiveId role to DiveListModel
This will be used when rendering the dive profile and also when
saving the dive changes.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-17 19:12:39 +03:00
Miika Turkia
5d12723656 Divinglog import: update O2sensors and dive mode
This is my best guess, and I have no sample logs that would prove my
assumption.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-17 08:51:04 -07:00
Miika Turkia
6e109a2129 Divinglog import: added setpoint
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-17 08:51:01 -07:00
Miika Turkia
5e439cef63 Divinglog import: add cns value
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-17 08:50:57 -07:00
Miika Turkia
70198ef11b Divinglog import: ppo2 sensor readings
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-17 08:50:49 -07:00
Dirk Hohndel
2a4cacda21 Better invalid dive site name
This should ensure that no one ever might end up with our "invalid" name
for real. And it allows us to more easily test elsewhere for that invalid
value.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-17 08:39:49 -07:00
Anton Lundin
c78e4fb92d Use a different package for the mobile app
Now we produce two different android apps, and to be able to have both
installed at once, we need to put them in different packages.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16 18:41:06 -07:00