Commit graph

195 commits

Author SHA1 Message Date
Dirk Hohndel
af45a2a072 Use hidapi on Mac
This allows us to support the Suunto EON Steel on Mac, assuming the matching
libdivecomputer version from the Subsurface-branch. If that was compiled with
the hdiapi lib then hopefully the build for Subsurface should find that library
as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-18 17:37:49 -07:00
Tomaz Canabrava
2eed9c0b9b Move the algorithm to divesite.cpp file
This shouldn't be on the maintab.cpp, this file is already too convoluted.

[Dirk Hohndel: slightly refactored this commit and the next one to make
               the code actually work and make the split across the two
               commits more reasonable]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08 06:27:38 +01:00
Dirk Hohndel
05f4f9b533 Cmake: ensure marbledata is actually copied into the build directory
This can be done regarless of whether Marble is enabled or not. No harm
done.

Fixes #937

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06 00:01:30 +01:00
Dirk Hohndel
cb112f9ac5 Add test for import, merge and renumbering
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-05 16:35:09 +01:00
Dirk Hohndel
a4a4276ed6 Make TestGitStorage run last
This can take a long time on slow connections so it makes sense to run all
the other tests first.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-04 13:52:31 +01:00
Dirk Hohndel
332cc0a418 Cmake: make libssh2 library path explicit
Under certain conditions on my Mac the build process will happily find libssh2
but then at link time can't figure out where it is. Making the path to the
library explicit seems to fix that issue.

This commit also adds the code to dump all visible variables at the end of the
cmake file (commented out). I have looked this up online, added it to address
an issue, and then removed it quite a few times... I figure I might as well
keep it there for the next time I need it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-28 07:46:44 -04:00
Lubomir I. Ivanov
0b0e203dbd Cmake: add LIBMARBLE_FROM_PKGCONFIG and some Marble related fixes
This patch adds the option to retrive Marble with pkg-config in a
similar way to Grantlee, libgit2, etc.

It reorganizes the "if(NO_MARBLE)" case to be the "else()" of
if(NOT NO_MARBLE).

Also, it adds the "-r" option to "rm" here:
add_custom_target(link_marble_data ALL COMMAND rm -rf ./marbledata ...

as otherwise it fails on Win32/Msys with "marbledata is a directory".

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22 07:18:53 -07:00
Dirk Hohndel
34930c0110 Cmake: make Grantlee5 required
Otherwise printing doesn't work. And we get weird build errors.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-06 07:53:12 -07:00
Dirk Hohndel
181d5c5db9 Cmake: turn on printing by default
As we get closer to the 4.5 release we should try to make sure we build
with printing enabled everywhere and just turn it off if we no it's not
supported.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-01 09:52:52 -07:00
Tomaz Canabrava
ab32295f89 Add a new model: SsrfFilterProxyModel
Add a new Model, it's the QSortFilterProxyModel that accepts
functions to filter / sort. so instead of creating a new class
for each different sorting (overkill), now we can just create
a function and pass to this class.  I'll rework the filtering
system of subsurface to use this - in the meantime I've created
this to ease the creation of another filter: the dive sites
by gps coordinates.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-31 18:41:14 -07:00
Dirk Hohndel
1b37e0f1a4 Add test for dive site duplication bug
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-30 10:32:38 -07:00
Dirk Hohndel
4360cee196 Cmake: install grantlee plugins on Mac
And add a small message that two potential ERRORS that are thrown in the
deploy step are actually harmless.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-27 13:53:32 -07:00
Dirk Hohndel
6eed3155e6 Add simple test for git storage
This just makes sure that writing data to git storage and reading it back
gives you the same result. Without the fixed generation of initial dive
site UUIDs this fails.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25 10:43:41 -07:00
Dirk Hohndel
e86fd45efd Cmake: fix cross compiling on Windows
Cmake has a bug that causes the moc process not being handed the necessary
defines for the architecture we are building for.

Also we were missing a library to make the BT implementation on Windows
work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-21 10:16:06 -07:00
Anton Lundin
8d73e4f81c Connect up serial_ftdi custom serial
This connects the serial_ftdi implementation to subsurface, and builds
libftdi1 for the android builds.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:59:54 -07:00
Anton Lundin
e2c98def26 Turn serial_ftdi.c into a custom_serial
This cleans up serial_ftdi.c from being a libdivecomputer source and
making it into a subsurface custom_serial.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-20 22:59:49 -07:00
Dirk Hohndel
aa48dfea27 Cmake: automatically create version for Mac bundle
The version info that is used for the Mac bundle is created at cmake run
time, not at make run time.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-17 08:45:15 -07:00
Dirk Hohndel
79f3f18ef6 Cmake: only link against libusb-1.0 if it was found
This should work much better as libusb is really only required if you want
support for all the dive computers (e.g., Atomics Aquatics Cobalt family).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-16 12:33:28 -07:00
Tomaz Canabrava
ed30059183 Add DiveSitePicturesModel
This model should be used inside the Edit Dive Site mode.
It should display all photos from all dives that are part
of this dive site, ignoring trips.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-15 04:59:01 -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
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
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
Anton Lundin
9a754972ed Fix libssh libssl linker order for Android
We need to link things in the correct order, even on android.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16 14:09:31 -07:00
Dirk Hohndel
f8ce5788b8 Cmake: use correct variable to find make command
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16 13:31:32 -07:00
Dirk Hohndel
4dfb39cc49 Cmake: don't hardcode the make command
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-14 14:53:15 -07:00
Dirk Hohndel
f35a271365 Android build: statically link against libssl and libcrypto
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13 15:21:16 -07:00
Dirk Hohndel
c2e1158cf7 Cmake: use the mobile icon for Android apk
The first attempt missed the second spot where this was set.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-10 11:22:39 -07:00
Dirk Hohndel
cbda93ce11 Add different icon for mobile app
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-09 16:37:43 -07:00
Anton Lundin
9217a03ef3 Teach android build about subsurface-mobile
This teaches android build.sh and cmake about how to build the qml ui of
subsurface-mobile as a apk.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-09 15:10:48 -07:00
Anton Lundin
5cbbff0084 Use qt-android-cmake to produce a android apk
This introduces code to use qt-android-cmake to produce a working apk.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08 15:48:42 -07:00
Anton Lundin
1f112c7738 Make the libssh linking optional
Due to bugs in libgit2, we force linking with libssh2 to add
git-over-ssh support. On android we currency don't want libssh2 due to
its dependency chain, so this makes the libssh2 force linking opt-out.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-08 15:48:30 -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
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
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
Dirk Hohndel
9c6a3a7ff3 Merge branch 'custom-print' of github.com:neolit123/subsurface 2015-07-05 12:01:43 -07:00
Gehad elrobey
963e09ad7b Printing: add TemplateEdit form to source tree
The TemplateEdit class works to customize the tempalate before printing,
User can select the font-size, font-type, color-palette, linespacing
and editing the template HTML code.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-05 20:59:55 +03:00
Dirk Hohndel
35dc814105 Add simple test for the dive planner
This sets up a standard dive scenario (30 minutes at 260ft/79m, EAN36 and
Oxygen as deco gases, last stop at 20ft/6m) and calls the planner to set
up a dive plan given certain standard gases.

Instead of trying to verify the complete plans it checks that we switch to
the deco gases at the right depth and the complete duration of the dive
matches our expectation.

The test intentionally fails right now for imperial as we have the wrong
switch depth for Oxygen. See how useful tests are?

On the downside, the test does NOT produce the same plan as Subsurface
when I try to create a consistent setup for both - and I have not been
able to figure out why. There must be some other parameters that I'm not
setting, but I haven't identified them, yet. It's very small differences,
for example in the metric case the stops at 21m, 9m, and 6m are each one
minute shorter in the test than it what Subsurface calculates.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05 09:42:38 -07:00
Dirk Hohndel
f554c2d16c Merge branch 'taxonomy' 2015-07-02 07:03:03 -07:00
Dirk Hohndel
36657c019b Geo taxonomy: create some data structures and helper functions
This is designed to store taxonomy information for dive sites, including
information where the data came from.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01 12:25:47 -07:00
Dirk Hohndel
b8ae4c50b4 Cmake support: remove a clearly broken line
This was intended to help us fine libssh2, but since it works as is now,
and the typo makes the entry pointless, I'm pretty sure that this isn't
needed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01 10:27:02 -07:00
Anton Lundin
d880040d0a Introduce CMake support for building for Android
This is the first step to be able to build Subsurface with CMake for
Android.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01 09:00:48 -07:00
Anton Lundin
c3f6fcb0bf Fix NO_PRINTING when printing is disabled in Qt
Qt for android doesn't have any printing support, so this fixes
NO_PRINTING so we can build against a Qt without any printing support at
all.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01 09:00:13 -07:00
Anton Lundin
eda0190e2a Group QT-quick options into one block
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01 08:59:50 -07:00
Anton Lundin
82b51e8021 Re-introduce NO_USERMANUAL for Android building
This re-introduces the NO_USERMANUAL flag, which is needed due to the
fact that Qt-Android doesn't have a WebView to view the manual in.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01 08:59:30 -07:00
Dirk Hohndel
186f8c6ac1 Cmake: missing quotes
I hate it when I do this

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-29 13:14:06 -07:00
Dirk Hohndel
da7fb2eff4 Cmake: another attempt to make things work with libssh2
This seems to work on all the systems I was able to test it on.
Famous last words.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-29 12:33:33 -07:00
Tomaz Canabrava
ab6e2cc9b4 Fix build with libssh from git
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-29 06:43:44 -07:00
Dirk Hohndel
9f86468c00 Make sure the output directory is created before we run asciidoc
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27 15:28:27 -07:00