aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
AgeCommit message (Collapse)Author
2017-05-27QML UI: add the DownloadThreadGravatar Tomaz Canabrava
For this I had to also make the DCDeviceData accessible, and for that it needed to be a pointer. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27Reduce the scope of variablesGravatar Tomaz Canabrava
Those variables should have local scope, not class scope. We are using it only inside of pickDump/LogFile metohds. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27Extract the device_data_t into helper classGravatar Tomaz Canabrava
Keeping the Desktop and QML versions of Subsurface using the same codebase will keep the code saner, this change makes the Desktop version use the DCDeviceData helper sturct that encapsulates the device_data_t member for easy access on the QML. This also helped move a bit of initializations from the UI to the Core - and that's always good. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27Display the dialog correctlyGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27Move the fill_computer_list() out of widgetsGravatar Tomaz Canabrava
fill_computer_list() creates a Qt friendly structure that contains all of the necessary information about dive computers and it's devices, and it's needed both in Qml and Widgets to allow the user to download their dives. This patch makes it possible to use the code in QML without duplication. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27Separate the download thread from the widget logicGravatar Tomaz Canabrava
This is important to not duplicate code for the Qml view. Now the DownloadFromDiveComputer widget is mostly free from important code (that has been upgraded to the core folder), and I can start coding the QML interface. There are still a few functions on the desktop widget that will die so I can call them via the QML code later. I also touched the location of a few globals (please, let's stop using those) - because it was declared on the desktop code and being used in the core. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27Move model code to modelsGravatar Tomaz Canabrava
This makes it easery to use it on Qml. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-26Creation of dive duration string and surface interval stringGravatar Stefan Fuchs
Update the function to create the dive duration string in a way that it can be used also in info and stats tab and added some more flexibility. Changed layout for <1h freedives to "0:05:35" (w/o units) or "5:35min" (with units and :) or "5min 35sec" (with units with space). Add a new function to create the surface interval string. Completely remove old function get_time_string() and get_time_string_s(). Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-05-09Allow weight system name to be editedGravatar Jan Mulder
Issue #272 lead to the introduction of a new private property of the ComboBoxDelegate class (editable). This new property was not correctly set when creating the weight system delegate. This corrects the (trivial) error, and now allows edit of the weight system name. Fixes: #392 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-05-07Merge branch 'seabear-refactor'Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-07Refactor Seabear importGravatar Miika Turkia
Moving the GUI independent Seabear import functionality to Subsurface core. This will allow Robert to call it directly from download from DC. Tested with H3 against released and daily versions of Subsurface. The result differs somewhat, but it is actually fixing 2 bugs: - Temperature was mis-interpreted previously - Sample interval for a dive with 1 second interval was parsed incorrectly Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-07Move intdup to qthelperGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-06Wire up duration units preference UIGravatar Dirk Hohndel
Now we track the preference, but we don't act on it, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-06Add UI for duration preferenceGravatar Dirk Hohndel
This isn't hooked up, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-06Save tags when manually adding diveGravatar Dirk Hohndel
Tags are handled differently from other fields, we need to call the special handling after the new dive was added and marked as the current dive. Fixes: #369 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-06Fix some warningsGravatar Dirk Hohndel
Two unused variables and one case of sign confusion. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-06Check if we have an instance before dereferencing itGravatar Dirk Hohndel
If we don't have a GPS service userid in the preferences and the GpsLocation class isn't instantiated, this would cause a crash. Fixes #367 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-06File selector should filter images we can actually handle.Gravatar Robert C. Helling
So better ask Qt about image formats known to it. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-05-06Image import: Make Exif handling more tolerant, better info,...Gravatar Stefan Fuchs
Changes to the "Add pictures to dive" function: - Make Exif handling more tolerant by removing the JPG sanity check for EOI - Give info to user if exif.cpp can't identify a Exif date/time - Restrict file dialog filter for correct picture time by DC photo to JPG because Exif is only available from JPG Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-05-04Implement OSTC4 specific settingsGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-05-04Connect up all the OSTC4 common settingsGravatar Anton Lundin
Connect up all the settings that are the same, and remove those who are not, and correct those who only are minor differences. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-05-04Start to read/write and present some OSTC4 settingsGravatar Anton Lundin
This is mostly copy-paste from the ostc3 case, but there are some minor differences. Some minor things have different meaning, and there's a slightly different command set, but I couldn't figure out a sane way of joining them. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-05-04Wire up a skeleton for configure OSTC 4Gravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-05-04Build a gui for configure OSTC 4Gravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-05-04Remove unneccecery spacer namesGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-05-04Remove unneccecery label namesGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-05-01Update translation and strings for gas usage in statsGravatar Stefan Fuchs
Giving the string " and " to transiflex seems to fail and/or it's highly possible that the translators make a mistake by translating it into "and" or " and" or "and ". Change the string to "and" and hard code the whitespaces before and after. Change O2 to O₂ in statistics. Translate "He" and "O2" in statistics. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-05-01Show min/max SAC in statistics only if different to average...Gravatar Stefan Fuchs
...and don't show a minimum depth in stats if there is only a single dive. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-05-01Change layout of information and statistics tab...Gravatar Stefan Fuchs
... to make it look more similar. This includes: - Same spacings between the boxes - Same way how to use the available space Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-05-01Picture feature: Improve UI and translation of shift image times...Gravatar Stefan Fuchs
... dialog (part 2) Show date/time of first/last selected dive instead of displayed_dive. Thats more useful to identify the right time offset for the images. Trigger first update of image info already in constructor of the dialog. Update the results and UI also when the "backwards" radio button is changed. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-30Picture feature: Improve UI and translation of shift image times dialogGravatar Stefan Fuchs
For the list of pictures with inappropriate date/time not fitting with the dive time use a QTextEdit in read only mode with scroll bars enabled instead of a QLabel. Also update and translate some strings used there. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-29Fix call to tr in order to create translation stringsGravatar Dirk Hohndel
Fixes #365 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29Add SPDX header to desktop widgetsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-26Hide avg max depth thingieGravatar Anton Lundin
We don't set it so just hide it. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-04-26Always set min/max sac in statistics tabGravatar Anton Lundin
It just looks weird when they aren't set, just because you only selected one dive. Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-04-26Rework statistics tab to use a grid layoutGravatar Anton Lundin
This makes everything line up better Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-04-26Fix saving table sizeGravatar Tomaz Canabrava
We need to make sure the model is avaliable for the table until it hits the destructor. Fixes #347 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-25OSTC3 incorrect notice to upgrade firmwareGravatar Jan Mulder
See https://github.com/Subsurface-divelog/subsurface/issues/342. The reason is that we never get a DC_EVENT_DEVINFO when doing a memory dump. Just do not offer to update firmware when we are creating a libdc dump. Full credits of this fix go to Anton. Fixed-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-23Translate string "cancel download" in DC download widget...Gravatar Stefan Fuchs
and change string "Retry" to "Retry download". Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-22Download from divecomputer: reset progress bar fractionGravatar Dirk Hohndel
Otherwise when retrying, the progress bar might already be reset, but its text might still show 100%. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-22Download from divecomputer: don't show bogus progress textGravatar Dirk Hohndel
On some divecomputers we download all the data from the device and then parse the data afterwards just in memory (at which point the progress bar has already run all the way to 100%). So don't try to show the dive number and time in that case. Fixes #335 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-22Download from divecomputer: stop timer on errorGravatar Dirk Hohndel
If we run into an error during the download, stop the timer that triggers the update to the progressbar. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-22Reduce default verbosityGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-21Move extra info tab in main window to the very right side againGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-21After DC import don't do RemoveRows if there is nothing to removeGravatar Stefan Fuchs
This fixes an issue where beginRemoveRows is called with argument -1 in DiveImportedModel::setImportedDivesIndexes. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-20Do not abort when there is no current diveGravatar Jan Mulder
Yes, currentdive can be undefined in case of of a new logbook and starting the planner right away. Do not abort on that. Reported-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-20Preserve dive mode when planning a diveGravatar Jan Mulder
Data such as cilinders and used gasses are populated fromn the currently selected dive when starting the planner. It is more logical to use the dive mode (OC, CCR, pSCR) of the currently selected dive as well. This commits changes this. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-04-18More strict filter for URL handling in dive notesGravatar Stefan Fuchs
Applie a more strict filter to URL handling in dive notes: The URL needs to have: - Scheme like "http:" or "mailto:" - Host name like "www.test.de" or path like "/pathtosomewhere/" Otherwise strings like "OTU:" or "Runtime:" are treated as URL. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-18Fix a crash in the URL handling for the dive notesGravatar Stefan Fuchs
URLs in the dive notes are detected today. A tooltip is displayed and one can follow the URL by Ctrl-click. In the function fromCursorTilWhitespace there is an issue with incorrect return value of Qt (5.7?!) function cursor->movePosition(). This value is erroneous true in some condition e.g. if the cursor is inside a table at the very beginning or the very end of a table line and not moving any more. This can cause the function end up in an infinite loop. Bugfix adds an additional exit criteria for the loop if the string is not growing any more. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-04-18Fix a crash on exitGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>