Commit graph

18316 commits

Author SHA1 Message Date
Berthold Stoeger
712e4680ca preferences: connect() dialog page only once
Weirdly, the settingsChanged() signal of the dialog-pages was
connected() to the settingsChanged() signal of the dialog
every time the settings were accepted. Do it only once
in the constructor.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-12 15:52:40 -08:00
Berthold Stoeger
0fab09a990 preferences: don't remove/add pages in refreshPages()
This function was called when opening the preferences dialog
to update all the pages with the current preferences.

For unknown reasons it also removed / readded all the pages.
Remove that code and use the now leaner function when refreshing
the pages.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-12 15:52:40 -08:00
Berthold Stoeger
f3a2ee8082 preferences: sort pages only once
After each addition of a page in the constructor, the list was
resorted. This appears pointless. Instead, sort the list only
after all pages were added.

Since the add-page function is now a single line, remove it.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-12 15:52:40 -08:00
Berthold Stoeger
2d7be7a0e3 preferences: create global settingsChanged signal
So far, the PreferencesDialog emitted a settingsChanged signal.
This meant that models that listened to that signal had to
conditionally compile out the code for mobile or the connection
had to be made in MainWindow.

Instead, introduce a global signal that does this and move
the connects to the listeners to remove inter-dependencies.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-12 15:52:40 -08:00
Berthold Stoeger
8bbd778c28 cleanup: remove unused PreferencesDialog::emitSettingsChanged()
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-12 15:52:40 -08:00
Robert C. Helling
e7a18456c9 Add surge etc to printing template variables
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-12-12 16:37:29 +01:00
Robert C. Helling
11eec0a503 Fix cylinders in printing templates
These did not appear in our templates. With this commit,
there are two lists to iterate over, cylinders and
cylinderObjects:

cylinders has just one property: description which is a string
summarizing cylinder information

cylinderObjects has the individual properties addresable

This also fixes a bug when the iterator variable did not
have the singular name of the list it iterates over.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-12-08 21:46:10 -08:00
Robert C. Helling
5452001dce Shorten the packages list
I compared the packages to those that come with a fresh Raspian
install and also removed those that are dependencies of others.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-12-03 13:26:55 -08:00
Dirk Hohndel
409a8c7223 downloader: set default logfile name
This way we always get a libdivecomputer log.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-03 13:26:55 -08:00
Robert C. Helling
df9a52d857 downloader: filter possible devices and add mounts, remember last choices
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-12-03 13:26:55 -08:00
Robert C. Helling
8934d9744a downloader: make cgi-script functional and add documentation
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-12-03 13:26:55 -08:00
Robert C. Helling
40311362f3 downloader: save downloaded dives
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-12-03 13:26:55 -08:00
Robert C. Helling
5e34531e32 downloader: wait for download thread
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-12-03 13:26:55 -08:00
Dirk Hohndel
eac59a79d8 build-system/downloader: cli-downloader isn't part of the core
It's part of the main excutable / helper and needs to be linked before
all of our support libraries.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-03 13:26:55 -08:00
Robert C. Helling
faf4736675 downloader: turn off bluetooth mode for now
Eventually, this should also be set from the command line.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-12-03 13:26:55 -08:00
Robert C. Helling
f0a512b0b8 downloader: add first downloader CGI script
This script will function as glue between a web server
and the downloader command line app.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-12-03 13:26:55 -08:00
Robert C. Helling
d73c70181f downloader: require only Qt 5.11
Qt 5.11 is what current Raspian comes with. Unless we
really need it, let's try not to have to manually download
Qt on an already slow RaspberryPi.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-12-03 13:26:55 -08:00
Robert C. Helling
85f8978e74 downloader: this is a QCoreApplication
This prevents it from trying to open a display.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-12-03 13:26:55 -08:00
Robert C. Helling
b39e77071e downloader: small improvements
Provide supported dive computer list on the command line
and actually call the cli download. Still not functional.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-12-03 13:26:55 -08:00
Dirk Hohndel
31f0741ecc downloader: first outline of downloading dives from a device
This is of course not functional at all, but it gives a first idea of
what we will need to do in this code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-03 13:26:55 -08:00
Dirk Hohndel
25d7c58c07 downloader: first step to get instructions via CLI
This still doesn't do a thing, but at least it seems to get the
information closer to where we want it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-03 13:26:55 -08:00
Dirk Hohndel
5a8db97819 build-system: add models and shared backends to the downloader
We'll need this in order to be able to actually open dive files and
download things from a dive computer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-03 13:26:55 -08:00
Dirk Hohndel
057c151fe8 build-system: start adding a headless build
Right now this doesn't do a thing, but it gives us a nice target that
has far fewer dependencies and should contain enough parts to download
stuff from a divecomputer and then sync that with cloud storage.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-03 13:26:55 -08:00
Berthold Stoeger
a23c3d0bb1 cleanup: remove unnecessary includes from divepicturewidget.cpp
Also, use finer-grained Qt includes instead of the full QtWidgets
include.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-03 10:32:20 -08:00
Berthold Stoeger
7e8636d7be cleanup: remove unused function in templatelayout.cpp
This was removed with grantlee.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-11-26 21:45:17 +01:00
Berthold Stoeger
b36178a00a cylindermodel: remove in_planner() use
in_planner() is problematic, since it is uses desktop-only
application state. Since the cylinder-model already has
an appropriate inPlanner flag, use this instead.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-11-24 10:54:10 +01:00
Berthold Stoeger
e47b812fd0 diveplannermodel: replace in_planner() by isPlanner()
The in_planner() function is problematic, because it depends
on the application state that is only available on desktop.
If we ever want to port the planner to mobile, we have to get
rid of it. Luckily, the DivePlannerModel already has an
appropriate flag that can be used instead.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-11-24 10:54:10 +01:00
Dirk Hohndel
f4ef9565a7 android: find the translations
As we switched to the qmake based build we now bundle the translations
via the Qt resource system instead of explicitly as Android assets. This
adjusts the code that opens the translations accordingly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-23 08:30:57 -08:00
Dirk Hohndel
feb4ec2f6a android: force inclusion of 32 & 64 bit openssl libraries
The reference via 1160{QT_ARCH} should work, but for some reason it
doesn't. Making it explicit is technically wrong, but at least it
appears to ensure that the shared objects are bundled correctly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-23 08:30:57 -08:00
Dirk Hohndel
3e8bd6caa3 Get ready for 4.9.10
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-20 13:53:26 -08:00
Dirk Hohndel
6d9b88938d Update translations from Transifex
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-20 13:03:48 -08:00
Dirk Hohndel
da5e05dd81 android: bundle the default font for OnePlus devices
This was missed in the transition to the qmake based build.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-20 11:46:17 -08:00
Dirk Hohndel
4c3b6e6df2 android: avoid crash with failed font load
Check that we found font families before accessing them.
But the larger issue is likely that bundling the font failed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-20 11:46:17 -08:00
Dirk Hohndel
e6804152e5 Adjust translations based on completeness
Dropping Latvian and Turkish as they fell way too low.
Adding Croation which is long overdue (can't believe I missed this for
so many releases).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:41:45 -08:00
Dirk Hohndel
16fb67706a Update translations from Transifex
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:27:08 -08:00
Dirk Hohndel
e3d4b91070 android: ensure that gradle can handle UTF8 files
This should be the case automatically, but appears to fail when run as part of
the GitHub Action.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
706f44a13c build-system: update GitHub Action to use current android container
This brings the scripts and the container in use back into sync.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
cb4ccea3c2 build-system: update Android builder docker container
This adjusts the docker setup to create a container with the correct
NDK, SDK, tools, Qt version, etc, and updates the helper scripts that
are needed in order to do that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
3071ea06f0 android: ensure all required pieces are in place for the build
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
068c7f5de1 android: move the build of googleaps plugin
We want to build the googlemaps plugin once we know with architectures we are
building for. So let's do that right before we build Subsurface-mobile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
198096e30e iOS: adjust GitHub Action to new build format
It's frustrating that I can't get the translation.qrc support the translation
files to be created in the build directory. Having them as part of the sources
just feels wrong.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
695950b15a build-system: fix tests in mobile builds
We can no longer build TestPictures in mobile builds.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
9909cbd273 mobile: update version to 3.1.0
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
648402506f build-system/iOS: no longer build in packaging/ios
That always was such a weird choice.
This also adjusts to a minor change in the layout of libgit2 sources.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
e73a82cd70 build-system: combine iOS and Android Subsurface-mobile.pro
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
64913bba47 android: add qmake based build for Subsurface-mobile
Several features that are needed to create Android bundles with the
current NDK and QT 5.15 aren't easily available when using cmake. Given
that we already do a qmake based build for iOS, I decided to simply
switch Android to that as well.

An added complication is that some of the magic that qmake uses to do
the right things fails if the .pro file isn't in the root directory of
your project. So this is right now somewhat inconsistent with the way we
build for iOS. Something that should get cleaned up in the near future
as it makes no sense to maintain two separate .pro files.

This commits also adds a new build shell script to drive the assembly of
all the dependencies. Once again this is a new file with the old one
left in place for now (but to be removed fairly soon).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
3a00ac0157 android: add new build setup script
This installs the required versions for most components, switches us to
Qt 5.15, current SDK, NDK, and the current OpenSSL version.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
fd88058060 android: update Subsurface-mobile manifest for Qt 5.15
With the switch to the bundle build (introduced at Qt 5.14) a couple of the
settings in the manifest had to change.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
480cdca0e9 mobile: hack around error with readonly properties
This used to work, and still works with Qt 5.15 on the desktop, but on
Android we get a fatal error trying to open the app. So let's just add
another hack on top of all the other hacks we already have.

Eventually we need to bite the bullet and update Kirigami. I just wish
that wasn't such a pain.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
47c837cc42 core/picture: don't compile all on mobile
We don't support adding pictures and videos on mobile, so let's not
referernce the infrastrutcture that's needed for that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00