aboutsummaryrefslogtreecommitdiffstats
path: root/core/settings
AgeCommit message (Collapse)Author
2021-04-19cloudstorage: try to pick between multiple cloud serversGravatar Dirk Hohndel
The backend infrastructure will soon be able to support more than one cloud server which automagically stay in sync with each other. One critical requirement for that to work is that once a session was started with one of the servers, the complete session happens with that server - we must not switch from server to server while doing a git transaction. To make sure that's the case, we aren't trying to use DNS tricks to make this load balancing scheme work, but instead try to determine at program start which server is the best one to use. Right now this is super simplistic. Two servers, one in the US, one in Europe. By default we use the European server (most of our users appear to be in Europe), but if we can figure out that the client is actually in the Americas, use the US server. We might improve that heuristic over time, but as a first attempt it seems not entirely bogus. The way this is implemented is a simple combination of two free webservices that together appear to give us a very reliable estimate which continent the user is located on. api.ipify.org gives us our external IP address ip-api.com gives us the continent that IP address is on If any of this fails or takes too long to respond, we simply ignore it since either server will work. One oddity is that if we decide to change servers we only change the settings that are stored on disk, not the runtime preferences. This goes back to the comment above that we have to avoid changing servers in mid sync. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-04-19cloudstorage: add API to just update on-disk settingGravatar Dirk Hohndel
This way we can change the host that we will use next time the app runs. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-04-19cloudstorage: some cleanup of cloud url handlingGravatar Dirk Hohndel
We know the preference is never empty, so stop testing for this. But don't maintain two different preferences with basically the same content. Instead add the '/git' suffix where needed and keep this all in one place. Simplify the extraction of the branch name from the cloud URL. Also a typo fix and a new comment. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-19mobile: add GF fields for ceiling calculationGravatar Doug Junkins
Adds fields to the advanced preferences page to modify GFLow and GFHigh for the Buhlmann decompression model for calculating ceilings. Updated preferences code to set the Buhlmann parameters in core/deco.c when the GF prefs are updated. Signed-off-by: Doug Junkins <douglas.junkins@gmail.com>
2021-01-06preferences: remove pointless memberGravatar Dirk Hohndel
This could never have worked the way it was used. Some whitespace fixes snuck into this commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-13prefs: add option to display only actually used tanksGravatar Berthold Stoeger
A user complained about the default cylinders list. Provide a preferences option to turn this off. When changing the preferences, the tank-info model will be completely rebuilt. Currently, this is a bit crude as this will be done for any preferences change. Suggested-by: Adolph Weidanz <weidanz.adolph@gmail.com> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-11-04revert preference settings for title colorGravatar Dirk Hohndel
Because of subsequent changes there is no clean way to just revert the changes introduced in commit 8b36cf1051 ("desktop: offer different colors for info tab titles"), so this manually removes the parts we don't need anymore. This also restores a tooltip value that was inadvertantly removed in that commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-03desktop: offer different colors for info tab titlesGravatar willemferguson
Add a preference option to set the color of the text on the information tab to either MediumBlue, LightBlue or Black. The last two of these colors are meant to enable areadable font contrast on displays with dark mode. The choice is saved with the other preferences. [Dirk Hohndel: this isn't really about dark mode, so changed many of the types and variable names, changed the user visible texts, and addressed some whitespace issues] Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-19desktop: remove user surveyGravatar Dirk Hohndel
We have never made good use of the results. Let's just remove it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-22cleanup: don't call uiLanguage() in qPref::loadSync()Gravatar Berthold Stoeger
uiLanguage() initializes the language fields from the preferences values. It is unclear why this function is called in qPref::loadSync() *before* the fields are loaded from disk. It can only initialize to the default values anyway. After qPref::loadSync() uiLanguage() is called again so that everything can be initialized with the correct perferences values. Remove the first call. If things break, let's fix them in a sensible way. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
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>