aboutsummaryrefslogtreecommitdiffstats
path: root/subsurface-core
AgeCommit message (Collapse)Author
2016-02-13Add helper function to parse gasmix stringsGravatar Joakim Bygdell
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13Add helper function to retrieve first gasGravatar Joakim Bygdell
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-13While parsing weight and pressure we should not change the users settings.Gravatar Joakim Bygdell
Now it is possible to enter a specific unit that is different from the unit stored in the preferences. If only numbers are inputed the unit will be the same as specified by the users preferences. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-12Don't connect to remote if git_local_only is setGravatar Dirk Hohndel
If there was no local cache we still tried to connect to the remote, even with git_local_only set. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-10Don't just keep going when opening a git URL failsGravatar Dirk Hohndel
Once we identified that our filename is actually a git designator (as seen by the fact that it ends in a [branchname] surrounded by '[]'), we shouldn't try to open that filename in order to try other ways of parsing the data; instead we should just return an error to the caller. This way the calling code can tell that an error occured. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09QML UI: add function to get cylinder pressuresGravatar Joakim Bygdell
Since we only show the first cylinder we can also only edit the first cylinder. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-09Add helper to parse pressure strings.Gravatar Joakim Bygdell
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-07Don't run time consuming gas interpolation without any dataGravatar Dirk Hohndel
If the user hasn't set any pressures at all there is no point in trying to interpolate all these data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05DiveObjectHelper: check if dive has only one weightsystemGravatar Dirk Hohndel
The mobile app should only allow editing the weight entry if there is no second weight defined. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05Simplify sumWeight functionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05Add helper function to parse weight stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-05Do not run the deco calculations in the mobile appGravatar Dirk Hohndel
We don't show the calculated ceilings and calculating them is compute intensive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-04Allow merging of dives with zero depth/durationGravatar Miika Turkia
Fixes #1003 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-03Fix Liquivision import crashGravatar Miika Turkia
When we detect a redundant DC we free the memory reserved for the model. Thus we need to malloc that memory here. Fixes #1002 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-01Silence compiler warningsGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-31Mark CCR dive's divetype properlyGravatar Miika Turkia
We used to mark CCR dives by having "SP change" event at time 0:00. As we nowadays mark CCR dives by setting dc->divemode appropriately, better to convert the old dives to this format as well. This way we do not have to take the special old format into account on multiple places in the source. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-27Move helper function to DiveObjectsHelperGravatar Joakim Bygdell
As per Tomaz recomendation the helper functions from 19588ce and e072596 are moved from qmlmanager to DiveObjectsHelper. [Dirk Hohndel: merged with the latest code] Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26QML UI: don't combine multiple trips to the same location into oneGravatar Dirk Hohndel
The way sectioning of the dive list works is by watching for different strings in the section.property. In order to be able to tell different trips apart we combine the address of the dive trip variable with the location (which will create a new section for a new trip, even if the location text is the same) and then strip that information out before showing the trip header. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26Fix usage of QStringGravatar Tomaz Canabrava
1 - Pass QStrings by const-ref 2 - Don't initialize empty strings with "", they are empty by default 3 - Don't compare empty strings with "", use .isEmpty() 4 - don't append or prepend " ", use QChar(' ') 5 - don't compare QStrings with "constant string", use QLatin1String(" constant string" ) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26Move CloudStorage out of the widgetsGravatar Tomaz Canabrava
Cloud Storage is a non-gui based class, we currently use two different approaches for cloud storage, one on the desktop target and other on the mobile target, we should use only one. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25Fix bug on the visibility of the Ruler GraphGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25Changed quite a few shorts to bool on the c++ implementtionGravatar Tomaz Canabrava
The shorts where being used on the preferences since a long while and we cannot just simply change them to bool since this could break the preferences files, so work around that by changing them to booleans, since it's the correct type for a true / false answer. Also, move some plot curves to the new settings style Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25Start to use the QSettings ObjectWrapperGravatar Tomaz Canabrava
start of the QSettinsg Object Wrapper usage on the code this first patch removes two macros that generated around 200 lines in runtime for something like a quarter of it Basically, whenever we changed anything we called the PreferencesDialog::settingsChanged and connected everythign to that signal, now each setting has it's own changed signal and we can call it directly. The best thing about this approach is that we don't trigger repaints for things that are not directly profile related. ( actually we still do, but the plan is to remove them in due time) this commit breaks correct atualization of the profile (because everything was connected to PreferencesDialog::settingsChanged) and now I need to hunt a bit for the correct connections Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24Make it compileGravatar Tomaz Canabrava
This is not hoocked up on Subsurface code yet, but it's already being compilled. now I just need to hoock things up. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24Finalize the SettingsGravatar Tomaz Canabrava
This was the hammer part of the settings, now I need to make it able to compile ;p Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24Remove prefs already implemented.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24Language Settings WrapperGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24Added Display SettingsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-24Added a GeneralSettingsWrapperGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22configure OSTC/OSTC3: Add safety stop parametersGravatar Anton Lundin
This adds the configure parameters for safety stops on the hwOS(OSTC3) and OSTC computers. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22configure OSTC3: Add temperature sensor offsetGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22Use libdivecomputer libc wrappers instead of QtGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22Remove unused headersGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22Remove workaround for OSTC Sport 10.22 and belowGravatar Anton Lundin
Now with firmware 10.23, the settings behave as they should, and won't hang the communication. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22Avoid precision loss on GPS fixesGravatar Dirk Hohndel
It appears that the Qt documentation might be incorrect. It claims that the precision value is digits after the decimal point, but we have seen examples where the values posted to the server appear to have a total of 6 digits, including the digits ahead of the decimal point. Upping this to 9 shouldn't hurt if Qt gets fixed, but should work around the issue reported by a tester. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-21Return a value when getting SAC rateGravatar Dirk Hohndel
Obvious "mass edit" error. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-18Fix crash with empty (or very short) dive listGravatar Dirk Hohndel
In commit 37c10c8fd6 ("Add dive type to statistics window") not enough space is reserved for the newly introduced array if the dive list as fewer than 4 entries. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-18Add dive type to statistics windowGravatar Miika Turkia
This adds dive type based division to the "yearly statistics" window. Thus people can see the stats from individually from OC, CCR, PSCR and freedive. See #949 Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: implement the unit settingsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: unit systemGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: dive planner preferencesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: add PlannerSettingsGravatar Tomaz Canabrava
We probably want to change that on the prefs struct too. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: cloud storage preferencesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: finish network preferencesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: start Proxy QObject configGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: some cleanupsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: geocoding preferencesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: minor cleanupsGravatar Tomaz Canabrava
Rename a few methods wrongly named and place them on the correct place on the file. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15Settings QObjectification: Facebook settingsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-13Don't round up / use minimum duration for profile in Subsurface-mobileGravatar Dirk Hohndel
On the desktop we have long had this vision of a minimum length and a "pleasant" duration of the profile - but on a device this seems to look like uneven margins. So let's just add space for the labels and not otherwise mess with the duration. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>