Commit graph

12681 commits

Author SHA1 Message Date
Tomaz Canabrava
15c4fadde9 [Facebook] Use the nonblocking calls to post on fb
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:54:03 -07:00
Tomaz Canabrava
e662ce1cec [Facebook] Fill the info struct
This will be used to send the profile to Facebook

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:54:03 -07:00
Tomaz Canabrava
dd17c6355d [Facebook] Remove broken function
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:54:03 -07:00
Tomaz Canabrava
1d8eb0d78a [Facebook] Code organization
Create the variable near its use.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:54:03 -07:00
Tomaz Canabrava
df166247af [Facebook] Signal that the album is found
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:53:59 -07:00
Tomaz Canabrava
a2734e6aaf [Facebook] New method, grabProfilePixmap
Just some code organization

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:52:03 -07:00
Tomaz Canabrava
5778dceb52 [Facebook] Prepare the FacebookInfo struct
This will hold the information for the profile upload.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:51:53 -07:00
Tomaz Canabrava
ba8e6878a8 [Facebook] Remove dead code
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-02 08:51:19 -07:00
Rick Walsh
8b5c5674b1 VPM-B profile: initialize first_ceiling_pressure
If we don't set first_ceiling_pressure at start of dive, a shallow ceiling can
be shown when it shouldn't be.

Fixes #584

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-01 23:58:55 +03:00
Robert C. Helling
1f50485732 More VPMB state in special structure
... and reset deco information in profile ceiling computation.

The planner test then needs to know about the struct holding the deco
state.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-01 23:58:55 +03:00
Stefan Fuchs
7713c7e607 Use helper function dive_endtime() where apropriate
Calculating dive.when + dive.duration doesn't always give the correct
endtime of a dive especially when a dive has surface interval(s) in
the middle.
Using the helper function dive_endtime() fixes this issue.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-01 23:55:37 +03:00
Miika Turkia
325c4459ad Update sample_start and sample_end pressures
When we merge dives, the sample_start and sample_end pressures are only
used in-memory for displaying data to the user. However, we should
update them as well as this will show the user the correct data in the
equipment/cylinder and i.e. SAC calculation.

Fixes #577

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-10-01 11:31:18 +03:00
Dirk Hohndel
571918feaa Random whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:57:34 -07:00
Tomaz Canabrava
f159802053 [Facebook] Add hability to choose size of profile
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:57:34 -07:00
Tomaz Canabrava
9b1a949a39 [Facebook] Resize the profile before sending it
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:57:34 -07:00
Tomaz Canabrava
2db4f626ed [Facebook] Only mark as connected if user id is received
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:57:34 -07:00
Tomaz Canabrava
a6aeaf897a [Facebook] create userIdReceived slot
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:57:34 -07:00
Tomaz Canabrava
689dcf1058 [Facebook] Mem leaks
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:57:34 -07:00
Tomaz Canabrava
475dfe1194 [Facebook] Use only one Network Manager
Fixes quite a few memory leaks.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:57:28 -07:00
Dirk Hohndel
7b8832bc0b [Facebook] fewer UI freezes while accessing facebook
Use signal / slots on the networkreply instead of freezing the event
loop.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:45:28 -07:00
Tomaz Canabrava
c8c9a5dc65 [Facebook] conversion to new connect syntax
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:44:39 -07:00
Tomaz Canabrava
f6ac79296e [Facebook] Dont use deprecated feature
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:43:45 -07:00
Tomaz Canabrava
73c242b6eb [Facebook] Use unblocking call for QNetworkRequest
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:43:45 -07:00
Tomaz Canabrava
8ce4692b5c [Facebook] Use QByteArray directly
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-09-29 12:43:41 -07:00
Jan Mulder
e2aaa43d8c QML UI: cleanup some whitespace and string formatting
This addresses some review comment on whitespace and translated
string formatting.

In the string formatting, a tiny additional change is made.
I wanted the email address in the explanation text in a bold
font. Using the HTML <b> for this, removed the /n newline
characters in the output. Apparantly, mixing these two
formatting styles does not work. No problem, replaced the
/n to HTML style too.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29 08:13:25 -07:00
Jan Mulder
dbed88bd81 QML UI: rework single credential page to two pages
This commit tries to implement most of issue #515. It reworks the
one credential page, which its dynamic PIN part, into two pages.
Main driver of selecting one of the two pages is the showPin
boolean. Page 1 contains the email/passwd field (and the
option to use a no cloud setup). Page 2 only contains the PIN
part (and the option to cancel the process).

The Kirigami central button does not seem very handy here. We
need, for example, a cancel, sign-in and register, only register,
etc. buttons, which are not easy to handle in specific icons.
Therefore, normal pushbuttons are chosen to deal with user
interaction, and the Kirigami button is removed from these
pages.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29 08:13:25 -07:00
Jan Mulder
81eb8466b2 QML UI: rework cloud credentials block
Previously, we could edit the cloud credentials in basically two
places. At startup of the app from a fresh install (and no previous
data on the device), and from the settings. Issue #515 proposes
only one way.

However, we need a way to access the new credential UI pages, so
that the pages at a fresh install of the app can be reused,
for example for account switching.

This commit replaces the settings cloud credentials block by
a simple (not editable) display of the current credentials, and
a button to access the initial pages, for all management tasks
on the credentials.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29 08:13:25 -07:00
Jan Mulder
0af64e4986 mobile: make sure that the old credential status is correct
This commit is just a precaution. It makes sure that the old
(aka previous) credential status is correctly set on all changes
of this status.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29 08:13:25 -07:00
Jan Mulder
85dfdaa3e5 mobile: only deal with localrepo in NOCLOUD mode
This is a very subtile bug. Testing/developing on the desktop for mobile,
with a normal logbook in a git repo, resulted in a surprising effect.
When swichting from a cloud account to a NOCLOUD situation, the no cloud
repo was (not always) reset to the NOCLOUD_LOCALSTORAGE, but to the
normal logbook. Resuling in commits in the wrong repo.

This can easily be solved by setting the filename to NOCLOUD_LOCALSTORAGE,
when switching to NOCLOUD mode.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29 08:13:25 -07:00
Jan Mulder
6ea3fd3d92 mobile: do not care about email/passwd when NOCLOUD
In case the credential state is NOCLOUD, the saving of credentials
in the preferences was suppressed in case of invalid data in the
email/passwd fields.

There is no reason to check these fields for correct input, as they
are not used in case of NOCLOUD mode. A simple if statement is added.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-09-29 08:13:25 -07:00
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