summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
AgeCommit message (Collapse)Author
2017-11-01Reset device field in DownloadFromDCWidget according to dive computerGravatar Berthold Stoeger
Fixes minor interface inconsistency: The device field in the download-from-dive-computer widget is disabled when selecting a non-serial-transport dive computer. In contrast, post-download the field was reset to enabled for all dive computers. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-10-31Postpone error message display if not in GUI threadGravatar Berthold Stoeger
Calls to report_error() crashed if not called from GUI thread. Fix this by postponing error message display if not in GUI thread. Code that creates a thread which possibly calls report_error() is responsible for calling MainWindow::showErrors() to flush the accumulated messages. Note that there is a race condition in report_error() and get_error_string(). Nevertheless, hitting it should be rather unlikely (two threads producing error messages at the same time) and hopefully it can be fixed rather easily. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-10-30New dive plan set salinity to current dive salinity if dive selectedGravatar Stefan Fuchs
This helps people who always use a std. salinity of e.g. 1020g/l. If they have a log with their dives open and plan a new dive they will have also for new planned dives the salinity set to their prefered value. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-29Remove three obsolete preferences options for geocodingGravatar Stefan Fuchs
These options are not used any longer/were never used and can be removed to not confuse the users. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-28mainwindow.cpp: fix whitespaceGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-10-28Set checked status of menu entry for dive list filter correctlyGravatar Stefan Fuchs
When enabling the dive list filter via the menu entry "Log->Filter dives" and then switch off the filter via the small "close" button of the filter: Set the checked status of the menu entry correctly. Also set it correctly when switching on/off via the menu entry to avoid any situation where it is not synced. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-26cloudstorage: better member name when updating authentication stateGravatar Dirk Hohndel
This isn't just about showing the PIN or not. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26desktop UI: no longer attempt to manually show error notificationsGravatar Dirk Hohndel
report_error() now does this automatically. So all these odd places in which we tried to make sure that we show errors are no longer needed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26Divelistview: use report_error to report and errorGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26desktop UI: always show errors when reportedGravatar Dirk Hohndel
Instead of waiting for a manual call to showError(), simply use the new callback to always immediately show the error in the notification widget. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-23Fix broken multi selected dive to tripGravatar Jan Mulder
See referenced issue number. It leads back to an ancient (3 year old) commit 512c42e. Not sure this issue is introduced there, but that's not relevant. Key in reproducing this is the location where the context menu is requested (using the right mouse button). When it is the row next to the trip, the add-to-trip succeeds correctly, otherwise it is a no-op. The solution is rather trivial (in hindsight). Just loop over the selected dives, and try to find the trip we want to add to. Fixes: #522 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-23[Facebook] Back to previous behavior when we were able to upload data,Gravatar Guillaume GARDET
even without album creation permission
2017-10-23[Facebook] add more debug when we are not able to create a new albumGravatar Guillaume GARDET
2017-10-22mainwindow: disable fullscreen support by defaultGravatar Lubomir I. Ivanov
Require the FULLSCREEN_SUPPORT macro to enable fullscreen support. The toggle was added 4 years ago in Subsurface, but with the current version of Qt 5.9.x, it's very buggy on Windows and Ubuntu. While it's possible to make this work on Windows, it seems to behave broken in different ways on different versiosn of Ubuntu. Fixes #705 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-10-20Silence random warningsGravatar Dirk Hohndel
None of these seem to point to actual issues, so let's quiet them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-20Turn off Facebook debug messages unless verboseGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-19Use displayed_dc instead of current_dcGravatar Robert C. Helling
current_dc is a macro that determines the dive computer based on the current dive number. When the planner is started from an emtpy dive list, the dive number ends up being -1 and that doesn't produce a valid dive computer. Use the divecomputer of the displayed_dive instead. This is done via a macro that can also be used in two other places. Without this patch, the planner crashed when called on an empty dive list. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-19Refuse to save an empty log to the clouldGravatar Robert C. Helling
This should prevent the problem of a user accidentally "deleting" their dives in the cloud by hitting "save to cloud" in the wrong moment. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-19printoptions.cpp: correctly remember the last selected templateGravatar Lubomir I. Ivanov
To find the last selected template index in the combo box, comparing against `printOptions->p_template` would work fine, except the `on_printTemplate_currentIndexChanged()` slot updates `printOptions->p_template` each time QComboBox::addItem() is called. This makes the `for` loop to add new combo box items and find the index of the last selected template not possible. To work around the issue, a local QString variable `storedTemplate` is introduced and it does not change during the `for` loop. Fixes #595 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-10-17Tags for geo references: Nicer look, translations and warning messageGravatar Stefan Fuchs
For the geo references tags update the following: - Nicer look w/o "Tags:" text and brackets when inside location UI - Translation for "Tags:" - Warning message when no dive site layout categories are set Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-17Correct spelling for text in prefs georeferencesGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-16Connect finished signal of download thread only onceGravatar bs
Connect finished signal of download thread only once in constructor of DownloadFromDCWidget instead of every time the Download / Cancel / Retry button is clicked. Fixes minor nuisance: On repeated download attempts multiple massage boxes were shown. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-10-16Correctly name member function gasChange of DivePlannerPointsModelGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-16In location information UI set reverse geo lookup button activ...Gravatar Stefan Fuchs
as soon as coordinates are available . Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-09Use lrint() for all degrees_t related roundingGravatar Lubomir I. Ivanov
In certain places the '(int)' cast is used, while in other the llrint() or lrint() functions. Make the conversation from degrees in the 'double' form to the 'int' degrees_t consistent using lrint(). lrint() is the function which should give the best results, because it accepts a 'double' and results in a 'long' even if degrees_t is 'int'. If the truncation from 'long' to 'int' is discarding some of the precision then the next step would be to turn degrees_t into a 64bit signed integer type. Possible fix for #625. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-10-09Preferences units dialog: Tab order and silence warningsGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-09Display units in dive list table based on prefs optionGravatar Stefan Fuchs
Add a preferences option which enables or disables display of units in the main dive liste table. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-08preferences: add missing dialog iconGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-10-07Locationinformation: correctly handle strings on the heapGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-07Tab order for location information dialogGravatar Stefan Fuchs
Fixed the tab order and excluded "notes" and "dive sites with same coordinates" from accessability via tab key. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-07Remove disfunctional asc. rate signals and add disable keyboardTrackingGravatar Robert C. Helling
The connection wasn't working anyway since the signal comes without value while the slot wanted a value and thus only created a runtime warning. Turning of keyboard tracking means that when typing the number 123 the value change signal is not fired three times (with values 1, 12, and 123) but is only fired upon pressing enter or the spin box losing focus. We should add a similar setting to the depth, duration and runtime columns of the DivePlannerPointsModel but i have no clue how to do that. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-07Warn if we edit non-existant dive siteGravatar Dirk Hohndel
And try to add it to the dive - bubt we really shouldn't get here. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-07LocationInformationWidget: make sure to clean out fieldsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-07Disable editDiveSiteButton without dive site nameGravatar Dirk Hohndel
Entering a name first creates and hooks up a dive site which we can then use in the edit dive site dialog to store modifications. This doesn't really fix these two bugs, but it might impact whether they can still be recreated See #633 See #636 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-07map-widget: don't crash if the map QML failed to loadGravatar Lubomir I. Ivanov
If the QML modules for QtLocation and QtPositioning are missing the QML in mapwidget.cpp will fail to load, which can lead to crashes. To solve the issue check if the QML has loaded and set a flag 'isReady' to true. If the loading has failed load another QML which is for showing a red error text in the lines of `MapWidget.qml failed to load!`. If the map QML has failed, use a macro in all relevant MapWidget members to turn them into a NOP. This approach leaves the rest of the codebase intact - e.g. no checks in classes which connect to the MapWidget class. Fixes #596 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-10-04Simplify the geo reverse lookup functionGravatar Dirk Hohndel
We never actually create a list of dive sites for which we call the reverse lookup service, it's always just displayed_dive_site. So make this all much simpler and just go straight for that. This commit removes a loop, but doesn't change the indentation of the code inside the loop to make it easier to see what was changed. That whitespace change will be in my next commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-04Remove bogus signalsGravatar Dirk Hohndel
One isn't connected to anything, the other one makes us overwrite the changes to displayed_dive_site. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-04Change the signature of constructLocationTagsGravatar Dirk Hohndel
We actually want to be able to pass a specific divesite structure and not have it look that up by uuid. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-04Don't add separate country field, use taxonomyGravatar Dirk Hohndel
The more I looked at the code that added the country to the dive site, the more it seemed redundant given what we have with the taxonomy. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-04Planner settings ascend and descende rate: Wire up UI elements correctlyGravatar Stefan Fuchs
Wire up the UI elements (QSpinBoxes) for ascend rates (4x) and descend rate (1x) correctly so that the profile and calculation is updated immediately after the value is changed (e.g. increased/decresed by 1) by clicking the QSpinBox arrows. Until now one had to click into the profile or change another planner preference first before the change became effective. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-03dive-list: maintain a single instance of DiveTripModelGravatar Lubomir I. Ivanov
A weird crash occurs if DiveListView creates another local instance of DiveTripModel inside reload(). Re-use the member variable tripModel and assign it a new instance of DiveTripModel. Reported-by: Gaetan Bisson <bisson@archlinux.org> Tested-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-10-03divelist: prevent a crash for missing column widthGravatar Lubomir I. Ivanov
The `static int defaultWidth[]` definition in divelistview.cpp could potentially end up missing an element which can later result in out-of-bounds access when iterating through the list of columns and updating their widths. Add a couple of methods in DiveTripModel for setting and getting the widths and use those. The default values are now pre-set in a QVector in the DiveTripModel() constructor. Throw warnings if out-of-bounds columns are requested. Reported-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-10-02[Divesite] Hook location information interface for countryGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02[Divesite] hook interface for countryGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02[Facebook] Enable the send button on editGravatar Tomaz Canabrava
Not when you press enter. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02[Facebook] Use statusbar instead of popup messagesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02[Facebook] More debug callsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02[Facebook] Use correct albumName variableGravatar Tomaz Canabrava
and code cleanup Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02[Facebook] Lots of debug messagesGravatar Tomaz Canabrava
Important debug messages, don't remove. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02[Facebook] Use the nonblocking calls to post on fbGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>