Commit graph

11002 commits

Author SHA1 Message Date
Dirk Hohndel
285c3a9b66 Update Subsurface-mobile manual stored in git
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04 11:19:04 -07:00
Dirk Hohndel
f40d5ff0a1 Update the README for building the iOS version
This still isn't quite straight forward, but at least now the README matches
the process that I use again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04 11:17:44 -07:00
Dirk Hohndel
80eafb8db7 Fix some warnings
At least the warnings about size potentially being uninitialized seem correct
and valid.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04 10:27:56 -07:00
Dirk Hohndel
3affaedb38 Update Subsurface-mobile version to 1.1.0
Just so that the iOS release has a sane starting point - and frankly,
we've done a very poor job of maintaining this version number.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04 09:53:24 -07:00
Dirk Hohndel
3f78283895 Update Subsurface-mobile manual
Correctly differentiate Android and iOS features.
Adapt style to be generally in the second person.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04 09:53:24 -07:00
Dirk Hohndel
4938a7a10f iOS: Don't show "No GPS source available"
We don't support GPS on iOS right now, the message is confusing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04 08:57:09 -07:00
Dirk Hohndel
055276f1ba iOS build: re-enable building libraries for the simulator
We now build Kirigami as part of Subsurface-mobile itself, so the simulator
builds work again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04 07:54:22 -07:00
Dirk Hohndel
830d9163dc iOS build: Fix compile failure
Without this moc_SubsurfaceObjectWrapper doesn't compile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04 07:52:18 -07:00
Linus Torvalds
833683521a Stop trying to fix up pressure sensor indexes
This removes 'fixup_dc_cylinder_index()', which was added to fix up the
pressure sensor indexes from the Atomic Cobalt dive computer.

Even for the Cobalt it really shouldn't matter, because the
libdivecomputer backend for the Cobalt actually tries to do the right
thing.  See for example commit 8853a1ccd422 ("Associate the pressure
samples with the primary tank.") in libdivecomputer.

Some historical digging shows that the subsurface sample pressure index
code came in from commit e32ba4d6d8 ("Improve tank handling for
Cobalt"), dated Tue Oct 28 13:48:15 2014.

And the libdivecomputer "use the right cylinder" code was around the
same time (Fri Oct 10 20:29:17 2014 +0200).

So I suspect that subsurface needed the fixup based on an older version
of libdivecomputer.  Jef's patch is a couple of weeks before, but we may
not have tracked libdivecomputer religiously.

The reason to remove this code is because it can (and does) mess up the
sensor index when it is actually reliable, like in the multi-sensor case
of the Suunto EON Steel.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04 07:37:28 -07:00
Joakim Bygdell
4e0200863b Remove hacks regarding multiple gasmixes and cylinders
Enabling cylinder edit in Subsurface-mobile our previous hacks
regarding multiple cylinders and gasmixes must be removed.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04 07:36:43 -07:00
Joakim Bygdell
674d8331f5 QML UI: Enable cylinder edit
This adds the option to select a cylinder when adding or editing a dive.
Due to limited screen size we restrict the editing to the first cylinder only.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04 07:36:13 -07:00
Rick Walsh
7b3665827a Settings fixup: gflow and gfhigh are int
With the recent setting cleanup, gradient factors were set to bool, so were
saved as 1/1, rather than say 50/80. This commit fixes that.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-09-04 07:29:42 -07:00
Linus Torvalds
d8a6b917a5 Teach 'interpolate()' about zero-sized ranges
No, they don't make sense.  We should normally not have multiple samples
that are on the same second.  But they seem to happen on the EON Steel
under some circumstances, and instead of dividing by zero when trying to
interpolate across such a sample, do something sane.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-29 21:43:19 -07:00
Linus Torvalds
5a66ac7698 Make sure DC_FIELD_TANK starts from a clean slate for each cylinder
We used to clear the 'dc_tank_t' for each dive, but then only clear the
volume field in between each cylinder.  That means that if the
libdivecomputer back-end does not touch a field, it might contain the
stale value from the previous tank information.

I'm not sure this is actually much of an issue, since I'd expect
back-ends do seem to initialize the fields fully (at least the EON Steel
back-end does).  But it's inconsistent.

Also, the code was actually buggy because of the odd indentation: it
would only ask for new tank information up to 'ntanks' tanks, but
because of the final fixup that was done outside of the conditional, it
would actually update the cylinder begin/end pressure data *beyond*
'ntanks', and just re-use the last libdivecomputer data for the rest of
the cylinders.

Again, in practice, that probably never really happened, but it is a
real bug.

The fixed-up code actually looks better too, imho, and is one line
shorter because of the initialization now being done in one place rather
than two.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-29 21:43:17 -07:00
Linus Torvalds
99d1cecf06 Hacky workaround for multiple gas pressures per sample
In subsurface, we only have one cylinder pressure per sample (well,
technically two: we have a separate o2 pressure for rebreather diving).

Which makes things "interesting" if the dive computer can actually have
multiple pressure sensors, and can report them all concurrently.  Like
the Suunto EON Steel.

We used to just take the last one (each sensor reading would just
overwrite any previous ones), and this quick hack just changes the logic
to prefer the "current" cylinder instead.

It's wrong, and it's stupid, but it's the best we can do without major
surgery.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-29 21:43:14 -07:00
Tomaz Canabrava
1b07483830 Settings update: Fix git_local_only loading
Thanks to the unittesting.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-28 20:01:41 -07:00
Tomaz Canabrava
3dce5de12d Add the beginning of the Preferences test
And it actually helped me to find a bug. yey.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-28 20:01:23 -07:00
Tomaz Canabrava
e54f81855d Settings update: Fix cloud_git_url
I was freeing data segment, sigh.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-28 20:01:00 -07:00
Tomaz Canabrava
3d788414c7 Add renumber test as a dependency for running the tests
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-28 20:00:25 -07:00
Tomaz Canabrava
28744e232c Settings update: Fix loading "show pictures" in profile tests
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-28 19:59:58 -07:00
Dirk Hohndel
79ab41dfd8 Android build: don't try to bundle libssh2, either
Since we don't link against it, no need to bundle it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-28 19:20:18 -07:00
Dirk Hohndel
7a55eeeb07 Android build: don't link against libssh2
We don't use ssh-based git in Subsurface-mobile, so there's no reason to
link against it.

This should hopefully fix the current issues with the Android APK on some
devices.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-28 19:14:06 -07:00
Tomaz Canabrava
0a6f6b4382 Settings update: Fix missing groups and Language initialization
There's one function named uiLanguage() that should return
the current uiLanguage() that subsurface is running, but
it actually sets a whole lot of preferences, I think
that the general idea of that function is okay, but it seems
broken for me.

still, I used it to load the correct language from the preferences
since it's what this function is currently doing right now.

Also, a lot of missing groups where added.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 22:37:15 -07:00
Tomaz Canabrava
270864d073 Settings update: Only set if value changed + bugfixes.
Only set the settings if it actually changes, when the user
clicked on the save button on the preferences, the code would
run in every dialog saving each preferences on disk, but this
is uneeded if the value didn't changed.

Also, while doing that, I found a couple of places where I
used the wrong field, which are now fixed.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 22:32:01 -07:00
Dirk Hohndel
c52688c528 Fix compile for Subsurface-mobile
The Settings update series didn't make the corresponding changes
for Subsurface-mobile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 12:45:20 -07:00
Dirk Hohndel
1bf76dd3db Settings update: Fix broken UpdateManger logic
In commit b76c1846bb ("Settings update: Simplify Update Manager")
the logic for when to show the UpdateManger question to the user got
broken. Unintuitively, a boolean setting actually has three possible
values. True, False, and Unset. This patch fixes things to work as
designed again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 12:29:08 -07:00
Tomaz Canabrava
f745a25cb7 Settings update: Remember to load the "UpdateManager" settings
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
9b2404fcb4 Settings update: Move loadPreferences out of qt-helper.cpp
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
8f178301d8 Settings update: Use the Settings to store the plannersettings
Instead of settings things manually in the code. (btw,
if we use lambdas the code can be quite smaller)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
ad7524fda1 Organize the connect calls per object.
Just to make it easy on the eyes.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
f8f87b7294 Settings update: Move preferences sync / initialization
Move Preferences sync / initialization out of the planner
widget prerferences to the ObjectWrapper.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
12eccda523 Settings update: Fix Facebook Widget to use the SettingsObjectWrapper
Fix facebook widget to use the SettingsObjectWrapper instead
of figthing our complementary Settings each call.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
5651abfd75 Settings update: Simplify code by using the SettingsObjectHelper
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
83236f7e9e Settings update: Some code cleanup
The only block of code that I removed here is because the
QSettings preferences that is being read is the exact one
that we populate on the prefs.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
a1b22797ca Settings update: Remove uneeded includes
and comment out questionable code.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:45 -07:00
Tomaz Canabrava
9299e3c42b Settings update: Correct comment
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:44 -07:00
Tomaz Canabrava
ee91002fdb Settings update: Remove unused include and add FIXME comment
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:44 -07:00
Tomaz Canabrava
db8e8957ab Settings update: Add "Dive Computer" settings to SettingsObjectWrapper
For some reason, the dive computer settings weren't in the
settings prefs. This moves it, makes the boilerplate on Settings
ObjectWrapper and make things compile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:44 -07:00
Tomaz Canabrava
b264c3e367 Settings update: Remove unused include & variable.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:44 -07:00
Tomaz Canabrava
b76c1846bb Settings update: Simplify Update Manager
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 11:40:44 -07:00
Tomaz Canabrava
5c8b87b5fd Settings update: Add UpdateManagerSettings to SettingsObjectWrapper
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:58:13 -07:00
Tomaz Canabrava
4f2057cd30 Settings update: Fix "Units"
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
b5e98ec993 Settings update: Fix "Network" and "CloudStorage"
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
81d5d82b7b Settings update: Clean up save user id local
So, prefs.save_userid_local is being set outside of
a preferences set (it's set to true and false while
loading the files via xml or git) and because of that
I had to bypass a few method calls.

When something triggers a preferences change, the
application will be notified that the preferences
changed, thing that I couldn't do while reading the
xml or git because that should be local-only.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
048379cc2b Settings update: Fix "Language" settings
Save the language settings using the SettingsObjectWrapper.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
bc95138f96 Settings update: Use internal prefs structure to read preferences
Don't use a QSettings to read properties, it's really
easy to mispell something. Just use the internal prefs structure.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:40 -07:00
Tomaz Canabrava
906d62ac7a Settings update: Fix settings in PreferencesGraph class
Use the SettingsObjectWrapper.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:55:36 -07:00
Tomaz Canabrava
93c19b18a7 Settings update: Fix "geocoding"
Use the SettingsObjectWrapper to access "geocoding"

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:46:38 -07:00
Tomaz Canabrava
8f05afcda3 Settings update: Fix "General Settings", "Display", and "Animation"
First commit in the series that will unify the way to use,
save, and update settings in the core. This fixes the usage of
"General Settings", "Display", and "Animation" to use the
SettingsObjectWrapper.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-27 10:46:32 -07:00
Dirk Hohndel
a5cf8aaa21 Android build: try to create APK that works on Android 7.0
It appears that instead of statically linking against ssl/crypto/ssh2, you
instead have to dynamically link against it and then bundle the library in
the APK. The documentation is not 100% clear and I don't have an Android
Nougat device to test this with, so for now this is an attempt.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-08-24 13:36:32 -07:00