aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/subsurfacewebservices.cpp
AgeCommit message (Collapse)Author
2015-10-26Allow building with both libzip 0.11.x and 1.0.xGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-26Some error reporting on divelogs.de exportGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-25Report error received from zip_closeGravatar Dirk Hohndel
We may want to hide the error text in a release build and replace it with something more user friendly but then again, the next time this fails on us at least our users can report more than "doesn't work"... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-25Divelogs.de upload: report error when unable to open upload fileGravatar Dirk Hohndel
Silently failing is not cool. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-28Make importing of GPS locations less verboseGravatar Dirk Hohndel
These messages are extremely useful to understand what Subsurface is doing, but they are a bit too wordy for normal use. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Windows XP doesn't contain a valid CA for our cloud certificateGravatar Dirk Hohndel
This is the authentication check and cloud server availability check which are different from the one git does. The mechanism for overriding things is different from there, but this should work just as well. We intercept the SslErrors signal and if we get the known good hash for our certificate, we simply call it good. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09Fix a crash on divelogs.de exportGravatar Miika Turkia
Subsurface crashes when multiple dives are selected on divelogs.de export. The crash occurs on malloc that is called indirectly from xmlReadMemory(). Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-07Include dive site on divelogs exportGravatar Miika Turkia
Due to the new dive site management, we need to include this information before transforming the XML to divelogs.de format. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Transform GlobeGPS in a static instance() classGravatar Tomaz Canabrava
This is needed to start easing the transition from the completely wrong and bogus MainWindow::instance()->globe() calls. this is still wrong, but with it I removed one level of indirection. I did that now because I wanted to not taint the location management when I use it to deal with the globe. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22Make password change asynchronousGravatar Dirk Hohndel
This isn't perfect (if you make multiple requests things could go badly), but it's better than just slapping the new password into the settings, even if the update failed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22Cloud storage: enable password updateGravatar Dirk Hohndel
This now allows the user to set a new password for the cloud service. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-16Change API signature to act on dive_site, not uuidGravatar Dirk Hohndel
This way in the future we can pass in a pointer to a dive site that isn't linked in our dive site list yet (i.e., while we are editing). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-24Rewrite GPS fix matching code for imports from our webserviceGravatar Dirk Hohndel
The longer I stared at the existing code the less it made sense. So instead I rewrote it in a way that seems logical to me. And added a boatload of debugging output (which needs to be removed, of course). I tested this against more than a hundred dives and it seemed to always pick the right fix. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Avoid possible use of uninitialized variableGravatar Dirk Hohndel
Errorcode doesn't get set if duppedfd is negative. So let's just issue an error and bail. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Better error handlingGravatar Dirk Hohndel
Most of these will likely have no big impact, but it's better not to just ignore them as they could lead to crashes. Uemis downloader: if lseek fails, return 0 Uemis downloader: consistently check for failure to open req.txt Zip file handling: dup could fail Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Address uninitialized member warningsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16Move checking the cloud connection into its own filesGravatar Dirk Hohndel
This isn't UI related and shouldn't have been in a file full of UI functionality. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-15Cloud storage: use preference member instead of hard coded stringsGravatar Dirk Hohndel
This creates the basis to allow other backends to be used with the cloud storage infrastructure. So far this should all just transparently continue to work. A user would have to manually add the cloud_base_url entry to the CloudStorage section in their config file in order to use a different backend server. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-14Cloud storage: clear our last error if verification succeedsGravatar Dirk Hohndel
This is cosmetic but makes things friendlier, I think. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-14Cloud storage: show in preferences if cloud account was verifiedGravatar Dirk Hohndel
This should make it easier to figure out what's happening. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-14Cloud storage: clean up handling of cloud storage accountGravatar Dirk Hohndel
Correctly tracking the status of our authentication with the cloud service is non-trivial, especially since the user may quit Subsurface between registering and verifying an account, they might even register on one machine and verify on another. This tries to make sure that when in doubt we check with the cloud service backend. And we show errors in the UI. 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-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-09Merge branch 'cloudstorage'Gravatar Dirk Hohndel
2015-06-09Cloud storage: implement confirmation of email address via PINGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-09Cloud storage: initial support for confirming the email PINGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-09Discard all temporary sites after merging with dive listGravatar Dirk Hohndel
After we import all the GPS fixes from the Subsurfae webservice we delete the ones that didn't match any dives. The algorithm skipped every other one by mistake. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-09Subsurface GPS webservice: make sure dive log is marked as modifiedGravatar Dirk Hohndel
One of the cases was missing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-09Fix building with NO_MARBLE issueGravatar Gehad elrobey
We can't build with -DNO_MARBLE after some previous commit broke globe.cpp - centerOnCurrentDive() is still existing in the code while removed from header in 6b81fb49d09. - Some referenced to MainWindow::instance()->globe() even if we are building with no marble. - include stdint.h Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07Cloud storage: first stab at creating an account on the backendGravatar Dirk Hohndel
This triggers when the email address / password is changed in the preferences. It opens an https connection with the backend server (the URL is hardcoded) which should create an account with these credentials. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07Always send the UUID of the coordinates to the globeGravatar Tomaz Canabrava
We were relying in the current_dive to display the globe coordinates correctly - but this is not always the case: you can be inserting a new dive site and it isn't yet inside of the dive until the user presses accept. So always pass the uuid of the dive site that we want to display. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-24Remove support for Qt4 (part 4)Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-28Simplify creation of the upload file for Divelogs.deGravatar Dirk Hohndel
Instead of writing each dive out to a file and reading that file back in, let's just use the internal helper function that places the dive as XML into a membuffer. So much simpler, so much faster. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-28Show error if creation of the Divelogs.de upload file failsGravatar Dirk Hohndel
Previously we simply failed silently without showing the user any indication that something went wrong. That seems wrong. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-25DivelogsDeWebServices::multipart - initializes memberGravatar Marcos CARDINOT
Non-static class member multipart is not initialized in the constructor Signed-off-by: Marcos CARDINOT <mcardinot@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27Change the references to ShowError to the new notification object.Gravatar Gehad elrobey
Showing an Error message is better called from the Notification Object, So for consistency old references to showError is replaced by calling the notification object. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-23Move helper functions aroundGravatar Dirk Hohndel
We had a ton of helper functions in qt-gui.cpp which really didn't make much sense. So I moved them all into qthelper.cpp. Also moved the UserAgent helper that didn't belong in the UpdateHandler to begin with - that's a generic helper used in many places... With this we can successfully build using cmake again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-17subsurfacewebservices.cpp: add QDebug includeGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-13Adapt GPS coordinate download from our companion app to dive sitesGravatar Dirk Hohndel
This is a bit awkward now. We are downloading what looks like fake dives in the v2 format. So we create a dive site for every single fix. After we merge those new dive sites into the existing dives we need to throw away all the dive sites that weren't used. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11Remove redundant functionGravatar Dirk Hohndel
We had two functions doing exactly the same thing. Let's drop the one with the highly confusing name. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove the ProfileWidget from mainwindow.uiGravatar Tomaz Canabrava
It is now in mainwindo.cpp Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove information panel from mainwindow.uiGravatar Tomaz Canabrava
Now it's created in the mainwindow.cpp as part of the new way to configure the interface. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove the Globe from the mainwindow.uiGravatar Tomaz Canabrava
Now it's started from mainwindo.cpp and it's part of the new states Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10Remove the DiveList from the mainwindow.uiGravatar Tomaz Canabrava
It's now set up from the mainwindow.cpp file. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17Clean up the header filesGravatar Dirk Hohndel
Lots and lots and lots of header files were being included without being needed. This attempts to clean some of that crud up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-09Add more infrastructure for a separate dive tableGravatar Dirk Hohndel
This will allow us to download the dives from the dive computer into a separate table just for that purpose and not into the main dive_table. I really dislike the code that's in place that dates back to the very earliest code written for Subsurface. Dumping the dives straight into the main dive_table seems really stupid to me. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-18Move update check and survey to the new domainGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-18TyposGravatar Salvo Tomaselli
This fixes two typos found by lintian. I guess a bunch of translations will need to be updated or something, I am not sure how they work so I didn't touch them. I presume in the worst case they will need to be re-translated at the next iteration -- Salvo Tomaselli "Io non mi sento obbligato a credere che lo stesso Dio che ci ha dotato di senso, ragione ed intelletto intendesse che noi ne facessimo a meno." -- Galileo Galilei http://ltworf.github.io/ltworf/ From a0e5f48349557fcccd82ba8c7555043de140835c Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it> Signed-off-by: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it> Date: Fri, 12 Sep 2014 18:25:20 +0200 Subject: [PATCH] Fix typos reported by lintian Fixes two typos reported by lintian. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-27Define PATH_MAX if it's not definedGravatar Salvo 'LtWorf' Tomaselli
Fixes FTBFS on Hurd. [Dirk Hohndel: changed PATH_MAX to 4096 for consistency with Linux] Signed-off-by: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-08Better User Agent for SubsurfaceGravatar Dirk Hohndel
This one is less verbose and very easy to parse. It's guaranteed to have five components, separated by ':' with no other ':' in the string: Subsurface:<version>:<PrettyOSName>:<appCpuArch[/osCpuArch]>:<UILang> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>