Commit graph

182 commits

Author SHA1 Message Date
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
Dirk Hohndel
785f9ba835 Cmake support: the printer files are part of the UI
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21 12:49:05 -07:00
Dirk Hohndel
217c6462f5 CMake support: turn building for mobile into an option
This way it can be easily turned on and off from ccmake.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21 05:56:36 -07:00
Dirk Hohndel
ff906ba699 Cmake support: fix typo
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21 05:48:10 -07:00
Grace Karanja
b7e4b35cde Add DiveListModel
This model will be used to show the dives in QML. This commit adds
the model, and the means to link it to QML.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:26:56 -07:00
Grace Karanja
e0a25289db Add QMLManager to the cmake
Build the QMLManager class when compiling for mobile.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:19:56 -07:00
Grace Karanja
48a54d0348 Add subsurface-mobile app to cmake
Add a subsurface-mobile entry to the CMakeLists.txt file. When cmake
is run with -DSUBSURFACE_MOBILE=True, the compiled app will be named
subsurface-mobile, and the initial page (main.qml) will automatically
be loaded.

This will
ensure that the mobile app will be linked to QtQuick.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:18:06 -07:00
Dirk Hohndel
f0706207df Cmake support: remove Documentation/images in build dir
In earlier versions we didn't simply create a link but actually copied the
directory and its contents. So for this to work smoothly for people who
have built earlier versions of Subsurface with cmake we need to no just
remove the link but be willing to recursively remove that directory.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 06:46:49 -07:00
Dirk Hohndel
0726d4c679 Cmake support: fix in tree builds
And add a message that we suggest that out of tree builds are a better
idea.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 06:06:32 -07:00
Dirk Hohndel
8ab7b5ea7f Windows installer: include grantlee plugins and printing templates
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-19 22:24:18 -07:00
Dirk Hohndel
7e216bcb0c Allow printing and HTML export to work when running from build directory
Yet more things that wouldn't work for a native build under Windows.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-19 21:33:29 -07:00
Gehad elrobey
c152314790 Printing: fix "if" condition clause in cmake file
Check for NO_PRINTING instead of checking for NOT NO_PRINTING.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-06-19 21:41:50 +03:00
Dirk Hohndel
226e9a7e85 Implement a standalone HTML exporter
This is mostly a proof of concept right now; it shows that it is possible
to create a headless server application that exports a git repository
based data file as html.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16 14:09:21 -07:00
Dirk Hohndel
0692e24036 Separate initializing Qt from initializing the UI
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16 14:05:09 -07:00