Commit graph

12501 commits

Author SHA1 Message Date
Jan Mulder
cf8e87545f mobile: add helper function cancelCredentialsPinSetup()
As written in 8d9ad3cfea7e4c0875, the user needs to be able
to exit the PIN entry UI, in case no PIN can be received due
to a wrong email address.

The simplest way seems to just clear the cloud credential data,
and let the user try again. Obviously, we could argue if the
exact previous state of the 1st credentials screen could
be restored, but as it is only 2 simple fields, of which
it is higly likely that the email adress is misspelled (and
the password hidden), it seems overly complex to implement.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29 08:13:25 -07:00
Jan Mulder
801b1bc5f5 mobile: propagate "still PIN required status"
Makes sure that the CS_NEED_TO_VERIFY status is carried forward
and sets the showPin flag that triggers the 2 different states
in de QML UI.

The new credential UI will have one page for username/passwd,
used for setting up an account or switchting to a different
account, and a second page to enter a PIN only.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29 08:13:25 -07:00
Jan Mulder
46f10362fc mobile: do not go to NO_CLOUD status from UNKNOWN
In case the credential status is UNKNOWN, and the cloud username
and password are empty, do not go automatically to NO_CLOUD status.
This is (again) preparation for future work on credential management.

For example, the user entered an email address with a spelling
error, so does not receive a PIN code email. This user needs a
way out, so there needs to be a <cancel> button on the PIN code
screen. And the most logic was of cancelling is emptying the
entered username/passwd and let the user try again.

Without this change, the user immediately gets into the (somewhat)
final NO_CLOUD state, which will result in (very) confused users.

With this change, there is exacly one way (left) to get into a
NO_CLOUD setup: hitting the proper button, so a deliberate user
action.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29 08:13:25 -07:00
Jan Mulder
2e91de9d95 mobile: initialize credential data in one place
It appears that the onCompleted of the StartPage item is triggered
before the onCompleted of the rootItem. This is logical as the
Startpage is a child of the rootItem. And, yes, this does matter.
As the divelist also contains the logic for initial cloud
registration (and is the default page shown in a state where
the cloud credentials are valid (CS_VERIFIED state)), we need to
know the correct credential state at start of the app.

The move of this one line of code makes sure of that, in addition
to setting the credential state from the preferences. Now, the
setupActions function can reference correct credential data.

This is further preparation for a better cloud creation
process from mobile.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29 08:13:25 -07:00
Robert C. Helling
e903c6bd1a Paragraph in manual about off-gassing
The VPM-B model assumes off-gassing only happens during ascent
which for us are that part of the dive where dp->entered is
false. This is wrong for dives with manually entered waypoints
in the ascent, as discussed in

See #601.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-09-29 01:02:55 +03:00
Miika Turkia
2a29d4a4ba Save Subsurface version to libdivecomputer logfile
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-09-28 08:51:34 +02:00
Rick Walsh
1bc5050eff Planner prefs: set all ascent rates to 9m/min
9m/min (or 10m/min) is the ascent rate assumed by Buhlmann and navy tables,
and the default of most other planning software and dive computers.

Setting the default to 9m/min allows the default behaviour to be consistent
with "expected" behaviour, but does not prevent the user from changing the
preference.  There is disagreement between some users whether the final ascent
ascent duration should be considered when determining the length of the final
stop.  This change does not alter that at all, but at 9m/min, the difference
is <1min.

See #592

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-09-28 06:11:51 +02:00
Dirk Hohndel
0f7c74f400 Update translation source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-26 23:35:40 -04:00
Federico Masias
777cf6c3fd Change Facebook upload description to eliminate confusion
Signed-off-by: Federico Masias <fede@masias.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-26 23:34:38 -04:00
Dirk Hohndel
7466766584 Add Contributing file
We already had this on our website, but GitHub suggests to have
this in the repo as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-26 23:28:50 -04:00
Lubomir I. Ivanov
7381458325 github: add templates for pull requests and issue reports
.github/ISSUE_TEMPLATE.md will be used when the Github users
create new issues.

.github/PULL_REQUEST_TEMPLATE.md will be used when the Github users
create new pull requests.

The markdown supports HTML comments (<!-- comment -->), which
can instruct the Github user how to create a detailed PR or issue
report.

Most big Github projects use such templates and these can help
the collaborators to examine the PRs and ISSUES faster.

Fixes #598

Reviewed-by: Dirk Hohndel <dirk@hohndel.org>
Reviewed-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-09-26 20:45:07 +03:00
Stefan Fuchs
f0de9e77b8 Windows NSI installer: Remove qml folder on uninstall
Do remove also the (new) qml folder on uninstall.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-09-24 22:20:23 +03:00
Miika Turkia
ae34f62489 Support gas changes on Shearwater XML import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-09-24 17:49:10 +03:00
Miika Turkia
10216f5e3e Add required qml modules to Ubuntu packaging
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-23 00:59:14 -04:00
Jan Mulder
f442031fdd BLE: big writes to connected DC (OSTC firmware)
Most writes to a connected DC are small, typically some
command bytes to get DC in download mode, or to set
some parameter. All this just worked over BLE,
however, sending a full firmware update (on an
OSTC device) failed, as the underlying BLE interface
can only handle small 20 byte BLE packets at once.

So, send max ble->packet_size chuncks at once.

Tested for the following cases (linux desktop with
OSTC3 over BLE):
1) normal download of dive data.
2) read and write settings from configure UI
3) update firmware (from 2.15 to 2.15)

And to my surprise, no flow control credit administration
is required here.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-22 02:30:58 -07:00
Dirk Hohndel
bb1df1218d BLE support: simplify write function
It seems clearer to bail when list is empty...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-20 19:19:25 -04:00
Dirk Hohndel
16d9b0c790 DC download: fix 'no new dives' message
Stupidly, commit 731d9dc9bd ("DC download: tell user when no new dives
were found") was missing the conditional when to show that messages.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-20 18:44:14 -04:00
Philippe Massart
9dd8726d12 Updated French documentation
This is a manually created single commit to incorporate the changes in
https://github.com/Subsurface-divelog/subsurface/pull/502

Closes #502

[Dirk Hohndel:]
I was able to manually merge that branch but it created a complete mess
out of the tree and brought several dozen commits in a second time, so
I gave up and instead created this single commit.

Signed-off-by: Philippe Massart <philippe@philmassart.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-20 09:25:46 -07:00
Robert C. Helling
5b080bedde Remove option to apply GFlow at maxdepth
This option should have never been there. This is not how
gradient factors are supposed to work. It would only trick
users to use the wrong value..

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-09-20 08:54:41 -07:00
Robert C. Helling
a6f186279f Add a checkbox to turn off plan variations
... as those come with a performance penalty

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-09-20 08:54:41 -07:00
Lubomir I. Ivanov
5e9bdce195 mapwidgethelper: support Qt 5.5.x
MapWidgetHelper::calculateSmallCircleRadius() uses
the second argument (boolean) of QDeclarativeGeoMap::toCoordinate()
and QDeclarativeGeoMap::fromCoordinate(), which isn't supported
in Qt 5.5.x and errors will be thrown on runtime.

This argument usage is redundant for the calculateSmallCircleRadius()
use case.

If the argument is set to "false" it tells the map to avoid
clipping the viewport and always return a valid QPointF/QGeoCoordinate.
Given that calculateSmallCircleRadius() only works with the
map center - i.e it's called like so in MapWidget.qml:
    onZoomLevelChanged: mapHelper.calculateSmallCircleRadius(map.center)

The only way for the radius estimation to fail is if the map widget
width is smaller than SMALL_CIRCLE_RADIUS_PX * 2 = 52px, which is not
possible as the MainWindow splitter prevents it.

If the map widget becomes that small it would be hardly usable,
yet no errors should be thrown related to this change.

Tested-by: Stefan Fuchs <sfuchs@gmx.de>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-09-20 08:53:41 -07:00
Stefan Fuchs
6a4b44a3d4 Correct comment for deco subsurface_conservatism_factor
This adapts the comment according to the change done in
bd89e33e76

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-09-20 08:52:36 -07:00
Dirk Hohndel
753c00a493 BLE on non-Apple OSs: switch back to using BT address
While this interface is deprecated, too much in our existing code depends
on being able to create the QLowEnergyController with just the address.

Additionally, createCentral() is new in Qt 5.7 and therefor this broke
builds on Linux distros that are still on 5.6.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17 16:31:07 -07:00
Dirk Hohndel
ae209a3d9f Merge branch 'macBLE' of github.com:Subsurface-divelog/subsurface 2017-09-17 15:40:16 -07:00
Dirk Hohndel
49fe120d95 DC download: show info messages on Mac
For some reason the progress bar on macOS doesn't show the
progress text. This creates a label below the progress bar
and shows the text there instead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17 15:04:14 -07:00
Dirk Hohndel
d03fabd373 DC download: better message at beginning of download
Especially on BT/BLE devices, where there is a longer negotiation
phase at the beginning of the download, this seems more user friendly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17 15:02:11 -07:00
Dirk Hohndel
605400a029 DC download: don't clear message if no dives downloaded
Otherwise the text telling the user that no new dives were
found will be deleted right away.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17 14:49:37 -07:00
Dirk Hohndel
731d9dc9bd DC download: tell user when no new dives were found
Otherwise it almost looks like something went wrong with the download.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17 14:46:44 -07:00
Dirk Hohndel
90d73924c2 BLE: try to pick the correct descriptor to write to
The ordering on Mac appears to be random, but after looking through the
various successful logs of BLE downloads, it seems we always wrote to the
ClientCharacteristicConfiguration descriptor. So try to find that one first,
and only grab the first descriptor in the list if we didn't find a
ClientCharacteristicConfiguration descriptor.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17 09:58:11 -07:00
Dirk Hohndel
26e610c3f4 BLE: create controller from QBtDeviceInfo
Creating it from an address is a) deprecated and b) impossible on Mac or iOS.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17 09:58:11 -07:00
Dirk Hohndel
db38a7023d BLE: helper function to get QBtDeviceInfo from UUID
Right now this will only work if you scan for your BLE dive computer every
time. Ideally we should simply initiate a scan and look for that address if
it's not found in the hash.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17 09:57:57 -07:00
Dirk Hohndel
e5b7fb74b4 BLE: on Mac/iOS use UUID instead of address
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17 09:56:28 -07:00
Dirk Hohndel
5695ef956b BLE: if there's no address, use the UUID instead
This is not just for IOS, the same applies on a Mac. But I see
no issue with enabling that for all OSs.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17 09:54:04 -07:00
Dirk Hohndel
08e4d2dc5e cmake: enable BLE on Macs
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17 09:54:04 -07:00
Dirk Hohndel
2d2bb95482 Mac packaging: add option to make bundle without creating DMG
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-17 09:54:04 -07:00
Robert C. Helling
58b7c6f8ef Don't comput plan variations when not in the planner
Fixes #565

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-09-16 08:36:59 -07:00
Stefan Fuchs
dc0f011920 Correct incorrect variable qt_version instead of QT_VERSION in build.sh
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-09-16 08:36:30 -07:00
Stefan Fuchs
19df57d7d3 Remove some very small marble leftovers
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-09-16 08:36:30 -07:00
Lubomir I. Ivanov
5eeefbff8b mapwidgetcontextmenu: use a QtQuick 2.0 import
Following on beb0d5703a, the context menu seems to work fine
with a much older QtQuick import - version 2.0.

The 2.7 import is technically a development leftover
and a minimal version should have been considered earlier.

On older Qt setups (e.g. 5.5.x) this might throw a:
'module "QtQuick" version 2.6 is not installed'

Reported-by: Stefan Fuchs <sfuchs@gmx.de>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-09-16 08:35:29 -07:00
Dirk Hohndel
5e1ad4948e latest translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-15 22:00:13 -07:00
Dirk Hohndel
5e3bf0b4fa Update translation source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-15 21:24:54 -07:00
Stefan Fuchs
8d8e694b0d End tankbar at the correct end of the dive plot
Go back to the old startegy of retrieving the correct end of the dive
plot by looking at the plot data instead of looking at dc->duration.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-09-15 09:01:10 -07:00
Stefan Fuchs
803e98befe MXE build script: Mention googlemaps plugin in comments
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-09-15 08:58:19 -07:00
Stefan Fuchs
26d9944013 MXE build script: Remove hint to use old MXE version
Meanwhile (after removing marble) it seems to be a good choice to use
latest MXE version with currently Qt 5.9.1.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-09-15 08:58:19 -07:00
Seppo Takalo
a2a1dfdf9f Use dive ID instead of dive number when importing from Shearwater db
Dive IDs are unique but same dive number can appear multiple times within
the same database. This can happen for example when user changes the
"next log number" from his computer.

Signed-off-by: Seppo Takalo <seppo.takalo@iki.fi>
2017-09-15 08:57:03 -07:00
Seppo Takalo
f7db0c705b Convert usage of atof() to strtod_flags()
The provided strod_flags(str, 0, 0) should work as a drop in replacement
for atof() but does not care about locales which may cause atof() to fail.

strtod_flags() would allow checking of conversion result, but I did not
change the existing logic. This was just regexp search&replace change
to get rid of atof(). I use flags 0 to get more relaxed conversion.

Fixes #574

Signed-off-by: Seppo Takalo <seppo.takalo@iki.fi>
2017-09-15 08:57:03 -07:00
Dirk Hohndel
d37bb466fe First stab at ReleaseNotes for the next version
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-15 08:50:15 -07:00
Linus Torvalds
e94af2c0b7 Properly clear sensor pressure data for synthetic plotinfo entries
We only cleared the first sensor data when we created new synthetic plot
info entries, because we only used to have one (well, we had the o2
data, but apparently nobody ever noticed that it didn't get properly
interpolated, probably because people who have CCR dives with o2
pressures are few, and the pressure drops are gradual anyway).

Clear all the pressure data, so that the interpolation code doesn't
think we have some existing real sensor data for the plot info entries
in between proper sample entries.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-15 16:29:00 +02:00
Linus Torvalds
41bbae31f5 xml: save the right sensor pressure when we have multiple sensor readings
The XML saving code got the multi-sensor case completely wrong, because
it still had one place where it would always save the first pressure,
rather than the pressure from the right sensor.

This was hidden by the fact that old data would be saved using the
legacy model that only ever used the first sensor slot.  Only if you
actually had multiple sensor slots used would the bug trigger.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-15 16:28:07 +02:00
Miika Turkia
a8ce78bf77 Refine cylinder usage tests
Consider cylinder used also if the first and last sample pressure differ
enough

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-14 07:33:55 +02:00