aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
AgeCommit message (Collapse)Author
2020-01-24Desktop: Import dive coordinates directly from GPSGravatar Willem Ferguson
This allows Subsurface to obtain the coordinates of a dive directly from a GPS track. It parses a GPX file (GPX V1.0 or V1.1) from a GPS to locate the trackpoint immediatedly after the start of a dive. There is an additional "Use GPS file" button in the Edit Dive Site panel that is selected from the Notes tab. Image: This allows one to select a GPX file, bringing up the Import GPS dialog. There is extensive provision for cross-checking that the dive track synchronises with the dive start and end. If the Save button in the dialog is pressed the dive coordinates are copied into the Dive Coordinates text box in the Edit Dive Site panel. The map moves to indicate the location of the dive site. The bulk of the work is done in importgps.cpp. The code is pretty intergrated: I tried to break it up in smaller commits but that was not feasible. The code includes responses to the comments by @neolit123 and @bstoeger. The C-based file input was replaced with Qt-based code using QChar, QString and QFile. [Dirk Hohndel: fixed several small issues in the .ui file, removed various headers includes that weren't needed and fixed printing of minutes as zero padded] Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20qt-models: add suffix Display to unit system aware asc/desc settersGravatar jan Iversen
Change ascent/descent setter function names to set_<name>Display to show the value is prepared for displaying (common for desktop and QML). Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20desktop-widgets: use set/get asc/desc rates in diveplannermodelGravatar jan Iversen
The spinboxes are already connected to diveplannermodel set_ functions, remove second connect to plannerShared. Change get functions to use diveplannermodel. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20core/settings:: remove string functions for unitsGravatar jan Iversen
Remove string version of unit_system, duration_units, length, pressure, temperature, vertical_speed_time, and volume, including tests and make signals strongly typed in C++ Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: add empty table structuresGravatar Dirk Hohndel
It seemed to make sense to combine all three types in one commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: use explicit zero_locationGravatar Dirk Hohndel
Again, several different ways to achieve the same thing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: replace deprecated member function QColor::dark()Gravatar Dirk Hohndel
dark() and darker() appear to have the same semantics. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: remove deprecated QString::nullGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: replace deprecated setAutoCompletion() functionsGravatar Dirk Hohndel
It's not even clear if we need the setCaseSensitivity() call as it appears that a case insensitive completer is the default. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: add missing initializationGravatar Dirk Hohndel
While technically the initial value of this variable makes no difference as it is set when the first dive is displayed, technically Coverity is correct. Fixes CID 353273 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: remove unused QSignalMapperGravatar Dirk Hohndel
Fixes CID #353274 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: replace deprecated setBackgroundColor() methodGravatar Dirk Hohndel
Here the replacement has been around for a very long time. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: mark unused argumentGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: initialize all elements in structureGravatar Dirk Hohndel
This seems silly. I don't like that warning and would rather disable the warning. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: use QElapsedTimer instead of QTimeGravatar Dirk Hohndel
Newer versions of Qt deprecate using QTime as a timer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: QFontMetrics::width() is deprecatedGravatar Dirk Hohndel
Qt5.11 introduced the suggested replacement QFontMetrics::horizontalAdvance(). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-07desktop-widgets: add comment why last SIGNAL/SLOT is not convertedGravatar jan Iversen
The last SIGNAL/SLOT cannot be converted due to a limitation in the new connect() syntax, it does not "understand" default parameters. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-07desktop-widgets: replace connect() for CylindersModel.Gravatar jan Iversen
Replace SIGNAL/SLOT in favor of new connect() Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-07desktop-widgets: replace connect() with parameter double.Gravatar jan Iversen
Replace SIGNAL() with QOverload<double>::of() to allow new connect syntax. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-07desktop-widgets: convert last simple connect().Gravatar jan Iversen
Convert the last convert() statements, that can be converted just by changing the syntax. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-07desktop-widgets: correct connect for QShortcutGravatar jan Iversen
Replace syntax for connect of QShortcut. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-07desktop-widgets: correct QDateTime connect()Gravatar jan Iversen
Change connect() to new syntax for QDataTime. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-07desktop-widgets: change rebreathermode to use new connect()Gravatar jan Iversen
Replace SIGNAL/SLOT with QOverload. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-06desktop-widgets: change connect() for triggered(bool)Gravatar jan Iversen
Change connect for QAction::triggered(bool) to new syntax. Signed-off-by: Jan Iversen <jan@casacondor.com>
2020-01-06desktop-widgets: change connect() for valueChange(int)Gravatar jan Iversen
Change connect for QSpinBox::valueChange(int) to new syntax. Signed-off-by: Jan Iversen <jan@casacondor.com>
2020-01-06desktop-widgets: change connect() for clicked/accepted/rejectedGravatar jan Iversen
Change connect for QAbstractButton::clickedto new syntax. Change connect for QDialogButtonBox::accepted/rejected to new syntax. Signed-off-by: Jan Iversen <jan@casacondor.com>
2020-01-06desktop-widgets: remove double connect.Gravatar jan Iversen
No need to connect ui.display_variations to the same signal/slot twice. Signed-off-by: Jan Iversen <jan@casacondor.com>
2020-01-06desktop-widgets: change connect() to new type for toogledGravatar jan Iversen
Change connect for QAbstractButton::toogled to new syntax. Signed-off-by: Jan Iversen <jan@casacondor.com>
2020-01-06desktop-widgets: correct typeGravatar jan Iversen
correct SLOT was sec_bottomsac(double), which is not reported as an error. correct to set_bottomsac(double) Signed-off-by: Jan Iversen <jan@casacondor.com>
2020-01-06desktop-widgets: correct set_min_switch_duration connect.Gravatar jan Iversen
correct SLOT was set_min_swich_duration()(int), which is not reported as an error. Signed-off-by: Jan Iversen <jan@casacondor.com>
2020-01-06desktop-widgets: set_bailout -> set_dobailoutGravatar jan Iversen
correct name mistake in connect() Signed-off-by: Jan Iversen <jan@casacondor.com>
2020-01-06desktop-widgets: set_verbatim_plan should go through plannerShared.Gravatar jan Iversen
Adjust connect() to use plannerShared, avoiding parameter convert problem. Signed-off-by: Jan Iversen <jan@casacondor.com>
2020-01-06desktop-widgets: remove use of QSignalMapper.Gravatar jan Iversen
QSignalMapper gives a warning that it is depreciated, and the doc. states that using a lambda function is more efficient. Replace use of QSignalMapper. Signed-off-by: Jan Iversen <jan@casacondor.com>
2020-01-06desktop-widgets: replace QSignalMapper for set_deco_modeGravatar jan Iversen
QSignalMapper had a parameter convert problem, when mapping to set_deco_mode in plannerShared. Use lambda function in connect to avoid parameter convert problem. Signed-off-by: Jan Iversen <jan@casacondor.com>
2020-01-06desktop UI: only show salinity warning when DC salinity is differentGravatar Dirk Hohndel
There were two cases that were handled incorrectly: - if the user hasn't entered a salinity, obviously there shouldn't be a warning - if this is a manually entered dive, there is no salinity downloaded from a dive computer, so equally, no warning Suggested-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-06desktop UI: use salinity of current DC, not first DCGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-06desktop UI: correctly show the salinity data overwritten warningGravatar Dirk Hohndel
We need to show this whenever the value in the dive (which could have been entered by the user some other time) doesn't correspond to the value in the DC. This, btw, will point out to the user if different DCs have different values. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-06desktop UI: treat an unknown salinity as thatGravatar Dirk Hohndel
We were royally confused when we didn't know the salinity value (e.g., if the dive computer didn't provide that information). We somehow treated this as the same as wanting to use the salinity information in the dive computer. Which makes no sense. While cleaning this up, this also adds the textual representations of the water types as a string list that corresponds to the enum values that we use - this way it's easier to stay consistent. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-06code cleanup: avoid unused argument warningsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-06desktop UI: remove strange sprintf callsGravatar Dirk Hohndel
I'm rather upset that I never noticed this in a review. That's just not how you print numbers. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-06desktop UI: small cleanups of salinity codeGravatar willemferguson
Added code for string translation. Added code to improve UI on Windows. Added some comments to make the code more understandable. Enable salinity combobox for manually entered dives Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-06core: read and write the user-specified salinityGravatar willemferguson
Both XML and git storage are added. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-06desktop UI: create the UI components for editing the salinity.Gravatar willemferguson
The user may modify the salinity by selecting a water type from the combobox. The new datum does not replace the existing salinity value but is stored in a separate variable within the dive structure. If the dc-based salinity is overwritten, there is an exclamation mark next to the modified salinity value to indicate that the salinity has been overwritten. The dc-derived salinity can always be recovered by selecting the "use dc" option in the combobox. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-06desktop UI: add preference for making salinity editableGravatar willemferguson
Create a checkbox in the Preferences: General screen that enables or disables editing of the salinity data. This preference is saved with all the other preferences. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-27Cosmetic updates to .UI files for PreferencesGravatar willemferguson
This is a cosmetic update to remove some warning messages while building a fresh subsurface. These warnings were due to duplicate label names in the .UI files. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
2019-12-26plannerShared: replace notes variables to plannerSharedGravatar jan Iversen
Replace display_runtime display_duration display_transitions verbatim_plan display_variations Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26desktop-widgets: replace variables to plannerSharedGravatar jan Iversen
Use plannerShared setter to update the variables in qPref. This will also signal the cylindermodel to calculate a new bestmix. variables: bottompo2 decopo2 bestmixend Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26desktop-widgets: replace o2narcotic from plannerModel to plannerSharedGravatar jan Iversen
Use plannerShared setter to update o2narcotic. This will also signal the cylindermodel to calculate a new bestmix. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26desktop-widgets: replace variables from plannerModel to plannerSharedGravatar jan Iversen
variables bottomsac decosac problemsolvingtime sacfactor are not set in diveplanner.cpp, but instead signals a slot in plannerModel. change signals to slots in plannerShared Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26desktop-widgets: replace var plannerModel -> plannerShared convertedGravatar jan Iversen
variables min_switch_duration are not set in diveplanner.cpp, but instead signals a slot in plannerModel. and are read from plannerShared which includes a conversion change signals to slots in plannerShared change read from prefs. to plannerShared Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>