summaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2015-06-16HTML export: separate UI and logic codeGravatar Dirk Hohndel
In order to be able to initiate an HTML export from the core library we need to separate the actual logic from the UI. 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-16Code cleanup: implement window title update via signalGravatar Dirk Hohndel
This seems quite convoluted to me but I can't seem to make a more straight forward implementation work. The idea is that core code should never directly call into the UI. So instead the core code (this is C code) calls a helper function. That helper function calls a member function of a class which in return emits a signal. The UI code connects to that signal and acts accordingly when it is received. 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-15Cloud storage: create preference entry for base URLGravatar Dirk Hohndel
This just deals with the mechanics. There is no UI to enter / change this URL (and that's intentional), neither is it used, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-14Fix renumbering of divesGravatar Dirk Hohndel
The implementation in commit 182fe790c9e8 ("Add ability to undo renumbering of dives") looks perfectly reasonable, but it depends on an implementation detail: it assumes that the keys of the QMap are returned in the same order in which they were placed there. Which apparently isn't the case for some version of Qt. With this commit we simply remember both the old and the new number for each dive and therefore the order in which they are processed doesn't matter. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-14Cloud storage: only offer cloud storage related options when verifiedGravatar Dirk Hohndel
If we don't have verified cloud credentials disable the menu options and disallow the use of cloud storage as default data file. 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-14Main menu: rephrase the cloud load/save optionsGravatar Dirk Hohndel
This seems to be more logical and more consistent. 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-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-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: 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-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-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-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-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-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-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: deal with visibility of PIN entryGravatar 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-07Select the correct dive in EditAddedDive modeGravatar Tomaz Canabrava
If we added two dives, and then tried to edit the first added one, the current 'added dive' set on main_tab would be the second one, so when we got to the accept() part of the call, it would reselect the last added_dive that we had. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07Change the name of the dive site on the globeGravatar Tomaz Canabrava
The name of the dive site on the globe wasn't being updated when we changed the name of it in the dive management dialog. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07Reset the current dive site when we reject itGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07Plot the current dive site in edit modeGravatar Tomaz Canabrava
We were ignoring the displayed_dive_site as we were adding it and the changes weren't accepted yet. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07Do not connect to same signal/slot twiceGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07Always fill the fields in LocationInformation edit widget.Gravatar Tomaz Canabrava
If the current_dive was the same as the dive send to the LocationInformation widget, we would do nothing, wich is wrong because we could have filled the information on an add_dive_site action and then cancelled it, so the info will stay there until we change it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> 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-06-04Make Subsurface compile with NO_PRINTING setGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-04GlobeGPS: add empty function for NO_MARBLEGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-04Printing: Add progress updating ability to print dialogGravatar Gehad elrobey
The progress bar shows the progress of both the rendering part and the templating part, unfortunately we can't check the progress of Grantlee templating engine so the progess bar doesn't have a constant pace it stops a little around 20%. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-04Printing: call print from printer classGravatar Gehad elrobey
This is the main function that prints dive lists. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-04Printing: remove the print_options struct from display.hGravatar Gehad elrobey
Move print_options struct to printoptions.h, its more relevant to be placed here. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-04Printing: Remove more obsolete code from printlayoutGravatar Gehad elrobey
This code can be removed as we don't need QT printing code anymore. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-04Printing: Edit the print options widgetGravatar Gehad elrobey
Remove obsolete code and add new customizable print code to the options dialog. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>