aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
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>
2015-10-03Use copy_string() to avoid potential crashGravatar Dirk Hohndel
If the trip has no location or notes calling strdup on NULL is just a bad idea. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-02Remove unused memberGravatar Dirk Hohndel
This isn't the bug that Coverity showed, but it was found by looking at CID 1307969 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-02Avoid potential uninitialized accessGravatar Dirk Hohndel
I don't think this could ever happen but hey, let's be sure. Coverity CID 1307985 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-02Avoid potentially uninitialized memberGravatar Dirk Hohndel
Coverity CID 1325281 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-02Undo/redo of dive deletion needs to handle trips as wellGravatar Dirk Hohndel
If we delete dives that were part of a trip, that trip may get deleted as well. So if we undo that operation we need to bring back the trip, too. This also deals with a bug in the original code that did the delete both in calling code (in divelistview.cpp) and in the redo function. Because of the nature of the delete this didn't really matter but it is of course wrong and with the new code it would in fact cause an issue. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Add support to "split" a dive with surface time in the middleGravatar Linus Torvalds
Right now this requires that (a) the dive have only one divecomputer associated with it. Trying to split a dive with multiple dive computers would be *much* harder to do, since you'd have to try to line up the surface interval between computers etc. So just don't do it after downloading multiple dive computers for the same dive. (b) there must be at least one minute between the sample that came up to the surface and the sample that goes down again. If you just peeked your head above the surface, don't try to split things into two dives. Maybe we can relax this for freediving or something. also note that the split dive will only get new numbering if the dive that was split was the very last dive in the divelist. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Avoid having uninitialized memberGravatar Dirk Hohndel
Coverity CID 1325283 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Avoid NULL dereferenceGravatar Dirk Hohndel
Coverity CID 1325297 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Avoid memory leaksGravatar Dirk Hohndel
Coverity CID 1308003 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Make dive trip location edit work again.Gravatar Tomaz Canabrava
:D Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Hide trip location when launching SubsurfaceGravatar Tomaz Canabrava
It was ugly to show trip and dive location when no dive was selected. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Update the dive site location when editingGravatar Tomaz Canabrava
Simple. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Add a new QLineEdit to set the dive trip locationGravatar Tomaz Canabrava
This is different from a dive site, as it's not a dive site. It's just a normal string, while a dive site has gps coordinates. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Fix selecting invalid dive siteGravatar Tomaz Canabrava
This patch fixes an invalid dive site selection when you where typing the name of a dive site for your current dive. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01printoptions.cpp: add missing tr() callsGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Don't zoom out the globe if the dive site has no GPSGravatar Dirk Hohndel
This may or may not look intuitive, but it can cause problems with the zoom seemingly stuck all out (because of the timeouts). So instead stay where you are. If the current dive site has GPS then its flag will be bigger and brighter - so there still is visual feedback. But there's less crazy zooming around. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-30Fix multi-dive edit regarding Dive SitesGravatar Tomaz Canabrava
Now it correctly sets the same dive site instead of creating a new one for each dive. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-30Better way to handle the tooltip for dive sitesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-30Make 'Choose dive site' work as 'Rename'Gravatar Tomaz Canabrava
But it will actually create a new dive site, not just rename the existing one. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-30Remove unused codeGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>