aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
AgeCommit message (Collapse)Author
2018-02-22In configure DC dialogs don't use a space between values and unitsGravatar Stefan Fuchs
In the configure dive computer dialogs remove all the spaces between values and units. This makes it consistent with the standard used all over the Subsurface UI. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-02-17Consistently use the famous l for liters in info tabGravatar Stefan Fuchs
For salinity in info tab change the l character to the famous Subsurface "ℓ". Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-02-17Coding-style: remove superfluous parenthesesGravatar Berthold Stoeger
Mostly replace "return (expression);" by "return expression;" and one case of "function((parameter))" by "function(parameter)". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-02-11Cleanup: fix emits in WinBluetoothDeviceDiscoveryAgentGravatar Berthold Stoeger
As far as I know, Qt's emit is defined to nothing. Thus, the construct "emit(lastError);" is compiled to "(lastError);", which is a no-op. Obviously "emit error(lastError)" was meant. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-02-11Cleanup: use constructor directly instead of move-assignmentGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-02-10Add a preference to turn on ICD warningsGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-02-04downloadfromdivecomputer.cpp: remove unused variable err_stringGravatar Berthold Stoeger
This was a relict from Gtk days. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-02-04Cleanup: Remove redefinition of DC_TRANSPORT_BLUETOOTHGravatar Berthold Stoeger
This transport option was defined at a time where libdc didn't know anything about bluetooth. Nowadays, this enum is defined by libdc to a different value. Since it is never returned from libdc, not a problem at the moment. But this looks like a recipe for desaster, therefore let's just use the libdc version. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-02-04Do not remove seconds from duration input fieldGravatar Oliver Schwaneberg
This change deals with issue #554. If you enter a dive duration manually, the cell renderer cuts the seconds away when the changes are saved. I added the helper "render_seconds_to_string" as a counterpart to "parseDurationToSeconds". The helper keeps the seconds, if not null. The rendering of the cell is done at two places in the code, so I think it is cleaner to add a dedicated method for it. Signed-off-by: Oliver Schwaneberg <oliver.schwaneberg@gmail.com>
2018-02-02Free various struct membuffer in different functionsGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-01-31Make report_error() reentrantGravatar Berthold Stoeger
Remove the global error buffer and pass the error string directly to the frontend. The frontend is then responsible for accumulating errors. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-31Remove unnecessary check for MainWindow instanceGravatar Berthold Stoeger
The error-callback is installed in the MainWindow constructor. Therefore, in the error-callback the existence of the MainWindow instance is guaranteed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-31Use queued connection to thread-safe MainWindow error handlingGravatar Berthold Stoeger
Up to now, errors produced by threads were not directly shown in the MainWindow. Code running in the GUI thread had to manually show the errors. This can be simplified by using Qt's queued connection as message passing facility. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-31Make future_watcher a subobject of NotificationWidgetGravatar Berthold Stoeger
This was a raw pointer. No point in doing error-prone manual memory management. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-27Use correct alias for satellite icon for revers geo lookupGravatar Stefan Fuchs
Bring back the satellite icon for the reverse geo lookup by using the correct alias name. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-01-18Whitespace onlyGravatar Jan Mulder
Now that we properly return when raising an error, do not if () else if(). Useles. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-18Fix preferences handling with invalid passwordsGravatar Jan Mulder
This fixes 2 problems related to entering passwords with illegal characters in it: 1) Do not save an invalid password in the preferences, but keep the old one. 2) On password change, check both old and new password for format validity instead of pushing an invalid password to the server that has to ignore it. Fixes: #1048 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-18Fix PreferencesNetwork::passwordUpdateSuccessful slotGravatar Berthold Stoeger
In preferences_network.cpp, the CloudStorageAuthenticate::passwordChangeSuccessful signal was connected to the PreferencesNetwork::passwordUpdateSuccessful slot. This never worked, because passwordUpdateSuccessful() was declared as a normal member function, not a slot (hooray for Qt's weird runtime-checked signal system). While touching this code, change the weird SIGNAL/SLOT macros to actual member function, to at least get *some* compile-time checks. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-13Resize progress bar width to fit all textGravatar Robert C. Helling
At least on Mac with larger font sizes part of the label text of the git access progress bar is cut off (even though it should automatically resize). This patch adds explicit resize. Fixes #1041 Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-01-11Use helper function empty_string() instead of manual checksGravatar Berthold Stoeger
For code consistency, substitute boolean expressions: s && *s -> !empty_string(s) s && s[0] -> !empty_string(s) !s || !*s -> empty_string(s) !s || !s[0] -> empty_string(s) Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-11Introduce helper function empty_string()Gravatar Berthold Stoeger
There are ca. 50 constructs of the kind same_string(s, "") to test for empty or null strings. Replace them by the new helper function empty_string(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-10Unused code: GroupedLineEdit::removeAllColors()Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-08Remove redundant setting of prefs.git_local_onlyGravatar Berthold Stoeger
In MainWindow::on_actionCloudOnline_triggered(), prefs.git_local_only was set twice in the case of going online. Remove the second, unnecessary, assignment. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-08Move resetting of current file out of clear_dive_file_data()Gravatar Berthold Stoeger
This is the only case where C-code sets the current file. Remove this call for a better separation of C-backend and C++-frontend parts. There were four callers of clear_dive_file_data(). Two of them would call set_filename() anyway. For the remaining two add an explicit call to set_filename(). This commit fixes a bug introduced in commit b3901aa8f90499ee2a34efdddc2463105afc53f1: The cloud-online menu entry was still enabled after "closing" the cloud storage. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-08Refactor CSV importGravatar Miika Turkia
Move CSV import related functions into import-csv.c. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-06Remove cloud_background_sync preferences optionGravatar Berthold Stoeger
The preferences flag cloud_background_sync used to be used heavily in the mobile code, but is not used there anymore. Now, it is accessed only in one place, but does not do what it actually says: If it is off, the remote storage is not synced on save (but will be synced on next load). Syncing on save can also be prevented by unchecking the "Cloud online" menu checkbox. Since the latter seems more logical and general (support for non-cloud remote git repositories), remove the cloud_background_sync option. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-06Enable cloud-online menu entry only if connected to cloudGravatar Berthold Stoeger
Enable the menu item cloud-online only if the current file is the cloud storage. Since this has to be checked every time the current file is set, factor this out into the new MainWindow::setCurrentFile() function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-06Turn take-cloud-online menu action into checkboxGravatar Berthold Stoeger
Replace the "Take cloud storage online" menu entry by a "Cloud online" checkbox. After this change, the user can also force going offline. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-06Sync cloud storage on take-cloud-onlineGravatar Berthold Stoeger
When taking the cloud online, actually sync with the online cloud storage. If there are no unsaved changes, do the same as "Open cloud storage". If there are unsaved changes, ask the user if they want to commit them (do the same as "Save to cloud storage") or if they want to sync manually. If syncing failed, inform the user. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-06Do not save WebserviceID in preferences until asked forGravatar Jan Mulder
Do not save the WebserviceID in the preferences until we ask for this. That is simply wrong. This is definitely not a full fix for all the weirdness that is going in related to the WebserviceID but saving the ID even if we do not ask for it, adds to possible confusion. To always automatically pull in the ID from the server based on cloud credentials, just leave the ID field empty in the network preferences. Fixes: #1013 (well ... a tiny part of this mess) Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-06cleanup: use new urlsGravatar Jan Mulder
Just rename some old hohndel.org urls Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-06cleanup: localize global variableGravatar Jan Mulder
Not needed to be global. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-06GPS: use applyGpsLocation::applyLocations from coreGravatar Jan Mulder
Fixes a big duplication of code. The code to apply GPS locations from the location service was already in core, and used from mobile, but there was an almost literal copy in the desktop code. See also commits 6f42ab46da1b59 and ee9531f76ec31a, where only one side of the duplicated code was fixed. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-04Replace BEHAVIOR macro by initializer listsGravatar Berthold Stoeger
The macro BEHAVIOR expanded to "QList<int>()". This was used to generate temporary QList<int>s with constructs such as BEHAVIOR << COLLAPSED << EXPANDED Instead, simply use initializer lists such as {COLLAPSED, EXPANDED} Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-04Replace macro TOGGLE_COLLAPSABLE by function toggleCollapsible()Gravatar Berthold Stoeger
There was no reason to do this in a macro. Let the compiler decide if it wants to inline or not. Note that for consistency with the Qt functions, collapsAble was replaced by collabsIble. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-04Use set_autogroup() functionGravatar Berthold Stoeger
Since this function exists, use it instead of setting the global variable directly. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-02Enable translation of ctrl key name for tool tip in dive notesGravatar Stefan Fuchs
This really enables the translation of the ctrl key name. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-01-02Cleanup: Rename preferences ui file names according the standardGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-01-02Remove leading space from kg/l units for salinityGravatar Stefan Fuchs
Change this according to our standard of NOT having a leading space before any unit. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-01-02Desktop: follow autogroup setting in UIGravatar Jan Mulder
When importing a dive (using import from logfile) and it is a ssrf/xml file that contains the autogroup setting, the autogroup is effectuated in the dive list. Not sure that I like this behavior, but thats the way it currently is. Simply wrong is that in this case the menu item toggle is not adapted so we end up with a dive list that is autogrouped, but the menu toggle is off. This can be solved by setting the UI toggle in a more central location. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-01desktop: clear tags when hitting new logbookGravatar Jan Mulder
A very simple commit to start 2018. When hitting new logbook from a currently open logbook, and the current dive has tags filled in, they stayed around in the UI. Just clear them. Further, delete an unused variable. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-31Get Bluetooth device nam from preferences if dialog wasn't shownGravatar Berthold Stoeger
If the BT dialog hasn't been shown, the device name was taken from the text field, which contained a formatted string. The device open would then fail. Fixes #1002 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-30Get ready for 2018Gravatar Jan Mulder
Copyright strings updated. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-30Add tool tip for negate filter buttonGravatar Stefan Fuchs
Add tool tip for buttons introduced in: b6bf57a13b5e4d3dd469b0fa8790d341eb4f1304 Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-30Reenable pressure interpolation in context menuGravatar Robert C. Helling
This fixes a bug reported by Willem that removing waypoints using the right click context menu makes the cylinder pressure lines partly disappear. The reason was that clicking a dive handler disables the pressure interpolation (and other things, controlled by shouldCalculateMaxdepth). This is turned on again upon the mouse release event. This event is not triggered when selecting in item from the context menu (like remove waypoint or gas selection) so we need to send it manually. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-29cleanup: less than operators shall not use equalGravatar Jan Mulder
See also commit c032006d91ee3c. Compare functions passed to sort functions need to compare for less-than and not less-or-equal. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-29Desktop: Don't hide errors on opening cloud storageGravatar Berthold Stoeger
In MainWindow::on_actionCloudstorageopen_triggered(), getNotificationWidget()->hideNotification() was called, thus hiding any error message produced by the cloud code. Notably, the information "Cannot sync with cloud server, working with offline copy" was not shown. Therefore, remove this call. Note that on cloud save messages were not hidden. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-29cleanup: Unchecked return valueGravatar Jan Mulder
CID 208312 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-29cleanup: Uninitialized pointer fieldGravatar Jan Mulder
CID 208311 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-29cleanup: Unchecked dynamic_castGravatar Jan Mulder
CID 208309 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>