summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-01-04backend-shared: add slot to detect switch METER <-> FEETGravatar jan Iversen
This allows to update plannermodel etc. and thus avoiding a restart when changing units for length. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-04core/settings: qPrefUnit, secure original signal gets emittedGravatar jan Iversen
When using the string setters, the original signal should still be emitted. Change to call original setter in string setter. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-04core/settings: force sending of signal when unit type changesGravatar jan Iversen
When changing between METRICS <-> IMPERIAL, all type signals are emitted. This may cause double sending of some signals, but all signals will be emitted at least once. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-04core/settings: change measurements when changing metric/imperialGravatar jan Iversen
When switching between imperial/metric it is important to change the single measurements as well (e.g. METER <-> FEET). Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-04core/settings: split "normal" version of unit_systemGravatar jan Iversen
All unit functions have a string version and a normal version, except unit_system. Make a non string version of unit_system. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-04mobile-widgetes/qml: standardize QML/C++ interfaceGravatar jan Iversen
Do not use a.set_b(value); it works, but it introduces yet another way of using the QML/C++ interface, furthermore the function might not be called set_b in some future, which is the reason the function is define in Q_PROPERTY Use a.b = value, that respects Q_PROPERTY, and is slightly more performant, most importantly it's like all the other settings so noone starts wondering why this is special. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-04mobile-widgets/qml: switch between m/min and ft/minGravatar jan Iversen
Set the text of ascent/descent rates. This shows the correct speed units when the user switches between metric and imperial. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-04Revert "build system: disable TestGitStorage"Gravatar Dirk Hohndel
This reverts commit d0e52140e586e4f9537738177d54400a855b7d2b. TestGitStorage should work again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-04GitHub Actions: change passwords to be hard codedGravatar Dirk Hohndel
As much as I hate having passwords exposed through the source code, since GitHub wisely prevents reading secrets in pull requests, there isn't really a sane way to have this use confidential credentials. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-02build system: disable TestGitStorageGravatar Dirk Hohndel
While this appears to work fine when tested individually, when running as part of the GitHub actions it causes random failures. This needs to be rethought. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-01GitHub Actions: execute the Ubuntu 19.10 steps in yamlGravatar Dirk Hohndel
This way we can also easily name them as we did for the other two tested platforms. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-01GitHub Actions: better grouping of test stepsGravatar Dirk Hohndel
This is a bit more convoluted to do inside of the Ubuntu 19.10 container, but at least for Ubuntu 14.04 and for Mac this will be an improvement. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-01GitHub Actions: use custom logins for cloud testsGravatar Dirk Hohndel
This should reduce the risk of stepping on top of each other. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-01tests: allow overwriting cloud accountGravatar Dirk Hohndel
TestGitStorage is used in all test runs, which results in occasional errors because two test runs step on each other. This allows us to use different accounts in different runs. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-01tests: refactor TestGitStorageGravatar Dirk Hohndel
It's silly to set up the URL and email in almost every function. Instead do it once at the start and reuse that information. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-02mobile-widgets/qml: reintroduce showPinGravatar jan Iversen
but the proper way, as a direct check on PrefCloudStorage. This secures PrefCloudStorage is only tested once and not n times. As a sideeffect it saves typing and control. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31Update libdivecomputerGravatar Dirk Hohndel
- Several fixes for Mares divecomputer BLE communication - Fix the Aeris Manta memory layout - Add support for the Oceanic Pro Plus 4 - Strip the source directory from file names Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-30GitHub Actions: better names for the Linux buildsGravatar Dirk Hohndel
This makes it easier to figure out which build is doing what. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-30GitHub Actions: add Ubuntu 19.10 / Qt 5.12 buildGravatar Dirk Hohndel
And run tests for desktop and mobile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-30GitHub Actions: run the tests on Mac and Ubuntu 18.04/Qt 5.9 desktopGravatar Dirk Hohndel
We lost running the tests when migrating to GitHub Actions... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-30GitHub Actions: install missing Homebrew packages to run testsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-31mobile-widgets/qml: add spinbox values to planner setupGravatar jan Iversen
(planning is excluded, due to not finished UI). Connect all spinboxes with plannerShared. This change allows live testing and compare with the desktop version. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31mobile-widgets/qml: add checkbox valuesGravatar jan Iversen
(planning is excluded, due to not finished UI). Connect all checkboxes with plannerShared. This change allows live testing and compare with the desktop version. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31tests: corrected typo in CMakeFiles.txtGravatar jan Iversen
This typo caused that testplannershared was not available in neither desktop nor mobil. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31tests: correct decosac/bottomsac in imperial.Gravatar jan Iversen
The getter returns alwayes in m/1000, making the calculations identical, independent if the system is in Metric or Imperial units. Correct getter test cases. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31tests: correct bestmixend test cases.Gravatar jan Iversen
When unit system Imperial is properly activated, these test cases have wrong values, and thus fail. Use correct values. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31tests: reactivate test case in testplannersharedGravatar jan Iversen
reactivate deco2 test case, after problem is solved in plannerShared. Also add a commit on bottompo2/decopo2 in imperial mode, that do not use PSI as expected. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31backend: correct deco2() problem in plannerSharedGravatar jan Iversen
Divided by 1000 (int) instead of 1000.0 (float) which caused precision problems. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-29tests: fix TestGitStorage in a mobile buildGravatar Dirk Hohndel
The default behavior of parse_file() is different between a desktop build and a mobile build. This makes parse_file() always assume that it's ok to connect to the cloud. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29tests: correct testplannersharedGravatar jan Iversen
PSI is not implemented for diveplanner Bestmixend in feet is not implemented for diveplanner Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29tests: deactivate testQMLGravatar jan Iversen
Qt 5.13 (and maybe 5.12) introduced new macros for QUICK_TEST_MAIN_WITH_SETUP and as testQML is loosely based on this macro it needs to be redesigned. Before Qt 5.11 it was not possible to do QML testing that depended on classes being registred with the macro QUICK_TEST_MAIN_WITH_SETUP, therefore it was nessecary to make an independent implementation of main(). For now, let the main do a "return 0", to keep the test in the loop. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29tests: fix testqPrefDisplayGravatar jan Iversen
Font size are never stored on disk for the mobile version, so testing load/save does not make sense. add #ifndef SUBSURFACE_MOBILE Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29tests: fix TestQPrefLogGravatar Dirk Hohndel
There were several issues with these tests, including checking the value argument against bool values even if the underlying preference isn't bool. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29tests: fix TestQPrefEquipmentGravatar Dirk Hohndel
When we actually change the value, the argument to the changed signal should be true, not false. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29tests: fix TestQPrefUnitsGravatar Dirk Hohndel
This clearly never was tested. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29mobile-widgets: remove qmlprefs.*Gravatar jan Iversen
class is not longer used, remove it. (also from qml) Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29QML: remove registration of qmlprefsGravatar jan Iversen
It is no longer used. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29mobile-widgets: use oldStatus in qmlmanagerGravatar jan Iversen
Switch oldStatus from qmlprefs to qmlmanager This is the last use of QMLPrefs, which can later be safely removed. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29mobile-widgets: add oldStatus variable to qmlmanagerGravatar jan Iversen
oldStatus() is kept in qmlPrefs during the login process to allow for a couple of special cases: - if a user have added dives in NO_CLOUD mode and changes to use the cloud these dives are copied to the Cloud, instead of being lost. - if a user does a bailout from the login process (this should not happen anymore) the old status is restored. The pure solution would be to have oldStatus at the top level (e.g. a property in qml) and only change it when actually being in the login process, however due to way the qmlmanager is written it proved very difficult and not worth the effort. In order to be able to remove qmlPrefs, oldStatus are moved to qmlManager. This commit only contain the creation of the variable and the supporting code. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29mobile-widgets: remove showPin from qmlprefsGravatar jan Iversen
showPin is no longer used so remove it. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29mobile-widgets: remove showPin from qmlmanagerGravatar jan Iversen
Setting showPin is no longer needed, so remove it. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29mobile-widgets/qml: remove prefs.showPinGravatar jan Iversen
prefs.showpin is the same as PrefCloudStorage.cloud_verification_status === CloudStatus.CS_NEED_TO_VERIFY but is actually implemented as a separate variable. Removing showPin in order to limit use of QMLPrefs, which is the overall goal. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29mobile-widgets: remove setCredentialStatus() from qmlprefsGravatar jan Iversen
Remove no longer used function setCredentialStatus() from qmlprefs. This is done to secure there are no missing setCredentialStatus calls in the code. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29mobile-widgets: remove second setCredentialStatus()Gravatar jan Iversen
call setOldStatus() and set_filename(). saveCredentials() will adjust email and password. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29mobile-widgets: remove first setCredentialStatus() in finishSetup()Gravatar jan Iversen
This setCredentialStatus() will never do anything, because qPrefCloudStorage is identical to prefs.cloud_verification_status, and can thus be safely removed. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29mobile-widgets: remove setCredentialStatus() from saveCloudCredentials()Gravatar jan Iversen
Revert to the divelist by setting oldStatus() directly to set_cloud_verification_status() This is done to further limit the use of setCredentialStatus() and prepare to remove qmlPrefs. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29mobile-widgets: remove setCredentialStatus from revertToNoCloudIfNeededGravatar jan Iversen
Update revertToNoCloudIfNeeded() to not use setCredentialStatus() by adding an extra call to setOldStatus() setOldStatus() is called in setCredentialStatus together with set_cloud_verification_status() therefore these 2 calls need to added when removing setCredentialStatus(). Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29mobile-widgets: replace simple setCredentialStatusGravatar jan Iversen
qmlprefs::setCredentialStatus() basically only does something when called with CS_NOCLOUD. A number of setCredentialStatus() calls happen where status cannot be CS_NOCLOUD, and therefore setCredentialStatus() can be safely replaced with set_cloud_verification_status() This limits the use of qmlprefs::setCredentialStatus(), but there are still a couple of more complicated calls. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29mobile-widgets: credentialStatus() -> cloud_verification_status()Gravatar jan Iversen
Replace all credentialStatus() with cloud_verification_status() Where both prefs.credentialStatus and PrefCloudStorage.cloud_verification_status are being set, remove prefs.credentialStatus. These replacements are valid since credentialStatus() is a simple envelope over cloud_verification_status(). Also remove qmlPrefs::credentialStatus() from qmlPrefs (mostly to ensure no replacements was forgotten). Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29mobile-widgets: remove m_cloudCredentialStatus in qmlprefGravatar jan Iversen
Remove m_credentialStatus in qmlpref, but let the setter/getter stay, using qPrefCloudStorage::cloud_verification_status() instead. This change ensures that qmlPrefs:credentialStatus() returns the same as qPrefCloudStorage::cloud_verification_status(), and the setter/getter of credentialStatus can later be removed safely. This is a "checkpoint" to ensure everything works without a temporary credentialStatus. No code part depend on the difference between qmlPrefs::credentialStatus() and qPrefCloudStorage::cloud_verification_status(), but the code reference both. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>