Commit graph

19616 commits

Author SHA1 Message Date
Dirk Hohndel
ac91eccbdd Pull latest translations from transifex
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-10-15 11:53:36 -07:00
Dirk Hohndel
9c900415f3 Update README and ReleaseNotes for 5.0.4
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-10-14 19:35:27 -07:00
Dirk Hohndel
afdfccd274 Android: allow user installed root certificates
On Android devices that no longer get updates to the system installed
SSL root certificates, the user can easily install the updated Let's
Encrypt root certificate, but that is only used by Subsurface-mobile if
we explicitly allow the use of those user installed root certificates.

Fixes #3335

Suggested-by: Greg Hunter
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-10-14 15:53:10 +00:00
Tim Segers
b618d93241 desktop: fix div-by-zero when selecting multiple invalid dives
Signed-off-by: Tim Segers <tsegers@pm.me>
2021-10-11 20:53:41 +03:00
Tim Segers
f3a02d7049 Ignore invalid dives in subsurface-mobile dive summary
Match subsurface-desktop's invalid dive behavior

Signed-off-by: Tim Segers <tsegers@pm.me>
2021-10-11 20:20:20 +03:00
Dirk Hohndel
18c0fa37d1 Update translations and source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-10-09 13:43:14 -07:00
Robert C. Helling
41258647d2 Don't access gasmix.o2.fraction
Air is a special gas that does not contain oxygen according
to gasmix.o2.fraction. If you want to use the fo2, you
need to use get_o2() to treat this special case correctly.

This fixes a bug when setting the MND of a gas containing
21% oxygen when o2 is considered not narcotic.

Reported-by: Christoph Gruen <gruen.christoph@gmail.com>
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2021-10-01 08:50:36 -07:00
Dirk Hohndel
5e9ee9febb mobile: restore dev_info display
In commit 105b60389c ("mobile: remove GpsLocation reference from qmlmanager") I
was a bit careless with the code removal and unintentionally also removed the
initialization of the progress callback.  With this change the updates from the
download process are once again shown on screen in the mobile app.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-27 08:42:50 -07:00
Berthold Stoeger
a481cdc13d core: don't write pressure samples with "no sensor"
This has led to broken XML files, don't do it.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-09-22 09:11:00 -07:00
Berthold Stoeger
d9c77a27da core: properly clear pressure data of invalid sensors
When we found an invalid sensor (referring to a non
existing cylinder) in fixup_dive() the sensor-id was
set to NO_SENSOR.

This led to invalid XML files, because the code decides
to switch into legacy mode. However, there are two
pressure readings, which is invalid in legacy mode.

Therefore, also clear the pressure data.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-09-22 09:11:00 -07:00
Dirk Hohndel
f50585a906 desktop/image-time-shift: use better filename filter
We already have a function to select all supported image formats. Let's
just use that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-22 09:09:12 -07:00
Tim Segers
10798c2a8d desktop/image-time-shift: reorder UI
The camera sync feature has been moved above the Ok and Cancel buttons
and given its own descriptive header. The checkbox to ignore unaligned
image timestamps has been moved closer to the buttons.

Signed-off-by: Tim Segers <tsegers@pm.me>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-22 09:09:12 -07:00
Dirk Hohndel
4167b2ff14 desktop/image: allow larger range for manual time shift
The QTimeEdit field is severely limited when it comes to the supported
time range. By coding our own input / validation we can allow far larger
time shifts. For simplicity, this always assumes hours:minutes format.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-22 09:09:12 -07:00
Tim Segers
6ea4cfcc02 desktop: add support for camera sync delta of more than 24h
When using the camera sync feature to sync media to the dive timeline,
the calculated time difference was considered invalid if it was more
than 24 hours.

To prevent this, this commit disables the manual time offset input
fields when the camera sync button is clicked. It then uses the epoch
difference in the final offset calculation, enabling arbitrary time
differences between camera and divecomputer.

Signed-off-by: Tim Segers <tsegers@pm.me>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-22 09:09:12 -07:00
Dirk Hohndel
8525b2e274 core: remove superfluous arguments
Fixes CID 373231

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-20 14:49:57 -07:00
Linus Torvalds
85392343fa Re-do the libdivecomputer fingerprint save/load code
This tries to make our fingerprinting code work better, by avoiding
using the "deviceid" field that has always been unreliable because we've
calculated it multiple different ways, and even for the same version of
subsurface, it ends up changing in the middle (ie we calculate one value
initially, then re-calculate it when we have a proper serial number
string).

So instead, the fingerprinting code will look up and save the
fingerprint file using purely "stable" information that is available
early during the download:

 - the device model name (which is a string with vendor and product name
   separated by a space)

 - the DC_EVENT_DEVINFO 32-bit 'serial' number (which is not necessarily
   a real serial number at all, but hopefully at least a unique number
   for the particular product)

but because the model name is not necessarily a good filename (think
slashes and other possibly invalid characters), we hash that model name
and use the resulting hex number in the fingerprint file name.

This way the fingerprint file is unambiguous at load and save time, and
depends purely on libdivecomputer data.

But because we also need to verify that we have the actual _dive_
associated with that fingerprint, we also need to save the final
deviceid and diveid when saving the fingerprint file, so that when we
load it again we can look up the dive and verify that we have it before
we use the fingerprint data.

To do that, the fingerprint file itself contains not just the
fingerprint data from libdivecomputer, but the last 8 bytes of the file
are the (subsurface) deviceid and the diveid of the dive that is
associated with the fingerprint.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-09-19 16:51:46 -07:00
Dirk Hohndel
de69f12262 Update translation source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:30:19 -07:00
Dirk Hohndel
32e3f7e7c2 build-system: update translation source script
Kirigami sources are now under 3rdparty.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:28:35 -07:00
Dirk Hohndel
2bb88a354f Android: hardcode permissions and don't ask for features
That seems to be the way to force it to not request FINE_LOCATION or GPS access.
If I leave this on 'auto' then the dependency on QtPositioning (for showing the
map) appears enough for it to claim access to GPS location. I no longer want
to deal with the Google Play police for that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
e454669215 documentation: remove location service reference from mobile manual
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
64098aeb2e iOS: don't request GPS permission anymore
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
539455071c update CHANGELOG
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
2a0d14b100 core: remove location service preferences
Including the related tests.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
6f813b9f8e mobile: remove GpsLocation
Only used in context of acquiring GPS locations with the mobile app, which
we no longer do.

Keep the DiveAndLocation structure around as that's needed by the
ApplyGpsFixes command.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
105b60389c mobile: remove GpsLocation reference from qmlmanager
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
5bc99194da mobile: remove locationService interfaces
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
7bf90fd208 mobile: remove hasLocationSourceChanged interface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
085c65b0c4 mobile: remove logText property
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
f33c90ba6b mobile: remove deleteGpsFix interface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
094a3b01c8 mobile: remove applyGpsData interface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
0b8c8599c1 mobile: remove copyGpsFixesToClipboard interface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
3065eddbe1 mobile: remove clearGpsData interface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
ea751928aa mobile: remove getCurrentPosition interface
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
bea552bf0d mobile: remove GpsListModel
This is only needed to show the list of GPS fixes obtained with
the now removed location service.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
edf4fbd38a mobile: remove GPS list UI
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
76e0208a11 mobile: remove current location checkbox from dive edit
Since we no longer access the device location, we can't do that any longer,
either.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
ebbef8cf17 mobile: remove long disabled planner UI
This was never functional.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Dirk Hohndel
53cbf53058 mobile: remove GPS related item in main mobile UI
Given the nonsense that Google and Apple makes us go through in order to
support this feature, it's time to cut our losses and walk away.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-13 11:21:34 -07:00
Josh Torres
4e93d38482 Adding changelog entry for rich text support
Signed-off-by: Josh Torres <torres.josh.j@gmail.com>
2021-09-07 08:51:40 -07:00
Josh Torres
dcf1188a3b Support rich text on mobile notes field
When viewing dives on mobile the notes field does not support rich
text. User formatting, output from the planning feature, etc will
render html as plain text.

Adding qml tag to support rich text

Signed-off-by: Josh Torres <torres.josh.j@gmail.com>
2021-09-07 08:51:40 -07:00
Josh Torres
da6eb9d947 Add changelog entry
Signed-off-by: Josh Torres <torres.josh.j@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-06 13:00:42 -07:00
Josh Torres
7e6d9935f1 core: fix off-by-one causing incorrect profile display
In commit 4724c88 get_plot_details_new was updated to pass an index
instead of the entry into plot_string. This means we are passing "i" to
plot_string after the final increment of the for loop, instead of
getting the entry[i] within the loop before the final increment. This
means if we are mousing over the far right of the graph, where the time
based break is not hit, we will end up passing an index equal to nr-2
instead of nr-3, which is intended to shave off the final two rows
containing data not useful to the display.

There are a handful of ways to fix this. This commit intends to be
consistent with stylistic choices made elsewhere in the project.

Signed-off-by: Josh Torres <torres.josh.j@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-06 13:00:37 -07:00
Berthold Stoeger
64faa23448 undo: renumber cylinders when deleting a cylinder
Removal of a cylinder requires a renumbering of
cylinders in the core data structures (samples, etc.).

The renumbering was performed in the undo-action of
cylinder removal, but not during actual cylinder removal.
What a mess!

Add the missing call.

Attention: this makes the deletion of sensor-readings
on cylinder-deletion non-undoable!

Undo will have to be fixed in upcoming commits.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-09-03 13:35:28 -07:00
Berthold Stoeger
9376721873 desktop: warn when deleting a cylinder with sensor readings
This makes the sensors pointless and in the future, they
will be removed.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-09-03 13:35:28 -07:00
Berthold Stoeger
28fe6a7b38 core: add a function to test for sensors of a given cylinder
We want to prevent the user from accidentally deleting a
cylinder with sensor readings. Therefore, we need such a
function.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-09-03 13:35:28 -07:00
Berthold Stoeger
5eda1c0e39 parser: XML_PARSE_RECOVER to xmlReadMemory()
Due to changes in the handling of sensor-ids, invalid XMLs were
generated. In particular, these contained duplicate attributes
in the sample tags.

Even though these files shouldn't exist, let's try to parse
them anyway. Some data will be lost, but that's better than
not opening the file.

libxml2 can be told to try to recover from such petty(?) errors
by passing the XML_PARSE_RECOVER flag.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2021-09-03 09:30:34 -07:00
Dirk Hohndel
836111da98 mobile: update version to 3.3.1
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-02 12:42:39 -07:00
Dirk Hohndel
f19e10209c mobile: fix broken cylinder name tracking in dive edit
Prior to this change, we had two different cylinder lists as models for
drop down boxes - one that prepends the "no default cylinder" entry
(which we need for setting up no default cylinder to be used in the
app), and another one that only includes actual cylinders.

The problem occured if a dive is created before the first time we edit
an existing dive: in this case we are applying indices across the two
models, but the indices are of course off by one; this results in
actually picking the wrong cylinder. So each time we try to edit a dive,
we end up with the previous cylinder in the list.

This commit simplifies the code by having only one place where we create
list of cylinder names (which is then used as the model for the combo
box). It also uses more logical names for the two 'flavors' of this list
to make it clear which one is supposed to be used (the regular list when
editing or adding dives, the one with the "no default cylinder" entry
prependet for the Settings page).

Reported-by: Brian Fransen
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-09-02 12:41:00 -07:00
Dirk Hohndel
33dc5478d8 update README and ReleaseNotes for 5.0.3
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-20 20:26:26 -07:00
Dirk Hohndel
834f9b813a Update list of supported dive computers
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-08-20 20:26:26 -07:00