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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
In order to be able to initiate an HTML export from the core library we
need to separate the actual logic from the UI.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This seems quite convoluted to me but I can't seem to make a more straight
forward implementation work. The idea is that core code should never
directly call into the UI.
So instead the core code (this is C code) calls a helper function. That
helper function calls a member function of a class which in return emits a
signal. The UI code connects to that signal and acts accordingly when it
is received.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This simplifies the distance calculations and removes a dependency.
This version uses propper math instead of my to simple previous version.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And use this to find a dive site within a certain radius of a GPS fix.
This will be used to figure out if dive sites might be the same.
This uses a new Qt5 component (Positioning) which was added in Qt5.2.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This code can be removed as we don't need QT printing code anymore.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If NO_PRINTING is not set, subsurface will require grantlee during
building. As Grantlee will be a hard dependency for Subsurface, so no
Grantlee means no printing.
[Dirk Hohndel: switched default for NO_PRINTING to ON]
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Render Html pages into a QWebView then print it using QPainter. the
Printer::print() is called that prepare the HTML file to be rendered by
the QWebView.
Printer::render() will do the rendering task.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is the main class to hold Grantlee engine logic.
TemplateLayout::generate() loads QT5Grantlee and initialize the
templates then returns a QString that contains the rendered HTML by
Grantlee library.
Also this class contains the Dive class which holds the logic that
formats the data before passing it to the templates.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Yes, it's kinda weird but that's what I happen to have on one of my
systems and this seems easy enough to implement.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This works on my system, I hope I don't break others.
Another possibility is to pass -libssh2 directly if it's NOTFOUND.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The credential callback doesn't appear to work (at least not the way I
implemented it) with v0.22 and earlier.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I forgot about this one, and we are going to use it
in the mobile version too.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This class will surely be used on the mobile version, and it was very
tangled inside divepicturewidget.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
TreeModel is the base of some important models in Subsurface, the
statistics model and the dive list models, this second is the most
important one in the whole Subsurface universe.
This commit is another one in the series to make easy to create a mobile
version of Subsurface.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Another attempt to make it easyer to create the mobile version of
Subsurface.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Another attempt to make it easyer to create the mobile version.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
One more step to make it easyer to port the app to Mobile.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is another effort to make it easyer for the mobile
interface of Subsurface.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Another change to make it easier to program the mobile ui. This was a
fairly easy patch: just moved the contents of the file and fixed the
includes.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Still trying to make it easier for the Mobile Port:
This patch is a bit bigger than I hopped, but it was the smallest that I
could get.
A lot of TODO items where added where I broke the code because the current
implementation would break the QML implementtion on the designer. I'll
most probably fix those myself when I finish the transition to the models
to the new folder.
I only moved both models at once because there's an interdependency
between them (seems inevitable, tough, but I'll take a better look at it
later).
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
models.h / .cpp was getting too big (around 2.5k lines), and each change
triggered a rebuild in tons of parts of Subsurface, this is the first
commit trying to make the models code sane by removing them all of the
models.h/cpp file and also clearning code in the process.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is an attempt to help share code between the desktop version of
Subsurface and the mobile version.
More code will be moved around and the models will be split in a way that
will help recompile times and also creation of different interfaces for
different form-factors.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Just as we would expect, the libgit2 developers of course once again broke
their API. In order to compile against current master we need to remap
those APIs once again.
Simply call cmake with -DUSE_LIBGIT23_API
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This doesn't work on QtCreator yet - but it's the documented way in CMake
to display the project hierarchy in some IDEs (the one that I know that it
works with is Visual Studio). Even knowing that this doesn't work with
QtCreator, it's a valid change because someone can fix creator in the
future.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The SimpleWidgets file was getting too big, and location information will
also need a new model - a good way to do not mix everything is to put
things in a new file.
[Dirk Hohndel: added missing include of stdint.h]
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
MACOSX_BUNDLE and WIN32 give hints to cmake for different
install behaviors. for instance, trying to copy frameworks
and other stuff to the correct places.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Only build the tests when running them. The downside of the way this is
implemented is that build errors for the tests actually show up as test
errors and are only seen in the test log - but this seemed worth not
having every build include the tests.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- don't put anything on the first line after the opening "("
- fix indentation of the closing "("
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
remoevs the extra white sapce in the generated
ssrf-version.h.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These two new options allow usage of pkg-config to retrieve
libdivecomputer and libgit2.
For some reason the variables *_LIBRARIES have to be set
to blank strings in the process, otherwise "-l" is passed to
the linker.
LIBGIT2_FROM_PKGCONFIG is a rename from PREFER_GIT_FROMSOURCE
for consistency. The IF() check is also fixed.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If NO_MARBLE is set to ON, the MARBLE package is not seeked.
If set to OFF the package is seeked, but if the find fails
the gcc definition -DNO_MARBLE is set and marble is disabled.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
NO_TESTS: disable the tests
NO_DOCS: disable the docs
Both are set to OFF by default.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We shouldn't need this. Ubuntu is once again broken. What else is new.
But since this shouldn't hurt any of the sane Linux version, I'll just add
it for any Linux flavor.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is being taken care by Qt5::LinguistTool
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
CMake still confuses me. When testing if a variable was set it sometimes needs
to want "DEFINED", but sometimes I need to compare it to an empty string. Let's
do both (this seems to fix the problem I ran into) - but this is still weird.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And use this to look for libusb.
If it's there then libdivecomputer likely was linked against it. If it isn't
then we don't need it, either.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
By adding a new CMakeLists.txt file and configuring
the translations inside of it's folder, the buildsystem
will compile everything on that folder.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And remove the old code that did the same thing in
a very complex way.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Currently we search for a static library and if we don't
find it, we search for a shared library. If one of them
is found, we return success but if none of them is found,
error. So - A static library for libgit and libdivecomputer
is preferred over the shared one.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We will use the OPTIONS variable to decide to find the
.a or the .so, so there's no need to do checks here.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- add an option to toogle between libgit2 from package vs built from source
- add two options that will be used in the future: use static/dynamic lib
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We are already looking for the default directory.
*if* cmake doesn't find Marble automatically, the user needs
to specify -DMARBLE_INCLUDE_DIR and -DMARBLE_LIBRARIES
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The pkg_config_library macro is a helper macro and was generating noise
on the main CMakeLists.txt file, so I moved it to another file.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is the correct way to deal with CMake Modules (or at least, the
default way). All our custom CMakeFiles will be here.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Qt5 Supports Components, which means that we can list the
components we need to find, instead of specifying one for
each line.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While I don't need this when building on Fedora 20, OBS builds for
openSUSE appear to fail without this. Strange.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is still not something I'm 100% sure I got right. But at least now it
correctly rebuilds the .qm files...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't try to install the TARGET into the Subsurface.app or we get a neat
infinite recursion. As a bundle cmake does all these things automagically.
Right now the version is hard coded which is ugly but since it's determined in
a separate cmake file it seemed non-obvious how to do this right...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The cmake keywords still confuse me at times.
A custom target is always recreated. How silly. But the correct (I think)
implementation is actually easier...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I guess I should add the code to move that app to /Applications but I never use
it this way... not sure how many people really install from source on a Mac,
anyway.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When building on a Mac for some reason I was getting an empty translation file
name (and therefore and entry that was the whole directory and not a
translation file. This is a bit clumsy but it fixes the problem.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Silly cmake doesn't allow a target to depend on the install target. This
ugly hack appears to be the recommended workaround :-(
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The previous attempt to install them was completely bogus as it only
worked when the source directory had previously used for an in-source
build using qmake.
Oops.
With this change we now create the translations in the build directory and
install them from there.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>