aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-04-05Don't set the window size on iOS, eitherGravatar Dirk Hohndel
Not that it appears to have been an issue, it just seemed wrong for this to be Android only... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05QML UI: dive list: smaller header above dives that aren't in a tripGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05QML UI: remove redundant dive log titleGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05remove code that is no longer usedGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05QML UI: use Kirigami default paddingGravatar Dirk Hohndel
The issue with needing extra space at the top of the page has been fixed upstream. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05Fix compilation with the new folder architectureGravatar Tomaz Canabrava
A few more fixes for things that broke in commit 7be962bfc287 ("Move subsurface-core to core and qt-mobile to mobile-widgets"). [Dirk Hohndel: slightly edited and overlap with Linus' patch removed] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05QML UI: better trip headerGravatar Dirk Hohndel
This tries to give the best information about the trip that we have. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05QML UI: dynamic page title for the root pageGravatar Dirk Hohndel
Subsurface-mobile is the name of the app, but not a good title for the Dive list / Cloud credential page Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05QML UI: keep the title bar larger on iOSGravatar Dirk Hohndel
This is where the back button is located on iOS. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05Fix include pathsGravatar Linus Torvalds
As expected, commit 7be962bfc287 ("Move subsurface-core to core and qt-mobile to mobile-widgets") caused some breakage. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05Small cleanup of helper functions to remove unused argumentsGravatar Dirk Hohndel
Also removes an unused variable. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05Add another Kirigami file and sort the private onesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Start using the actual cylinder data for gas switch eventsGravatar Linus Torvalds
Now that gas switch events always have indices into the cylinder table, start using that to look up the gas mix from the cylinders rather than from the gas switch event itself. In other words, the cylinder index is now the primary data for gas switch events. This means that now as you change the cylinder information, the gas switch events will automatically update to reflect those changes. Note that on loading data from the outside (either from a xml file, from a git/cloud account, or from a dive computer), we may or may not initially have an index for the gas change event. The external data may be from an older version of subsurface, or it may be from a libdivecomputer download that just doesn't give index data at all. In that case, we will do: - if there is no index, but there is explicit gas mix information, we will look up the index based on that gas mix, picking the cylinder that has the closest mix. - if there isn't even explicit gas mix data, so we only have the event value from libdivecomputer, we will turn that value into a gasmix, and use that to look up the cylinder index as above. - if no valid cylinder information is available at all, gas switch events will just be dropped. When saving the data, we now always save the cylinder index, and the gas mix associated with that cylinder (that gas mix will be ignored on load, since the index is the primary, but it makes the event much easier to read). It is worth noting we do not modify the libdivecomputer value, even if the gasmix has changed, so that remains as a record of the original download. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Make gas change events always have a cylinder indexGravatar Linus Torvalds
In commit df4e26c8757a ("Start sanitizing gaschange event information") back about a year and a half ago, I started sanitizing the gas switch event data, allowing gas switches to be associated with a particular cylinder index rather than just the gas mix that is switched to. But that initial step only _allowed_ a gas switch event to be associated with a particular cylinder, the primary model was still to just specify the mix. This finally takes the next step, and *always* associates a gas switch event with a particular cylinder. Instead of then looking up the cylinder by trying to match gas mixes at runtime, subsurface now looks it up when loading the dive initially as part of the dive fixup code. The switch event still has an a separate gas mix associated with it, but this patch also starts preparing for entirely relying on the gas mix in the cylinder itself, by starting to pass in not just the event but also the dive pointer to the routines that look up gas mix details. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Make cylinder_nodata() take a const cylinder pointerGravatar Linus Torvalds
Some of the gas mix cleanups I'm doing are in code that uses const pointers, and wants to use this. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Make "is_gasmix_redundant()" more robustGravatar Linus Torvalds
The gas switch event handling is somewhat fragile, mostly because the legacy event encoding for gas switches is odd. It's also limited to whole percentages, unlike our internal gas mix model. In addition, it also ends up comparing the values to the raw permille values, which is wrong for air, and wouldn't match our O2_IN_AIR which is 209 permille (closest approximation to 20.946%). So handle air separately, since "21" really is a valid oxygen value for air, and should match 20.9%. And use the proper accessor functions to get the gasmix values. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Remove linear pressure interpolation detection codeGravatar Linus Torvalds
Dirk says that divinglog hasn't been doing the linear pressure interpolation for a long while, so we're doing extra dive fixups that really aren't needed any more. Also, the code is actually buggy: it only ever worked on the first cylinder anyway (because only the first cylinder pressure_delta[] would be initialized). That was probably perfectly fine in practice, since it's unlikely that many tech divers used old versions of divinglog anyway, so the bug per se isn't a reason to remove it - but it is a sign that the code was a bit hard to read, so let's get rid of it if there is no reason to maintain it or fix it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> 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>
2016-04-04Don't write back dive data that hasn't changed in gitGravatar Linus Torvalds
This caches the git ID for the dive on load, and avoids building the dive directory and hashing it on save as long as nothing has invalidated the git ID cache. That should make it much faster to write back data to the git repository, since the dive tree structure and the divecomputer blobs in particular are the bulk of it (due to all the sample data). It's not actually the git operations that are all that expensive, it's literally generating the big blob with all the snprintf() calls for the data. The git save used to be a fairly expensive with large data sets, especially noticeable on mobile with much weaker CPU's. This should speed things up by at least a factor of two. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04QML UI: include the new back button for iOSGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Revert "QML UI: make sure the correct data is in the bread crumbs"Gravatar Dirk Hohndel
This reverts commit 410fd222d15dca8673606133499cefde780f163b. The change this relied on was rejected by upstream Kirigami Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04QML UI: animate showing the dive edit sheetGravatar Dirk Hohndel
This now uses the correct property to open the OverlaySheet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Revert "QML UI: animate showing the dive edit sheet"Gravatar Dirk Hohndel
This reverts commit faa22d5343f39f335bc281e139bc347241295ebf. Upstream Kirigami already had a property to do this. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04QML UI: rate limit git progress outputGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Use the same format for output to stderr and AppLogGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04QML UI: keep cloud sync enabled state in settingsGravatar Dirk Hohndel
So if the app gets closed and restarted, it will continue to not sync (or sync) over the network. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04QML UI: allow user to disable automatic cloud syncGravatar Dirk Hohndel
This is useful if you are in an area with slow or spotty network and if you are fine with just saving to the phone. In order to sync to the cloud you either have to manually sync via the menu or turn this back on and hide the application. The commit also removes the old refresh from the Manage dives menu as the semantic of that was possibly destructive now that we no longer immediately save changes to git - those could be thrown away by selecting refresh before the app had a chance to save them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04QML UI: be more careful when to show us accessing the cloudGravatar Dirk Hohndel
There may be other paths where we potentially show the wrong status to the user... but at least with this it times out eventually; there shouldn't be any single operation that isn't broken down with progress markers that takes more than 10 seconds, so keeping the notification around for 30 seconds seems very conservative. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04QML UI: don't immediately save data after we make changesGravatar Dirk Hohndel
Much as this felt like the prudent thing to do, it makes the UI painful to use. In bad network conditions, with a large dive log, on a phone, the save operation can take more than a minute - which is just completely ludicrous. So instead we mark the dive list changed when we make changes and wait for the app to not be in the foreground. Once the OS tells us that we are hidden (on the desktop that generally means we don't have focus, on a mobile device it usually does mean that the app is not on the screen), we check if there are data to be saved and do so. There is of course a major problem with this logic. If the user switches away from Subsurface-mobile but comes back fairly quickly (just reacting to a notification or briefly checking something, changing a song, something... then the app may still be non-responsive for quite a while. So we need to do something about the time it takes us to save the git tree locally, and then figure out if we can move at least some of the network traffic to another thread. And we need to make sure the user immediately notices that the app is not crashed but is actually saving their data. But that's for another commit. tl;dr: CAREFUL, don't kill Subsurface-mobile before it had time to save your data or your changes may be gone. In typical use that shouldn't be an issue, but it is something that we need to tell the user about. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Instrument the git storage codeGravatar Dirk Hohndel
This allows fairly fine grained analysis on what part of loading from and saving to git we are spending our time. Compute performance and network speed play a significant role in how all this plays out. The routine to check if we can reach the cloud server is modified to send updates every second so we don't hang without any feedback for five seconds when there is network but we can't reach the cloud server (not an unlikely scenario in many dive locations with poor network quality) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Make accessingCloud an integer so it can convey more informationGravatar Dirk Hohndel
This will be used to simulate a progress bar eventually. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Change the git progress update callback signatureGravatar Dirk Hohndel
This way we can include additional text. This will be used in later patches. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Git storage: after successful merge push merged commit to upstreamGravatar Dirk Hohndel
Otherwise a merge will only make it to cloud storage the second time we connect. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02QML UI: make sure the correct data is in the bread crumbsGravatar Dirk Hohndel
Once again this requires changes that aren't upstream in Kirigami. But with this the bread crumbs update when the user swipes from dive to dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02QML UI: remove obsolete codeGravatar Dirk Hohndel
This simply causes an error Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02QML UI: tap on the very top / title bar of dive list goes to topGravatar Dirk Hohndel
This requires changes to Kirigami that aren't upstream, yet. So there's a chance that this commit will have to be changed or reverted / redone. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02QML UI: work around problem starting some actions while on the App logGravatar Dirk Hohndel
If you show the App log and then start "Add dive manually" or "Show GPS fixes" you get this odd behavior that the page stack returns to the App log for some reason. A simple workaround is of course to return to the dive list, first. Not ideal (because there shouldn't be a reason not to have the All log in the stack as well, but not really a big problem, either, since the App log is mainly intended for developers. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02QML UI: redo application log pageGravatar Dirk Hohndel
This makes things wrap and scroll correctly again for me Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02whitespace cleanup for previous commitGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02QML UI: press and hold for delete dive on dive listGravatar Dirk Hohndel
This looks a little rough, but I think it works well. I'm sure it could be prettier, though. The next patch will just do the white space cleanup for the additional indentation level. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02QML UI: don't go through manager object to show mapGravatar Dirk Hohndel
We can open URLs in the browser directly from QML. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02QML UI: don't go through manager object to open user manualGravatar Dirk Hohndel
We can open URLs in the browser directly from QML. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02SDM import: fix logic for sample importGravatar Miika Turkia
Seems that testing if BOOKMARK is empty is a bad idea. We end up not getting any samples, but the ones containing a bookmark. So we need to switch the logic to testing if BOOKMARK contains something and do those tasks first and otherwise grab a regular sample. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-02SDM import: calculate duration if neededGravatar Miika Turkia
Seems that DiveManager does not always return the dive duration in DIVETIMESEC field. In this case we can try to calculate the duration from sample count and interval. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-01QML UI: all these changes certainly deserve a new versionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-01QML UI: when on the dive list, action button now offers add diveGravatar Dirk Hohndel
This seems like a useful default action when people are looking at the dive list (and it's a request from a user to have this as a button instead of just via the menu). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-01QML UI: add an "add" iconGravatar Dirk Hohndel
Again, proudly borrowing from the breeze icon set. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-01QML UI: put add dive action in a functionGravatar Dirk Hohndel
This way we can call this from a button as well as the menu. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-01qml white space fixesGravatar Dirk Hohndel
Left over from the merge of the Kirigami 1.0 port Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-01QML UI: add space at the top of dive details viewGravatar Dirk Hohndel
With the switch to Kirigami 1.0 it seems that the top bar now overlaps the page. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>