summaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2015-10-30Move qt-ui to desktop-widgetsGravatar Tomaz Canabrava
Since we have now destkop and mobile versions, 'qt-ui' was a very poor name choice for a folder that contains only destkop-enabled widgets. Also, move the graphicsview-common.h/cpp to subsurface-core because it doesn't depend on qgraphicsview, it merely implements all the colors that we use throughout Subsurface, and we will use colors on both desktop and mobile versions Same thing applies for metrics.h/cpp Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30Modify code to make it compile after rebaseGravatar Tomaz Canabrava
Did a git rebase and some stuff changed in the meantime; This is a compatibility commit: Add a few include directories on the cmake to quiet some ui_headers.h not being found (the ones that are created automatically by uic) and a few noiseances like models requiring interface functionality. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30Move all core-functionality to subsurface-coreGravatar Tomaz Canabrava
And adapt a new CMakeLists.txt file for it. On the way I've also found out that we where double-compilling a few files. I've also set the subsurface-core as a include_path but that was just to reduce the noise on this commit, since I plan to remove it from the include path to make it obligatory to specify something like include "subsurface-core/dive.h" for the header files. Since the app is growing quite a bit we ended up having a few different files with almost same name that did similar things, I want to kill that (for instance Dive.h, dive.h, PrintDive.h and such). Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30Start to clean CMakeGravatar Tomaz Canabrava
CMake can be a good system but if we keep everything into one big cmake file things can go nuts really quick. Since I already took quite a start on an subsurface layer separation some time ago, I'm improving it by making each module on Subsurface depend on it's own CMake module. This first patch moves the qt-ui part to qt-ui/CMakeLists.txt file, it cleans tons of the main cmake file ( moving all parts to the in ternal folder ), and makes things more easily manageable by the programmer that will change the ui bits, he doesn't need to play hide and seek with the CMakeLists.txt file anymore, trying to figure out where should he put his newly generated file. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-29Fix plurals translationGravatar Sergey Starosek
This allows separate translation of singular and plural forms Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>