aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-12-20mobile/UI: correctly theme the global and context drawersGravatar Dirk Hohndel
This requires more changes to Kirigami, but with this we get dark drawers (the menus that slide in from the side) in the dark theme. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20mobile/UI: improve theming of title barGravatar Dirk Hohndel
We do theming very differently from what Kirigami intended. Mostly that's because our code predates theirs. But also because Kirigami wants and app to simply use an OS theme - whereas we want to be able to provide different looks, independent from the OS theme. Ideally we'd still use the existing methods to change the colors and sizes of Kirigami UI elements, but for now this hack helps improve readability of the title bar. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20mobile/UI: ensure we show a line between divesGravatar Dirk Hohndel
In the dive list the rendering of the line ended up being subject to rounding errors. With this change we ensure that the thin line is always shown. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20mobile/UI: shrink dive log date buttonGravatar Dirk Hohndel
This was too big relative to the page layout. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20mobile/UI: remove the thick line between tripsGravatar Dirk Hohndel
This took up a lot of space and made the UI look stodgy. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-20mobile/UI: fine tune the action button renderingGravatar Dirk Hohndel
On some platforms the side buttons looked disjoint from the center button. This fixes that problem. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-19GitHub Actions: build all three targets in the Tumbleweed buildGravatar Dirk Hohndel
This is kind of a random choice - I don't see much value to build this everywhere, but it's kinda neat to use this to test that the -all option works correctly and does the right thing with WebKit now. And it will also ensure that the downloader build isn't broken. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-19build-system: don't build googlemaps for downloader only buildsGravatar Dirk Hohndel
This is kind of a silly optimization, but might make a huge difference in build time on a Raspberry Pi. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-19build-system: clean up handling of printing/manualGravatar Dirk Hohndel
This was wrong when running -both in the past. We only want these options for desktop builds. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-19build-system: start enabling support for downloader in build.shGravatar Dirk Hohndel
This is just adding the third option and then untangles some of the 'there are only two options' based code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-19profile: move picture removal from DivePictureItem to ProfileWidget2Gravatar Berthold Stoeger
On clicking the DivePictureItem "trash" icon, the item would delete the picture it represents in the currently displayed dive. This needed an access to the global "displayed_dive" variable, which we want to get rid of to make the profile more flexible. For example, we want to render the profile for printing without messing with global state. One solution would be to save the dive with every DivePictureItem. This commit follows a more Qt-ish strategy by handling this via signals: The close button emits a signal that is recast by the DivePictureItem and ultimately handled by the ProfileWidget2, which knows which dive it represents. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-19cleanup: remove CloseButtonItem::show() and hide() slotsGravatar Berthold Stoeger
These were only calling the corresponding functions in the base class. So just don't override them..? Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-19undo: fix annoying warning message when deleting picturesGravatar Berthold Stoeger
The RemovePictures command filters the pictures provided by the UI: only actually existing pictures are removed. The code was buggy: the original list was copied and then the filtered list was added. Thus, every picture was listed twice leading to annoying warning messages. Remove the copy. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-19undo: add \n to console warning error messagesGravatar Berthold Stoeger
To make the output more readable. Moreover, fix a comment-typo. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-19downloader: Fix typo in libdivecomputer includeGravatar henrik242
Signed-off-by: henrik242 <henrik242@users.noreply.github.com>
2020-12-17core: remove DiveObjectHelperGravatar Berthold Stoeger
Since switching to the mobile-models and removing grantlee, DiveObjectHelper was demoted to a thin wrapper around string formatting functions. The last user was removed in a previous commit. It was never a good idea, given QML's strange memory-management. Let's remove it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17mobile: remove DiveObjectHelper codeGravatar Berthold Stoeger
When editing a dive, a DiveObjectHelper of the unmodified dive was created to compare the edited with the old values. Since the DiveObjectHelper is used here only as a pointless wrapper around the formatting functions, call these functions directly. However, note that the code is in principle wrong since the change to the mobile-models, which do not use the DiveObjectHelper. The real fix would be to reload the data from the model to prevent going out-of-sync with respect to the formatting routines! Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: remove CylinderObjectHelperGravatar Berthold Stoeger
With the removal of grantlee, this became pointless glue code. Call the formatting functions directly. Since the printing code was the only user of CylinderObjectHelper, remove the whole thing. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: remove DiveObjectHelper from printing codeGravatar Berthold Stoeger
At this point (post grantlee), DiveObjectHelper is just pointless glue code. Let's remove it from the printing code and call the formatting functions directly. If necessary, move these functions to core/string-format.cpp. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: remove DiveObjectHelperGrantleeGravatar Berthold Stoeger
This was a weird helper object, needed for grantlee. Instead of storing this object, loop over cylinders and dives directly. The actual accessor function is unchanged and now generates a DiveObjectHelper or DiveCylinderHelper for every variable access. Obviously, this is very inefficient. However, this will be replaced in future commits by direct calls to formatting functions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17core: create string-format.cpp source fileGravatar Berthold Stoeger
The mobile version of the list used string formatting functions defined in DiveObjectHelper and declared in mobilelistmodels.h. Very confusing. Move them to a separate source file where - in the long run - all the string-formatting functions, which are scattered all over the place, can be collected. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17cleanup: remove QPointer instancesGravatar Berthold Stoeger
QPointer is a strange "smart" pointer class, which resets itself when the pointed-to QObject is deleted. It does this by listening to the corresponding signal and therefore is surprisingly heavy for a plain pointer. A cynic would say that the existence of QPointer is an expression of Qt's broken ownership model. In any case, QPointer was only used at two places, were it was 100% useless: As a parameter to a function and as a locally scoped pointer. It only makes sense if a) there is a chance that the object disappears during the pointer's lifetime and b) it is actually checked for null before use None of which was the case here. Remove. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: move #includes from headers to source filesGravatar Berthold Stoeger
To decrease include-file interdependencies. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: remove YearInfo structureGravatar Berthold Stoeger
This is a wrapper around "stats *" used to pass statistics through Qt's weird metatype system. Not needed anymore. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: replace dive master by dive guide in templatesGravatar Berthold Stoeger
This does not rename the variables, only the user-visible output. Case "Dive guide" vs. "Dive Guide" is according to the rest of the templates. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: refactor if and loop codeGravatar Berthold Stoeger
The loop code was buggy: the current position was only increased inside when executing the loop once. This would obviously fail for empty lists. Moreover, the whole thing was quite difficult to reason about, since a reference to the current position was passed down in the call hierarchy. Instead, pass from and to values to the parse function and create a generic function that can search for the end of loop and if blocks. This function handles nested if and for loops. The if-code now formats the block only if the condition is true. The old code would format the block and throw it away if not needed. This should now provide better diagnostics for mismatched tags. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17printing: remove objects QVariant mapGravatar Berthold Stoeger
An artifact from the old grantlee code: the whole parser state was kept in an untyped QVariant map. One case was particularly bizarre: the options were a class member and yet added to the weird map. Replace this by a strongly typed state structure. Ultimately, this will allow us to replace the "dive object helper". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17cleanup: make templateOptions and printOptions reference typesGravatar Berthold Stoeger
These two structs describe options used during printing. They are passed through numerous classes as pointer. In this case, reference semantics are preferred, as references: - can never be null - can not change during their lifetime This not only helps the compiler, as it can optimize away null checks, but also your fellow coder. Moreover, it prevents unintentional creation of uninitialized references: one can't create an instance of a class without initializing a reference member. It does not prevent references from going dangling. However, pointers have the same disadvantage. Contains a few whitespace cleanups. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-12-17build-system/iOS: fix minimum iOS version supportedGravatar Dirk Hohndel
Qt requires iOS 10, let's not pretend that we can support ancient iOS 6. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/iOS: remove outdated build-ios directoriesGravatar Dirk Hohndel
The places we build things are still rather inconsistent for historic reasons - this definitely deserves some more cleaning up. The top level build-ios dir was completely unused, and the build location for the googlemaps plugin was inconsistent with all of the other build dirs. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile: update version to 3.1.1Gravatar Dirk Hohndel
3.1.0 was never released, but this is a quick hack to work around a versioning issue in the iOS app store. Not ideal, but at least it works. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17add CHANGELOGGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile: adapt resource namesGravatar Dirk Hohndel
With the new Kirigami the URI for the backwards and forwards arrows apparently changed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17Android: improve documentation and setup scriptGravatar Dirk Hohndel
This has now been verified to work on a fresh clean Ubuntu 20.04 install, both using the docker image route as well as the full local build system. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17GitHub Action/iOS: build in the right directoryGravatar Dirk Hohndel
The way I test things locally I build in the directory above the subsurface directory. Let's match this on GitHub as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17GitHub Actions: better job namesGravatar Dirk Hohndel
This makes it more obvious which action actually failed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17Github Actions: switch to Ubuntu 20.04Gravatar Dirk Hohndel
19.10 is no longer receiving updates and causing problems when running the tests. 20.04 also uses Qt 5.12. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/iOS: ensure icons are bundledGravatar Dirk Hohndel
We already did this for Android, so let's just always do it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/iOS: remove obsolete .pro fileGravatar Dirk Hohndel
We now use a shared one in the root directory. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/iOS: create the build directory parallel to subsurfaceGravatar Dirk Hohndel
This seems more consistent with how we do things elsewhere. Also make sure that the ssrf-version.h file is created in the correct directory. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/iOS: build Kirigami separately for iOS as wellGravatar Dirk Hohndel
Since the integrated build no longer seems to work, this creates a separate Kirigami build using qmake (as I couldn't make Kirigami's cmake build work). The install target tries to install into the Qt install which may not be possible with a user account, so this instead uses the built library directly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/iOS: ensure cmake works for Qt buildsGravatar Dirk Hohndel
I stumbled across needing this when trying to build Kirigami via cmake (just like on Android). I abandoned that attempt, but there seems to be no harm in adding this. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/Android: work around missing C compiler in our build containerGravatar Dirk Hohndel
This of course needs to be fixed in the build container itself, but for now this might be enough to make progress. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/Android: we need to collect the ABIs earlierGravatar Dirk Hohndel
That's what happens if you develop a script like this sequentially. We need to have the ABIs picked in order to build googlemaps, otherwise this fails with the build container as that only includes the ARM libraries and tools. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/mobile: force using our own ECM buildGravatar Dirk Hohndel
If the OS has an older one installed, that is found first and the build fails. This way we know that ours is used. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system: configure git when running GitHub ActionGravatar Dirk Hohndel
In order to apply the patches for Kirigami, git insists on having a valid user name and email. Also, don't build the mobile app when preparing the AppImage. That build already takes way too long and we test this in a few other actions. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17build-system/Android: handle resource issuesGravatar Dirk Hohndel
It appears that the Kirigami shaders aren't bundled with the app. They should be part of the plugin, but somehow they aren't. This way things at least 'mostly work'. We also need the icons. And to make this a bit more structured, move those resource declarations into the Android part of the qmake file until we know how all this works out on iOS. The Android app is still fairly unusable with all kinds of weird font problems and many other issues, but at least it once again starts. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile: more build hackeryGravatar Dirk Hohndel
So while the documentation explicitly says that you need to have the getInstance()registerTypes() call, that clearly is not supported if you build kirigami as a library. Even the required include file doesn't exist in the install-root. So let's try some other way to make this work. Heck if I know what the correct way of doing this might be. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17android/build-system: build kirigami as libraryGravatar Dirk Hohndel
Doing it this way using the cmake build system at least gets us to the point where everything links and appears to fit together. It still doesn't work at all, but hey, progress. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17mobile/qmake: use correct Kirigami filesGravatar Dirk Hohndel
And don't try to build kirigami in the same qmake run. The inclusion of the .pri file doesn't appear to lead to a build that works. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>