aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-03-25mobile/profile: ensure profile opacity resets when zoomingGravatar Dirk Hohndel
It's possible for our code to think that the user wants to pan the profile before realizing that the user actually is making a pinch gesture. In that case the profile could get stuck in semi-transparent mode. This prevents that from happening by explicitly resetting the opacity to 1.0 when we start a pinch. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-25mobile/profile: adjust offsets when scalingGravatar Dirk Hohndel
If the user is scaling out again we need to make sure that our offsets are adjusted so that we always show a subset of the profile and not 'empty space' outside of it. Instead of reimplementing the offset logic, let's just trigger another paint() call. This requires a trampoline function because of different signal and slot signatures. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-25mobile/profile: don't pan outside the actual profileGravatar Dirk Hohndel
When zooming and panning the profile, make sure we always show a subset of the profile and don't end up showing the empty space outside of the profile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-25mobile/debug: simulate zooming through mouse wheel on desktopGravatar Dirk Hohndel
And allow touchpad gestures to be recognized as well. This has no negative impact on the mobile platforms, but makes it much easier to test profile scaling / panning on the desktop. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-24cleanup: fix unitialized valueGravatar Dirk Hohndel
Fixes CID 355179 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-24mobile/user-manual: some tuning of the textGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-24mobile/user-manual: typo fixesGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-24divelist: don't initialize invalidFont at startupGravatar Berthold Stoeger
To mark invalid dives, we use a struck-out font, which was a static variable at translation unit scope, i.e. initialized at application startup. Sadly, this crashes on iOS. It is unclear when we can initialize fonts. Try to move initialization to the constructore of DiveTripModelBase and make the font a member of that class. For consistency, also make the invalidBrush a member of this class. This now means that the diveData function cannot be static anymore, since it needs access to the font and brush. But OK. Reported-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-23macOS: still issues with mixed case namesGravatar Dirk Hohndel
It's 2020. And by default the file system in macOS is still case insensitive. Right. Of course. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-23Latest translationsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-23mobile/profile: don't pan unless we are zoomed inGravatar Dirk Hohndel
This way someone trying to swipe from dive to dive won't inadvertantly pan the profile instead. And panning it really only makes sense when zoomed in in the first place. This could leave us in a situation where we zoom in, pan, zoom out and now the profile is out of whack and we cannot correct it. A simple click on the profile fixes that. The real solution would be some constraining / adjusting as we zoom and pan to ensure we keep things correctly positioned. Maybe I'll figure out the correct way to do this later... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-23mobile: show the new v3 user manualGravatar Dirk Hohndel
I would love to figure out a way how to bundle the user manual and load it from the device file system, but in the meantime this should continue to work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-23Subsurface-mobile v3 user manualGravatar Dirk Hohndel
While this is based in large parts on the existing manual, it is a fairly substantial rewrite with mostly new screenshots. Includes edits by Rainer Mohr. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-22translations: update sources and translationsGravatar Dirk Hohndel
With the change in context for all the commands there was a lot thrash in the translations. I tried to work around that as well as I could and to keep the translations valid on Transifex, but a few appear to have been lost in the shuffle. But at least the command texts are now correctly translated. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-22translations: qualify tr function to get correct contextGravatar Dirk Hohndel
The way inheritance is implemented for the undo commands confuses the Qt translation tooling - with the result that the context assumed by the tools used to extract the strings doesn't match the context calculated at runtime - so all the translations for the strings in undo commands fail (including creating proper numerus forms). This change forces a consistant context tag, at the price of creating a significant delta for the source strings (the strings themselves stay the same, but the context for a lot of them changes). I am hoping that Transifex is smart enough to automagically add the correct translations for these, but I guess I won't know until I try. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-22translations: use German translation for non-Swiss German localesGravatar Dirk Hohndel
Unless a German speaker explicitly asks for the Swiss localization, give them the German localization. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-22translations: update en_US plural 'translation'Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-22buils-system: automatically handle plurals for en_USGravatar Dirk Hohndel
This had been something I did manually which caused all kinds of mistakes. I finally figured out how this is supposed to work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-22Typo fix: Programm to programGravatar Johan Hansson
Signed-off-by: Johan Hansson <reply.johan@gmail.com>
2020-03-22cleanup: remove unnecessary <QDebug> includeGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-22cleanup: don't allocate translators on heapGravatar Berthold Stoeger
This is pointless bike-shedding: instead of allocating the QTranslators on the heap an assigning them to a variable at translation-unit scope, we can simply generate them as static objects. That makes 1) two fewer lines of code 2) the translator-resources are properly released when the application closes. Not that either of these points would make *any* difference. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-22cleanup: remove memory leak in initUiLocale()Gravatar Berthold Stoeger
The prefs.locale.lang_locale field was overwritten without free()ing the old value. Not that the function would be called numerous times, but as a matter of principle... Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-22cleanup: split uiLanguage() in two functionsGravatar Berthold Stoeger
The uiLanguage() function was used for two purposes: to initialize the language related preferences and to read the current language. To make things more easy to follow, split this function in two: one for initializing, one for getting the current language. Moreover, don't return the current locale in an out-parameter as there is already a function to do that [getLocale()]. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-22locale: store locate to preferences after fixing up mac-weirdnessGravatar Berthold Stoeger
In uiLanguage() the preferences fields are initialized and there is fixup for a MacOS indiosyncrasy. For some reason the uncorrected value is written to the preferences. Let's store the corrected value instead. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-22cleanup: don't call uiLanguage() in qPref::loadSync()Gravatar Berthold Stoeger
uiLanguage() initializes the language fields from the preferences values. It is unclear why this function is called in qPref::loadSync() *before* the fields are loaded from disk. It can only initialize to the default values anyway. After qPref::loadSync() uiLanguage() is called again so that everything can be initialized with the correct perferences values. Remove the first call. If things break, let's fix them in a sensible way. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-21Revert "core: use set_lang_locale to modify prefs.locale.lang_locale"Gravatar Berthold Stoeger
This reverts commit 573a4a5e2da9531fbaa9e82da57131edc691a851. The commit broke setting the language in the desktop preferences: Instead of setting the locale in the prefs struct, the locale is set via qPrefLanguage. However, that saves the default language (extracted from the system) to disk. Now when the language is read from the preferences, we get that default value. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-21Add CHANGELOG entry for mobile UI for dive invalid flagGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21mobile/divelist: add UI to toggle dive invalid flagGravatar Dirk Hohndel
This reuses the corresponding undo command. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21mobile UI: show dives marked as invalid with strike throughGravatar Dirk Hohndel
This matches the visual language of the desktop UI. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21mobile/models: make dive invalid flag available to mobile UIGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21Android: use Subsurface as TAG for log messagesGravatar Dirk Hohndel
Having the file name as TAG was just stupid. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21mobile/tripedit: close page after savingGravatar Dirk Hohndel
That's consistent with how we do things on other pages. Also hide the on-screen keyboard. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21mobile/settings: attempt to fix the layoutGravatar Dirk Hohndel
The hardcoded widths with fixed values was just flat our broken and created all kinds of strange artifacts. But even with this somewhat more idiomatic approach this still isn't perfect - on wider screens it doesn't shrink back to the minimum column width. But that seems like a bit of a corner case. Overall this feels like a huge improvement. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21mobile/DCdownload: try harder to get the right elements selectedGravatar Dirk Hohndel
The number of possible sequences of events when the user is connecting a USB device is rather surprising. These changes try to ensure that in every case we get USB connection information we do in fact show the correct (or best guess) connection. See #2686 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21mobile UI: stop the use of dark icon themeGravatar Dirk Hohndel
This was used very inconsistently and had more bugs than positive impact. See #2686 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-20Ignore invalid dives in statisticsGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-20Core: consider invalid flag when adding divesGravatar Berthold Stoeger
Adding dives uses the number of the last dive to create a new dive number. Ignore invalid dives. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-20Dive filter: reset filter on change of display_invalid_dives flagGravatar Berthold Stoeger
The user had to restart the application or manually change the filter if they changed the flag. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-20Dive list: add option to mark dives validGravatar Berthold Stoeger
If the dive the user clicked on is invalid show an option to make the dive valid. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-20Dive list: mark invalid dives with a struck out fontGravatar Berthold Stoeger
Mark invalid dives in the dive list by striking them out and rendering them with a grey color. The color-change is not sufficient, because the default model delegate ignores color hints if the item is selected. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-20Filter: hide invalid divesGravatar Berthold Stoeger
Hide invalid dives if prefs.display_invalid_dives is false. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-20Undo: implement invalidate-dive commandGravatar Berthold Stoeger
Connect command to context menu. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-20Core: introduce invalid flag for divesGravatar Berthold Stoeger
Implement reading/writing the flag from/to XML/git. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-19More translation updatesGravatar Dirk Hohndel
Good progress by the translation teams! Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-19cleanup: fix mis-spelling of UCT in comments as wellGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-19Typo: UCT to UTCGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2020-03-19cleanup: remove unnecessary includeGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-18mobile: remove QMLManager::updateSiteList()Gravatar Berthold Stoeger
The location information model is updated automatically by the divelist-model and the undo commands. Therefore remove the QMLManager::updateSiteList() function. We do have to keep the locationListChanged() signal though, because the list of dive sites is not exported via model/view but rather via a Q_PROPERTY. We really should change that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-18models: update divesite-model when clearing/updating dive modelGravatar Berthold Stoeger
When the dive list is cleared or updated, the entries in the divesite-model become stale and therefore the divesite-model (with the actual name LocationInformationModel) also must be updated. This was done manually in some parts of the code and forgotten in others. Therefore, do it directly in the clear() and reset() function of the dive list-model. This might be a bit of a layering violation: why should one model call into another if they are not in parent/child relationship? However, this seems easier than introducing a global "reset dives" function that coordinates the models. Moreover, it does not appear 100% safe: if the clearing of the divesite model causes accesses to the divelist-model, they happen in the midst of a model reset and we had horrible bugs with that kind of things. However, I don't think that should happen. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-17undo: remove EditNumber commandGravatar Berthold Stoeger
Number editing works via the RenumberDives command. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>