Commit graph

13923 commits

Author SHA1 Message Date
Berthold Stoeger
fbe1144eaf Dive pictures: use modelReset signal when reseting picture list
In the old code a combination of removeRows()/insertRows() was used
to signal a model reset.

Replace this by a single, modelReset signal. This saves a call to
plotPictures() and will allow us to be smarter in the future,
when removing pictures.

Reset-model and remove-items are semantically different.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-21 22:17:28 +03:00
jan Iversen
3646fa800b iOS: copy libdivecomputer.log to clipboard
Read libdivecomputer.log file and append to clipboard

Remark, subsurface_open is not available in iOS so using
QFile instead.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:57:14 -07:00
jan Iversen
4a872f74a4 iOS: updated text in About to reflect logs not log
Both subsurface.log and libdivecomputer.log are on the clipboard.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:57:14 -07:00
jan Iversen
997251d43a iOS: store libdivecomputer.log in documents (same dir as app log)
Make location of subsurface.log and libdivecomputer.log consistent

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:57:14 -07:00
jan Iversen
571965ec6d mobile: removed setting for libdivecomputer.log
Users need a simple way to report download problems. Asking them
to go into settings, activate logging, and repeat the download
is too much.

libdivecomputer.log will always be generated, but overwritten, with every
download, so the latest log is ready.

The download is very slow due to BT, so there are no impact of having the log
active, neither in terms of size (a concern on small mobiles) or write time.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:57:14 -07:00
jan Iversen
67838de5bc iOS: qt-ble.cpp remove unsupported event.
QEvent::DeferredDelete is not supported in iOS

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:46:41 -07:00
jan Iversen
37ac354291 profile-widget: divepixmapitem.cpp, silence unused parameter
remove parameter name for not used parameter, to silence
unused warning.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:31:16 -07:00
jan Iversen
158be64883 profile-widget: profilewidget2.cpp, silence unused parameter
Add Q_UNUSED for not used parameter

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:31:16 -07:00
jan Iversen
46ff506096 build-system: iOS only turn off specific warnings
Turning off all warnings (-w) was too radical.

Only turning off specific warnings.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:26:56 -07:00
jan Iversen
d7e31ebbcd iOS: get rid of ios/Subsurface-mobile
Having a split between ios and ios/Subsurface-mobile is just confusing
and without a practical reason

Move files from ios/Subsurface-mobile to ios and update .gitignore

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-20 11:35:28 -07:00
jan Iversen
16555e663b iOS: remove duplicate of deployment.pri
one deployment.pri is enough

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-20 11:35:28 -07:00
jan Iversen
4c8ed5a5ae QML UI: allow changing the connection ID
When downloading with bluetooth, changing connection did not work.
The new selection was not passed to the download thread.

Fixes #1274

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-20 11:35:28 -07:00
Dirk Hohndel
d8fa24dcd8 Travis: don't fail Linux build when .zsync is missing
It seems that sometimes the AppImage tooling gets confused and doesn't
create a .zsync file. That should cause Travis to fail.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-20 11:35:28 -07:00
jan Iversen
96079d7e6a build-system: libgit2 depends on libcurl and libssh2
When building with -builddeps on a "virgin" mac, configure
of libgit2 could not find libcurl and libssh2

moved building of libcurl and libssh2 in front of libgit2

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-20 08:12:10 -07:00
jan Iversen
aab33694f2 build-system: corrected -build-deps problem
Missed a "cd $SRC" so when building with
-build-deps the script broke

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-20 08:12:10 -07:00
jan Iversen
d8227c4a70 core: marked unused parameter
Add Q_UNUSED to unused parameter

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-20 08:11:29 -07:00
Dirk Hohndel
dce7e46766 Mac: don't try to copy libraries we got from Homebrew
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-19 21:22:31 -07:00
Dirk Hohndel
d417d717b9 build-system: change the logic when to build what
Specifically, don't conflate needing libgit2 with the Mac -builddep
argument, and when determining if we need to build libgit2 on Linux,
make sure to also check for a version that we may have built in a
previous run of the build.sh script.

This commit is much easier to understand with
  git show -w
as it contains quite a bit of simple indentation change.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-19 21:22:31 -07:00
Dirk Hohndel
14d18276e4 Travis: add secondary Linux build target
The goal is to reduce the overall wall clock time of our test builds.

This secondary Linux target uses the no-sudo container setup with a Qt
5.10.1 backport and tests the build without BT support as well as the
mobile build (but not the full desktop build and doesn't create an
AppImage as the pre-built Qt5.10.1 is missing QtWebKit).

In exchange we remove the no-bt and mobile build from the existing linux
target.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-19 21:21:46 -07:00
Dirk Hohndel
1faa5d7ae1 build-system: don't always build qtserialbluetooth.cpp
This should only be built if we have BT support enabled.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-19 16:49:05 -07:00
Dirk Hohndel
6a91611e90 build-system: updated OpenSSL and libusb for Android
These are the latest, supported versions for OpenSSL. I have not tested
if Android would work with OpenSSL 1.1.

The lower versio for libzip is still required as libzip 1.2.0 doesn't
compile for Android.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-19 14:15:11 -07:00
Dirk Hohndel
5047e90857 Android: set target API level to 26
This doesn't affect the minimum we support, but a target level of at
least 26 will be required starting in August in order to be able to
upload to the Google app store. This is equivalent to targeting Android
8.0. Google plans to bump this target API level every year.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-19 14:15:11 -07:00
Dirk Hohndel
5b9c28e1c0 Mac: support running Subsurface-mobile
Copy the required QML modules into the app bundle.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-19 14:13:46 -07:00
jan Iversen
95bfd3af29 iOS, supress warnings.
Changed .pro file to supress warnings
clang does not allow all of the issued warnings to be
supressed with -Wno-foo, so instead doing -w

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-19 14:05:23 -07:00
jan Iversen
090eb1ee34 iOS, remove linker warnings (version mismatch).
The Qt libraries are compiled as iOS 10.0, we link
as iOS 8.0, this is a problem waiting to happen. First
time we use a Qt function that uses a iOS 10.0 specific
function the app will crash.

Bumping iOS minimum version from 8.0 to 10.0
Removing the 76x icon, which are not valid from 10.0 and forward

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-19 14:05:23 -07:00
Berthold Stoeger
7836a78dca Profile: minor coding style issues concerning axis-ticks
1) Fix the English of a comment.
2) Remove a number of int-to-double compares:

Make "steps" an integer variable (the number of steps).
Rename the old double "steps" variable to "stepsInRange". This gives
a non-integer number of steps and is necessary to calculate the
correct step size

3) Replace a "x = x/y" by a "x /= y" construct.

4) Remove an unnecessary if clause.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-19 07:48:28 -07:00
Berthold Stoeger
555f2f9565 Profile: Fix leak in animation
If animDelete() was called with prefs.animation_speed == 0, the
object would not be marked for deletion, as opposed to calling
with prefs.animation_speed != 0. This would leak the objects.

Therefore delete the objects if called with prefs.animation_speed == 0.
The caller doesn't keep a reference to the objects. Therefore,
a plain delete is fine, as opposed to a deleteLater().

While touching this function, use the function-pointer version
of connect().

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-19 07:48:28 -07:00
jan Iversen
ffdaba6c84 build-system: added get-dep-lib to android/build.sh
Integrated get-dep-lib in android/build.sh

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-18 16:58:16 -07:00
jan Iversen
8e2aaa4242 build-system: update get-dep-lib with Android fix.
Android build uses wget and not curl.

Currently android uses older versions of some libs, due to that
a new switch is added temporary.

Old version tested for curl and if not found set the different versions,
however this is not a stable method for obvious reasons

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-18 16:58:16 -07:00
jan Iversen
a181020b19 mobile: add "Copy log to clipboard" button
on iOS it is practically impossible to copy the App log
to e.g. a mail! in iOS 11 the log file is stored within
the subsurface container and you first need to copy (actually
using the clipboard) out from there to the "normal" document
shared space, before it can be used.

At least iOS users (and I believe Android users) are not really
used to work with files, so the process is not easy to document
in an understandable way.

The alternative is to provide a button, which simply puts the
log on the general clipboard, allowing it to be pasted in a
multitud of applications.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-18 12:43:15 -07:00
jan Iversen
2a0ee09cb2 core: solved PictureEntry defined as class and struct.
PictureEntry was defined as class in imagedownloader.h and
as struct in divepicturemodel.h

A class has a vptr in front, so the difference is real at least
for the clang compiler.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-18 12:42:48 -07:00
jan Iversen
6034b25cb2 core: removed clang warnings from dive.h
interpolate, rel_mbar_to_depth, gas_mod and
gas_mnd returns int but uses
a function that returns long, causing clang to
warn about conversion loss due to implicit conversion.

Adding a cast, shows that it is correct.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-18 21:27:37 +03:00
jan Iversen
262e994bbc core: removed clang warnings from units.h
lbs_to_grams and to_feet returns int but uses
a function that returns long, causing clang to
warn about conversion loss due to implicit conversion.

Adding a cast, shows that it is correct.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-18 21:27:37 +03:00
Berthold Stoeger
10cabcdb69 Plannernotes: '\0'-terminate ICD-buffer
When creating the ICD-notes the membuffer was not '\0'-terminated,
leading to output of stale data.

Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-18 15:11:04 +03:00
jan Iversen
21bf811a57 core: corrected wrong default email
Typo in email.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-17 11:32:54 -07:00
jan Iversen
1a86c17e28 build-system: changed build.sh to use get-dep-lib
get-dep-lib has been integrated into build.sh, which
ensures different platforms use the same versions etc.

travis is a frequent user of build.sh, but on a mac it runs
without -build-deps and instead used cached versions of the
library. This setup is alo supported

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-17 11:16:50 -07:00
jan Iversen
1ed8c87d63 build-system: enhanced get-dep-lib with "single"
Added the posibility to fetch a single third lib.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-17 11:16:50 -07:00
jan Iversen
6d3637fce0 build-system: made get-dep-lib faster and more robust.
Secured git work only happens when cloning a dir.

There is a version for hidapi, but scripts/build.sh
(which are the source for that part of depend) has a
line:
	# there is no good tag, so just build master
and then continues with master, so it should be good
enough for get-dep-lib as well.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-17 11:16:50 -07:00
jan Iversen
77b9a62f7f iOS: added get-dep-lib to build.sh
Removed all 3rd party download/clone, and used common
get-dep-lib instead

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-17 11:16:50 -07:00
Anton Lundin
b55c5d55e6 android-build: Build on ubuntu bionic on travis
This way we ensure we can build on the latest LTS, and not just a old
lts.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-05-17 07:36:44 -07:00
Anton Lundin
a2065334bb android-build: Remove old libgit2 special handling
And replace it with something that works on a modern cmake.

The upside with using the right linker, we get the symbols resolved
correctly so we don't need to regex the code.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-05-17 07:36:44 -07:00
Anton Lundin
75205240df android-build: Stop installing ant, we're using grade
Since about a year ago qt-android-cmake shifted to using gradle instead
of ant, and the android sdk's stopped supporting ant to.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-05-17 07:36:44 -07:00
Anton Lundin
05e6c2dfaa android-build: Simplify and correct
This simplifies the code and uses correct quoting for variables.

This also fixes the sha1-stampfile handling so that we don't build
libdivecomputer every time.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-05-17 07:36:44 -07:00
Anton Lundin
a8c47cb75d android-build: Build googlemaps plugin same way as others
This reworks the googlemaps build to be more like the other builds, with
the same pattern and way of detecting what we need to do, and when we
need to rebuild it.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-05-17 07:36:44 -07:00
Anton Lundin
d12e842c68 android-build: Use sed -i instead of home rolled variant
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-05-17 07:36:44 -07:00
Anton Lundin
fa95a7c56a android-build: Use subsurface source variable
We already have a variable pointing to the source dir for subsurface, so
use it.

This way we can build out of tree, in any directory.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-05-17 07:36:44 -07:00
Willem Ferguson
346bb9f31f Bugfix: Saving divemode to xml and to git
There is a space character missing in the xml generated by the
present code. Insert a space character.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
2018-05-17 07:35:58 -07:00
Willem Ferguson
773ee0d990 Update user manual for CCR and pSCR dive logs
Update the text pertaining to CCR and pSCR dive logs to include the
changes with respect to:
1) Colour of CCR setpoint graph and pSCR OC-equivalen pO2 graph.
2) Display of bailout information on dive logs.
3) Preferences tab allowing setting pertaining to the above.

This is the first of a few PRs with updates to the user manual
relating to CCR and pSCR dives.

Correct some typos.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
2018-05-17 17:32:24 +03:00
jan Iversen
facb524585 iOS, update Info.plist.in note
Info.plist is no longer generated by qmake but by build.sh,
and it is more interesting to highlight the fact that it is
open software

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-17 07:29:49 -07:00
Murillo Bernardes
97090aeb47 mobile: fix wrong coords when saving new location
This one place it was not being multiplied by 1000000,
as expected for degrees_t.

Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-05-17 07:25:56 -07:00