aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-04-13Remove unused functionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-11Build instructions to deplay on you own iOS deviceGravatar Robert C. Helling
... so others might have less trouble. 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-11Merge branch 'for_dirkhh' of https://github.com/atdotde/subsurfaceGravatar Dirk Hohndel
2016-04-11VPM-B profile: declare CVA iteration variables within each loopGravatar Rick Walsh
The variables that control each CVA iteration should be declared at the start of each loop so that the values are carried over from one iteration to the next. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Robert C. Helling <helling@atdotde.de>
2016-04-11Fix time of first ceiling calculationGravatar Robert C. Helling
In our verision of VPM-B for real dives, we take as the deco time the difference between the time of the deepest ceiling and the time when the ceiling clears. When the display of ceilings was set to multiples of 3m this was confused, as the maximum finder had issues: First of all, it updated the time when the ceiling was the same (which was almost always the case for stepped ceilings) but changing >= to > was not enough, since then the first time a deepest stepped ceiling was reached was used. This patch uses the actual ceiling (not rounded to the next integer multiple of 3m) for this calculation to get rid of this problem. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2016-04-11Fix seabear import sample overrun bugGravatar Linus Torvalds
The Seabear import fixed up the NDL and TTS in the samples from minutes (in the import) to seconds (our internal format for all time). But it did it with a loop that overran the end of the samples array by one: for(int s_nr = 0 ; s_nr <= dive->dc.samples ; s_nr++) { Fix it to use the proper "<" instead of "<=". Reported-by: Stuart Vernon <stuartv@force2.net> Tested-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-11Fix wrong function call for desktop build of Subsurface-mobileGravatar Dirk Hohndel
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-08Simplify code - we now can rely on git_local_only to do the right thingGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-08QML UI: reformat the warning message when turning off auto syncGravatar Dirk Hohndel
This is silly - it should be set up so it wraps by itself... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-08git storage: only sync with remote if git_local_only isn't setGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-08QML UI: change order of cloud backend accessesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-08QML UI: make readonly fields more obvious in dive editGravatar Dirk Hohndel
Remove the border and make them look more like labels. This adds a StyledTextField for that purpose. And while we are at it, we can make that StyledTextField a little prettier. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-07QML UI: make gas mix validator case insensitiveGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-07remove reference to non-existing objectGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-07avoid dereferencing undefined objectGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-07QML UI: remove redundant headingGravatar Dirk Hohndel
This makes the start page look a bit more natural Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-07QML UI: more fixes to correctly calculate page widthsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-07QML UI: fix page width calculation for dive detailsGravatar Dirk Hohndel
Fixes #1049 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: close the drawer right when the user taps sync manuallyGravatar Dirk Hohndel
Having a short delay before the menu closes looks bad. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-06QML UI: after successfully opening storage, store the filenameGravatar Dirk Hohndel
We rely on the filename being valid elsewhere in the code. 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-06QML UI: hide keyboard before saving credentialsGravatar Dirk Hohndel
This way the user gets to see the git notifications. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05Desktop UI: make sure that git progress is actually shownGravatar Dirk Hohndel
This updates the got progress indicator to the changed interface where we don't pass in an explicit percentage. It also finally fixes an old problem: If we don't allow the Qt main loop to process the events, we'll never see a decent progress indicator... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05QML UI: more hacking around with git progress reportingGravatar Dirk Hohndel
I gave up on the magic numbers and instead report simply linear progress. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05QML UI: don't fetch the remote twice when loadingGravatar Dirk Hohndel
We first check the sha to see if we want to load at all. But at that point we already have the repository and the branch and we have synced with the remote. So when we decide that we need to reload from storage, we don't need to repeat those steps, instead we can go directly to the git load. For that to work we need to pass the repository pointer and the branch name back to the caller so that we can directly call git_load_dives(). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05QML UI: restructure (and fix) the saveChanges logicGravatar Dirk Hohndel
We first want to save any exiting unsaved changes to the local repository (and ONLY to the local repository). After that we want to make sure that we are syncing remotely, fetch the remote and then (possibly after a merge) push the changes to the remote. In the end we reset the previous "local git only" preference which we overwrote for this manual forced sync. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05QML UI: don't try to save again if we are already savingGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05QML UI: simplify code for loading data from the cloudGravatar Dirk Hohndel
We had a redundant check of the server reply hidden in there, and the logic which values were set where didn't really make much sense. This seems clearer to me. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05Simplify git tracking of git tree creationGravatar Dirk Hohndel
With Linus' changes to the tree creation saving the dives is no longer the dominant part of that process, so simplify the output (which also removes the hacky buggy code to show the percentages that is of course totally bogus). (apparently a couple of white space cleanups snuck into this patch) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05QML UI: simplify git tracking outputGravatar Dirk Hohndel
And don't waste quite as much time on updating the UI. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05DiveListModel: don't add the dives one at a timeGravatar Dirk Hohndel
Most of the time we are adding all the dives, so do this in a single model operation. This makes the case when adding a single dive (in the undo delete function) slightly more complicated, but that seems totally worth it for the speedup in the common case. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05Keep the instance in static variableGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05git storage: add explanation for fast forward to remoteGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05git storage: compare with correct SHA when checking if cache is currentGravatar Dirk Hohndel
Otherwise by the time we make the comparison the saved_git_id has already been updated. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05Fix per-cylinder SAC rate calculations when cylinder use isn't knownGravatar Linus Torvalds
John Van Ostrand reports that when he dives using two cylinders using sidemounts, the per-cylinder SAC rate display is very misleading. What happens is that since the two cylinders are used together (but without a manifold), John is alternating between the two but not actually adding gas switches in the profile. As a result, the profile looks like only one cylinder is used, even though clearly the other cylinder gets breathed down too. The per-cylinder SAC rate calculations would entirely ignore the cylinder that didn't have gas switch events to it, and looking at the info window it would look like John had a truly exceptional SAC rate. But then in the general statistics panel that actually takes the whole gas use into account, the very different real SAC rate would show up. The basic issue is that if we don't have full use information for the different cylinders, we would account the whole dive to just a partial set. We did have a special case for this, but that special case only really worked if the first cylinder truly was the only cylinder used. This patch makes us see the difference between "only one cylinder was used, and I can use the overall mean depth for it" and "more than one cylinder was used, but I don't know what the mean depths might be". Reported-by: John Van Ostrand <john@vanostrand.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05Remove unused and buggy get_cylinder_used_gas_string() functionGravatar Linus Torvalds
It's good that this is unused, because it does the calculations wrong. Due to the gas compressibility the gas use calculations should subtract the gas_volume() values at the differing pressures, not the pressures themselves. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05QML UI: more theme informationGravatar Dirk Hohndel
The fonts on my Nexus 6p are way too big (especially when compared to the fonts of the same build on an iPhone 6plus that has very similar screen size). Simply trying to get more data... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>