aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
AgeCommit message (Collapse)Author
2017-11-24printing: minor improvements to import / exportGravatar Lubomir I. Ivanov
1) Always open the user path on Import / Export 2) Update the list after Export, as the user might have exported to the user path Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-24printing: add set_bundled_templates_as_read_only()Gravatar Lubomir I. Ivanov
Add the function set_bundled_templates_as_read_only() in templatelayout.cpp/h. The function is used to mark the bundled template files as read-only in the user folder. It is called in mainwindow.cpp, after the files are copied from the bundle. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-21Desktop UI: allow user defined cylinder as defaultGravatar Jan Mulder
Currently, it was only possible to use a hard-coded default cylinder in the preferences. At the same time, the user is allowed to add own cylinders to a dive (by just typing in a new name and cylinder properties). These own cylinders could not be selected in the preferences, requiring the user to manually add this every dive. Not sure the reason for all this was intentional, or just an overlooked aspect in the implementation. It appeared that the selection list in the UI was constructed before any logbook was parsed, so at that moment, there are only hard-coded cylinders. The fix is simple. Refresh the UI of the preferences just before it is shown. While opening the logbook, a new list of cylinders, including the own cylinders is constructed, so the UI is refreshed to that. While a simple change, there is a use case that might be considered strange. Open a logbook, choose new logbook, and change the default cylinder preference to an own (from the previously opened logbook). Do not add a dive with the new (own) cylinder and save this logbook. Reopen this new logbook, and see that the default cylinder in the preferences is empty. This is logical, as the list of own possible cylinders is constructed from the (new) logbook, that has no dive with that specific own cylinder. I consider this acceptable behavior, as it can be also be used to copy own cylinders to a new logbook. Fixes: #821 Proposed-by: Davide DB <dbdavide@gmail.com> Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-20Make handling of booleans consistent on the C++-side of preferencesGravatar Berthold Stoeger
In general, the C++-side of the preferences code consistently uses the bool data type for boolean settings. There are five exceptions, which use short instead: showPo2 showPn2 showPhe saveUserIdLocal displayInvalidDives This patch attempts to make the code more consistent by turning these into bools as well. Tests showed that writing as short and reading as bool is handled gracefully by the Qt variant code. Therefore, an upgrade should not cause user-visible changes to their settings. As a bonus, two extern declarations of the set_save_userid_local() function, which is not defined anywhere, were removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-20Fix typo: successfull -> successful and succesfully -> successfullyGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-17Show all autocompletes after entry of comma in tag listGravatar Jan Mulder
The almost 3 year old commit e1db5f21b15b2 introduced the behavior that you need to type at least 1 character for a tag to show any autocompleted data. While this went unnoticed for years, there is always a user that notices this changed behavior. The solution is rather simple. Do allow the 0 lenght string to act as seed for autocompletion instead of just returning, and doing no autocomplete at all. As the afore mentioned commit was explicitly meant to prevent over active firing of the tag list autocompleter, this (simple) change is carefully tested on this, and no adverse effects are visible. Fixes: #605 (wrt the 1 character issue) Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-16In maintab disable correct label when dive trip selectedGravatar Stefan Fuchs
Until now accidentally the dateLabel was disabled and the timeLabel was enabled. Changed this the other (correct) way round. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-16Introduce mode field in Bluetooth device selection dialogGravatar Berthold Stoeger
Some BT devices support both, classical and LE, modes. Users could choose either by prepending or removing "LE:" in the device address field. After commit d23bd46a1be2dfb25293639abcf06b5b4d4b94df, the device field is always disabled in Bluetooth mode. Therefore, add a mode combo box to the Bluetooth device selection dialog. In the default mode (auto), the old code path (based on the Qt device flags) is used. The two other modes (force LE, force classical) allow the user to force the preferred behavior. This feature is meant as a stop-gap measure until a more refined transport choice is implemented. Therefore, the value of the new combo box is not saved in the settings, to avoid cluttering of the preferences with soon to be obsolete entries. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-13Make Bluetooth naming consistentGravatar Berthold Stoeger
Currently, on Linux, after selecting a Bluetooth device the name of the device is shown. On reopening the download dialog, on the other hand, the address is shown. In the device selection dialog both are shown. This patch changes the download dialog such that both, name and address, are shown. The bulk of the patch introduces the name of the device in the preferences and DCDeviceData. It has to be noted that DCDeviceData is an encapsulation of the libdivecomputer device_data_t. Nevertheless, the new Bluetooth-name field is, at the moment, not passed through to libdivecomputer. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-13Planner and profile limit minimum GFlow to 10 and minimum GFhigh to 40Gravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-12Trivial: Replace a QSharedPointer by a QScopedPointerGravatar Berthold Stoeger
Since the QSharedPointer is never passed or copied, reference counting is certainly not needed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-12Typo: modp02 -> modpO2Gravatar Berthold Stoeger
Fixes two function names, where O2 was written as 02. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-11Fix memory leak in download-from-dive-computer widgetGravatar Berthold Stoeger
Instead of (re)allocating the vendor and product models, use the setStringList method on sub objects. Even though only a theoretical problem, the model objects are moved in front of the ui object, so that the widgets referencing the models are destroyed first. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-10Initialize Facebook page only when dialog is shownGravatar Berthold Stoeger
Quick hack to avoid Facebook access on every program start. Move the initialization of the login page from the FacebookConnectWidget constructor to the show event handler. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-10preferences: support a pre-defined list of time formatsGravatar Lubomir I. Ivanov
Add a combo-box that holds a list of pre-defined time formats in the Language preferences. The user is still allowed to enter a custom time format. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-10preferences: re-use a tr() string in _language.cppGravatar Lubomir I. Ivanov
Also, tell "in date format" instead of "in time format" for dates. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-10preferences: support a pre-defined list of date formatsGravatar Lubomir I. Ivanov
Add a combo-box in place of the single line text field and support some pre-defined date formats, such as: MM/dd/yyyy Each long format has a corresponding short variant stored in the QMap dateFormatShortMap and it's updated automatically once the user selects a combo box item for the long format. The regex for dates is slighly modified: [^dMy/\\s:;\\.,\\-] The user is still allowed to enter custom long / short date foramats. Fixes #276 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-09map-widget: allow real-time updates of edited markersGravatar Lubomir I. Ivanov
This patch allows updating the location of map markers while editing a dive site and updating the text in the LocationInformationWidget in real-time. Currently it is only possible to see the marker changes by clicking 'Apply'. The modification required the following changes: - add the MapWidget::updateCurrentDiveSiteCoordinatesToMap() slot and call it each time the GPS text updates - separate the updateCurrentDiveSiteCoordinates(FromMap/ToMap) logic by having the FromMap/ToMap suffix to method names - make MapWidgetHelper::updateCurrentDiveSiteCoordinatesToMap() call a new MapLocationModel::updateMapLocationCoordinates() method, which updates selected location coordinates and the model - add MapLocation::setCoordinateNoEmit() that does not emit a signal when updating a coordinate Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-06BT device selection dialog: make Save the default buttonGravatar Berthold Stoeger
When a user presses enter, they probably want their selection saved, not discarded. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-06Remove unnecessary == NULL test.Gravatar Berthold Stoeger
Test not necessary, because the QString in question is not a pointer and the string is tested for emptiness (which also flags null-strings). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-05map-widget: move the widget and its resources to 'map-widget'Gravatar Lubomir I. Ivanov
Move all the map widget platform agnostic files to the <subsurface-root>/map-widget folder. This avoids the confusion about the desktop version of subsurface using mobile components. The map widget is planned as a shared component between the mobile and desktop versions. desktop-widgets/mapwidget[.h/.cpp] still remain as those are specific to the desktop version. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-04Replace itemClicked() by currentItemChanged() in Bt device selectionGravatar Berthold Stoeger
This fixes two problems: 1) Using the keybord or clicking below the list and moving the mouse up while holding the mouse button did not properly update the status message and the save button. For example, one could save with a non- paired device selected. 2) The code assumed that a device is selected if the save button is active, but the save button was not disabled on scan. Thus, one could provoke a crash by selecting an item, scanning and then pressing save. This problem is fixed indirectly, because the save button is now always disabled if the selection is cleared. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-04Disable o2 break option if last stop is not at 6m/20ftGravatar Stefan Fuchs
Disable the possibility to plan o2 breaks of option "last stop at 6m/20ft" is not set. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-04O2 breaks code enhancements and cleanupGravatar Stefan Fuchs
Remove unused variables o2time and breaktime or convert into boolean. Never consider minimum gas switch time when switching to o2. Reflect this behavior also in the UI. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-04Planner UI: Move dive mode UI element to the top of the column...Gravatar Stefan Fuchs
and add a label for it. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-04In planner for different deco modes enable/disable options correctlyGravatar Stefan Fuchs
Disable option "safety stop" for all deco modes other than "recreational". Disable also labels "reserve gas", "GF ..." and "VPM conservatism" correctly. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-04Correct, cleanup, translate and unify file filtersGravatar Stefan Fuchs
Correct spelling and typos in file filters. Unify and translate file filter names. Don't pass a file filter to a directory open dialog - not needed. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-04Replace QMap::operator[] with QMap::value()Gravatar Berthold Stoeger
QMap::operator[] creates a new default constructed entry in the map if no entry with the given key exists. While not problematic (since typically nullptrs are inserted) this is usually not what you want for read access. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-04Planner copy salinity only if current dive existsGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
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>