aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-01-25dive-planner: removed unused QML interfaceGravatar jan Iversen
Remove Q_PROPERTY and signals from plannershared, since they are no longer used (transferred to qmlinterface). Unregister object plannershared, since it is no longer used in QML. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-25mobile-widgets/qml: correct backgroundcolor in setupGravatar jan Iversen
Use subsurfaceTheme in DivePlannerSetup. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-25mobile-widgets: update design of TemplateSectionGravatar jan Iversen
Update size and colors. Changing the TemplateSection, automatically changes all sections in the system, converted to the new layout. The styling would be better in a style/theme class, but subsurfaceTheme is in main.qml and not in a C++ class, so for now use primitive styling. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-25mobile-widgets: update design of TemplateSpinBoxGravatar jan Iversen
The standard SpinBox uses far too much real estate. The new SpinBox have a smaller footprint, and more visual effect. Changing the TemplateSpinBox, automatically changes all spinboxes in the system, converted to the new layout. The styling would be better in a style/theme class, but subsurfaceTheme is in main.qml and not in a C++ class, so for now use primitive styling. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-25mobile-widgets/qml: connect QML to Backend.Gravatar jan Iversen
Add property pressureUnit to use as BAR/PSI text. Added slot to catch when user changes BAR <-> PSI. Add Backend variables to Planning section. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25diveplanner: add surface_segment to plannersharedGravatar jan Iversen
Add surface_segment to plannerShared and then update desktop-widgets. Signed-off-by: jan Iversen <jan@casacondor.com> desktop-widgets: use plannerShared for surface_segment Change getter/setter for surface_segment to plannerShared, in order to share the conversion with mobile diveplanner Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25mobile-widgets: make planning vars available to QML.Gravatar jan Iversen
Update qmlinterface.h with the planning variables (calling plannerShared). Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25mobile-widgets: make DECO_MODE and DIVE_MODE available to QMLGravatar jan Iversen
Duplicate deco_mode to DECO_MODE, in order to make it available to QML. Duplicate enum divemode_t to DIVE_MODE in order to make it available to QML. Only part of the enum is made available. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25mobile-widgets/qml: correct reference in TemplateComboBoxGravatar jan Iversen
theme is not available, use older subsurfaceTheme. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25mobile-widgets/qml: graphic layout Planner (Planning)Gravatar jan Iversen
Add all needed graphical elements for DivePlannerSetup planning section. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25diveplanner: add last gas variables to QMLInterfaceGravatar jan Iversen
Add bottompo2, decopo2 and bestmixend to QMLInterface Bestmixend in gas options changing with meter/feet Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25diveplanner: adjust sac-factor calculation.Gravatar jan Iversen
The real values are 1.0 to 10.0, but QML needs int so mobile gets values 10.0 to 100.0 add sacfactor() to QMLInterface and update QML. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25dive planner: correct bottomsac/decosac calc.Gravatar jan Iversen
Move conversion cuft <-> liter from desktop-widget/diveplanner.cpp to plannerShared, to facilitate the same results in mobile diveplanner Use Backend for bottomsac/decosac and update to check for switch LITER <-> CUFT Add bottomsac/decosac to QMLinterface. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25mobile-widgets: correct error in connectGravatar jan Iversen
connect to set_o2narcotics missed an & but the compiler did not complain (which it usually does). Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25diveplanner: call planner model directly for simple variables.Gravatar jan Iversen
Variables without conversion, do not need to pass plannerShared (due to the QML interface). Simple variables do not pass plannerShared, but diveplanner in desktop-widgets and qmlinterface in mobile-widgets call the implementation directly. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25Parse GPX dive coordinates: Qt XML frameworkGravatar willemferguson
This replaces the C-code XML parsing with a Qt infrastructure. QXmlStreamReader is used to parse the GPX file. It also takes into account comments by @neolit123 Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
2020-01-24mobile-widgets/qml: add slot for volume changeGravatar jan Iversen
Catch when volume type is changed and update bottomsac/decosac. Also update text l/min <-> cuft/min and add a space between value and unit. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-24mobile-widgets/qml: Add drop_stone to ratesGravatar jan Iversen
Drop_stone_mode, when set, affect the descent rate, so place it alongside the descent rate. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-24mobile-widgets: add simple part of remaining planner variablesGravatar jan Iversen
Add simple variables, where getter uses prefs. and setters call directly to set function (without using plannerShared). rename last_stop --> last_stop6m Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-24backendShared: remove length slotGravatar jan Iversen
Length variables are updated from the QML and desktop directly. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-24mobile: move dive planner notes access to pure interfaceGravatar jan Iversen
Make notes rates available to QML through the Backend interface. Remove the corresponding variables from plannerShared. Getters are from prefs. while setters are linked to diveplan model. Remark: signals from qPrefDivePlanner is used, because the diveplanner model sets qPrefDivePlanner but do not issue special signals. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-24mobile-widgets/qml: use Kirigami Units instead of hardcoded valuesGravatar jan Iversen
This allows for better scaling of the UI. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-24scripts: expand build.shGravatar jan Iversen
Add option "-src-dir <source directory>" to build options. When calling build.sh without -src-dir it uses src/subsurface as usual, but when called with -src-dir <source directory>, it uses src/<source directory> as source basis. This is a needed option, when working with "git worktree", which is used when working on different branches in parallel (e.g. master and my-feature-branch), because it allows a build directory in each worktree, and thus much faster when switching work. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-24documentation: add line to CHANGELOGGravatar jan Iversen
Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-24mobile-widgets/qml: add radiobuttons for single units.Gravatar jan Iversen
For METRIC and IMPERIAL, show the radiobuttons disabled For PERSONALIZED, allow user to select individual units. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-24mobile-widgets: use radiobuttons for UnitsGravatar jan Iversen
Change to radiobuttons for units, and add a third choice (personalize). Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-24Desktop: Import gps coordinates: test filesGravatar willemferguson
These are test files enabling a test of the import of dive coordinates from GPS Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
2020-01-24core: move GPX parsing into coreGravatar Dirk Hohndel
This shouldn't be part of the desktop UI code; there's still the issue that we really shouldn't hand code XML parsing, but I'll leave that for later. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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-20backend-shared: remove asc/desc functionsGravatar jan Iversen
Ascent/Descent rate functions are fully implemented in diveplannermodel, therefore remove these functions. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20mobile-widgets/qml: use Backend instead of PlannerGravatar jan Iversen
Use Backend instead of Planner for ascent/descent variables. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20mobile-widgets: add asc/desc rates to pure interfaceGravatar jan Iversen
Make ascent/descent rates available to QML through the Backend interface. Remark signals from qPrefDivePlanner is used because the diveplanner model sets qPrefDivePlanner but does not issue its own signals. Signed-off-by: jan Iversen <jan@casacondor.com> 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-20qt-models: add getters to diveplanner modelGravatar jan Iversen
diveplannermodel already contains set_<asc/desc> function that convert from screen value to real value; this adds get functions that convert real value to screen value, so now all conversions are done in one place. Use prefix Display to identify this is values prepared for the UI (both desktop and QML). Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20Update CHANGELOGGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20mobile UI: add ability to unset the default cylinderGravatar Dirk Hohndel
This was requested in a 'bug report' by a user. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20core/settings: removed unnecessary ifGravatar jan Iversen
prefs.unit_system is set at the top, so no need to set it again. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20core/settings: correct signal errorGravatar jan Iversen
prefs.unit = x needs to be after the setters are called, otherwise the setter will not do anything, and result in an inconsistency between the values stored on disk and in prefs.units. 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-20core/settings: allow signals to be strongly typed in C++Gravatar jan Iversen
Register enums to allow them to be used in signal handlers instead of int. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20mobile-widgets/qml: use strongly typed units in QMLGravatar jan Iversen
Change Settings and DivePlannerSetup to use the strongly typed enums Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20mobile-widgets: allow qPrefUnit strongly typed in QMLGravatar jan Iversen
Add qPrefUnit Q_PROPERTY but using QMLInterface enums, that way all variables become strongly typed in QML. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19documentation: add line to CHANGELOG.mdGravatar jan Iversen
Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19mobile-widgets: move rest of gridlayout to section advancedGravatar jan Iversen
Create section advanced around the remaining gridlayouts, and adjust. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19mobile-widgets/qml: create units section and move unit_settingsGravatar jan Iversen
Move gridlayout unit_settings to TemplateSection units, without changing anything (apart from adding a visible: attribute). Removed first label in units_settings, since it is the title of the section Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19mobile-widgets/qml: create theme section and move themesettingsGravatar jan Iversen
Move gridlayout themesetting to TemplateSection theme and use the TemplateTitle. Also switch from using PrefDisplay.mobile_scale to subsurfaceTheme.currentScale Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19mobile-widgets/qml: move dive computers to general section.Gravatar jan Iversen
move gridlayout divecomputers to TemplateSection general, without changing anything (apart from adding a visible: attribute and replacing the Rectangle used to draw a line at the bottom with a TemplateLine on top. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19mobile-widgets/qml: move default cylinder to general section.Gravatar jan Iversen
move gridlayout defaultCylinder to TemplateSection general, without changing anything (apart from adding a visible: attribute and replacing the Rectangle used to draw a line at the end with a TemplateLine at the top). Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19mobile-widgets/qml: move cloudSettings to general section.Gravatar jan Iversen
move gridlayout cloudSettings to TemplateSection general, without changing anything (apart from adding a visible: attribute and removing the rectangle used to create a line). Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>