Commit graph

336 commits

Author SHA1 Message Date
Dirk Hohndel
a7f8a7574e Create GpsListModel in order to be able to display GPS fixes
This will allow us to visualize the GPS fixes that are currently stored in the
QML UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07 21:29:05 -08:00
Dirk Hohndel
0f31102020 Don't try to install Grantlee files when building Subsurface-mobile on Mac
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07 10:22:31 -08:00
Miika Turkia
164d2f8c07 Enable BT_SUPPORT compilation flag
We need to enable the BT_SUPPORT compilation flag to get the support
built in.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-04 10:00:44 -08:00
Dirk Hohndel
98fb625667 Cmake: only need Marble/Grantlee/Manual for desktop version
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-30 09:55:24 -08:00
Dirk Hohndel
b87df3ecaa Cmake: don't add the BT_SUPPORT define too early
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-21 10:53:55 -08:00
Dirk Hohndel
c819d40c19 Cmake: don't use wildcards when deleting debug components
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-19 22:09:31 -08:00
Dirk Hohndel
c7278cd9ed Cmake: adjust dlllist.cmake to no longer be created on the fly
Because of this a bunch of variables need to be passed in and the quoting
changes in rather subtle ways.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-17 15:59:15 -08:00
Dirk Hohndel
88d5fc0fbc Cmake: more use of SUBSURFACE_TARGET and more complete macdepoyqt args
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-17 11:50:41 -08:00
Dirk Hohndel
7c095419f7 Cmake: consistently use SUBSURFACE_TARGET and get the capitalization right
Also clean up a bit of the whitespace mess right where I'm making changes

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-17 11:49:58 -08:00
Tomaz Canabrava
13573915b6 Fix CMake to not add Facebook on Android
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-17 11:48:15 -08:00
Tomaz Canabrava
8abbcc5598 Add the correct target on the Android build
The android build could be the Desktop and the Mobile app,
we cannot force it to be the mobile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-17 11:47:50 -08:00
Tomaz Canabrava
92d1dbe3fd Build on android is a shared library
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-17 10:17:51 -08:00
Tomaz Canabrava
9626b8ad84 Simplify IF for OSX handling
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-17 10:17:39 -08:00
Dirk Hohndel
d4184f852d Cmake: bring back the QtXml hack and other Mac changes
The hack in commit c8be04edad ("Mac build: move the QtXml hack into Cmake")
had been lost in the latest cmake rewrite.

Similarly, the modified BUNDLE info and the manual QML deployment.

Strangely this still doesn't correctly create a Subsurface-mobile.app on Mac.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-16 15:33:30 -08:00
Dirk Hohndel
5672d3f567 Cmake: indentation fix
I split this out as separate commit so that the previous commit becomes easier
to read.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-16 14:27:27 -08:00
Dirk Hohndel
060b5e2189 Cmake: fix install
This had not been updated since the change of direction that we would support
building Mobile and Desktop on all supported platforms.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-16 14:25:38 -08:00
Dirk Hohndel
44990671f1 Cmake: correctly read in the enabled translations
FILE READ doesn't do what we want. It's the STRINGS command that considers \n
as whitespace and gets the correct result.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-16 14:24:47 -08:00
Dirk Hohndel
ec48e9ce5a Cmake: fix QtQuick component designator
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-16 14:03:31 -08:00
Dirk Hohndel
607a601559 Cmake: fix another Mobile/Desktop confusion
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-16 10:41:28 -08:00
Dirk Hohndel
23265f31b5 Cmake: fix Application/Executable confusion
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-16 09:48:20 -08:00
Tomaz Canabrava
b8483a1e6c Fixed cached variable
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 09:23:15 -08:00
Tomaz Canabrava
5acfc8c632 Fix targets on mobile and desktop
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 09:23:02 -08:00
Tomaz Canabrava
c3493fa141 Fix some broken-by-design code
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 09:21:28 -08:00
Tomaz Canabrava
27bf6f68f6 Create targets MobileApplication and DesktopApplication
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 09:21:23 -08:00
Tomaz Canabrava
89658cc291 Remove checking the Platform and the App Type,
The check must be done, but not on the way I tried to do.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 09:21:14 -08:00
Tomaz Canabrava
85946700eb Complain if no Correct App version was passed to be build
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 09:21:07 -08:00
Tomaz Canabrava
3462da19fd Finish things
i hope

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:02:16 -08:00
Tomaz Canabrava
6087c246c4 Read the translations from the translations file
instead of hardcoding everything on the main cmake

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:01:48 -08:00
Tomaz Canabrava
30999a6898 Move run on build dir code out of the main cmake
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:01:48 -08:00
Tomaz Canabrava
cc6875d39e Rework the dependencies on the Android platform
We where able to build the android-mobile on desktop and the desktop on
android, now I allow only mobile on android and desktop on desktop.
this is to make the cmake clear, and we can also use the emulator on
the android platform, so nothing is really lost.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:01:46 -08:00
Tomaz Canabrava
9079701176 Move adding -lpthread
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:01:16 -08:00
Tomaz Canabrava
320cfccd71 Change the way we handle targets
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:00:57 -08:00
Tomaz Canabrava
47a985b0c7 correct android usage
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:00:57 -08:00
Tomaz Canabrava
b6eb865803 Issue an error when no platform is found
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:00:56 -08:00
Tomaz Canabrava
aaafaade5e Use a single variable to handle the extra Qt stuff
It's easier to debug what's wrong this way

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:00:31 -08:00
Tomaz Canabrava
24f0abe347 Remove commented out code
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:00:31 -08:00
Tomaz Canabrava
32714faf24 Remove the Dll finding code from within the Main CMake
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:00:31 -08:00
Tomaz Canabrava
c7a3cb68f5 We don't need the same test twice for the same thing.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:00:31 -08:00
Tomaz Canabrava
4ae0ce0c60 Code Cleanup
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:00:31 -08:00
Tomaz Canabrava
b33059e08b We don't support insource builds anymore
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:00:31 -08:00
Tomaz Canabrava
6948859678 Move include directories a bit down below
Better to follow the CMake logic and se those near the
sources

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:00:31 -08:00
Tomaz Canabrava
957f5532b8 Move OSX code to OSX IF
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:00:30 -08:00
Tomaz Canabrava
2637b5c3f1 Rework Options order, add SUBSURFACE_TARGET_PLATFORM flag.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 08:00:04 -08:00
Tomaz Canabrava
f26df4f80a Move Handling of user manual to Modules directory
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 07:59:37 -08:00
Tomaz Canabrava
268fbf3fb1 Handle VersionGeneration outside of the main CMakeFile
This is actually a good change: we used to write a new
CMake file in configure time just to move it outside of the
source to the build dir at compile time. Now this file is
pre-created and it's only moved.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 07:59:37 -08:00
Tomaz Canabrava
f60e86b19c Move FTDI and Grantlee configuration out of CMakeLists.txt
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 07:59:36 -08:00
Tomaz Canabrava
cef86356f5 Add HandleFindMarble.cmake
Marble stuff should be inside handleMarble file, this clears
the Main CMakelists.txt file.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 07:59:01 -08:00
Tomaz Canabrava
126d9a00e4 Added HandleFindLibDiveComputer.cmake
Anoter attempt to clear the Main CMakeLists.txt file

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 07:59:01 -08:00
Tomaz Canabrava
65cecad564 Add some commits to make cmake clear
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 07:59:01 -08:00
Tomaz Canabrava
c738dade47 Ensure Out of Source builds
In source builds creates a lot of noise on the source tree,
creating tons of temporaries that makes git status cry, and it also
creates dangerous files that have names similar to actual source
and could make a developer use them by mistake.

Make out of source buiild mandatory to remove that, it also makes
CMake code easier to read.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 07:59:01 -08:00
Tomaz Canabrava
24f3743fc1 Start to clean the Main CMakeLists.txt filel
CMake is a strange and complex language for buildsystems,
and as such we need to let the main CMakeLists.txt be as
clear as possible.

Moving a bunch of code that deals with finding git via
default CMake way or pkg_cofig to a file named 'HandleFindGit'
on our cmake/Modules folder.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
2015-12-16 07:58:56 -08:00
Dirk Hohndel
b5905f3ab7 Cmake: remove debug code that accidentially slipped in
And try to fix the upper case / mixed case confusion that we apparently
have with libssh2 - oh how I hate this stuff.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-15 17:47:15 -08:00
Dirk Hohndel
7aab635585 Remove support for older libgit2 - we now require 0.23 or later
Also fixes a capitalization error that prevented finding libssh2 in some
circumstances. And adds a missing include when building with libzip on Mac.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-15 13:33:00 -08:00
Dirk Hohndel
c8be04edad Mac build: move the QtXml hack into Cmake
This way build.sh can build a Subsurface.app that the user can use via

	open subsurface/build/Subsurface.app

after running build.sh.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-09 15:24:25 -08:00
Dirk Hohndel
b928dff3ce Only install QML Framework files for Subsurface-mobile
The workaround to building Subsurface-mobile on Mac messes with the ability to
sign the bundle, so only do this when building Subsurface-mobile which we don't
bundle, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-06 13:44:32 -08:00
Anton Lundin
59042b2ed0 Fix disabling of facebook integration
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02 09:21:04 -08:00
Anton Lundin
58901690dd Remove defaults for Android from cmake
Some of the flags needed to build for android was set in cmake. There
are many more that needs to be set correctly for things to work, so
having some in cmake and some in the Android build.sh is just confusing.

This removes the bits from cmake and moves everything into build.sh.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02 09:20:50 -08:00
Dirk Hohndel
05bf480e2e CMake hack to build Subsurface-mobile on Mac
With this running

	make && make install

should give you a Subsurface-mobile.app that you can execute (either with
double click or using "open Subsurface-mobile.app" from the command line).

This contains a couple of hacks but I didn't try too hard to make this clean
since Tomaz is redoing the CMake build system, anyway and I'll need to make
sure this still works once he's done.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-30 15:06:18 -08:00
Dirk Hohndel
2c77aa5519 Cmake: fix building of Subsurface-mobile on Mac
The error message was completely useless, but it turned out to be an issue of
the order of arguments to add_executable().

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-24 09:38:51 -08:00
Dirk Hohndel
456cc3955a Location service: move into subsurface-core
While this is primarily something targeted at a mobile device, with many
of the 2 in 1 devices it is possible that the user might be running the
desktop version of Subsurface on a mobile device.

As a first step to make it possible to collect GPS fixes on such a device
we need to make the infrastructure to do so available in the desktop
application as well.

This still needs to be hooked up in the desktop UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18 18:34:49 -08:00
Dirk Hohndel
4cf20c3448 Cmake: add SUBSURFACE_MOBILE definition earlier
This way it is set when subsurface-core is built.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18 14:41:47 -08:00
Salvador Cuñat
427c696c70 SmartTrak import - Add build capability to cmake
This enables posibility of building standalone import tool via cmake.
Adds an option SMARTRAK_IMPORT (defaults to OFF) which, if turned ON,
will require glib-2.0 and libmdb libraries to be installed, and, calling
will produce an executable with the highly original name of smtk2ssrf.

I have no capability to cross-compile to windows, so I haven't even
tried to put this in Win, less say in Mac. I expect linux users which
may be actual users of SmartTrak, to test this before trying to build on
windows, although the target public will probably be the windows users (or
at least, ex windows user).

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-12 07:39:18 -08:00
Dirk Hohndel
9195f247c4 Location service: move files around to fit new directory layout
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11 12:37:57 -08:00
Dirk Hohndel
136b87e7c0 Location service: Add GPS location infrastructure for Subsurface-mobile
This doesn't do a thing - just adds the empty class and sets up the Cmake
file so it finds the required Qt components for Subsurface-mobile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11 12:36:49 -08:00
Miika Turkia
77d7e773b9 Enable BT compilation earlier
Commit ba55c60395 broke Bluetooth
support for me. This patch moves the setting of BT_SUPPORT earlier,
re-enabling BT download option on the download dialog.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-10 09:10:04 -08:00
Tomaz Canabrava
c71df5baa5 Don't rely on CMAKE_AUTOUIC
Some old CMakes that we use had problems with it, change to use
the qt5_wrap_ui macro that's bundled with Qt.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09 18:00:56 -08:00
Tomaz Canabrava
66091ff853 Remove Facebook from Plugins
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09 18:00:56 -08:00
Tomaz Canabrava
4ddf4f6d83 Removed C++11 from the code.
Make Dirk ungrumpy

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 16:33:34 -08:00
Dirk Hohndel
761c3e4718 Revert "Mac: don't use C++11 on older clang versions"
This reverts commit acb74f25f7.

Better not enable it anywhere
2015-11-08 16:33:19 -08:00
Dirk Hohndel
871f585f42 Make building plugins optional
This currently fails at least on my old Mac that I use to create binaries
that work on 10.7 and newer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 16:31:38 -08:00
Dirk Hohndel
acb74f25f7 Mac: don't use C++11 on older clang versions
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 15:34:15 -08:00
Sebastian Kügler
aae4a326f4 organize qml files in subdirectories
This makes the organization of the qml files a bit more fine-grained, it
prevents mixing of .cpp and QML files, and also of what's compiled, and
what's included in the app as qrc data.

In particular:
- subsurface specific QML items go into the qml/ subdirectory
- theme and unit definitions to into qml/theme subdirectory (they
  already were located in a theme directory)
- generic components, such as our Label goes into qml/components

This facilitates sharing of functionality and identifying common stuff
better. Ideally, we can pull qml/theme and qml/components from a
standardized set at some point, so we don't have to maintain that code.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:00:59 -08:00
Dirk Hohndel
b76d3fa25f Better file names for Subsurface-mobile related sources
They aren't Android specific - they are for the QML UI mobile app which
should run on iOS as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 13:44:13 -08:00
Dirk Hohndel
06e65e4c02 Cmake: untangle subsurface and subsurface-mobile
In the cmake restructuring it seems that subsurface-mobile building got
completely messed up. With this subsurface-mobile still doesn't actually
build (still too many unfulfilled dependencies, but we're getting closer).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05 15:06:10 -08:00
Rex Dieter
fcf47552c6 Use target_link_libraries for Grantlee
This allows for finding headers when not in /usr/include (like
parallel-installable distribution-packaged grantlee5)

Signed-off-by: Rex Dieter <rdieter@fedoraproject.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05 13:45:50 -08:00
Dirk Hohndel
ba55c60395 Cmake: fix BT definition
This was set twice, the first time before we checked that we have a new
enough Qt version installed.

Also fixed a typo.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-03 09:20:47 -08:00
Tomaz Canabrava
53a5f6d7a4 Make code compile in gnu11 and c++11
This is to make it possible to use some nice to have features of
c11 and c++11 like range based loops, delete default functions,
auto variable assignment. Talked to Dirk about this and he is ok
with the change, but he also states that he will not accept lambdas

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:51 -07:00
Tomaz Canabrava
7cd9e2b7bb Make icons work again
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
225ac07005 Clear the main CMake file
A bit of dust was setting here, when I moved tons of things around
I forgot to remove some bits.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
044e593957 CMake for tests in its own folder
Besides making it more simple to add a new test now since
you don't need to play hide and seek with the main cmake
this has another good thing: on IDE's that scan the cmake
to create targets on the project tree, the main project
was being popullated with test-targets on the main tree
and not inside the tests directory.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
1d6683f3e0 Move Profile widget out of desktop-widgets
The reason for that is, even if profile widget is made with qpainter
and for that reason it should be a desktop widget, it's being used
on the mobile version because of a lack of QML plotting library that
is fast and reliable.

We discovered that it was faster just to encapsulate our Profile in
a QML class and call it directly.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
50ec7200e6 Single CMake to handle the models
This one was pretty easy because of the work I did a few months
ago to separate the models from the UI.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
45c9764073 main.cpp -> {android-main, desktop-main}
This is needed to compile both in a single call to make. Also it will
help removing some of the mistakes in the current android version:
it always created the mainwindow, even without using it for anything,
so tons of memory will be freed now for the android version, making it
snappier and smoother.

This is a necessary move so we don't need to #ifdef all over the place
for the two different versions, and imo the changes needed to keep both
versions will not be that huge if we keep things in subsurface-core
sane.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
e49d6213ad Move qt-ui to desktop-widgets
Since we have now destkop and mobile versions, 'qt-ui' was a very
poor name choice for a folder that contains only destkop-enabled
widgets.

Also, move the graphicsview-common.h/cpp to subsurface-core because
it doesn't depend on qgraphicsview, it merely implements all the
colors that we use throughout Subsurface, and we will use colors on both
desktop and mobile versions

Same thing applies for metrics.h/cpp

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
588abd019f Move the icons to the icons folder
There was no reason at all to keep those icons on the root
folder.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:48 -07:00
Tomaz Canabrava
6cd711a11b Modify code to make it compile after rebase
Did a git rebase and some stuff changed in the meantime;
This is a compatibility commit: Add a few include directories
on the cmake to quiet some ui_headers.h not being found (the
ones that are created automatically by uic) and a few noiseances
like models requiring interface functionality.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:48 -07:00
Tomaz Canabrava
4c0156e3d5 Move all core-functionality to subsurface-core
And adapt a new CMakeLists.txt file for it. On the way I've also
found out that we where double-compilling a few files. I've also
set the subsurface-core as a include_path but that was just to
reduce the noise on this commit, since I plan to remove it from
the include path to make it obligatory to specify something like

 include "subsurface-core/dive.h"

for the header files. Since the app is growing quite a bit we ended
up having a few different files with almost same name that did
similar things, I want to kill that (for instance Dive.h, dive.h,
PrintDive.h and such).

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:48 -07:00
Tomaz Canabrava
a079821423 Start to clean CMake
CMake can be a good system but if we keep everything into one big
cmake file things can go nuts really quick. Since I already took
quite a start on an subsurface layer separation some time ago, I'm
improving it by making each module on Subsurface depend on it's own
CMake module.

This first patch moves the qt-ui part to qt-ui/CMakeLists.txt file,
it cleans tons of the main cmake file ( moving all parts to the in
ternal folder ), and makes things more easily manageable by the
programmer that will change the ui bits, he doesn't need to play
hide and seek with the CMakeLists.txt file anymore, trying to figure
out where should he put his newly generated file.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:02 -07:00
Guillaume GARDET
f451387f8f Add subsurface.debug script to help debugging and install it (for Linux only)
This patch adds subsurface.debug script and install it for Linux.
Instead of running subsurface, you can run subsurface.debug which will launch
subsurface as usual, but will monitor subsurface exit and run gdb automatically
if subsurface crashes and it creates a crashlog in $HOME/.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-29 08:35:01 -07:00
Dirk Hohndel
5d8f3c1ebd Cmake: fix incorrect modification of a QT_LIBRARIES
It's a list, not a string. Treating it as a string creates all kinds of
exciting weird errors that make no sense.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-26 14:51:07 -07:00
Dirk Hohndel
3b0f38f24a Fix building without BT support
I guess no one had tried this in a while.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-26 06:51:47 -07:00
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