aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
AgeCommit message (Collapse)Author
2015-09-20When calling save-as with cloud storage as default, pick sane filenameGravatar Dirk Hohndel
Passing the cloud URL to the file select box leaves "git syntax" in the filename which makes us look for a directory with a git repository in it and give non-sensical error messages to the user. With this we simply use the users email address as local filename with a .ssrf suffix. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-16Make Facebook more user friendlyGravatar Tomaz Canabrava
The current way that facebook works is terrible: it's scattered around tons of files ( at least 4 different files and classes ) this moves things around a bit, add a disconnect button that was missing, cleans tons of code and fix inconsistencies. I will also redo this part for 5.0, but it's too late for 4.5 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09Replace the spinner with a progress dialog for cloud storage accessGravatar Dirk Hohndel
Since the spinner caused all kinds of problems inside VMs, wasn't shown at all for some people on Win10 and appeared to get stuck a lot and still left people with the perception that Subsurface was hung, this patch takes a more traditional approach and gives the user a progress dialog. An additional benefit of this is that the user now can cancel a hung transfer. The slightly weird passing in of the callback allows for the separation of UI and core logic code... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-09Two small string changesGravatar Dirk Hohndel
Reported by Ettore Atalan on Trnasifex. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-07Save Bluetooth download mode settingsGravatar Claudiu Olteanu
Save the dive computer download mode flag. In this way, if the user used Bluetooth mode to download its dives on his last session he doesn't need to open the Bth selection dialog if he wants to use the same device. Signed-off-by: Claudiu Olteanu <olteanu.claudiu@ymail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-05More style and readability changesGravatar Tim Wootton
Changes to capitalisation to comply with coding style Changes to make some blocks of english sound a bit better Signed-off-by: Tim Wootton <tim@tee-jay.org.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29Fix edit & show of divesites for new and existing dives.Gravatar Sander Kleijwegt
The UI detects when it should refresh the loction after the user finished editting a divesite. Creating and editting divesites is now working even when the current dive is not saved yet. Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-26Explicitly show the menubar after mainwindow initialisation.Gravatar Sander Kleijwegt
At least on Ubuntu with xfce instead of Unity this appears to be necessary to get a menu bar for the application. Fixes #833 Signed-off-by: Sander Kleijwegt <sander@myowndomain.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Remove a couple of debug messagesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Keep the dive list disabled if editing a diveGravatar Tomaz Canabrava
When, in a dive edit mode user entered a dive site and went to dive site edit mode then finished the ds edit, the app would lose the disabled property of the dive list, making it possible to select a new dive when we where editing another one, complete mess. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Turn the get taxonomy button into a manage dive site buttonGravatar Tomaz Canabrava
The get taxonomy button will be inside the manage dive site interface. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Disable profile when in dive site edit modeGravatar Tomaz Canabrava
I didn't have time to create / finish the photos widget, so I'm adding back the profile view while in dive site edit mode, but disabling it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Add spinner while opening or saving cloud storageGravatar Dirk Hohndel
Right now this is quite ugly. And at least in my VM the transparency doesn't seem to work correctly. But at least we now have some visual indication that we are doing something while opening or saving cloud storage. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-22Continue to separate logic code from UI codeGravatar Dirk Hohndel
We don't want to call into the MainWindow from C code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-21Save Properties for each State of the mainWindowGravatar Tomaz Canabrava
Each state can have the same widgets but with different properties - currently I'm using "enabled" : true and false for the DiveSiteEdit, it looks like a big amount of code for such a small thing but it was the cleaner way that I tougth of doing. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-18Replace global in_planner variable by helper functionGravatar Robert C. Helling
as promised earlier Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-15Some unification between Buehlmann and VPM-BGravatar Robert C. Helling
This patch makes deco_allowed_depth() work both for Buehlmann as well as VPM-B (as long as the VPM-B internal variable total_gradient[] is valid). As a bonus, in VPM-B mode, in the planner, the ceilings are VPM-B ceilings and not Buehlmann GF. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-09Set proper mode for file open dialogGravatar Miika Turkia
Fixes #913 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-31Correctly update the dive when the user edits dive_siteGravatar Tomaz Canabrava
We didn't correctly update the dive site as soon as the dive_site edit finished, and this time we are actually correctly updating things using signals instead of calling the mainwindow for everything. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-31Remove unused signalGravatar Tomaz Canabrava
And move things around, informationManagementEnded was a good name but endEditDiveSite is better. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28Printing: search for grantlee templates in the templates directoryGravatar Gehad elrobey
We need to dynamically look up for all the existing templates in the template directory. A grantlee template can be named any name but we ignore files ending with '~'. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-07-25Don't show the survey for the mobile appGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25Close the dive site edit when accepting/rejecting itGravatar Tomaz Canabrava
Return to the default mainwindow state when the user accepts or rejects the dive site edit. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25Re-enable the dive site editGravatar Tomaz Canabrava
Since now we found the perfect way to deal with dive site handling on the dive, we can reenable this widget. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-24QML UI: make sure the dive list is empty before loading divesGravatar Dirk Hohndel
When testing subsurface-mobile on the desktop from an account that had a default file set up in the Subsurface preferences that file would already be loaded creating rather confusing output. 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-07-12Divinglog import: add .sql extension for importGravatar Miika Turkia
Generic divelog might come with the .sql extension, thus adding that to the file filter. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06Be more careful freeing taxonomy dataGravatar Dirk Hohndel
We want to only access data that we consider valid. And we need to clear out pointers to freed memory. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-29Building without Marble: don't try to connect a signal to the globeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27Globe: use lighter and darker flags to mark the current dive siteGravatar Dirk Hohndel
This may be too subtle... the current dive site now has a brighter flag than the others. I may need to make it an even bigger difference or maybe make the flag a little bigger or something... but it's a start. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: remove superfluous connectGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-26Dive site rewrite: remove a ton of code from the LocationManagementGravatar Tomaz Canabrava
The way I was doing the old location management was very dull: everything was tangled on the mainwindow. Now I think I've found the correct way to create this, and thus, this code can die. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-25Don't show datafile version warning if no file was openedGravatar Dirk Hohndel
Also remove most of the hard new lines in the text so it flows better depending on the font size used. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Show warning if user loads an old datafileGravatar Tomaz Canabrava
Show the user a warning if he opens an old version of the divelog file, the warning tries to explain some things that are different on the new version. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22Do not mess with dive location automaticallyGravatar Tomaz Canabrava
This might be what the user wanted, but also might not be it. So wait for the user to request it manually. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-21Some file dialogs insist on adding a default extensionGravatar Dirk Hohndel
We already had code to deal with this in the Save As case, but similar handling is needed in the Open case. This commit also makes the regular expression handling a bit stricter and identical between the two cases. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20Track minimum datafile versionGravatar Dirk Hohndel
Add infrastructure and helper functions to track minimum datafile version. To make this information useful we need to keep the XML and git data format versions in track moving forward. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16Set up signalling to display notes in planner again.Gravatar Robert C. Helling
This got broken in a recent transition to more abstract models. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16Remove all the no longer necessary code that aborts read of first V2 fileGravatar Dirk Hohndel
This was a poorly implemented hack when we executed the reverse geo lookup in the main thread and opening a V2 file could take a very long time. We need to do the "Welcome" message quite differently. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-16Cloud storage: warn the user if we are not onlineGravatar Dirk Hohndel
This isn't perfect, but at least tells the user if we weren't able to connect and are working just off the local cache. 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-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-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-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-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>