aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
AgeCommit message (Collapse)Author
2015-10-18Enable/Disable toolbar element in freedive modeGravatar Giorgio Marzano
Signed-off-by: Giorgio Marzano <marzano.giorgio@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-18Print: copy the bundled templates to a safe locationGravatar Lubomir I. Ivanov
This patch adds couple of helpers to retrieve the template path in the application bundle (getPrintingTemplatePathBundle()) and the template path in the user directory (getPrintingTemplatePathUser()). Once the print dialog is initiated for the first time the contents of the bundled template path are copied to the user template path using copyPath(). No overwriting of files will occur. The PrintOptions and TemplateLayout classes then only use the user path for retrieving templates. Fixes an issue where the bundled templates can be locked as read-only on OSX and Linux. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-14Add app icon to statistics windowGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09Fix main window size, position, and stateGravatar glerch
Now size, position and state should be preserved correctly. Signed-off-by: glerch <guido.lerch@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08Fix a crash when editing manually added diveGravatar Miika Turkia
I have manually added dives from an ancient version of Subsurface. Trying to edit these caused Subsurface to crash due to comparison of string of dc.model that did not exist (to a static string). And further down the execution path we were crashing as there were no samples associated with the dive. See #941 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08Refresh the screen even if started with no valid filesGravatar Dirk Hohndel
If no command line argument is given and no default file is set we didn't call refreshDisplay() and so the information widget stayed enabled even though no dive was shown which looked really weird and was inconsistent with what we showed when the user closed an already open file. This makes the behavior more consistent. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07Preserve profile toggle-button state zoomed_plot across sessions.Gravatar pestophagous
Fixes #912 Signed-off-by: K. Heller <pestophagous@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07Ask the Preferences Widget to show and be visibleGravatar Tomaz Canabrava
The 'show' call only makes the dialog visible, but if it's covered by any other window that's not from *this* program it could still be hidden in some OSes. the call to raise() asks the window manager to make the widget to be on top of the widget stack. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06Show error messages during start up as soon as the main window is shownGravatar Dirk Hohndel
When the user has setup cloud storage as their default file but didn't store the cloud storage password an error is created but not shown until another error happens - that's very confusing for the user. This patch fixes that. Fixes #938 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-05With no filename set pick reasonable directory for Save asGravatar Dirk Hohndel
If the user has no default filename set and starts Subsurface without a filename, the directory that is opened with Save as ends up being the current working directory of the executable, which might be its installation directory - which in general is not a good place to save data files to. With this change we pick the directory which is usually used for the default file, which should give us reasonable places on all OSs. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-28Cloud storage: show progress bar when using Save with cloud storage openGravatar Dirk Hohndel
When you have openend cloud storage, the Save and Save to cloud storage are basically the same thing... so we need to show the progress bar in that case, too. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-28Make progress dialog show up more reliablyGravatar Dirk Hohndel
Counterintuitively, setting the minimum duration to 200ms actually makes the dialog show up while waiting for the first progress signal. I had thought that setting it to 0 would make it show up right away, but with a value of 0 it waits for the first progress notification and with slow internet connections that can take quite a while (and with some git operations no progress notification will be sent out the whole time). So this should make the situation with the progress bar a little better. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23Show progress bar when loading from cloud storage by defaultGravatar Dirk Hohndel
It turns out that I forgot to make sure that the progress bar is shown if the user has things set up so that the cloud storage is the default dive file that they open. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22Add refreshProfile member function to MainWindow classGravatar Dirk Hohndel
While the whole idea of calling these functions through the MainWindow instance is atrocious, until we change the architecture of all this refreshProfile() is a useful function to have. In order to make this cleaner to implement I allowed an argument to ProfileWidget's replot() which allows picking a specific dive. By defaulting this to 0 we get the previous behavior when calling replot() without an argument. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>