Commit graph

15128 commits

Author SHA1 Message Date
Berthold Stoeger
7f2026ded8 Cleanup: remove DiveTripModel::layout() function
This accessor was never used. This is a small step in splitting
the DiveTripModel in two (list & tree), which means that the
layout is moved up to the view.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-28 15:10:57 +00:00
Dirk Hohndel
651f63282f build-system: switch back to upstream qt-android-cmake
And in the process use our script to do the work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-27 10:38:39 -04:00
Dirk Hohndel
01cd2e224f QML UI: we don't need Controls 2.4
In commit 99c06dec3d ("Mobile/filtering: simple busy indicator") we switched to
Controls 2.4 which requires Qt 5.11. Revert that one line of the commit as it
isn't necessary.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-27 07:17:51 -07:00
Dirk Hohndel
4461b47965 qPref: reduce recompiles with every commit
Including ssrf-version.h in an include file that a lot of files depend on
caused a ton of unnecessary recompiles with every commit. This should reduce
that problem.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-27 07:16:01 -07:00
Berthold Stoeger
d9588ec5df Cleanup: remove declaration of unused signal
The last use of the LocationInformation::startEditDiveSite()
signal was removed in ff26ffe0d0.
Remove its declaration.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-26 18:48:27 +01:00
Berthold Stoeger
b02fd072e7 Cleanup: remove dead code in qthelper.cpp
The reverseGeoLookup() function defined in qthelper.cpp has long
ago moved to its own compilation unit. It is not even defined in
the headers anymore. Remove it and the now unnecessary <QNetwork*>
includes.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-26 17:50:52 +01:00
Dirk Hohndel
3f5f851fcb Update CHANGELOG
This is of course an update that covers both this and the previous PR.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-25 23:24:22 +01:00
Dirk Hohndel
c5fb66e775 Mobile/filtering: update nr of dives shown in a trip when filtering
Whenever the filter changes, simply walk the filtered dive list and ensure
that we have the correct count for dives that match this filter.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-25 23:24:22 +01:00
Dirk Hohndel
89a242976f core: use nr of dives shown in tripMeta info
When creating a trip header (as it is used in the mobile app right now), we need
to show the number of dives shown, not the total number of dives in that trip.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-25 23:24:22 +01:00
Dirk Hohndel
f7b1c762a9 core: add seperate number of dives shown to the trip structure
We assume that any dive that gets added to a trip initially gets shown. The
filter logic then needs to make sure it adjusts this number (which then makes
it easy to tell the user how many dives of that trip are visible with the
current filter).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-25 23:24:22 +01:00
Dirk Hohndel
66184d58e8 core: add ability to get underlying dive to DiveObjectHelper
This feels a bit like cheating, but if we need to be able to make modifications
to the underlying dive and only have the helper object (for example inside of a
view model), doing everything through the helper object can turn into a real
performance issue.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-25 23:24:22 +01:00
Berthold Stoeger
583d8d653a Dive list: emit selectionChanged signal in filterFinished()
In commit 9829e49815 the dive
selection code was moved from the filter to the dive list.
As a consequence of that change, the selectionChanged signal
was not emitted anymore and therefore the map widget was not
informed of the new dive site list. This had funky effects on
the dive-site editing. Notably, changing the location would
move the map, but not update the flag.

Explicitly emit selectionChanged in filterFinished() to fix
dive site editing.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-25 23:24:06 +01:00
Simeon
8cf8d490d6 Fix bug in for loop that can lead to segfault
In case of big log files, where MAX_TANK_INFO is reached, tank_info[i]  != NULL should be checked after i<MAX_TANK_INFO

Signed-off-by: Simeon Geiger <simeon.geiger@gmail.com>
2018-10-25 23:23:03 +01:00
Miika Turkia
bb4c2031ef Show coordinates if no tags from reverse geolookup
This will display the dive site coordinates after the Location label if
there are no associated tags from reverse geolookup. Thus it'll be
clearer for users that we do have GPS location stored for the dive, and
might be able to see more easily if the recorded coordinates are
correct.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-10-24 08:04:20 +01:00
Dirk Hohndel
e0e3b63601 Mobile/filtering: make busy indicator smaller
Suggested-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
3eabb80398 Mobile/filtering: update number of dives shown when resetting filter
Otherwise we start showing an illogical '0' there when first opening the filter
dialog, and the equally wrong previous count when closing and then re-opening
the filter dialog.

Reported-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
6248ddf529 Mobile/filtering: roll our own filtering for performance reasons
The regular expression based generic filtering made things very slow on a cell
phone or other, slower device. With this the results seem more reasonable.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
51e7603d7e QML UI: remove some of the log file noise
A couple came from this series, others are much older.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
1e6c5d002b Mobile/filtering: show a better message while waiting for the filter
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
cf3fcc53b6 Mobile/filtering: implement the filter update through a thread
It's important to disconnect the model from the ListView, otherwise the update in a
different thread will fail.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
84822ebd2f Mobile/filtering: remove redundant busy indicator on dive list
We should use the global one instead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
b0a0e1e374 Mobile/filtering: simplify the filter toggle
Simply make it always reset the filter. There's no point remembering the last
filter pattern and explicitly setting it, if the last thing we do is to reset
this pattern.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
466a0bf758 Mobile/filtering: update filter in separate thread
We can't use that while the model is shown, which is why this isn't hooked up.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
2183e41bb0 Mobile/filtering: add properties for dive list model and filter text
This allows us to modify those from different parts of the code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
09507416c8 QML UI: add busy indicator to the main window
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
8d01d421d4 QML UI: make the QML window object part of the QMLManager class
This way we can access it from that code (which we'll need to invoke methods in QML code
from C++).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
16e91177bb Cleanup: remove attempt to set long gone property
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
6d77e66b69 Mobile/filtering: clean up whitespace from last commit
This one does nothing but whitespace - separating it into two commits makes the
previous one a lot easier to read.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
00a80c0e08 Mobile/filtering: add background rectangle for filter row
We are still trying to ensure that the filter is indeed shown in front of the
dive list. This is working when running on the desktop without the rectangle,
but on Android this appears to be needed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
76e4826fbc Mobile/filtering: simplify transitions
We don't need to toggle visibility, toggling height is sufficient. This
dramatically simplifies the transitions.  But as a result we need to use the
'enabled' property to reset the filter.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
e4e0c608e1 Mobile/filtering: simple busy indicator
Filtering takes a noticeable time on mobile, so lets show the user we are doing
something.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
52ec544c3b Mobile/filtering: finally implement the new settings in the actual filter
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
17347f5110 Mobile/filtering: add fullTextNoNotes role to the dive list model
This way we can filter with and without the notes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
40536286d2 Mobile/filtering: add fullTextNoNotes to the dive object helper
This way we can filter with and without the notes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
c0540d7682 Mobile/filtering: add Settings options for filtering
Toggle case sensitive and whether or not to include the notes in full text search.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
eedb1ce0ea Mobile/filtering: add two preferences for filtering
With this we can make it configurable if the search should include the notes field
and if the search should be case sensitive or not.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
2caaf8889b Mobile/filtering: make sure the header is top-most element
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
97e6494eee Mobile/filtering: ensure filter input field has focus when shown
QML's logic for who gets focus is a bit complicated. But forceActiveFocus()
cuts through the confusion and makes sure that your field does indeed get
focus.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
fd31dfe40d Mobile/filtering: use margins instead of rectangles to create space
I'm not sure why this had initially failed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
c797038bd8 Mobile/filtering: only filter when editing is finished
This is a usability / performance tradeoff. I like it better when it filters as
I type, but on mobile this may make things feel sluggish.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
f965492241 Mobile/filtering: reset the filter text when toggled
This seemed less UI clutter than adding a clear button.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:30 +01:00
Dirk Hohndel
cadb072a0c Mobile/filtering: improve code readability
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:29 +01:00
Dirk Hohndel
e5ee895793 Mobile/filtering: animate the filter header
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:29 +01:00
Dirk Hohndel
2fe1750bf8 Mobile/filter: add marker between entries in full text search
Otherwise we could match the end of one string and the beginning of the next,
so having a buddy name Linus and a dive master named Alvin would be matched
by USA.

Also add Notes to the full text search (I had forgotten those earlier).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:29 +01:00
Dirk Hohndel
90d321f0ff Mobile/filtering: add count of filtered dives to search bar
The count in the trip headers is still that for the complete trip and therefore
misleading.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:29 +01:00
Dirk Hohndel
65aa6bc43b Mobile/filtering: make the search box an overlay
This way it stays at the top of the dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:29 +01:00
Dirk Hohndel
8f7633eff8 Mobile/filtering: full text filter, instead of just dive site
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:29 +01:00
Jan Mulder
0bc0b6bfe8 Mobile/filtering: first attempt to filter on dive site
[Dirk Hohndel: this is the starting point of my following commits, I decided to
	       leave it in place to give Jan credit for the work he did on
               figuring out some of the plumbing needed to get things to work]

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:29 +01:00
Jan Mulder
f1bb2c8478 Mobile/filtering: add icons for filter and sort
Add 2 icons for filter and sort capabilities. And as before, these
icons are coming from the Google Material design set.

[Dirk Hohndel: Jan's commit forgot to add the actual icons, I added
               those so the commit matched its message]

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23 22:45:29 +01:00
Berthold Stoeger
ca211c03e0 Dive site: remove webservice code in MainTab::updateDiveSite()
There was still code in MainTab::updateDiveSite() related to
dive-sites obtained from the obsolete web-service. Remove.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-23 22:07:42 +01:00