Commit graph

10621 commits

Author SHA1 Message Date
Dirk Hohndel
9ba090c31f git storage: init local repository
So far we didn't do that at all, we either relied on the user manually
creating a local repo, or we cloned a remote repo.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-27 15:05:37 -07:00
Dirk Hohndel
d6b36c47cb Fix SettingsObjectWrapper to actually use the group set
At least for the GeneralSettings group.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-22 12:04:24 -07:00
Dirk Hohndel
a1f0263c64 Remove useless command line handling code from mobile app
The files collected were never opened, this all is just the result of
a copy and paste job that clearly was never fully thought through.

Also remove support for ancient libgit2

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-22 11:59:16 -07:00
Dirk Hohndel
8946edfd92 QML UI: adapt "Manage dives" to no cloud status
If we are in no cloud mode
- allow adding dives via the menu
- enabling / disabling automatic sync makes no sense.
- if the user wants to manually sync the cloud, they need to first enter
  credentials.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-22 11:59:16 -07:00
Dirk Hohndel
27fccbbe4e QML UI: when chosing 'no cloud', switch to dive list
Currently we don't remember that we picked 'no cloud' across restarts.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-22 11:59:16 -07:00
Dirk Hohndel
6b43b3015d QML UI: turn off 'no cloud' button when not in use
This needs to be actively cleared.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-22 11:59:16 -07:00
Dirk Hohndel
34628f8e6d QML UI: add option to disable cloud to start screen
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-22 11:59:15 -07:00
Dirk Hohndel
be30724ba0 QML UI: allow switching to offline mode without valid credentials
If the user wants to work offline, they don't need validated credentials.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-22 11:59:15 -07:00
Dirk Hohndel
a5af2478d4 QML UI: reword the intro text to mention offline mode
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-22 11:59:15 -07:00
Dirk Hohndel
6af77b08b2 QML UI: rename menu entry for offline use
That really is what it boils down to.

Also removes a few stray spaces in the warning text.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-22 11:59:15 -07:00
Dirk Hohndel
4e62bfa9a9 QML UI: allow changing input fields with tab/return key
This assumes a physical keyboard (e.g., iPad with BT keyboard).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-21 14:00:37 -07:00
Dirk Hohndel
85560531da QML UI: don't exit on iOS
Apparently users interpret that as a crash.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-21 13:27:49 -07:00
Dirk Hohndel
68bb49e4ca Fix Android keyboard issue as recommended by Kirigami
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-21 11:40:02 -07:00
Dirk Hohndel
f3929af0e4 QML UI: add new Kirigami file
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-21 11:40:02 -07:00
Dirk Hohndel
31b34a24cc Don't calculate the 9 minute average
We don't do the "smoothed" profile anymore (and haven't for years),
so no need to calculate the data.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-20 16:00:28 -07:00
Dirk Hohndel
eb07faef00 Only do 9 minute interval for min/max/avg
We don't use 3 and 6 minute values anywhere, so why calculate them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-20 15:55:51 -07:00
Linus Torvalds
e0ac1c9a26 Fix 3-, 6- and 9-minute min/max calculations
Make them use indices into the plot-info, fix calculation of average
depth, and fix and add comments.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-20 15:36:25 -07:00
Dirk Hohndel
d7103f97f7 Android build: use static libssl / libcrypto
Android M does not allow using those as shared libraries.

See #1029

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-20 15:29:09 -07:00
Dirk Hohndel
5d1fbbe57b QML UI: don't show add dive button without valid credentials
Given that currently we don't deal well with not having a git repository
that is linked to cloud storage, don't allow people to add dives unless
there are verified cloud credentials.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-20 15:25:16 -07:00
Dirk Hohndel
0fcf67ca55 QML UI: make sure drawer is really closed after delete
At least one iPhone user still has the drawer pop open and prevent
them from using the undo function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-20 07:42:10 -07:00
Dirk Hohndel
a8cfa0abf5 QML UI: make multi column support work again
Due to a change in Kirigami on most tablets even in landscape mode we are
only showing one column. Because of this I missed the fact that I had
broken multi column support by mistake. Without setting the width of the
dive list it expands all the way and prevents the showing of two pages
next to each other.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19 14:14:49 -07:00
Marco Martin
b3d0d9fd4e Don't put margins outside the internal ListView
put the margins only around the fullscreen delegate of the listview,
making the listview go all trough the screen edges.
This because the cutted effect when the list view is half scrolled
looks quite ugly. Making the ListView reach the borders
also moves the scroll indicator at the screen edge
where it conventionally is.

Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19 10:35:07 -07:00
Dirk Hohndel
660f421d6d QML UI: correctly show if we are accessing remote or local storage
This makes sure that if the user switches to offline mode they don't get
incorrect notifications that tell them that they are accessing cloud
storage.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19 10:34:49 -07:00
Dirk Hohndel
ac0c1eb5e1 QML UI: prevent changing pages while showing the edit/add overlay sheet
If you switch back to the dive list by swiping horizontally you stay in
edit/add mode and then can't select a dive on the dive list. This way you
have to discard or save the edit, first.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19 10:34:44 -07:00
Dirk Hohndel
1e86662e4a Remove QML files that are no longer used
The TextButton was what we used for actions very early on, and the TopBar
has now been replaced by the Kirigami header bar.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19 10:34:40 -07:00
Dirk Hohndel
a807a5e8cd QML UI: show dive site on map with left action on dive details page
The icon isn't great, though.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19 05:14:44 -07:00
Dirk Hohndel
c6dbbe1aac QML UI: adapt for latest Kirigami
In commit 50ebdd020e3c of the Kirigami project the syntax with which
actions are added to pages has changed. This commit tracks that, adds the
new file that was added in Kirigami and also removes the now obsolete
context menus (since we have a working back button on iOS now)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19 05:14:44 -07:00
Dirk Hohndel
fe62da3a6b QML UI: always show the time stamp when logging data
This should help understand some of the issues with git storage and GPS
fixes better.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-19 04:20:12 -07:00
Miika Turkia
9607ff6c93 Import picture URLs from divelogs.de
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-18 21:03:27 -07:00
Rick Walsh
62b989979e Fix broken Bluetooth support
This partially reverts Commit 39313c5

Reported-and-analyzed-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-18 06:01:01 -07:00
Dirk Hohndel
628f83d5cf QML UI: only show GPS service / use current location if GPS accessible
If there is no GPS source or if permission to use it was denied, don't
offer to run the GPS service or to detect the current location when
adding or editing dives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-17 22:59:19 -07:00
Dirk Hohndel
1819cc1ccc QML UI: make the state of the GPS service available to QML
This exposes a locationServiceAvailable property to QML and keeps it in
sync with the corresponding state in the GpsLocation widget.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-17 22:59:19 -07:00
Dirk Hohndel
4ac6f34b16 With patched Qt 5.6 for iOS correctly handle disabled GPS source
Qt 5.6.0 is broken when it comes to using CoreLocationService on iOS.
It doesn't even check if the location service is enabled. My patches fix
that and make Qt set an error code right after service creation. Having
the service creation fail is actually the wrong thing to do because then
Qt switches over to GeoClue and that really isn't helpful for our needs
here.

Additionally, Qt 5.6.0 without my patches doesn't follow the REQUIRED
flow of using the location service as it does not check the access
permissions before accessing the GPS service - without doing so the
GPS service will not run in the background.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-17 22:59:19 -07:00
Dirk Hohndel
c0b44e25b7 GPS provider: change haveGPS status if GPS source returns error
If the GPS source returns an error that could be an indication that the
user hasn't given us permission to use it, so switch our status to NOGPS.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-17 22:59:12 -07:00
Dirk Hohndel
b00306f50e GPS provider: track tristate information for GPS source
Initially we don't know if we have a source. After that we may think
that we have one, or not have one (but that can actually change while
the program is running if the user, for example, turns the source off
or switches to airplane mode).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-17 22:59:02 -07:00
Dirk Hohndel
5e42909964 iOS build: include the libraries for the phone simulator
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-17 22:36:29 -07:00
Dirk Hohndel
ecf44bb2fa QML UI: quit on back key while showing dive list
Make sure you save first, though.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-15 14:42:08 -07:00
Dirk Hohndel
71d74f9e3c QML UI: rewrite the commitChanges function
I couldn't figure out how to break this down into small, useful commits.
Part of the problem is that I kept going while working on this and as you
can see from looking at the commit, diff tries so hard to find small code
fragments that moved around, that the diff overall becomes quite
unreadable and it seemed impossible to recreate the sequence of steps
after the fact.

It all started with adding the parsing for the GPS coordinates. But while
testing that code I found several issues with the rest of the function.
Most importantly it seemed ridiculous that we carefully tried to match the
texts that the DiveObjectHelper would create for the various fields,
instead of just using the DiveObjectHelper to do just that. And once I had
converted that I once again realized just how long and hard to understand
that function was getting and decided to break out some of the more
complex parts into their own helper functions.

But of course all this didn't happen in this logical, structured, ordered
way. Instead I did all of these things at the same time, testing,
rearranging, etc.

So in the end I went with one BIG commit that does all of this in one fell
swoop.

This adds four helper functions to deal with start time/date, duration,
location and gps coordinates, and depth of the dive.

To avoid mistakes when dealing with the GPS coordinates, there's another
helper to encapsulate the creation of the dive site and we switched to a
current GPS location.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-15 13:22:16 -07:00
Dirk Hohndel
c111c4bb02 QML UI: add elements to allow editing the GPS coordinates
This isn't hooked up, yet, but provides the UI

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-15 13:22:16 -07:00
Dirk Hohndel
00ac1c12db QML UI: fix the save to cloud logic
There were several logical flaws here. Ugh.

Don't save things if there are no unsaved changes, if we haven't
initialized this repository from the cloud or if we are already saving
things.

Then, once we decide that we should save, first always save to the local
cache and then check if we should save to the cloud and do so if
requested.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-15 13:22:16 -07:00
Dirk Hohndel
6985c123d4 QML UI: stop using "--" for empty strings
I can't remember why we started doing this, but at this point I find it
just weird.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-15 13:22:08 -07:00
Miika Turkia
9e787a2476 Copy coordinates when renaming site
Let's not discard our GPS location when editing site name on mobile.

Fixes #1051

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-14 12:57:40 -07:00
Dirk Hohndel
67742856b2 QML UI: don't try to scroll to dive at time 0
If no timestamp is available, just start at dive 0.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-14 11:49:25 -07:00
Miika Turkia
95292ac560 Set default build number for apk building
Having build number as mandatory parameter seems unnecessary, thus
setting default value (used for andoird:versionCode) to 0.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-14 11:02:19 -07:00
Miika Turkia
454a62c835 Fix initial build of APK
Running subsurface/packaging/android/build.sh after deleting
subsurface-mobile-build-arm directory fails for me due to missing
ssrf-version.h file. Just ignore if it doesn't exist.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-14 10:59:56 -07:00
Dirk Hohndel
9f9853fc44 Hack to work around issue in current Kirigami master
Commit 339411cca69b in Kirigami master tries to reparent the OverlaySheet
to the page that it is related to. Unfortunately the heuristic used there
to find the right object assumes that every page has a contentItem
property, which our DiveDetails page doesn't have.

As a hack to work around this issue (until this is fixed upstream in
Kirigami) we simply create such a property. This commit should be
reverted once Kirigami upstream has been fixed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-14 10:53:31 -07:00
Dirk Hohndel
6e6cce770b QML UI: keep QML manager and the UI in sync about selected dive
The manager can now directly update the index of the selected dive, and
the UI tells the manager the timestamp of the currently selected dive.
This allows the manager to pick the best possible dive as selected dive
if things change (for example if the dive list gets reloaded because it
changed in cloud storage).

Fixes #1009

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-14 09:43:33 -07:00
Dirk Hohndel
5909e438c9 Make it easy to access the sort model from the QML manager
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-14 09:43:33 -07:00
Dirk Hohndel
2878236268 QML UI: clear the flag indicating that we are accessing storage
If the automatic sync is turned off we could be stuck in a state where we
always thought that we were already in the middle of a save.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-14 09:43:33 -07:00
Dirk Hohndel
c84f16e7f6 Make the raw timestamp available in QML
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-14 09:43:33 -07:00