aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mainwindow.cpp
AgeCommit message (Collapse)Author
2017-04-29Add SPDX header to desktop widgetsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-22Reduce default verbosityGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-20Do not abort when there is no current diveGravatar Jan Mulder
Yes, currentdive can be undefined in case of of a new logbook and starting the planner right away. Do not abort on that. Reported-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-20Preserve dive mode when planning a diveGravatar Jan Mulder
Data such as cilinders and used gasses are populated fromn the currently selected dive when starting the planner. It is more logical to use the dive mode (OC, CCR, pSCR) of the currently selected dive as well. This commits changes this. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-16Restore FB grayed out when disconnectedGravatar Jan Mulder
See https://github.com/Subsurface-divelog/subsurface/issues/253. The original behaviour (greyed out when disconnected) is restored. Not sure where and when got lost, but this simple change fixes it. Fixes #253 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-06Break down MainTab into smaller classesGravatar Tomaz Canabrava
Maintab is one of our most complex classes, and it's something I'm not actually proud of. But it currently works and the idea of splitting it was in my head for quite a while. This is the third or fourth tentative of splitting it, and this time I let the most complex part of it untouched, the Notes and Equipment tab are way too complex to untangle right now on my limited time. A new class 'TabBase' should be used for any new tab that we may create, and added on the MainTab (see the new lines on the MainTab constructor). Also, Extra Info, Information, Photos and Statistics where ported to this new way helping reduce the number of lines and functions on the MainTab quite a bit. Overall this is a step in the right direction for the future. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-24Fix double to int truncation in C++ codeGravatar Jeremie Guichard
Wfloat-conversion enabled for C++ part of the code Fix warnings raised by the flag using lrint Original issue reported on the mailing list: The ascent/descent rates are sometimes not what is expected. E.g. setting the ascent rate to 10m/min results in an actual ascent rate of 9m/min. This is due to truncating the ascent rate preference, then effectively rounding up the time to reach each stop to 2s intervals. The result being that setting the ascent rate to 10m/min results in 20s to ascend 3m (9m/min), when it should be exactly 18s. Reported-by: John Smith <noseygit@hotmail.com> Reported-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-04Get initial depth/duration correct when manually adding diveGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-25Add 4 file types op file-open logbook menu filter, consistencyGravatar Jan Mulder
4 file types (that are very rarely used), did showup in the import-import dive logs menu (e.g. the file filter), but were missing from file-open logbook file type filter. Just added them to the file-open part to be more consistent. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-02-25Correct file list in file-open filter boxGravatar Jan Mulder
Some missing ;; caused the filter on filetypes in open-open logbook to be garbled. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-02-20Remove default stylesheet from planner outputGravatar Stefan Fuchs
Remove the default stylesheet ("Courier" 13pt) from the planner output QTextEdit. Remove the content of the html property of the QTextEdit because we overwrite it when doing setHtml. After printing copy the original dive notes string displayed_dive.notes back to the QTextEdit Advantages: Display is according to font settings. ctrl - mousewheel for zoom always works. Drawbacks: Printing font is same as display font but can be adjusted by zooming before. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-01-18Only set surface pressure when it has a valueGravatar Robert C. Helling
When replanning a dive, do not set the surface pressure when it is 0. Same for salinity. This closes #161 . Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-01-01Facebook integration: change the menu entry to disconnectGravatar Dirk Hohndel
This way the menu entry becomes the togglee it appears it was designed to be in the first place. This closes #129 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-01Facebook integration: keep the connections QMenu aroundGravatar Dirk Hohndel
This way we can change the text, later. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-26Set surface pressure and salinity correctly when replanningGravatar Robert C. Helling
We need to initialize the UI elements accordingly. Fixes #1094 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-15Manual revert of commit 9295b3aa3742ea3af4427de831af58ed2a268c9bGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-11-09Use fake profile when replanning dives without samplesGravatar Robert C. Helling
This can happen when the user asks to replan a dive that was imported from CSV. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-22Fix building of Facebook supportGravatar Dirk Hohndel
No idea when this got broken. Fix seems like a hack as that variable should get set in the plugin CMakeLists.txt. But it seems to work, so "whatever". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27Settings update: Add "Dive Computer" settings to SettingsObjectWrapperGravatar Tomaz Canabrava
For some reason, the dive computer settings weren't in the settings prefs. This moves it, makes the boilerplate on Settings ObjectWrapper and make things compile. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-30Add menu entry to remove the offline stateGravatar Dirk Hohndel
If an attempt to contact the cloud storage fails, Subsurface switches into offline mode. This allows us to go back online again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-17If cloud storage is offline, show that in title barGravatar Dirk Hohndel
Not sure if "local cache" is the best text, but it's accurate. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-13Set date and time when replanning a diveGravatar Robert C. Helling
Otherwise we pretend the dive is now. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-11Make sure dive computer model is proper malloc'ed allocationGravatar Linus Torvalds
Reported-and-tested-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05Use encoded file name on importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05Allow parsing of .txt files on importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25Fix file extension regespGravatar Miika Turkia
The original negative lookahead failed in case the file name contains more than 1 dot as it looks for dot that is not followed by the given extensions. And such a match exists in the file name. The new version should look properly if the file ends with any of the given extensions. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25Add CSV parsing trigger for zxu and zxl filesGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25Add DAN DL7 file extensions for import UIGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05Desktop UI: make sure that git progress is actually shownGravatar Dirk Hohndel
This updates the got progress indicator to the changed interface where we don't pass in an explicit percentage. It also finally fixes an old problem: If we don't allow the Qt main loop to process the events, we'll never see a decent progress indicator... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Move subsurface-core to core and qt-mobile to mobile-widgetsGravatar Dirk Hohndel
Having subsurface-core as a directory name really messes with autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an autocomplete conflict and also was inconsistent with the desktop-widget name for the directory containing the "other" UI. And while cleaning up the resulting change in the path name for include files, I decided to clean up those even more to make them consistent overall. This could have been handled in more commits, but since this requires a make clean before the build, it seemed more sensible to do it all in one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Change the git progress update callback signatureGravatar Dirk Hohndel
This way we can include additional text. This will be used in later patches. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22Don't start Add or Plan while accessing cloud storageGravatar Dirk Hohndel
This avoids a race condition where we get confused about our internal state. Fixes #1031 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in mainwindow.cppGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07Remove unused variableGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25Start to use the QSettings ObjectWrapperGravatar Tomaz Canabrava
start of the QSettinsg Object Wrapper usage on the code this first patch removes two macros that generated around 200 lines in runtime for something like a quarter of it Basically, whenever we changed anything we called the PreferencesDialog::settingsChanged and connected everythign to that signal, now each setting has it's own changed signal and we can call it directly. The best thing about this approach is that we don't trigger repaints for things that are not directly profile related. ( actually we still do, but the plan is to remove them in due time) this commit breaks correct atualization of the profile (because everything was connected to PreferencesDialog::settingsChanged) and now I need to hunt a bit for the correct connections Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-20Remove the non-canonical Subusrface versionGravatar Dirk Hohndel
It no longer makes sense to lie about the version. If you are running a product build, then the canonical version is the same version as the plain version used to be. And in either case it makes much more sense to simply log the full version information. We used to have the differently styled versions for different OSs, but I don't think this is needed anymore. Let's hope this doesn't go down as one of these "famous last words" moments... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-15Remove support for older libgit2 - we now require 0.23 or laterGravatar Dirk Hohndel
Also fixes a capitalization error that prevented finding libssh2 in some circumstances. And adds a missing include when building with libzip on Mac. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02Fetch the Subsurface webservice userid if cloud credentials were givenGravatar Dirk Hohndel
This allows users to not have to worry about this userid anymore. Both the mobile app and the desktop app can now derive the userid from the cloud storage credentials. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02Fix disabling of facebook integrationGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Add menu entry for creating GPS locationGravatar Dirk Hohndel
And disable it if there is no satellite based location service (but see the comment in the previous commit - this doesn't appear to work reliably). Nothing happens when you use the menu entry. This just allows us to hook this up later. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: instantiate location provider in the desktop UIGravatar Dirk Hohndel
We still aren't doing anything with it, but at least it's there now. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15Planner: support profile in planner printGravatar Lubomir I. Ivanov
The "Print" button in the planner dumps the QTextEdit to a QPrinter via ::print(). This patch renders the Profile to a Pixmap which is inserted as Base64 stream in an <img> tag and fed on top of the QTextEdit HTML contents. This route preserves the planner notes as text in PDF prints. The quick alternative is to render the QTextDocument to a QPixmap as well, but that will not preserve the text and pagination becomes manual. Possibly the QTextDocument can be rendered as a QPicture but pagination is still an issue, while so far there is exactly one user requesting this feature! Related small change in ProfileWidget2: Explicitly hide the tooltip when printMode is true. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-14Missing half of the previous commitGravatar Dirk Hohndel
Oops. I fixed the previous commit, tested the fix, and then forgot to update the commit and instead pushed it out. That was dumb. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-14Move proxy initialization into shared codeGravatar Dirk Hohndel
This way we can use the same code on desktop and mobile app. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-10Preferences: correctly hook up the signals to enable/disable cloud storageGravatar Dirk Hohndel
This way the menu state matches the actual verification state again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09Remove the PluginSystemGravatar Tomaz Canabrava
But keep the Interface so it's still userfull to create a new SocialNetwork when needed, but it will be part of the code, and not a plugin. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09Remove Facebook from PluginsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08Removed C++11 from the code.Gravatar Tomaz Canabrava
Make Dirk ungrumpy Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08Remove lambdas: they don't work on OSX 10.7Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08Facebook Plugin is aware of it's connection statusGravatar Tomaz Canabrava
This patch makes facebook plugin aware of it's connection status enabling uploads only when connected, and hooking some things up. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>