summaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2015-10-27Remove unnecessary Q_INTERFACES declarationGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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-26Fix building without BT supportGravatar Dirk Hohndel
I guess no one had tried this in a while. 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-10-25Use neutral color for "no SAC information"Gravatar Dirk Hohndel
In commit 31d1d1f4217c ("Don't change pen color when for zero SAC") Robert continues to use the last SAC color (which certainly was better than switching to dark green for "extremely low SAC rate"). But I think it makes even more sense to mark it as neutral - so I picked a gray. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-25Fix location edit UI issue on MacGravatar Dirk Hohndel
For some reason the Mac doesn't create an "activated" signal when hitting enter/return on the drop down. So we simply manually send this and now you can select the site with enter/return just like on Linux or Windows. Fixes #953 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-23Don't change pen color when for zero SACGravatar Robert C. Helling
When for individual plot entries the SAC is zero this comes from gas changes and the SAC calculation needing a bit more pressure data and not from the diver switching to freediving mode. So we shold not change the pen color on the pressure line for that but pretend we are still breathing at the previous SAC. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2015-10-22When calculating the offset, both times are localtimeGravatar Dirk Hohndel
So we don't need to take the relative time zone into account. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-22Don't clear out the time stamp we rememberedGravatar Dirk Hohndel
Otherwise the offset calculation ends up completely wrong. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-18Display divetime according to dive mode and translationGravatar Giorgio Marzano
Many time stats in maintab display also seconds in short freediving Signed-off-by: Giorgio Marzano <marzano.giorgio@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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: remove the warning about editing bundled templatesGravatar Lubomir I. Ivanov
Bundled templates can no longer be edited, because copies are made in the user directory. The TemplateEdit special case warning is no longer relevant so it can be removed. Signed-off-by: Lubomir I. Ivanov <neolit123@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-14Mark dive type list for translationGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> 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-13Keep state of reverse geocode button in sync with GPS dataGravatar Dirk Hohndel
So if the data is removed or invalid, don't allow reverse lookup. Otherwise do. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-13Only allow reverse geo lookup if divesite has GPS dataGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-13usermanual.cpp: use default QWidget theme colors for text selectionsGravatar Lubomir I. Ivanov
The default selection text/background colors (also when seaching) are black/light-grey in QWebView, for some reason. To solve the issue we pass a stylesheet that makes use of the default palette's highlight() and highlightedText() from QWidget. Fixes #797 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-12Planner: add recreational mode tooltipGravatar Rick Walsh
Recreational mode isn't self-explanatory. Add a hint for the user. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-11profilewidget2: fix line width when printing on OSX and LinuxGravatar Lubomir I. Ivanov
On OSX and Linux only, the cosmetic width of the QPen on profile axes does not work and is weirdly dependent on the fact if a printer is installed or not. Possible Qt bugs at hand. The same is not present on Win32. To solve the issues we add setPrintMode() in DiveCartesianAxis and call it for all instances of the class in ProfileWidget2. This patch also moves gridPen() as a private member function of PartialGasPressureAxis as it now needs to access member variables. Fixes #943 Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-11profilewidget2: add resetZoom()Gravatar Lubomir I. Ivanov
resetZoom() is now a new method that is called both when 'printMode' is updated or when the dive is re-plotted. Fixes a bug where zooming in on the profile and then printing the dive has the profile at the wrong zoom level (makes the profile look smaller). Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Lubomir I. Ivanov <neolit123@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-08Fix font issue on Windows 10 in the weight widgetGravatar Lubomir I. Ivanov
Column headers were drawin in a smaller font. This fixes it for no apparent reason. Signed-off-by: Lubomir I. Ivanov <neolit123@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-08Clear date and time when no dive is shownGravatar Dirk Hohndel
So far we showed bogus date and time - whatever time it might be in UTC at midnight 2000-1-1 in your timezone. Instead we now show a discrete little "-" in both fields. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08Update UI on dive site widget when retrieving taxonomyGravatar Tomaz Canabrava
[Dirk Hohndel: slightly refactored this commit and the previous one to make the code actually work and make the split across the two commits more reasonable] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08Move the algorithm to divesite.cpp fileGravatar Tomaz Canabrava
This shouldn't be on the maintab.cpp, this file is already too convoluted. [Dirk Hohndel: slightly refactored this commit and the next one to make the code actually work and make the split across the two commits more reasonable] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08Add the labels for taxonomy in dive site widgetGravatar Tomaz Canabrava
Nothing to see here - just added the widgets on the .ui files Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07Passwords fields should have echoMode PasswordGravatar Tomaz Canabrava
so nobody can see what's being written. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07Add missing tooltip for the reverse geo location lookupGravatar Dirk Hohndel
This sadly adds another string for tranlsations Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07modeldelegates.cpp: add custom highlight drawing in location itemsGravatar Lubomir I. Ivanov
There is a problem in LocationFilterDelegate::paint(), which can manifest as very light background with white text in the combo box from which the user selects a location - a Windows 7 test case. The main offenders are the drawControl() call which draws the selected item background very bright and the fact that the highlightText() is returning white. It seems as if the combination of these is just wrong, theme wise. e5fa424a and 44762c42 fix that by branching Windows by version, but do not cover the case where the user can use a custom theme - e.g. dark selection highlight on Windows 7. This patch skips drawControl() and draws the highlighted item background manually. It makes it look similar to the small tag highlights in TagWidget. The patch adjust slightly the X offset of the drawn text. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> 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-07Bugfix for checkboxes in DC download window GUI repaint delay.Gravatar pestophagous
Bug was due to incorrect use of QAbstractItemModel::index. The arguments should be in (row, col) sequence but we were mistakenly passing in (col, row). Fixes #820 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-07Simplify codeGravatar Tomaz Canabrava
Do not call the setAttributte *everytime* the Preferences is called, call it once on the constructor. Also, no need to call the LanguageModel::instance() on the instance method, it will be already called on the constructor it seems that it's a leftover from a long while. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06Fix typo on string formatting optionGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06Be way more carefull when copying dive siteGravatar Tomaz Canabrava
I don't know how I was not shot regarding on how broken the old behavior was. The new behavior: 1 copy the old_dive_site on top of the current_dive_site only if the current_dive_site was actually a new uuid, created by that method. 2 if the current_dive_site is an existing one but it doesn't have gps coords, copy only the gps coords. This fixes existing dive sites copying notes and coordinates from the old_dive_site. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06Remove unused codeGravatar Tomaz Canabrava
This was needed when maintab had to thinker every little aspect of the dive site selection, which has not been necessary for quite a while. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06Correctly copy preferencesGravatar Dirk Hohndel
When just assigning one structure to the other we copy the string pointers. If we then modify those strings in the copy, we happily free the strings of the original. And then resetting the preferences equally happily reused those strings, pointing to long since freed memory. I think what I did now is excessive for the current use case in that it copies a ton of strings that are unset in the default_prefs. But I figured this is a rarely used function and I might as well do it correctly. Also, once we implement multi user support with per user preferences we will be copying completely populated preferences around (at least that's my guess). Fixes #940 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06Correctly handle the webservice userid in preferencesGravatar Dirk Hohndel
Because of the way that the webservice userid can be saved both in the preferences and in a data file it was treated differently than other preferences settings - which prevented the reset of the preferences from actually clearing it. This patch makes sure that if the preferences are reset the preferences UI reflects that. To make this work the data file loading functions can no longer be allowed to just simply clear out the userid preference value just in case they might load a new one. Fixes #939 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06Only check Windows version when building on WindowsGravatar Dirk Hohndel
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-06Remove unused part of the geocoding preferencesGravatar Dirk Hohndel
And always turn on geocoding. The user needs to trigger this manually anyway, so there's no point in having the extra option in the preferences. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06Do not use White font on newer Windows versionsGravatar Tomaz Canabrava
It isn't readable with the very light background. Which Windows versions this should be used on is a guess right now. So far Windows 7 or newer, but that may need adjustment. Fixes #935 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06Do not incorrectly use the UUID as the dive nameGravatar Tomaz Canabrava
for some reason sometimes activating the dive via tab or enter gave us the wrong column, so simply select the right one. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-05Don't use the numerus version of tr()Gravatar Dirk Hohndel
It looks like our tools create a .ts stance that transifex can't deal with. 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>