Commit graph

720 commits

Author SHA1 Message Date
Lubomir I. Ivanov
2006513169 packaging/windows: add the /styles folder
For Windows, the Subsurface installers do not include
the file "qwindowsvistastyle.dll" required to make the
applications that are published to have a native look.

Modify the MXE *build.sh scripts to include the
file as "plugins/styles/qwindowsvistastyle.dll".

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2020-10-09 07:31:54 -07:00
Dirk Hohndel
ec7422feb5 build-system: remove Grantlee from the packaging scripts
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-08 12:19:39 -07:00
Berthold Stoeger
2f5223035a filter: add filter preset undo commands
Add undo commands to add / edit / delete filter presets.
These are styled after the other undo commands: On changes,
the UI is informed by DiveListNotifier signals. Editing is
a simple std::swap of values.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-29 16:13:03 -07:00
Berthold Stoeger
536fc05dd6 filter: add (very primitive) filterpresetmodel
Implement a trivial model to provide the filter preset names
to the UI. Sadly, for now this features the QWidget/QML
column / name dichotomy. However, in this simple case that
shouldn't be too much of an issue.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-29 16:13:03 -07:00
Berthold Stoeger
937fdb500b filter: add primitive filter presets
Add a rudimentary list of filter presets to the core. The list
is sorted by name. Access is provided via a C interface so that
the presets can be written to the git and XML logs. Internally,
the list is realized by a C++ vector for convenience (euphemism for
laziness).

Morover, a C++ interface is provided for the UI. Currently names of
the presets cannot be edited, since this would mean that the order
of the list changes. This may be implemented later if required.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-29 16:13:03 -07:00
Berthold Stoeger
af9d379a41 filter: add filter constraint model
Add a model that keeps track of a list of filter constraint and makes
them accessible from Qt. Sadly, this is mostly repetitive boiler-plate
code, but this is due to Qt's model/view-API, which is a perfect example
of how *not* to design a reasonable modern API.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-29 16:13:03 -07:00
Berthold Stoeger
634152ae43 filter: add filter constraint object to the core
Adds a filter constraint object to the core, which represents one
constraint the user can filter dives with. The plan is to write these
constraints to the XML and git logs. Therefore, this code is written
in C-style except when it comes to handling strings and dates, which
is just too painful in plain C.

There is one pointer to QStringList in the class, though when compiled
with C, this is simply transformed into a pointer to void. Granted,
that smells of an ugly hack. However it's more pragmatic than
self-flaggelation with C string and list handling.

A filter constraint is supposed to be a very general thing, which can
filter for strings, multiple-choice lists, numerical ranges and date
ranges.

Range constraints have a range mode: less-or-equal, greater-or-equal
or in-range. Text constraints have a string mode: startswith, substring
or exact.

All the data are accessed via setter and getter functions for
at least basic levels of isolation, despite being written with
a C-interface in mind.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-29 16:13:03 -07:00
Dirk Hohndel
2a3a58a3c7 build-system: update OBS spec file
Just trying to keep things in sync with what we actually use in the automated
builds.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-28 11:19:21 -07:00
Dirk Hohndel
63cc2d864f build-system: document how to create a Windows installer
These are the instructions that I use at this point.

Removed a long obsolete script - it's been many, many years since that last was
useful (it was still using qmake to try to build Subsurface)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-28 10:38:08 -07:00
Dirk Hohndel
d73e0a0fb4 build-system/packaging: add bluez dependency for Linux builds
I hope this captures all the variations

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-19 19:26:56 -07:00
Dirk Hohndel
601f49ab84 build-system/macOS: change signing to re-enable notarization
This continues to be useless for other people as it requires my signing key,
but when signed like this I can then successfully submit the dmg for
notarization, so I'll update the signing script in order not to lose that
magic...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-13 18:34:36 -07:00
Dirk Hohndel
53ea3b4964 build-system/macOS: use consistent code to pick SDK
Hardcoding versions was kinda silly. This now matches what's in build.sh.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-13 13:55:46 -07:00
Berthold Stoeger
a01ab81713 cleanup: fold core/divecomputer.cpp into core/device.c
core/device.h was declaring a number of functions that were related
to divecomputers (dcs): creating a fake dc for manually entered dives
and registering / accessing dc nicknames. On could argue whether
these should be lumped together, but it is what it is.

However, part of that was implemented in C++/Qt code in a separate
core/divecomputer.cpp file. Some function therein where only
accessible to C++ and declared in core/divecomputer.h.

All in all, a big mess. Let's simply combine the files and
conditionally compile the C++-only functions depending on
the __cplusplus define.

Yes, that means turning device.c into device.cpp. A brave soul
might turn the C++/Qt code into C code if they whish later on.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-13 13:54:59 -07:00
James Wobser
4f3b26f9b6 Implement Seac SeacSync databaser parser.
Dives for the seac action computer are imported by the seacsync
program into two tables in an sqlite3 database.

The dive information is read from the headers_dive table.
The dive_data table is then queried for each dive to get samples.

The seac action computer is the only current supported computer
by the seacsync program. It only supports two gas mixes, so the
parser will toggle between two cylinders whenever it detects a
change in the active O2 mix.

Dive start time is stored in UTC with a timezone offset.
A helper function to read this was added to qthelper.

Default cases have been added to some switch statements
to assist in future development for other dive types and
salinity.

Example database has been added to ./dives/TestDiveSeacSync.db

Signed-off-by: James Wobser <james.wobser@gmail.com>
2020-09-04 15:54:08 +03:00
Dirk Hohndel
02a4aa927e build-system: update Ubuntu distros that we build for
Eoan no longer accepts builds, Groovy Gorilla will be the next one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-03 11:43:24 -07:00
Paul Buxton
a753845d5a build-system/MXE: build with more up to date MXE tools.
- use hidapi grantlee and mdbtools from MXE
- update MXE version to use QT 5.15, and pull in libzstd and  CMake 3.17.3
- fix linking of winmm on windows build with new mxe
- add some instructions on building the container
- add some new dependancies from QT 5.15 to the packaging
- add a patch to MXE to Build qtconnectivity with native-win32-bluetooth

[Dirk Hohndel: small refactor]

Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-06-25 11:00:51 -07:00
Dirk Hohndel
2690325623 Android: install translations into the right place
When updating the NDK I forgot to adjust the install destination for the
translations.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-27 12:41:14 -07:00
Dirk Hohndel
9815024199 add Berthold to the list of explicitly mentioned developers
Number 3 overall committer with currently 9% of total commits and 27% of all
commits in the last three years.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-09 17:21:43 -07:00
Berthold Stoeger
fe82cb32b9 media: add small C++ helper describing a picture struct
By using a std::string instead of a C-string, memory management
becomes so much simpler! This class will be used for keeping track
of deleted/added pictures in the undo system.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-06 13:58:09 -07:00
Berthold Stoeger
e61641c79c undo: implement undo of setting a picture time by drag&drop
Even though the functionality is seemingly trivial, this is a bit
invasive, as the code has to be split into two distinct parts:
1) Post undo command
2) React to changes to the divelist

Don't compile that code on mobile.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-06 13:58:09 -07:00
Dirk Hohndel
006d630142 build-system/Android: add missing install-qt.sh
This file is copied from the QBS project. It's under LGPL and therefore
compatible with our licensing. While it would be possible to retrieve
this file at build time from the original project, for now it seemed
easier to include it in our repo.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-27 11:04:29 -07:00
Dirk Hohndel
da953fa18a move GitHub url to the Subsurface org
Instead of using the Subsurface-divelog user on GitHub, we now use an org that
was generously donated to us.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-26 16:36:30 -07:00
Dirk Hohndel
f04bfd4a86 GitHub Actions: use the Qt 5.13.2 based Android build container
This is no longer created using GitHub actions (but all the necessary
information is still included in this repo). We need to be able to
shrink this container so our GitHub Action runs don't run out of disk
space.

Adjust the path where the resulting binaries are found with this build.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
0fe02af0e8 build-system/android: remove libusb at QTest
We no longer use libusb to access USB devices on Android, therefore
there's no point including libusb in our build. Also, we have never even
attempted to run the tests on Android, so let's not even pretend to
support building them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
d3e495efd0 build-system/Android: use PREFIX outside of NDK
If we install our support libraries into the NDK we later run into
include path order issues that result in strange errors around the
inclusion of math.h (because we find the C version of that include
file that ships with the NDK before we find the libstdc++ version
of math.h (because the include path for our support libraries is
listed before the libstdc++ include search path). By having a distinct
install-root for our libraries we can avoid this problem.

Remove the previous hack that tried to work around the symptoms of
this issue.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
f112be7a61 build-system/Android: use install-qt.sh to install Qt
The official installer now requires the user to log in which we can't
really do in a scripted manner. Let's see how long this way of
installing things will be available.

While doing this remove an ancient hack of some Qt settings that we no
longer need.

This also tries to prune some things that we don't need in the Docker
image to reduce image size.

The mapbox plugin is removed as it would add a dependency to QtSql which
we otherwise don't need. And since the plugin isn't used, no point in
installing it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
c0ecd3a597 build-system/Android: create standalone toolchain in wrapper script
This way when we build the android build container, the correct toolchain
is already in place.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
9025a9b2b1 build-system/Android: update some dependency versions
Qt 5.13.2 fixes a few bugs.

We are NOT switching to Qt 5.14 as that breaks a ton of things with
Android support. At this point even with qmake it near impossible to get
working Android binaries, no one appears to have a solution for cmake.

With qt-android-cmake current master fixes the problem that held us back
at the earlier commit, so let's go back to using master.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
999cc2d642 build-system/Android: remove no longer supported Qt versions
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
08c5788020 build-system: cleanup Ubuntu/Debian script
This code block was also for the OBS builds and is no longer needed now that we
have to separate make-package scripts.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-19 14:27:54 -07:00
Dirk Hohndel
195d43d186 build-system: simplify and clean up OBS make-package script
The previous version wasn't quite ready for prime time.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-19 08:41:29 -07:00
Dirk Hohndel
2f8c968ff9 build-system: remove OBS support from Ubuntu/Debian scripts
This feels much cleaner.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-19 08:17:15 -07:00
Dirk Hohndel
83a963bc37 build-system: create separate OBS make-package
It seemed very odd to have those steps mixed in with the Ubuntu/Debian
instructions. Yes, there is a bunch of overlap, but this seems much cleaner.

This also updates the spec files to something that works for the current
sources.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-19 08:17:15 -07:00
Dirk Hohndel
37badf2746 cleanup: fix image reference in Android README
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18 17:38:09 -07:00
Dirk Hohndel
b38138fd0d build-system: update Ubuntu/Debian package script
This cleans up a lot of the ancient mess in that file.

It's still confusingly usable to push sources to OBS as well (but that's now
hidden behind an option) and it is still somewhat custom-made for me, but it
should be much easier to reuse for others now.

In addition to Subsurface and libdivecomputer we are inclooding the googlemaps
sources and libgit2 1.0.0 sources. Bionic is the only remaining distro that we
support that doesn't have a new enough version of libgit2 (0.26 is the minimum
we expect), but since we are linking statically against it, maybe it's best to
simply force all of these builds to include libgit2 1.0.0.

Handling of the debian/* files in the script has been changed quite a bit to
make it easier for others to create a working setup. It now updates all of the
files with the exception of the changelog files from the sources we are
building from. I am hoping that this will be a not-so-subtle incentive for me
to keep the bundled versions up to date.

Since we no longer do beta releases, I removed that part from the file.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18 17:38:09 -07:00
Dirk Hohndel
29884ba307 build-system: remove references to docs we no longer ship
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18 17:38:09 -07:00
Dirk Hohndel
ef947ffc1f build-system: silence one more warning for Ubuntu/Debian builds
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18 17:38:09 -07:00
Dirk Hohndel
da5aa06cc0 build-system: get ready for switching to libgit2 1.0
We want to build this against its own regex package to avoid adding more system
dependencies.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18 17:38:09 -07:00
Dirk Hohndel
c8f40c57c9 build-system: add missing dependencies for Ubuntu/Debian build
And acknowledge the current file format standard.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18 17:38:09 -07:00
Dirk Hohndel
a3731ecc69 build-system: update copyright years in Ubuntu/Debian files
And remove an optional entry (which we would have to keep changing otherwise).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18 17:38:09 -07:00
Dirk Hohndel
afccff08dc build-system: add valid Ubuntu/Debian changelog file
We don't want to try to track every change to this file in our source repo, so
this starting point is as goos as any.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18 17:38:09 -07:00
Dirk Hohndel
61f9c4114e
Merge pull request #2737 from Subsurface-divelog/libgitCleanup
Libgit cleanup
2020-04-10 17:19:51 -07:00
Berthold Stoeger
3f3869ff65 media: move picture function from dive.c to picture.c
Currently, move only those functions that do not access dive
structures.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-10 10:53:03 -07:00
Dirk Hohndel
3828ec6097 build-system: remove references to long gone support for libgit2 < 0.23
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-09 17:05:24 -07:00
Dirk Hohndel
f9ccbabb3d cleanup: update all copyright dates to 2020
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04 12:00:24 -07:00
Dirk Hohndel
0d8324bfb4 iOS: fix libxslt build
We need to build libxml2 without LZMA.
We need to make sure that libxslt finds the libxml2 includes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04 11:09:17 -07:00
Dirk Hohndel
6c5c2bfb18 iOS: clean up build shell script
Address shell linter comments. Follow our usual naming for build dirs.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04 11:09:17 -07:00
Dirk Hohndel
5178ea2d15 iOS: add libxml2 build
I don't know why this is suddenly needed and wasn't before, but hopefully
this fixes the broken builds on GitHub.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-04 11:09:17 -07:00
Berthold Stoeger
8c63d4e2bd build: use -Wno-inconsistent-missing-override in Subsurface-mobile.pro
The inconsistent-missing-override warning is annoying as it prevents
us from adding "override" modifiers: It will warn if we do this only
for selected functions. Sadly, this is the default on clang. Therefore,
we disable this warning for quite some time in CMakeLists.txt. For
consistency also do this in the Subsurface-mobile.pro file.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-01 12:26:59 -07:00
Dirk Hohndel
7719373f1a Android: remove legacy FTDI support
This works on almost no devices anymore and has been replaced by the USB
serial support for Android.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16 07:58:20 -07:00