Commit graph

18439 commits

Author SHA1 Message Date
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
Dirk Hohndel
afb062611c build-system: use libgit2 1.0.1 if building from source
We still only require v0.26 from an API perspective, but it seems
backwards to build that version when building from source as we do for
macOS or Android.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
9f98369106 ios: correct capitalization of filename
This was changed in commit 9ed886e4be ("Cleanup: lower-case filenames in
core/subsurface-qt/") but since iOS builds happen on a case-insensitive
file system, no one ever noticed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
d6d3c9a02f core: fix incorrect QString::asprintf/vasprintf usage
These are static functions, they cannot be used as a method on an object to
construct that object.

commit aa5f2e7c73 ("cleanup: replace deprecated sprintf()/vsprintf() calls")
introduced this bug in an ill-advised attempt to deal with a deprecation
warning.

This caused us to not print GPS coordinates in the UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-17 12:56:40 -08:00
Berthold Stoeger
71389cfa92 cleanup: remove empty function MainTab::reload()
This used to reload the completion models. Moreover, remove two
obsolete member-function declarations.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-11-14 10:01:50 -08:00
Berthold Stoeger
38a784f5af desktop: automatically reload completion-models
Instead of programatically reload the completion models, listen
to the relevant signals in the models. To that goal, derive all
the models from a base class.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-11-14 10:01:50 -08:00
Berthold Stoeger
52d5125926 undo: add a general dives-imported signal
Add a general dives-imported signal for those cases where we
want to fully rebuild models, notably, the completion models.
The divesAdded signals are too fine, because they are sent
per trip and we don't want to reload these models multiple
times per import.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-11-14 10:01:50 -08:00
Berthold Stoeger
67d956b44c cleanup: remove macros from qt-models/completionmodels.cpp
There were macros to auto-generate functions to reload the models.
One was only used once and therefore is pointless. The other can
be replaced by a function with a pointer-to-member-variable argument.

While doing this, adapt the coding style.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-11-14 10:01:50 -08:00
Robert C. Helling
10bedf02d0 Gracefully handle infinite MND for oxygen
When breathing pure oxygen and considering it not
narcotic, there is not maximal narcotic depth and
the formula divides by zero. So better, handle this
case separately.

Fixes #3080

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-11-13 11:10:48 -08:00
Dirk Hohndel
78da1869ce Update README and ReleaseNotes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-12 11:24:50 -08:00
Berthold Stoeger
b390fb368d desktop: update completion models if dive was edited
In the main-tab, when changing tag, buddy or divemaster,
update the corresponding completion model.
This is a quick-fix and the wrong thing to do. It works only
if the currently shown dive is changed, which is not a given.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-11-12 11:22:12 -08:00
Berthold Stoeger
0272f118ae printing: properly initialize DPI value
The DPI value in the print_options structure was never initialized.
This could lead to random DPI values and crashes. How this ever
worked is a mystery.

Therefore, read and write the DPI value from the settings just
as the other print-options. And initialize the corresponding dialog
widget to this value.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-11-12 11:20:54 -08:00
Dirk Hohndel
6d93a14d18 build-system: giving up on TestGitStorage
It is completely incomprehensible why these fail. And why randomly restarting
sometimes fixes them, and often doesn't. At this point there is no incremental
value in having this test. If it were to ever catch a real bug, we wouldn't
realize it because we are too well trained to ignore the problem.

Very disappointing, but IMHO the right thing to do.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-12 11:19:55 -08:00
Dirk Hohndel
69e7baf682 build-system: allow building only a 64bit Windows installer
This is simply a time optimization that is sometimes useful

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-12 11:19:55 -08:00
Dirk Hohndel
10a026b2ff filter: avoid Windows crash
The scope confusion between s (the for loop variable) and s (the function
argument) caused a crash in the s.split() on Windows.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-12 07:46:52 -08:00
Dirk Hohndel
6133796cda Update latest translations from Transifex
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-10 08:39:25 -08:00
Dirk Hohndel
d3a3263671 Update Supported Divecomputers list
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-09 07:13:16 -08:00
Dirk Hohndel
95a82ef035 Update ReleaseNotes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-08 16:15:25 -08:00
Dirk Hohndel
79c7ac347a Update to latest libdivecomputer
Merge git://github.com/libdivecomputer/libdivecomputer into Subsurface-DS9

  Merge upstream libdivecomputer from Jef:

   - support the Scubapro Aladin A2

   - improve Cressi Goa support

   - parse and report Oceanic firmware versions

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-08 16:12:50 -08:00
Dirk Hohndel
cd0aec4f17 Latest translations from Transifex
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-08 15:58:16 -08:00
Dirk Hohndel
947a100d45 translations: brute force adjustment of tranlated text
Thanks to commit 299ba20364 ("Update translation source strings") all
the translated terms in the Command classes are now part of the base
class. So remove the references to the subclasses in the translation
sources as well.

Fixes: #3068

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-08 14:56:19 -08:00
Dirk Hohndel
299ba20364 Update translation source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-08 14:41:40 -08:00
Dirk Hohndel
8e3f7f9565 desktop: fix translation implementation
We need to always call the tr() function of the base class. This will have
consequences for our translations.

See: #3068

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-08 14:39:26 -08:00
Dirk Hohndel
51d0cb7aba Update README, ReleaseNotes and CHANGELOG
This is the first step towards the 4.9.8 release.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-07 15:59:08 -08:00
Dirk Hohndel
58ea215881 desktop: minor tweak for dark modes
This ensures that the BT/BLE devices are legible, regardless of light or dark
mode.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-07 15:23:53 -08:00
Berthold Stoeger
41c0fb4039 filter: don't escape '&' in filter-preset menu
When constructing an action, '&' is used as the keyboard shortcut
marker. Since this mangles preset names, use the setIconText()
function of the action instead.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-11-07 14:08:39 -08:00
Berthold Stoeger
5caac4c480 filter: don't render filter preset name as HTML text
QLabels must be explicitly set to not accept HTML input.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-11-07 11:37:51 -08:00
Berthold Stoeger
396598430b desktop: fix saving of column-widths of device and site tables
Qt's memory management scheme is completely broken and messes
with common expectations.

QObjects are organized as a tree. The children are destroyed
in the destructor of QObject. This means that they are destructed
after the destructor of the parent object has run and its
sub-object were destructed. Obviously, this makes no sense as
the child objects should be able to access their parent at
any time.

To restore the commonly expected deterministic order of
construction and destruction, one might simply do away with
Qt's silly object tree and organise things using classical
subobjects. However, that breaks with the Qt-generated UI
classes: The objects generated by these classes are *not*
destructed with the UI class. Instead, they are attached
to the widget's QObject tree. Thus these are again destructed
*after* the widget! Who comes up with such a scheme?

In our case this means that we cannot have models used for
TableViews as subobjects, because the TableView needs the
model to save the column widths in the destructor. Which,
as detailed above is called *after* the desctructor of the
widget! Thus, turn these models into heap-allocated objects
and add them to the QObject tree.

Funilly, this exposes another insanity of Qt's QObject tree:
Children are destructed in order of construction! One would
expect that if objects are constructed in the sequence
A, B, C one can expect that C can, at any time, access B and A.
Not so in Qt: The destruction order is likewise A, B, C!

Thus, take care to init the widgets before the model. Jeez.

Finally, print a warning in the column-saving code of
TableWidget, so that these kind of subtleties are caught
in the future.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-11-07 11:37:51 -08:00