aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-06-14Make default file behavior work as expectedGravatar Dirk Hohndel
Subsurface will now start with the no default file, the local default file or cloud storage as chosen in the preferences. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-14Preferences: hook up default file behavior in the dialogGravatar Dirk Hohndel
This now sets the preference variable / config entry and keeps them in sync. Doesn't actually change the behavior at program start, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-14Preferences: radio buttons for default data file behaviorGravatar Dirk Hohndel
These aren't hooked up, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13system_default_directory() is broken with Qt 5.4Gravatar Dirk Hohndel
So for now just keep using the same function as we use with earlier versions of Qt5 as that seems to work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13Simplify distance calculationsGravatar Anton Lundin
This simplifies the distance calculations and removes a dependency. This version uses propper math instead of my to simple previous version. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13Cloud storage: clean up error propagationGravatar Dirk Hohndel
We were falling of the end of a number of functions that were supposed to return 0 on success or an error. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13Cloud storage: initialize local cache and remote on first useGravatar Dirk Hohndel
There's no point in telling the user that the remote is empty. We need to instead fix that and create the local cache and set things up for the remote. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13Cloud storage: if there is no remote tracking branch, create itGravatar Dirk Hohndel
When we first store things to the remote there won't be a matching branch for it. And even if for some silly reason the remote branch got lost - what's the point of telling the user that there is no remote branch? What are they supposed to do about it. Let's just fix the problem and move on. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13Cloud storage: make do_git_save available to other modulesGravatar Dirk Hohndel
And add a parameter that tells it whether to try to save any Subsurface data or whether to just create a branch and push it out. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13Add helper function to create a directoryGravatar Dirk Hohndel
Yes, this could easily done from the C code. But this seems just so much easier and I don't have to worry about the oddities of Windows and all that. I'm lazy. So sue me. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13Cloud storage: don't print confusing warningGravatar Dirk Hohndel
This is no longer correct and is actively misleading. We now correctly sync with the remote. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13Cloud storage: Remove another git related messageGravatar Dirk Hohndel
Once we failed to load data from cloud storage (for example the first time we try to use it when the remote repository is empty), don't show git related errors to the user. It's enough to tell them that the cloud storage is empty. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13Cloud storage: setup proxy before cloning new repositoryGravatar Dirk Hohndel
If we don't have a repository yet, we can't setup the proxy option before calling into libgit2. Instead we use a callback. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13Don't show an error if you fail to open the cloud storageGravatar Dirk Hohndel
The lower level functions will already report that things didn't connect successfully, no reason to repeat it here (which then exposes the git URL). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13Cloud storage: give user friendly error messagesGravatar Dirk Hohndel
Instead of showing the git URL and talking about failures to clone repositories, simply tell the user what's happening with the cloud storage. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13Cloud storage: check connectivity before trying to connectGravatar Dirk Hohndel
With a new repository we take a different path. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-13Move git related declarations into their own header fileGravatar Dirk Hohndel
Also change the name of the enum and make sure all the inner functions get passed the remote transport information. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12Cloud storage: sync the remote after saveGravatar Dirk Hohndel
This change once again tests if the remote can be reached. Even with a fairly big data file and a medium speed internet connection the remote sync is fast enough to call it nearly instantaneous. Maybe a couple of seconds. We may need more checks / different heuristics / warnings if the sync didn't happen, etc. But for now this should allow more reasonable testing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12Cloud storage: Add preference option whether to sync in the backgroundGravatar Dirk Hohndel
This defaults to on as that's the most useful setting for the average user. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12Cloud storage: don't clear out password by mistakeGravatar Dirk Hohndel
If the user didn't enable saving the password to the preferences, then the password was cleared out as the preferences got synced. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12Use friendlier file name when asking about saving changesGravatar Dirk Hohndel
It's silly to show our full URL with branch name in that case. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12Cloud storage: better window titleGravatar Dirk Hohndel
This makes it clear that we are working with the cloud storage and removes the (in that case, redundant) branch name from the title. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12Indicate that there are unsaved changes with a '*' in the window titleGravatar Dirk Hohndel
This seems to be a fairly common way to indicate this property. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12Add header for Qt helpers used from C functionsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12Cloud storage: check connection before connectingGravatar Dirk Hohndel
libgit2 takes forever (a minute or so) to figure out that it can't connect to a remote server. So if we are using https as connection protocol, quickly check utilizing RFCs 2324/7168 to make sure we can reach the cloud server (and not some captive portal or something). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12Cloud storage: Unset the proxy if none is configuredGravatar Dirk Hohndel
The settings are stored in the local cache repository - so without resetting it a proxy would stay configured even if it was disabled in the Subsurface preferences. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12Cloud storage: Setup http proxy for git connectionGravatar Dirk Hohndel
At the time of this commit support for this feature has not landed in upstream libgit2, yet (but there is a pull request). Yet supporting this here doesn't appear to cause any issue with older versions of libgit2, either, so the http proxy support will simply not work when enabled and a version of libgit2 that's too old is used. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12Cloud storage: Require libcurl in order to support http proxiesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-11Add two new libraries to requirement list (deb)Gravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-11Dive site management: show pictures instead of profileGravatar Dirk Hohndel
This seems to work better than moving the Globe up there. It's not ideal (I really want to be able to show one big picture for the site - and on all the sites without pictures we show nothing), but for now I think this is better than having the profile there. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-11Revert "Dive site management: remove the profile view"Gravatar Dirk Hohndel
This reverts commit ec8ba5f830efc01f2db627e82e34c353c0dd13f7. Turns out that moving the globeGps widget to a different quadrant breaks the parent relationship and that causes things not to work. I know that I tested this and didn't notice any issues, but I now can reproduce a broken default screen. So let's revert. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-11Add a more complex sample diveGravatar Dirk Hohndel
This includes trips, dives outside trips, deco, gas changes, dives with multiple dive computers, a really short dive, a rather long dive, a dive with pictures, dive computers with very coarse sample rate, rather fine sample rate, with gas integration, without... Should touch a lot of different scenarios. The file is in V2 format to also allow testing the importing / conversion to dive sites. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-11Minor fixes to the INSTALL-fileGravatar Paul-Erik Törrönen
* Add needed qt5-qtlocation-devel package for Fedora install * Correct the call to subsurface binary after compilation] Signed-off-by: Paul-Erik Törrönen <poltsi@777-team.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10Cloud storage: use our credentials when updating the remoteGravatar Dirk Hohndel
If we are pushing to an ssh or https based remote we need to use our credentials. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10Cloud storageGravatar Dirk Hohndel
Use the credential helpers earlier in the source. This way we can use them for the push as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10Cloud storage: track the repository type and pass the information aroundGravatar Dirk Hohndel
This is easier than having various parts of the code to the string comparison on the URL. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10git storage: actually update the remote repository if the local cache is ↵Gravatar Linus Torvalds
more recent Again, note that this currently only happens when you initially open the repository. So if you do subsurface https://.../repo[myubranch] it will start up by fetching the remote information, and updating the local cache. If you then download new dives, and do a save-and-exit, it will save to the local cache, but it doesn't do the fetch at this point, so the remote is now begind. The *next* time you start subsurface, and load that git branch again, it will fetch the remote, and now notice that the local cache is ahead of it (because you downloaded new dives and saved them locally), and *then* it will try to update the remote with the new information. This is obviously bogus, but we will need to decide exactly how we want to sync with the remote repository. But now the core functionality is there, it's just that we need some interface to say "sync now". Especially in the face of spotty (or non-working) internet, you want a GUI etc for this whole remote sync, rather than doing it unconditionally and silently whenever you load the local cache initially. With that caveat: Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10git storage: re-organize code to make 'origin' remote more widely availableGravatar Linus Torvalds
I'm going to try to update the remote if the local cache is more recent when we fetch the data, which requires access to the remote over a wider range of code. This re-organizes the code so that we can free the remote later without having to have nasty error handling. We avoid the whole "if an error happened, free the remote and return" by creating helper functions and freeing the remote in the caller, so that all paths end up freeing it naturally. NOTE! We want to try to update the remote when we save the local cache too, so this whole "update remote when opening it" is incomplete. But (a) we do want to do it here as well and (b) this is the easiest place to create the initial "push to remote" code without any new "sync with cloud" interfaces. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10git storage: actually update cached copy from remoteGravatar Linus Torvalds
We used to fetch the remote information but not actually do anything about it, except report when it wasn't up-to-date. Now we actually update the local cached copy if the remote has changed. The code does not try to actually merge things, so only fast-forward updates are done, but that should be the normal case. We might eventually do some simple merging on our own, but I suspect manual merging may be the safer option. We don't currently ever update the remote repository, and only inform users that our local repository is ahead of the remote. Fixing that is the next step. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10Dive site management: remove the profile viewGravatar Dirk Hohndel
While this isn't what I really want (I wanted pictures of the dive site instead of the profile), at least this makes it clear that we aren't editing a dive but instead are looking at a site. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10Add "additional name" to the correct dive siteGravatar Dirk Hohndel
Adding the name to its own dive site was kind of silly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10When done reverse geocoding, hide the notificationGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10Don't show the V2 warning anymoreGravatar Dirk Hohndel
This now happens in its own thread... But leave the infrastructure so we can ask questions about the geo encoding Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10When parsing V2 XML files try to be smarter when creating dive sitesGravatar Dirk Hohndel
Two "locations" from a V2 file are the same site if they have the same name AND if their GPS coordinates are within 20 meters of each other. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10Add helper function to determine the distance between two pointsGravatar Dirk Hohndel
And use this to find a dive site within a certain radius of a GPS fix. This will be used to figure out if dive sites might be the same. This uses a new Qt5 component (Positioning) which was added in Qt5.2. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10When saving only selected dives, only include referenced dive computersGravatar Dirk Hohndel
Since we should have far fewer dive computers than dives this straight forward algorithm shouldn't cause any performance issues. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10When saving only selected dives, only include referenced dive sitesGravatar Dirk Hohndel
The algorithm seems rather brute force; basically quadratic in the number of dives, assuming we have about the same number of dive sites as dives which seems a reasonable assumotion. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-10Don't show all the auto generated dive sites on the globeGravatar Dirk Hohndel
When downloading GPS data from the Subsurface webservice we repopulated the globe before purging all the unused GPS fixes from the list of dive sites which caused massive clutter (until the next time the user changed the displayed dive or did anything else that caused the globe to redraw itself). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-09Cloud storage: be more careful when trying to determine a user nameGravatar Dirk Hohndel
Since we use the email address (including the '@' sign) as the repository name we have to be more careful when trying to pick an account name from a git URL. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-09README should mention that this is not a releaseGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>