aboutsummaryrefslogtreecommitdiffstats
path: root/core/settings
AgeCommit message (Collapse)Author
2020-03-01mobile: remove filter settingsGravatar Berthold Stoeger
These are not used anymore. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-08Cleanup: remove erroneous commentsGravatar Berthold Stoeger
Remove two erroneous comments stating that a function-local QSettings variable should not be static because it is initialized too early. Scoped static variables are initialized when execution first hits the statement. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-02-08core/settings: add new preference to limit number of columns on mobileGravatar Dirk Hohndel
The idea is that in portrait mode we can force the display to be single column (which makes sure that the profile in dive display mode is nice and big). This commit only implements the preference variable that we need for that. 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-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-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>
2020-01-17core/settings: correct copy/paste error.Gravatar jan Iversen
The registration for several Pref* point at wrong C++ object, correct the paste error. Signed-off-by: jan Iversen <jan@casacondor.com>
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>
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>
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-27core/settings: make qPrefUnit accesable from QMLGravatar jan Iversen
Use string literals to communicate with QML. Instead of passing arounds enum/int value, it seems easier to pass string literals to QML and have that code respond to those Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-25Preferences UI: final cleanupGravatar willemferguson
This commit does some final cleaning up to the code, mostly deleting white space and comments. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Preferences UI: add dive log tabGravatar willemferguson
This adds a tab for dive log - related preferences. A suitable test programs is still required. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Preferenced UI: add dive download tabGravatar willemferguson
Add a preferences tab for dive download, allowing resetting the buttons representing download connections in the Download panel. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Pereferences UI: add media tabGravatar willemferguson
Remove the preference settings dealing with thumbnails (currently under General preferences and Profile preferences) and put them in a newly-created Media preference tab. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Preferences UI: create new equipment tabGravatar willemferguson
Remove the "Show unused cylinders" checkbox (Profile tab) and the "Set default cylinder" qTextEdit box (General tab) and put them in a separate and new Equipment tab. This sounds like a simple task but, as can be seen from the files changed, was actually a complex matter. Adapt the existing test programs (General and TechDetails) for creating a test program that tests parts of the Equipment tab. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-12core/settings: qPrefCloudStorage, correct diveshare_uid namingGravatar jan Iversen
The variable in Q_PROPERTY was wrongly named diveshare_userid change diveshare_userid to diveshare_uid Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11core/settings: extend qPrefCloudStorage with divelogsde user infoGravatar jan Iversen
Add divelogsde_userid and divelogsde_password to qPrefCloudStorage to be used in Export.qml Extending qPrefCloudStorage is more logical than adding QSettings (and securing the same behaviour) outside qPref. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11core/settings: extend qPrefCloudStorage with diveshare uid/privateGravatar jan Iversen
Add diveshare/uid and diveshare/private to qPrefCloudStorage to be used in Export.qml as well as diveshareexportdialog Extending qPrefCloudStorage is more logical than adding QSettings (and securing the same behaviour) outside qPref. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-05core/settings: remove Q_PROPERTY warning in qPref headersGravatar jan Iversen
Q_PROPERTY contains an internal ";", making clang produce a warning when ending the line with a ; Remove ; at the end of Q_PROPERTY lines. Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-05core/settings: make qPref* constructors privateGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-05core/settings: make qPrefGeocoding functions staticGravatar jan Iversen
Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-03Desktop: handle environmental states in Information tabGravatar willemferguson
Create a preference setting on the General Settings page. The setting is saved with the other preferences. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-31Planner: Add option to treat O2 as narcoticGravatar Robert C. Helling
When computing the best mix for a target depth, for helium, one can either require that the partial pressure of N2 is the same as at the target depth or the partial pressure of N2 plus O2. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-07-18Cleanup: move deco function declarations to deco.hGravatar Berthold Stoeger
Another tiny step in making dive.h smaller: move function declarations to deco.h if these functions are defined in deco.c and don't directly concern dives. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-12use the default constructor for empty QString and QByteArray constantsGravatar Rolf Eike Beer
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-04-12use QStringLiteral for constantsGravatar Rolf Eike Beer
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-04-04Cleanup: don't instantiate a QPref objectGravatar Berthold Stoeger
QPref has only static functions. There seems to be no point in instantiating a singleton of this object. Remove the instance() method and remove the Q_OBJECT macro. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-04Cleanup: make qPref::registerQML() staticGravatar Berthold Stoeger
This member function does not access any other member of the object. Make it static. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-04Cleanup: remove qPref::canonical_version() and qPref::mobile_version()Gravatar Berthold Stoeger
These two member functions were never used, but cause frequent recompilation of the qPref.cpp file. Remove them for now until their usefulness becomes evident. These were the only functions tested in test_qPref.qml. Therefore remove this test-file. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-03-29Add UI element for final surface segment in plannerGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-02-05Add button to toggle deco info in info boxGravatar Robert C. Helling
The info box can get longish. Offer the user to turn off display of deco information (surface GF and individual ceilings). Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-02-01facebook: remove the featute from the code baseGravatar Lubomir I. Ivanov
Remove from: - unit tests - desktop widgets - preferences - core intergration - cmakefiles - build scripts - icons - docs Also remove the plugins and social network integration. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2019-01-13Planner: Add checkbox to force OC bailoutGravatar Robert C. Helling
This adds a checkbox for rebreather modes of the planner that force the ascent to be in OC mode. Before, one had to add a one minute last segment with the mode change but this is not practical when manually searching for the maximal bottom time given gas reserves. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-10-27qPref: reduce recompiles with every commitGravatar Dirk Hohndel
Including ssrf-version.h in an include file that a lot of files depend on caused a ton of unnecessary recompiles with every commit. This should reduce that problem. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: add two preferences for filteringGravatar Dirk Hohndel
With this we can make it configurable if the search should include the notes field and if the search should be case sensitive or not. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-19Preferences: wire-up the deco parametersGravatar Jan Mulder
The deco parameters need special treatment to wire them up to the underlying deco model code. And with the new preferences setup this is a lot of boilerplate. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-15Bluetooth cleanup: remove pointless download_modeGravatar Dirk Hohndel
This was used to track whether we had selected the native BT mode in the download dialog. But the information is redundant as we can tell from the device name whether this is a BT/BLE download or not. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-09Prefs: add bool preference cloud_auto_sync [1/3]Gravatar Jan Mulder
With removal of the git_local_only from the preferences (see ae653703a5d3f), the users choice, in the mobile app, was not stored any more in between sessions. This resulted in issue 1725. So, in order to store that user preference, we need a new preference. This is added here, but its not yet hooked up in the app yet. This deals only with the preference handling. And adapted tests are included. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-25cleanup: do not compare doubles like thisGravatar Jan Mulder
Cleanup another possibly dangerous compare of doubles. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-25qPref: don't compare doubles for equalityGravatar Dirk Hohndel
This is a much safer way to do this. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-25qPref: add mobile_scale preferenceGravatar Dirk Hohndel
We use that in the mobile app to scale the whole app, as all sizes there are relative to the default font. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-23qPref: add ability to remember recently used dive computersGravatar Dirk Hohndel
This does feel clumsy and complicated. This is a lot of special case handling and a lot of boilerplate for something that really should be quite simple. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-19Mobile: always update the preferences when set_unit_system is calledGravatar Jocke
Unit_system is read from git storage but units are set from locale when the app starts. To prevent a miss-match between unit and unit_system we have to always update the preferences variable when set_unit_system is called so that the user doesn't end up with imperial units when the preferences say metric. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>