Commit graph

18082 commits

Author SHA1 Message Date
Dirk Hohndel
4c6b00f812 Update translations from Transifex
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-04 12:13:17 -08:00
willemferguson
335d3f9c07 Reorganise the current statistics tab
As the title above says....

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
2020-11-04 11:34:26 -08:00
Dirk Hohndel
041b51f930 Update translation source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-04 11:01:28 -08:00
Dirk Hohndel
9e38b2552b update CHANGELOG
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-03 23:08:39 -08:00
Dirk Hohndel
814cda7183 desktop: generalize the colorization of the tab widget
Instead of doing it just for the Information tab, do it for all of the tabs.
There's still room for improvement. But this certainly feels more consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-03 23:08:39 -08:00
Dirk Hohndel
7d18a525f1 desktop: allow update of tab widget colors at run time
Adding a new virtual function to all of these classes may seem like overkill,
but of course the idea is that likely we'd allow similar changes to all of
them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-03 23:08:39 -08:00
Dirk Hohndel
00dd98163f cleanup: random small whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-03 23:08:39 -08:00
willemferguson
8b36cf1051 desktop: offer different colors for info tab titles
Add a preference option to set the color of the text on the information tab to
either MediumBlue, LightBlue or Black. The last two of these colors are meant
to enable areadable font contrast on displays with dark mode.
The choice is saved with the other preferences.

[Dirk Hohndel: this isn't really about dark mode, so changed many of the types
	       and variable names, changed the user visible texts, and
               addressed some whitespace issues]

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-03 23:08:39 -08:00
Salvador Cuñat
1ff488a439 smtk-import: Add support for new devices model
Include devices Ids in the DC data.
Ensure we always set a DC model string for manual dives or unsupported devices.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2020-11-01 14:52:34 -08:00
Dirk Hohndel
c5ab9647d5 build-systsem: move back to Xcode 11
It appears that Xcode 12 applies some rather self defeating logic when picking
build architectures in release builds for the simulator. It adds aarch64 by
default and I can't find a way to turn that off from the command line. At the
same time, you can't link against the simulator if you have build with aarch64
as the aarch64 simulator doesn't exist, yet.

Since I couldn't get any of the claimed workarounds to work, I'm forcing Xcode
11 to be used in the Action.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-01 14:28:09 -08:00
Berthold Stoeger
386e08b69c parser: don't crash when parsing <weight> tags
When encountering a <weight> tag, we would parse into the last
weightsystem. However, we only create weightsystems when
encountering <weightsystem> tag. Therefore, this code would
either crash or overwrite the previous weightsystem.

Instead, create a new weightsystem for each <weight> tag.

Moreover, make sure that inside a <weightsystem> tag a
weightsystem actually exists. This should be the case,
but who knows...?

Reported-by: Nihal Gabr <gabr.nihal@gmail.com>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-11-01 10:59:39 -08:00
Berthold Stoeger
b2b3544f3f core: on import remove merged dives from trip/divesite
When dives were merged on import, they were not unregistered
from their dive site and trip before being deleted. Thus, these
tables had stale pointers, which would ultimate lead to crashes.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-31 23:20:59 -07:00
Dirk Hohndel
43f15f1b48 build-system: build libmtp for macOS if requested
If we are building our own dependencies (usually only for release builds), we
now also need to build libmtp.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-31 16:09:37 -07:00
Dirk Hohndel
cc04f5d3f8 cleanup: fix stupid hack for MXE build script
This is much easier.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-31 16:08:02 -07:00
Dirk Hohndel
e3cc0d9651 Update libdivecomputer
Fix two Coverity issues.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-31 15:12:18 -07:00
Dirk Hohndel
f53aa42838 Update CHANGELOG
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-30 16:36:08 -07:00
Dirk Hohndel
21882d1841 Update to latest libdivecomputer
- Garmin Descent Mk2i: add initial support for parsing cylinder pressure data

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-30 16:36:08 -07:00
Dirk Hohndel
20d97f7bff build-system: enable both 32 & 64 bit Windows builds
The 32bit build won't include libmtp and therefore won't support the Garmin
Descent Mk2/Mk2i.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-30 16:36:08 -07:00
Dirk Hohndel
f425bbbde3 build-system: switch to the 32/64bit MXE build container
This doesn't actually build 32 bit binaries, yet. One step at a time.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-30 16:36:08 -07:00
Dirk Hohndel
03e2d1e045 build-system: create an MXE docker container for both 32 & 64 bit
This should allow us to then do both 32 and 64 bit Windows builds in our CI/CD
and of course for our releases.

In order to still be able to use this container in a GitHub action, aggressively
remove things that we won't need during the build. Since we use the experimental
-squash argument during docker build, this should get us a much smaller container
image in the end.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-30 16:36:08 -07:00
Dirk Hohndel
bd0d7bd0fa build-system: switch GitHub Action Windows build to 64 bit
This is using the new build container with a 64bit MXE system.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-30 12:24:36 -07:00
Dirk Hohndel
e71e715cd3 build-system: Docker build for 64bit MXE
We previously tried to build the MXE Docker container on GitHub using
an Action, but that really didn't work well and was a lot more trouble
than it was worth.

So this goes back to an offline build mechanism where I simply create
an updated Docker image when needed and push that to Docker Hub.

But this nearly hides the most interesting change here - we are finally
switching to using 64bit binaries on Windows. It's 2020 and fewer than
1% of our users use 32bit Windows machines. We'll need to expand this
to be able to have both a 32bit and a 64bit version of Subsurface for
Windows. But for now, this solves the problem for 99% of our users.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-30 12:24:36 -07:00
Dirk Hohndel
a0cdd38ff6 build-system: adapt the smtk2ssrf script for 64bit Windows
Quite analogous to the Subsurface Windows build script.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-30 12:24:36 -07:00
Dirk Hohndel
e9073a7570 build-system: first steps towards a 64bit Windows build
This is barely scratching the surface (no put intended), and of course the
container needs to be updated, first, to have a 64bit version of MXE installed,
but this seems to help make libmtp build correctly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-30 12:24:36 -07:00
Dirk Hohndel
cdf1865246 build-system: add libmtp for our Windows builds
This uses latest master (as that's the only one that has the explicit
Descent Mk2i support in it).

Right now, unfortunately the MXE build fails.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-30 12:24:36 -07:00
Dirk Hohndel
0b13cbd81b build-system: add libmtp for Linux and macOS
Since MXE doesn't offer libmtp I'll need to add code to manually build
libmtp there.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-30 12:24:36 -07:00
Dirk Hohndel
4b24730ee6 add initial support for the Garmin Descent Mk2i
This brings in the needed libdivecomputer updates and builds Subsurface against
libmtp in order to support downloading dive data via MTP (since the Mk2/Mk2i
no longer provide a FAT filesystem via USB).

In order for this to work you need to have libmtp installed on your system.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-30 12:24:36 -07:00
Doug Junkins
31813af49a desktop: make edit icon non-transparent
Switched the edit icon to one that has the pencil color set to
white instead of transparent so that it remains visible when
switching to Mac OSX dark mode.

Signed-off-by: Doug Junkins <junkins@foghead.com>
2020-10-29 15:00:20 -07:00
Doug Junkins
e6956b9d57 desktop: add label to dive computer table
There was no "title" property on the dive computer table which
was causing an default label of "GroupBox" to appear above the
table. Added a title property to clean up the UI.

Signed-off-by: Doug Junkins <junkins@foghead.com>
2020-10-29 15:00:20 -07:00
Doug Junkins
6dccce21da desktop: use default colors for dive info labels
Removed the style change to force a style change for the labels on
the dive information page to Medium Blue. This makes labels more
readable in MacOSX dark mode since the default style changes colors
when the mode is shifted from light to dark or vice versa.

Signed-off-by: Doug Junkins <junkins@foghead.com>
2020-10-29 15:00:20 -07:00
Berthold Stoeger
7c70459f6c cleanup: remove unnecessary includes from maintab
These are artifacts from when the maintab contained more stuff.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-28 11:27:58 +01:00
Berthold Stoeger
d747d76762 cleanup: refactor subsurfacesysinfo.cpp
This used to be a copy of QSysInfo. However, once the requirement
was raised to Qt5.4, this was replaced by a subclass of the original
QSysInfo - which made the whole file mostly obsolete.

Just use QSysInfo directly where needed.

Only for windows.c, which can't call directly into Qt, keep the
isWin7Or8() helper function.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-27 16:18:09 -07:00
Berthold Stoeger
49fc05de7e desktop: move MinMaxAvgWidget to TabDiveStatistics
This is its only user and the widget is scheduled for removal.
Let's move it there temporarilly.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-26 20:56:56 -07:00
Berthold Stoeger
ab94956759 cleanup: remove dive.h include in simplewidgets.h
Let's simply forward declare the needed structures.
Also removes removes two more unnecessary includes.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-26 20:56:56 -07:00
Dirk Hohndel
2a876be844 tests: don't fail if TestGitStorage can reach the server
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
b554b3d060 build-system: use openSUSE Tumbleweed latest
Without a distro update, Leap 15.2 appears to only give us Qt 5.12.
Since the upgrade takes forever and causes problems as it requests a senseless
'reboot' of the container, let's try using Tumbleweed instead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
f3c23946f4 documentation: remove mention of Grantlee in INSTALL file
We don't use Grantlee anymore.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
f193c2ef08 cleanup: fix deprecated QVector constructor
Annoyingly, the replacement has only been available since Qt 5.14.
To make the code less messy, implement our own stdToQt conversion helper.

Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
1a0cf0bb44 cleanup: remove struct/class confusion
DiveSiteChange is defined as a struct, not as a class.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
369baa5b74 cleanup: move variable declaration closer to use
This way we avoid an unused variable warning on mobile builds.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
c5eaac122e cleanup: remove reference to deprecated enum value
This had been deprecated for quite a while.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
10695e51ee cleanup: remove unnecessary call to qsrand
We actually don't use random numbers anywhere outside TestGitStorage.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
bbb55b2973 cleanup: replace deprecated swap() usage
Instead of using the two different ways Qt supports swap, depending on the Qt
version in use, let's simply use std::swap()

Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
c463da3fac cleanup: replace deprecated pos() member
Again, replacement was just recently added.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
7fb4dd7a03 cleanup: remove unused function argument
Also, only compile the static function where it is used.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
0c2bfc1103 cleanup: replace long obsolete delta() member
This has been deprecated for years.
The delta() member dealt with the old style mouse wheel that is associated with
a vertical scroll - so we need the y-component.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
bbf76f9ee7 cleanup: don't initialize flags with just an integer
This is slightly different from the previous cleanup around QFlag use as this
one is related to QtWebKit flags. But the logic is the same.
Just syntax to avoid a warning.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
d58c962bdb cleanup: replace deprecated signal
Again, the replacement was only implemented in Qt 5.14, so more conditional
code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
ffecc00f42 cleanup: SkipEmptyParts syntax has changed
Sadly, the new enum has only been available since Qt 5.14, so this is a rather
ugly replacement.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00
Dirk Hohndel
f8f83a9986 cleanup: model isn't used in the lambda
Simply cleaning up a warning.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-26 19:27:03 -07:00