aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.h
AgeCommit message (Collapse)Author
2016-04-29QML UI: when switching from no cloud to cloud usage, don't drop local dataGravatar Dirk Hohndel
This is rather simplistic, it just imports the local data into the remote repository and therefore loses the git history of the local data - but I wasn't able to make the git merge without shared base commit work, so I went this much easier to implement route instead. One thing we need to be careful about is that contacting the remote server could fail. If we don't manage to merge the dives from cloud server and local storage, we need to revery to no cloud status in order not to lose the local data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-27Add helper function for the consumption of loaded dive dataGravatar Dirk Hohndel
This allows us to call that part of the process from multiple places in the future. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-22QML UI: when chosing 'no cloud', switch to dive listGravatar Dirk Hohndel
Currently we don't remember that we picked 'no cloud' across restarts. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-17QML UI: make the state of the GPS service available to QMLGravatar Dirk Hohndel
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-15QML UI: quit on back key while showing dive listGravatar Dirk Hohndel
Make sure you save first, though. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-15QML UI: rewrite the commitChanges functionGravatar Dirk Hohndel
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-14QML UI: keep QML manager and the UI in sync about selected diveGravatar Dirk Hohndel
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-14Make it easy to access the sort model from the QML managerGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-13Remove unused functionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-11Upon undoing a dive deletion select that diveGravatar Robert Helling
Before it had the next dive still selected. Fixes #1053 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-10QML UI: try to do the right thing for changes on all platformsGravatar Dirk Hohndel
On Android we can save locally right away, but we don't want to make the user wait for a network sync. Sadly, on Android currently the saving in the background doesn't work and the save will run when the user comes back. Definitely not ideal. On iOS the situation is different - a save to the local git cache takes surprisingly long. Must be the shitty file system they use or something. Because of that we only mark the dive list changed and instead save the next time the app is not in the foreground (which works on iOS but not on Android - go figure). On all the other OSs (I guess that would be desktop builds of Subsurface-mobile? But there may be other mobile OSs that people might want to build it on) we save both locally and to the cloud right away. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-08QML UI: only force network access when user asks us toGravatar Dirk Hohndel
So when the user taps on the manual cloud sync, we always force access to the cloud server. Otherwise we only access the cloud server if git_local_only isn't set. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-06QML UI: break the sync into explicit save local and save cloudGravatar Dirk Hohndel
This makes the code much cleaner and easier to understand and should allow us to then switch back to doing at least the local save right after we make any changes to the data. This commit also tries to make sure that the accessingCloud status stays correct and consistent throughout all the various success and error paths. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-06QML UI: save with unchanged credentials returns to dive listGravatar Dirk Hohndel
If the user is on the credentials page, doesn't change the credentials but simply taps on save, they now get back to the dive list. Fixes #1047 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Move subsurface-core to core and qt-mobile to mobile-widgetsGravatar Dirk Hohndel
Having subsurface-core as a directory name really messes with autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an autocomplete conflict and also was inconsistent with the desktop-widget name for the directory containing the "other" UI. And while cleaning up the resulting change in the path name for include files, I decided to clean up those even more to make them consistent overall. This could have been handled in more commits, but since this requires a make clean before the build, it seemed more sensible to do it all in one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>