Commit graph

14218 commits

Author SHA1 Message Date
Guillaume GARDET
65e823b21d Documentation: update french manuals
Signed-off-by: Guillaume GARDET <guillaume.gardet@opensuse.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-26 14:26:17 -07:00
Murillo Bernardes
2de814fec8 desktop: fix multi-keystroke input on location
When the tooltip is hidden QInputMethodEvent is handled
by QLineEdit and works properly.
When the tooltip is visible DiveLocationListView gains
focus and receives QInputMethodEvent, without handling
them properly.

This patch just forwards the event back to the QLineEdit
object.

Fix #1405

Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-06-26 08:06:07 +02:00
Dirk Hohndel
4fa19534a9 Latest translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-26 07:38:51 +08:00
Dirk Hohndel
d309bd43e6 Update list of support dive computers
This is simply extracted from libdivecomputer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-26 07:38:51 +08:00
Dirk Hohndel
df4638917a Update README.md for 4.8
And mention the continues releases on GitHub.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-26 07:38:51 +08:00
Dirk Hohndel
f998b59900 QML UI: don't use anchors within Layouts
Qt 5.11 adds useful warnings when code attempts to use anchors within
Layouts and even tells you how to fix things.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-26 03:56:44 +08:00
Dirk Hohndel
cda1961d80 Update mailmap
Might as well get it right...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25 21:04:42 +08:00
Dirk Hohndel
3bd59a9382 Latest translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25 20:43:28 +08:00
Dirk Hohndel
d5bc885e8b ReleaseNotes: start preparing for 4.8 / 2.1
Move changes from CHANGELOG to ReleaseNotes and add a few items that
were missing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25 20:28:20 +08:00
Dirk Hohndel
2afd5047e1 Update translation source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25 20:21:13 +08:00
Dirk Hohndel
f61ac686fd tools: keep the log of translation extraction
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25 20:21:13 +08:00
Dirk Hohndel
d35c3c0fbf build-system: detect libdivecomputer changes in MXE build
Automatically trigger a rebuild of libdivecomputer if it has changed
since the last build.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25 20:21:13 +08:00
Dirk Hohndel
dde2049027 QML UI: correctly update the model
In order to trigger the redraw of an edited dive we need to make sure
the model realizes that it has been updated. So far the only way to make
sure this happens reliably appears to be to remove the item and
re-insert it. Seems weird, but with this the bug of not redrawing the
profile after an edit appears fixed.

Fixes #1419

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25 20:20:35 +08:00
Miika Turkia
f638b7ef80 CSV import: support \n as new line on notes field
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-06-25 20:12:06 +08:00
Berthold Stoeger
86988f9cdc Documentation: update CodingStyle.md with more details on translations
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-06-24 20:31:14 +02:00
Berthold Stoeger
db0dd54c37 Localization: make cache thread safe and robust against use-after-free
The old trGettext() was not thread-safe and the returned C-strings
could be freed in the case of empty translations strings. Therefore:

1) Introduce a mutex protecting access to the cache.

2) Never change existing entries, even if the translation string is empty.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-06-24 20:31:14 +02:00
Berthold Stoeger
879cb73b8b Localization: remove gettextFromC::instance()
There were a handfull instances of the kind
1) gettextFromC::instance()->tr(...)
2) gettextFromC::instance()->trGettext(...)

1) is pointless, as tr is a static function.

All instances of 2) were likewise pointless, because trGettext()
returns a C-string, which was then immediately converted to a
QString.

Thus, replace both constructs by gettextFromC::tr(...).

After this change there was only one user of gettextFromC::instance()
left, viz. the C-interface funtion trGettext(). Therefore, remove
gettextFromC::instance() and do all the caching / translating
directly in the global trGettext().

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-06-24 20:31:14 +02:00
Berthold Stoeger
61b8add590 Localization: don't go via C-string in qthelper.cpp
The purpose of the gettextFromC class is twofold:
1) It provides a static storage of C strings if the C part needs
a translation and doesn't want to deal with memory-management.
2) It severs as a catch-all class for translations that do not come
from a proper class (i.e. from helper functions).

The second case was used a few times in qthelper.cpp. By using the
trGettext() function, a cached C-string was obtained. But in every
single instance, this C-string was then back-converted into a QString.
Therefore, use the gettextFromC::tr() function directly, which
returns a QString. Not only is the resulting code simpler - this also
avoids superfluous caching of translation strings.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-06-24 20:31:14 +02:00
Robert C. Helling
8406cbf187 Fix interpretation of dive mode changes upon replan
... by taking into acount that dive planner points refer
to the sement before the waypoint (while change mode
events are concerned with the future of a waypoint).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-06-24 09:35:55 +02:00
Robert C. Helling
4157365c96 Make planner notes divemode aware...
... and fix a problem with setpoint changes shown in the wrong line

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-06-24 09:35:55 +02:00
Robert C. Helling
068b4c65bd When adding new waypoints, use previous setpoint.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-06-24 09:35:55 +02:00
Robert C. Helling
0f77d73df2 Planner: Change segment setpoint according to divemode
When making a segment non-CCR, its setpoint should be 0.
OTOH, when it becomes CCR, use the default setpoint
(or should we try to find the last previous setpoint?)

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-06-24 09:35:55 +02:00
Robert C. Helling
c64e4b159f Copy divemode to Replan
this needs copying the divemode from the dive to the plan.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-06-24 09:35:55 +02:00
Dirk Hohndel
2eb7c2e23f Latest translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-23 22:07:52 +09:00
Dirk Hohndel
67d8f31d94 Update translation source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-23 19:38:39 +09:00
Anton Lundin
d853c477b7 build-system: Only run autoreconf when needed
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-06-22 02:47:58 -07:00
Anton Lundin
207c752396 build-system: Use the correct library name, libftdi1
The library name is actually libftdi1 , not libftdi.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-06-22 02:47:58 -07:00
Anton Lundin
1157ad3faf build-system: Use a list instead of string + regexp
There are actually more datatypes in bash than just strings. One can for
example hold a list of strings in a list, and use that to keep track of
what we're expected to do.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-06-22 02:47:58 -07:00
Anton Lundin
c4bf9e6d6e build-system: Don't fail if tarball is there but no dir
The previous code assumed everything was good to go if just the tar ball
was there, but if it wasn't unpacked, it all went sideways.

This makes it more robust and to actually handle that the tarball might
just be there.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-06-22 02:47:58 -07:00
Anton Lundin
5f4006ae4f build-system: Cleanup script with shellcheck
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-06-22 02:47:58 -07:00
jan Iversen
5df93e084d android/desktop: remove mapWidget from subsurface.qrc
remove mapWidget entries from subsurface.qrc, and
add reference to map-widget.qrc in CMakelist.txt

Android uses the same CMakelist.txt

Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-21 20:27:58 -07:00
jan Iversen
ff88e7ee99 mobile: remove MapWidget from mobile-resources.qrc
remove MapWidget entries from mobile-resources.qrc, and
reference map-widget.qrc in Subsurface-mobile.pro for iOS

Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-21 20:27:58 -07:00
jan Iversen
2b7b7ad8f5 map-widget: add qrc file for widget
Make map-widget self contained, with its own qrc file.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-21 20:27:58 -07:00
Berthold Stoeger
c65617661a Dive pictures: fix loading of remote images without local version
Owing to the recent churn in imagedownloader.cpp, some of the
code was bogus.

Notably, in f60343eebb the code
was changed such that always the local filename was used to access
the images. Yet, the old code remained, which after failure tried
again to access the local picture. This second access can obviously
be removed completely.

More seriously, after failing to load the local version, no
attempt was made to fetch the image via canonical filename. This
could produce the following sequence of events:
  - Import remote image
  - Delete thumbnail and local cache of image
  - Image loading would fail

Therefore, first try to load using local file-location. If
that fails, load using the canonical file-location. To do
so, split the file-access code in two functions. The code
should now be distinctly easier to follow.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-06-22 00:26:02 +03:00
Dirk Hohndel
74d1afc0d5 mobile: iOS/Android: always delete libdivecomputer.log at start
This way the user doesn't inadvertantly end up with information from a previous
run of Subsurface-mobile when they copy the logs to the clipboard.

Not sure we should do the same when building for desktop, so right now it's
only when building for a device.

Reported-by: Thomas Fänge <thomas.fange@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-21 17:17:35 +09:00
Dirk Hohndel
5377706aca FTDI support: try ftdi_open first if the device name is 'ftdi'
It makes no sense to have the OS try (and fail) to open that device name.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-21 16:16:29 +09:00
Dirk Hohndel
b7619553fd core: print the correct message code for download failures
We filled in the missing information and then printed the wrong string.
This fixes that and also makes the strings slightly easier to understand.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-21 16:15:48 +09:00
Dirk Hohndel
05a00f31e9 mobile: better message regarding logfiles
On mobile those area always created and available for simple cut and paste.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-21 15:49:23 +09:00
Dirk Hohndel
6936047538 Update libdivecomputer submodule
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-21 08:43:04 +09:00
Anton Lundin
dcb663e407 Revert "cleanup: remove empty function"
This broke our hook to plumb in our usb open function into libusb, so
this broke ftdi based downloads.

This reverts commit e4530cd5ef.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-06-21 06:28:39 +09:00
jan Iversen
38bf351cc1 mobile/ios: correct whitespaces to coding standard
correct whitespaces to coding standard
in translations.qrc, qml.qrc and deployment.pri

Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-21 04:25:21 +09:00
Linus Torvalds
98bd303d93 qt-ble: purge pending read data when writing
This should never happen, since our interface is bassically synchronous,
but it could happen with delayed replies that came in just after we
decided to re-transmit a command.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-06-20 16:38:04 +09:00
Linus Torvalds
21d6531e45 qt-ble: improve responsiveness of waiting for bluetooth data
Our model of waiting for 100ms before re-checking if we got a packet
over BLE resulted in potentially horrendously bad latency for received
packets.

That isn't just a possible performance issue, it actually seems to cause
IO errors with my Suunto EON Core.  I'm not entirely sure why, but it
might simply be some timing interaction, particularly since the IO
errors seemed to primarily happen when the dive computer itself was also
busy updating the screen (ie if you pressed buttons on the dive computer
to switch to compass mode, for example).

So replace the silly hardcoded 100ms "waitFor()" function with a
WAITFOR() macro that checks the provided expression every time through
the loop, which gets us a much lower latency (we basically check every
ten milliseconds).

The macro is not beautiful, but it WorksForMe(tm).

This makes a huge difference to the reliability of the download for me,
and might matter for some other dive computers too.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-06-20 16:38:04 +09:00
Dirk Hohndel
b75eae95c1 QML UI: remove unused property
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20 13:23:59 +09:00
Dirk Hohndel
7f7e7cf51d QML UI: ensure we track vendor/product for download
This is based on something that Anton Ludin sent to the mailing list.
Reading through the code it seemed that there were scenarios in which
DC_vendor and DC_product were not updated correctly. That's one of the
problems of the declarative approach in QML - it can be very hard to
figure out which code is run when in certain situations.

This may help address the issue with FTDI downloads no longer working on
Android.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20 12:07:11 +09:00
Dirk Hohndel
1ccf21f08d QML UI: improve banner in global drawer
The asynchronous load seemed to be (at least one of) the culprit(s) of
the banner occasionally not showing up.
Making the font for the cloud ID smaller looks better (and works much
better for long email addresses).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20 11:50:14 +09:00
Dirk Hohndel
547dd51892 Update CHANGELOG.md
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20 11:36:44 +09:00
Dirk Hohndel
7ec9c206b5 QML UI: store nocloud data when adding cloud credentials
We want to allow people to keep dives they collected without a cloud
account. The code was mostly there, we just got confused about the
existing status because we ran through this twice (no cloud -> unknown
-> verified). This way we explicitly remember this kind of transition.

Fixes #1404

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20 11:13:13 +09:00
Dirk Hohndel
e6835d76cc QML UIL: fix more problems with members moving from manager to prefs
That change clearly would have benefited from better code review.
This is a superset of a change proposed by Jan Iversen.

Closes #1406

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-20 09:34:27 +09:00
Lubomir I. Ivanov
e0f7a2ca37 CHANGELOG.md: add note about fixing a MAX_TANK_INFO bug
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-06-20 09:30:58 +09:00