Commit graph

16295 commits

Author SHA1 Message Date
Dirk Hohndel
aff54e17e5 GitHub Actions: post releases
This so far just works on push and hopefullt pull requests, not for tags
and therefore actual releases.

In order not to conflict with the binaries from Travis, I changed the
name to "ci-release" instead of "continuous".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-18 20:46:01 -07:00
Dirk Hohndel
f099b22820 GitHub Actions: build Windows binaries
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-18 20:46:01 -07:00
Dirk Hohndel
ef3d67be08 GitHub Actions: add Linux Qt 5.12 container build
The AppImage works - I just need to figure out how to post releases. For now
it'a available on the Actions page as Artifact.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-16 10:57:32 -07:00
Dirk Hohndel
754fffc795 GitHub Actions: first CI/CD build for Mac based on GitHub Actions
This feature is in beta right now and might change without notice, but instead
of dealing with the broken Travis Mac builds, this does seem progress.

The build artifact seems to work, but it's a bit more painful to get to. Go to
https://github.com/Subsurface-divelog/subsurface/actions and click on the
corresponding run - it's then in the top right corner under Artifacts. The one
oddity is that after unzipping the file you need to manually make
Contents/MacOS/Subsurface executable.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14 21:00:10 -07:00
Dirk Hohndel
0f3d287200 Desktop: update to Grantlee 5.1
Also make sure Grantlee still compiles with Qt 5.13 by cherry picking a commit
that was added after the v5.1.0 release.

In order to identify this commit as comming from the build automation we
temporarily override the user name and email address. As a side effect this
also makes this work on Travis.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14 21:00:10 -07:00
Dirk Hohndel
01f1bea995 Mobile: ensure input fields stay visible after keyboard opens
When the user taps on a TextField to enter text, usually the virtual
keyboard will pop up. This code tries to ensure that the keyboard
doesn't cover the entry field that the user was trying to work on.

In order to centralize these changes, this introduces a new
SsrfTextField type which we use to also remove a few redundant default
settings that we previously had for every field. The one TextArea for
the Notes field didn't seem worth creating yet another type for, so
there the changes are done directly in DiveDetailsEdit.

The awkward timer mechanism is necessary as the keyboard pops up
asynchronously and then triggers a change of height for the app, so we
need to wait a little bit before doing the adjustment.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14 13:39:45 -07:00
Dirk Hohndel
85d810119b Mobile: pick icons depending on theme
QML has ways to style icons - and we use that for the main theme color,
but it doesn't seem to work (anymore?) for the edit and save icons.
Instead of tracking down what changed there, simply switch between icons
with different foreground color, depending on theme.

All the other icons seem to work well in all three themes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14 13:39:45 -07:00
Dirk Hohndel
804a5be71f Travis: test mobile build under Linux-Trusty-Qt-5.12
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14 13:37:17 -07:00
Dirk Hohndel
5ce4b3d5eb build-system: Subsurface-mobile now requires Qt 5.11
This is one of the side effects of switching to Kirigami 5.62 - but since
we build our mobile versions with Qt 5.12 and Qt 5.13, this really isn't
an issue.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14 13:37:17 -07:00
Dirk Hohndel
3df2be5c16 build-system: require Qt 5.9.1 or newer
With this all BT platforms now support BLE

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14 13:37:17 -07:00
Dirk Hohndel
d323e9381b Stop support Qt versions before 5.9
There's just no point to testing these outdated versions.
Everything we build is now Qt 5.9 or newer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14 13:37:17 -07:00
Dirk Hohndel
cd8e1eb15a Revert "Windows build: Changesto build using mxebased hidapi,libusb and grantlee"
This reverts commit 60e63afb82.

I merged this to early without paying attention to the fact that this
needed an updated build container as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14 07:31:56 -07:00
Dirk Hohndel
5f11c94f02 Mobile: improve helper function to track selected dives
While on mobile there should always be only one selected dive, it's very
cheap to make sure that amount_selected is tracked correctly.  The
incrementing of amount_selected is done in case an invalid id is passed
in.

Suggested-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
4fb2f89bb5 Mobile: another kirigami hack to make toolbar work
Without this the font size and positioning of the toolbar is broken.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
fe56fa587a Mobile: bring back the adaptive size for the tool bar
When switching to the global tool bar this was lost, and then it turned
out to be broken and required more patches to fix.

Commented out because it doesn't work at all.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
56713842b9 Mobile: ensure consistent path when accessing arrow icons
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
e3eaf03d2f Mobile: implement our own back entry for GlobalDrawer
This way we'll get a working back icon on Android and also correct font
size for the (translated) Back text.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
0d4acbd735 Mobile: add another Kirigami hack so we can fix the Back menu entry
Kirigami isn't picking up our font for the Back entry in sub menus.
Also, we still don't get a back button icon on Android. This will
allow us to work around that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
e91a8ff7f9 Mobile: hack around missing icons in the toolbar
This looks extremely fishy to me, but it does seem sufficient to
get the forward and backward buttons to show up in the toolbar.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
26a7cf1698 Mobile: hack around toolbar theme issue
Whatever I try, the toolbar background is always based on the 'active'
color set in qtquickcontrols2.conf, not on anything that I can set in
QML code. So in an effort to brute-force the issue, this hardcodes the
subsurfaceTheme value in the toolbar UI code of Kirigami.

To make this easier, this (and one of the other hacks) is added to the
existing kirigami.diff.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
fda10b8baa Mobile: update the map when the selected dive changes
Now we see the highlighted dive flag match the dive selected in the dive
list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
9a73be9207 Mobile: add helper function to keep selection in sync
Without this the core data structure never gets updated to reflect which
dive is currently selected.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
2f0689d3b8 Mobile: move pageIndex function to main.qml
This way it can be more easily called from other pages.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
2ef401ef5f Mobile: when selecting dive via map, expand its trip
Previously if the dive was in a different trip, we'd scroll to that trip
but not expand the trip, which was a confusing user experience.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
6422079de5 Mobile: when selecting dive via map, update details view
We updated the selected dive in the dive list, but not the one shown in
the details view.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
b07a1cc8b6 Mobile: when switching to the details, reuse existing page
While pageStack.push() can handle pushing a page that's already there,
that creates an unfortunate sequence of currentItemChanged signal which
leads us to do the wrong thing with our map hack.

This commit changes things around to first look for the page in the page
stack and just switch to it, and only pushing the page as new if it
cannoot be found oon the page stack.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
d8cc8732bd Mobile: use tri-state variable to improve the map hack
QML enums are a bit painful to use, so this uses poor man's emums
instead.

Basically what this changes is that a forced switch to the map doesn't
count as picking the map. That seems obviously correct, as otherwise you
could end up in a situation where a legitimate switch away from the map
is ignored.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
4e4fcda91c Mobile: insane hack to make map page work
This makes no sense and seems crazy. But it also seems to work,

For some reason with the current Kirigami version and Qt 5.13.1
selecting the map page makes the pageStack jump back to the previous
page right away. I cannot find what triggers this behavior.
Since I cannot fix the root cause, I am working around the bug. When we
select the map page we remember that fact and when a different page is
picked with the mapPage being the last page on the stack, we force the
page selection back to the map page. I can imagine countless ways in
which this could go horribly wrong - but right now I can't figure out a
better solution.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
8cd1abb7f7 Mobile: keep existing page stack when showing map
There doesn't appear to be a reason to pop all of the existing pages from the stack.
Just on principle, only close the drawer if it was open.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
e855dde965 Mobile: stop dumping the list of supported dive computers
This doesn't seem to add much value anymore and massively clutters the output.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
a200ac0982 Mobile: need to recalculate column width when rotating
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
5025943bc4 Mobile: don't make sub-pages fill the parent
This had very strange results with the current Kirigami.
Instead set the width of those pages based on our overall column width.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
b9861a0059 Mobile: change handling of columns and column width
The old calculation was clearly bogus, we'd also get zero columns here.
Instead do a correct calculation of the number of columns and make the
resulting column width a property of the rootItem so we can refer to it
elsewhere.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
e047e97190 Mobile: ApplicationHeader is now deprecated
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
1e25c85dde build-system: update the mobile components script
The hack to remove the action button caused situations where the action
button didn't return. Let's skip that for now. All the other fixes
appear to still be needed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
272cb43c4e Mobile: update Kirigami to v5.62
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
57d50d0101 Mobile: show the undo for delete for 5 seconds
Before that it was 3 seconds that was a little too short for peopl to
be happy.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Dirk Hohndel
68a752ec19 Mobile: update version number before next release
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:32:27 -07:00
Paul Buxton
60e63afb82 Windows build: Changesto build using mxebased hidapi,libusb and grantlee
Remove hidapi from manually built components and use the mxe based one instead.
Remove libzip as that is handled by mxe packages.
Update version of grantlee used to build with qt 5.13.1.
Also hide vscode files from git.

[Dirk Hohndel: combined two commits, cleaned up the commit message and removed
               one now incorrect comment line from mxe-based-build.sh]

Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:31:38 -07:00
Dirk Hohndel
9c744e401e Cloud storage: remove outdated certificate hack
The old server certificates where not recognized on some older platform,
so we hardcoded the hex digest of the valid certificate and ignored the
error.

Those certificates have been replaced last week, so there is no point to
this hack anymore - also, we should always show the SSL error, not just
in verbose mode.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-09 22:38:29 +03:00
Paul Buxton
65ec16e59d Fix text in darkmode on mobile app.
Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com>
2019-10-06 11:39:46 -07:00
Dirk Hohndel
d82e008b4c Android: switch to latest OpenSSL
If we update all this, we might as well go to the latest.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-05 08:19:31 -07:00
Dirk Hohndel
00550d9284 Android: work around Android 5.x issues with OpenSSL
The Qt documentation has specific suggestions how to build our own
version of OpenSSL in order to work on Android 5.x:
https://doc.qt.io/qt-5/android-openssl-support.html

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-05 08:19:31 -07:00
Dirk Hohndel
ea0e447e0d builld-system: switch Android to Qt 5.13.1
This fixes the SSL issue with Android 5.x/Lollipop.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-05 08:19:31 -07:00
Dirk Hohndel
4458373488 Cleanup: remove bogus code that slipped in earlier
Commit df4fbf7699 ("Android: force different font on OnePlus devices")
inadvertantly added this hunk - let's undo it again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-05 08:19:31 -07:00
Berthold Stoeger
7343fe4cc6 Cleanup: Implicitly free QApplication
Instead of deleting the Application explicitly in exit_ui(),
use a unique_ptr to have the instance automatically freed.
This is the pattern given in the Qt-docs:
https://doc.qt.io/qt-5/qapplication.html

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-04 09:19:10 -07:00
Berthold Stoeger
1e1f33c0f5 Cleanup: Make constructor of singletons private
This guarantees that they are actually singletons: there can
only be one application-wide instantiation of these objects.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-04 09:19:10 -07:00
Berthold Stoeger
3db50aedea Cleanup: Turn DiveListSortModel into classical singleton
To make this class available from QMLManager, the run_ui()
function would create the object and then set a pointer in
QMLManager. It works, but is inconsistent with the rest of
the code. Therefore, make it a classical singleton class,
which is generated on demand.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-04 09:19:10 -07:00
Berthold Stoeger
2a9a3dda20 Cleanup: turn GpsListModel into standard singleton
GpsListModel was one of those "special" singletons that could
be created explicitly with new. This would make sense if a
parameter were passed to the constructor. We only passed null,
so one might as well turn that into a classical singleton with
default constructor.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-04 09:19:10 -07:00
Berthold Stoeger
36d42a6a57 Cleanup: turn DiveListModel into standard singleton
DiveListModel was one of those "special" singletons that could
be created explicitly with new. This would make sense if a
parameter were passed to the constructor. We only passed null,
so one might as well turn that into a classical singleton with
default constructor.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-10-04 09:19:10 -07:00