Commit graph

17437 commits

Author SHA1 Message Date
Dirk Hohndel
cbf1f35d63 mobile/dive-list: show/hide virtual keyboard as needed for filter
This should happen automatically, but for some reason it doesn't. So
let's try to force it manually.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-30 09:16:55 -07:00
Dirk Hohndel
ccb671685d mobile/dive-list: make sure filter input area is visible
Since apparently the header property of the ListView isn't reliably
making sure that our filter input line is visible, let's move the filter
header to be it's own visual element and manually manage the
relationship between that and the ListView.

The obvious idea was to anchor the ListView to the bottom of the
filterHeader, but that didn't work in my tests. So instead we are using
the topMargin to make sure that there is space to show the header.

Because this re-indents the whole filterHeader, 'git show -w' gives a
much better idea what this commit actually changes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-30 09:16:55 -07:00
Dirk Hohndel
d12e86cb2b mobile/cleanup: use a mutex to protect storage access
Instead of the crude and error prone bool, let's just use the right tool
for this job.

In order to avoid issues with a goto across a mutex boundary, this
slightly restructures the code in one place - 'git show -w' makes it
clear that this is really rather simple in its changes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-29 12:36:57 -07:00
Dirk Hohndel
d482108f8c Increment mobile version
That's needed to be able to push out new binaries to the stores.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-28 11:00:54 -07:00
Dirk Hohndel
98966fdd8a mobile/save-changes: untangle the handling of alreadySaving
I'm suspicious that an issue that some people have seen around changes
not being saved is caused by our handling of alreadySaving.
When starting with Subsurface-mobile in no-autosync mode, we were able
to end in a scenario where alreadySaving was true, even though there
were no unsaved changes. And in that case no changes made during such a
session were saved unless the user forced a manual sync with the server.

This commit radically changes our approach to handling the flag. It
moves it right next to the actual calls into code that could modify git
storage, and ensures that the flag can never stay set.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-28 11:00:09 -07:00
Dirk Hohndel
73bbe1f02b mobile/cleanup: tiny coding style issue that bugged me
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-28 11:00:09 -07:00
Berthold Stoeger
10a4225013 mobile: when editing dives update the fulltext filter
In the mobile version of the dive-editing command, the fulltext
filter was not updated. Thus, when editing a dive while the filter
was active, the dive would disappear.

Unregister the old and register the new version.

Reported-by: Chirana Gheorghita Eugeniu Theodor <office@adaptcom.ro>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-28 10:55:04 -07:00
Berthold Stoeger
76cab71b7c mobile: fix filter flag when editing dives
When editing dives, the undo-command sends a filte changed signal.
The models catch the signal and check whether the filter status
changed.

The mobile-version of the dive-edit command simply exchanged the
dives. This could lead to inconsistencies when the filter flag
was overwritten. Therefore, make sure that the filter flag
is not overwritten by the dive-exchange.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-28 10:55:04 -07:00
Dirk Hohndel
fbf99c0105 ReleaseNotes: start independent MobileReleaseNotes file
Only having release notes for the desktop version really doesn't make
sense anymore.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-27 12:32:06 -07:00
Dirk Hohndel
a486d82efb Latest translations
With this, international Portuguese, Swedish, Finnish, Hebrew, Spanish,
Romanian, Dutch, and German are 100% translated.

Catalan, Chinese, and Bulgarian are more than 90% translated as well.

A HUGE thank you to the translators once again stepping up.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-27 12:32:06 -07:00
Dirk Hohndel
76dc36ddae mobile/user-manual: update bundled html
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-27 12:32:06 -07:00
Dirk Hohndel
851c8c273a mobile/user-manual: add hyperlinks where useful
Suggested-by: Martin de Weger <martin@deweger.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-27 12:32:06 -07:00
Crawford Currie
b0572dd043 mobile/user-manual: small language tweaks
[Dirk Hohndel: added another fix to Crawford's commit]

Signed-off-by: Crawford Currie <curriedot@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-27 12:31:43 -07:00
Dirk Hohndel
ebbe01a359 mobile UI: disable action button / drawer interactions
This is a feature that I never fully understood, but that apparently is
causing the drawers to show up for people who are just trying to
interact with the action button. The approach here is really drastic and
crude, but in my testing it seems to work.

Reported-by: Hartley Horwitz <hhrwtz@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-27 12:31:02 -07:00
Dirk Hohndel
60d2d051bb mobile UI: add create trip to DiveDetails context menu
Should have done that in the first place. That's what happens when you
are rushing it...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26 16:48:48 -07:00
Dirk Hohndel
302404dac0 iOS: ensure changes are saved locally
This was disabled in the past because it was deemed to slow. A lot
of time has passed, since. Maybe on current phones / iPads this is
acceptable again?

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26 14:27:14 -07:00
Dirk Hohndel
59bc5bb368 Update translation source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26 13:03:27 -07:00
Dirk Hohndel
8177dd4dc3 cleanup: remove dead code
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26 12:59:00 -07:00
Dirk Hohndel
66fd93c9cc mobile/dive-list: add ability to create trip
This adds a context menu entry for top level dives that allows the user
to create a trip for that dive.

Unfortunately this creates a new string to translate right before a
release...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26 12:59:00 -07:00
Dirk Hohndel
241d378f14 mobile/cleanup: pageStack.pop() doesn't take a string argument
This happens to do the expected thing, anyway, but let's not keep this
broken code around.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26 11:49:46 -07:00
Dirk Hohndel
0301fc6905 mobile UI: undo partial dive add when canceling
When we start adding a dive, we actually create a diveAdd undo command
so we have a dive that the user can edit. Which means we need to undo
this action if we cancel.

Also, for a more consistent UI, we should pop the dive details page that
we used to edit this dive and bring the user back to the dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26 11:49:12 -07:00
Dirk Hohndel
f2a48e813f mobile/page-selection: consistently use showPage to select a page
We still used pageStack.push() all over the place.

Also, in showPage, disable the map hack if the user actively picks a
different page.

This should fix an issue where the user picked the map and then tried to
add a dive to the dive list - and instead of the dive edit was shown the
map again.

Reported-by: Hartley Horwitz <hhrwtz@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26 11:49:05 -07:00
Dirk Hohndel
69272eefa8 mobile/profile: ensure profile opacity resets when zooming
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-25 09:28:05 -07:00
Dirk Hohndel
6629d046b7 mobile/profile: adjust offsets when scaling
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-25 09:28:05 -07:00
Dirk Hohndel
577f713f1a mobile/profile: don't pan outside the actual profile
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-25 09:28:05 -07:00
Dirk Hohndel
f084852f5c mobile/debug: simulate zooming through mouse wheel on desktop
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-25 09:28:05 -07:00
Dirk Hohndel
93ab1232f0 cleanup: fix unitialized value
Fixes CID 355179

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-24 16:45:48 -07:00
Miika Turkia
a8e2aef785 mobile/user-manual: some tuning of the text
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-24 16:44:26 -07:00
Miika Turkia
5d3f92362d mobile/user-manual: typo fixes
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-24 16:43:45 -07:00
Berthold Stoeger
59b6ad6a0b divelist: don't initialize invalidFont at startup
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-24 09:01:25 -07:00
Dirk Hohndel
0b83971ff9 macOS: still issues with mixed case names
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-23 20:58:49 -07:00
Dirk Hohndel
886e5bcfe7 Latest translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-23 20:54:21 -07:00
Dirk Hohndel
c7dd1e1bab mobile/profile: don't pan unless we are zoomed in
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-23 20:49:05 -07:00
Dirk Hohndel
bba73fdc87 mobile: show the new v3 user manual
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-23 20:48:03 -07:00
Dirk Hohndel
97c7fad53d Subsurface-mobile v3 user manual
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-23 20:48:03 -07:00
Dirk Hohndel
6de28ab93c translations: update sources and translations
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-22 12:02:48 -07:00
Dirk Hohndel
a109a28367 translations: qualify tr function to get correct context
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-22 12:02:48 -07:00
Dirk Hohndel
e6cbb28a9f translations: use German translation for non-Swiss German locales
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-22 12:02:48 -07:00
Dirk Hohndel
0d2ec0802d translations: update en_US plural 'translation'
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-22 12:02:48 -07:00
Dirk Hohndel
cee6989409 buils-system: automatically handle plurals for en_US
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-22 12:02:48 -07:00
Johan Hansson
438bac0f8f Typo fix: Programm to program
Signed-off-by: Johan Hansson <reply.johan@gmail.com>
2020-03-22 12:01:59 -07:00
Berthold Stoeger
eddd0e3197 cleanup: remove unnecessary <QDebug> include
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-22 12:01:09 -07:00
Berthold Stoeger
463bb25705 cleanup: don't allocate translators on heap
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-22 12:01:09 -07:00
Berthold Stoeger
0f30ca9b33 cleanup: remove memory leak in initUiLocale()
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-22 12:01:09 -07:00
Berthold Stoeger
eb55ffde16 cleanup: split uiLanguage() in two functions
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-22 12:01:09 -07:00
Berthold Stoeger
2dca7d0ce5 locale: store locate to preferences after fixing up mac-weirdness
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-22 12:01:09 -07:00
Berthold Stoeger
621d00d891 cleanup: don't call uiLanguage() in qPref::loadSync()
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-22 12:01:09 -07:00
Berthold Stoeger
2db7d5cc23 Revert "core: use set_lang_locale to modify prefs.locale.lang_locale"
This reverts commit 573a4a5e2d.

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-21 21:06:36 -07:00
Dirk Hohndel
f9b8d16a0d Add CHANGELOG entry for mobile UI for dive invalid flag
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21 14:31:37 -07:00
Dirk Hohndel
30e6102886 mobile/divelist: add UI to toggle dive invalid flag
This reuses the corresponding undo command.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-21 14:31:37 -07:00