Commit graph

8272 commits

Author SHA1 Message Date
Dirk Hohndel
33a7e5cd73 Build fix for older Qt5
This breaks for example on Ubuntu Trusty.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08 10:59:40 -07:00
Tomaz Canabrava
127f3b7da1 Use current dive site to get the information
and not the displayed_dive_site. tsc.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08 08:08:46 -07:00
Joakim Bygdell
bea24edc29 Planner: redo the spacing of the prefs
Divide the space eaqually to all three settings panels.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08 08:02:04 -07:00
Tomaz Canabrava
7bc11f3044 Correctly paint the states
The state handling is a pain to do manually, but I can't really
use the style painter because if I do that it would paint the
string of the model (and that's something I don't wanna do)
so I clear the text, draw the control, then I paint the stuff
that I really need.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08 07:50:43 -07:00
Tomaz Canabrava
2f9e859615 Use taxonomy or coords on the delegate
The Taxonomy text should be used if there's a taxonomy
for the dive site. If there isn't, then use coords. If
there's none, then nothing will appear on the bottom
of the dive site name.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08 07:50:09 -07:00
Tomaz Canabrava
967bd68e64 Better spacing on the delegate
Makes the location delegate pleasant to the eye.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08 07:49:49 -07:00
Tomaz Canabrava
eff22c28db Show the correct delegate on the completer
For some reason the completer wouldn't show the delegate if the line order
of the code was different.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08 07:49:29 -07:00
Joakim Bygdell
ff6bf497c8 Planner: update disclamer
Update the disclamer text to reflect which algorithm where used.

[Dirk Hohndel: cleaned up coding style & replaced snprintf with strncat]

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08 06:52:02 -07:00
Joakim Bygdell
d6582aa095 Rename generic QT labels
Some QT objects in the planner ui files had generic label names.
Give them proper names so we can see where they belong.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08 06:37:03 -07:00
Joakim Bygdell
543ffcda32 Planner: move notes options under gas options
The notes optiopns are rather few, if we move them under the gas options
we can save a bit of hirizontal space.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08 06:33:29 -07:00
Dirk Hohndel
fa69a1b7d5 Allow to compile Subsurface with upstream libdivecomputer
This will create an inconsistent build that has some UI features implying
BT support but those will be non-functional. I don't think this is the
right thing to do - either fail to build with a decent message or really
remove the BT support.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-07 21:41:22 -07:00
Dirk Hohndel
fe8605ed5b Fix crash accessing freed memory
That one should have been quite obvious.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-07 15:48:27 -07:00
Dirk Hohndel
4fc4bbd9bc Build script: use mirror on our git server
gitorious is going away and the project doesn't appear to have migrated
anywhere, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-07 12:45:59 -07:00
Joakim Bygdell
97e70a9c0e Planner: fix tab stop order
Fixes the tab stop order on the planner settings page.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-07 12:23:27 -07:00
Joakim Bygdell
68ceb75294 Planner: disable unrelated planner settings
When VPM-B is the choosen deco algorithm changing,
GF low and high have no effect. So lets disable them similar to what we do
for recreational mode.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-07 11:49:16 -07:00
Joakim Bygdell
19648e28cc Planner: GUI changes for improved clarity
Restructure planner GUI for improved clarity of how settings are related.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-07 11:49:10 -07:00
Salvador Cuñat
097d65521a Clean double free in copy_dive_site()
This makes subsurface crash by simply clicking a dive in the list.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-07 10:37:53 -07:00
Rick Walsh
f9c3142fa7 Include units in VPM config structure definition
Include units in the comments of VPM structure definition.  We should
confirm the units surface_tension_gamma and skin_compression_gammaC.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-07 06:26:40 -07:00
Rick Walsh
b2d27ca685 Use common VPM configuration parameters
Adopt the same critical radii used by Eric Baker's original VPM Fortran
code and V-Planner.

Standard critical volume lambda = 7500 fsw-min (numerous sources). We need
to convert it properly.
λ = 7500 fsw-min
  = 7500/33 = 227.2727 ata-min
  = 227.2727 * 1.01325 bar-min
  = 230.284 bar-min

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-07 06:25:28 -07:00
Dirk Hohndel
e46f6a5231 INSTALL file: add the required packages for QtBluetooth
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-07 06:14:13 -07:00
Dirk Hohndel
9039785dc9 Make things compile under Qt5.5
This declaration already exists in a Qt5.5 header file.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 22:17:38 -07:00
Dirk Hohndel
b1538c809d Code cleanup
Make precedence of && over || explicit.
Explicitly convert between char * and unsigned char *.
Don't assign potentially negative return code to an unsigend variable.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 13:59:14 -07:00
Dirk Hohndel
e76675d4df Whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 13:58:12 -07:00
Salvador Cuñat
1197be235b OSTCTools - Add unsigned char variable
In commit 22bfc49 an explicit cast to (char *) was introduced to silence
some compiler warnings, but an (unsigned char *) is needed if related
values are expected to be greater than 127 or we will get the usual
weirdnesses.

Just introduce such variable and use it where needed.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 13:15:29 -07:00
Tomaz Canabrava
e6ae371673 Removed unused icons
While looking for the icons so luisa could create svg
versions of them, I found out a few things that are not
used anymore.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 12:49:52 -07:00
Dirk Hohndel
cf047466b5 Cmake: make Facebook support an actual option
This way we can selectively turn off Facebook support.

And turning off both Facebook support and support for the user manual
allows us to not rely on QWebKit which once again allows debugging
Subsurface with valgrind on Arch Linux.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 12:11:07 -07:00
Dirk Hohndel
6ebeba3c7c Be more careful freeing taxonomy data
We want to only access data that we consider valid. And we need to clear
out pointers to freed memory.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 12:09:20 -07:00
Robert C. Helling
56913191af Fix typo in test and some numbers
With these values I reproduce the runtimes from the UI.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 08:56:48 -07:00
Claudiu Olteanu
14e071e8d8 Add extra logs for custom serial Bluetooth implementation
This patch increases the verbosity level for QtBluetooth API
and add some extra logs for custom serial Bluetooth open method.

The scope of this patch is only for testing.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 08:38:12 -07:00
Claudiu Olteanu
198cc41959 Implement the custom Bluetooth serial communication and use it
Create a custom Bluetooth serial communication using the QTBluetooth
API and use it when the Bluetooth download mode is enabled.
First try to connect on RFCOMM channel 1 because this is the default
RFCOMM channel of SPP service for most devices. If this doesn't work
try again on RFCOMM channel number 5 because it could be a Petrel2 device.

Add a fake open function for the custom implementation. This is
used when the selected device is HW OSTC 2N and the Bluetooth
mode is activated, then fake the open call of the serial device.

Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 08:37:42 -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
5766d1894c Adapt the test to the API change
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05 22:30:02 -07:00
Dirk Hohndel
35b4af913b Cmake: only build print related files if NO_PRINTING isn't set
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05 16:33:07 -07:00
Grace Karanja
db3a9abac9 Correctly include QtQuick when building for mobile
The changed introduced in d880040d breaks mobile builds by not correctly
linking with QtQuick. This change fixes that by fixing the incorrect line
in CMakeLists.txt so that the correct QtQuick headers will be found.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05 16:01:54 -07:00
Robert C. Helling
e864c365c7 Correct logic
At least my compiler warns about ! binding stronger than == and
thus comparing a bool to an int. I guess this is what was meant.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05 15:54:20 -07:00
Robert C. Helling
a7d18a9fa6 Round MOD of gas rather than truncate
For the proper calculation, we need to take salinity and surface pressure
into account (rather than depth = bar * 10 - 10)

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05 15:53:49 -07:00
Dirk Hohndel
9c6a3a7ff3 Merge branch 'custom-print' of github.com:neolit123/subsurface 2015-07-05 12:01:43 -07:00
Gehad elrobey
cc53dc7acf Printing: implement QPlainTextEdit in TemplateEdit
This is the main area to edit the templates inside Subsurface.
Whenever the user edits a template the edited template is saved in
custom.html and custom.html is considered the selected printing
template.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:03:12 +03:00
Gehad elrobey
c44496e23d Printing: move template_options to print_options.h
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:03:04 +03:00
Gehad elrobey
a70cea95e8 Printing: refactor the print options class
-Remove unneeded parameter to member variable
-Check if template_options struct is valid

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:02:49 +03:00
Gehad elrobey
605e1e2d93 Printing: add functions that read/write a template
Read/write templates from files.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:02:40 +03:00
Gehad elrobey
c35092f5c9 Printing: add custom options to the PrintDialog
Add:
-custom.html template
-custom template to print_options struct
-options to the options dialog

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:02:09 +03:00
Gehad elrobey
815072d2ae Printing: retrieve number of dives per page from the template file
Add special data attribute 'data-numberofdives' in the template <body> with
the number of dives per page.
This is standard HTML5 specification so it won't corrupt the template file.
Any template that will be used for printing must contain this attribute to
assure correct output.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:01:53 +03:00
Gehad elrobey
6446b75b9e Printing: edit templates to show template options dynamically
Template styles must refere to Grantlee fields to be replaced with
user selected settings.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:01:31 +03:00
Gehad elrobey
4a98d92489 Printing: export template_options struct to Grantlee engine
Add template_options to Grantlee lookup section and export the struct
fields.

-font: is the font type used, must be selcted from 5 different types.

-font-size: is a user selection from 9 - 18 then it is scaled to a range
from 1 to 2 of the displaying view port.

-color-palette: is the colors used in the template, all used colors must be
referenced from here.(not yet implemented)

-line-spacing: is the distance between two consecutive lines in the dive
notes text.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:01:01 +03:00
Gehad elrobey
bc80fc8849 Printing: pass the template_options struct to TemplateLayout
The template_options struct needs to be passed to TemplateLayout
constructor.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:00:40 +03:00
Gehad elrobey
71561e720d Printing: add QSettings for TemplateEdit class
TemplateOptions struct must be saved to QSettings after the window
is closed, also it must be recalled when initializing the window.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:00:28 +03:00
Gehad elrobey
a600ea5201 Printing: add template_options struct that contains template
The template_options struct holds the settings variables in the code.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:00:25 +03:00
Gehad elrobey
ff594c65e3 Printing: call TemplateEdit when edit is triggered
Edit button should open TemplateEdit dialog.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 21:00:20 +03:00