aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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>
2020-01-19mobile-widgets/qml: add General section to SettingsGravatar jan Iversen
ColumnLayout does not work well with TemplateSection, so change to Column Add TemplateSection "General Settings" "General Settings" are open when visiting page first time. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19mobile-widgets/qml: bump versions for settingsGravatar jan Iversen
bump import versions to reflect Qt 5.12 and remove unused imports remark QtQuick 1 and QtQuick.Controls 1 are depreciated since Qt 5.12 Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19mobile-widgets/qml: settings Control.TextEdit -> TemplateTextEditGravatar jan Iversen
Replace Control.TextEdit with TemplateTextEdit, in order to use common font/color scheme. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19mobile-widgets/qml: settings Control.comboBox -> TemplateComboBoxGravatar jan Iversen
Replace Control.ComboBox with TemplateComboBox, in order to use common font/color scheme. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19mobile-widgets/qml: settings Control.label -> TemplateLabelGravatar jan Iversen
Replace Control.label with TemplateLabel, in order to use common font/color scheme. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19mobile-widgets/qml: add TemplateTitleGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19mobile-widgets/qml: add TemplateLineGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-19mobile-widgets/qml: add TemplateTextFieldGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-18mobile-widgets/qml: use strongly typed CloudStatusGravatar jan Iversen
Replace CloudStatus.<value> with backend.<value> as part of making enum sharing between C/C++ and QML more robust. Replace PrefCloudStorage.verification_status with backend.verification_status to use the strongly typed function. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-18mobile-widgets: make cloud_verification_status type proof in QML.Gravatar jan Iversen
Add CLOUD_STATUS enum to interface. Add cloud_verifification_status variable to interface, and make it strongly typed in QML. using backend.cloud_verification_status = 1 will fail but backend.cloud_verification_status = backend.CS_UNKNOWN is correct. Added note to the original definitions of the enums that they have been duplicated. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-18mobile: register QML interfaceGravatar jan Iversen
call setup with registration of QML interface class Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-18mobile-widgets: add pure interface for passing values to QMLGravatar jan Iversen
Add a header file that contains a duplicate of the enums, that are needed in QML in one class. the unit enums are added imidiatly, since they are needed or will be neede shortly in Settings and DivePlannerSettings This class will also contain Q_PROPERTY and signal/slot for variables used in QML. This is done to allow e.g. deco_mode qPrefUnits::planner_deco_mode() void qPrefUnits::set_planner_deco_mode(deco_mode) as strongly typed in C++ and DECO_MODE planner_deco_mode() void set_planner_deco_mode(DECO_MODE) as strongly typed in QML Remark: wrong assignments gives errors in QML The advantage over using strings or the value directly is that QML detects typos and flags them as errors/warnings. It is important to note that the class may only contain a) a function call to the implementation b) a reference to a global variable e.g. prefs. Added note to the original definitions of the enums that they have been duplicated. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-18mobile-widget/qml: add missing colors to dark themeGravatar jan Iversen
add missing colors so that dark theme contains the same colors as "colors in use". Update the darkTheme() to correctly copy colors from pink theme Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18mobile-widget/qml: add missing colors to pink themeGravatar jan Iversen
add missing colors so that pink theme contains the same colors as "colors in use". Update the pinkTheme() to correctly copy colors from pink theme Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18mobile-widget/qml: add missing colors to blue themeGravatar jan Iversen
add missing colors so that blue theme contains the same colors as "colors in use". Update the blueTheme() to correctly copy colors from blue theme Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18mobile-widgets/qml: secure block of used colors is correctGravatar jan Iversen
move contrastAccentColor, lightDrawerColor to block of used colors in order to avoid confusion. move darkDrawerColor to dark theme. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18mobile-widgets/qml: remove M126 warnings in main.qmlGravatar jan Iversen
changed != --> !== and == --> === to make QML happy. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-18mobile-widgets/qml: columnWidth undefinedGravatar jan Iversen
Remove reference to columnWidth, because it is not defined in main.qml (subsurfaceTheme). Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-17mobile-widgets/qml: main reference qPrefGeneral.default_cylinder wronglyGravatar jan Iversen
change qPrefGeneral.default_cylinder -> qPrefEquipment.default_cylinder Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-17mobile-widgets/qml: change PrefGeneral -> PrefEquipmentGravatar jan Iversen
default_cylinder was moved from PrefGeneral to PrefEquipment, but Settings was not updated update Settings. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-17core/settings: remove PrefClearDC because not used.Gravatar jan Iversen
PrefClearDC was registred with the wrong object, but also is not used. Remove registration. Signed-off-by: jan Iversen <jan@casacondor.com>