Commit graph

19632 commits

Author SHA1 Message Date
Dirk Hohndel
6b272ac3aa build-system: add Ubuntu kinetic (22.10)
That's been out for a while... oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-02-18 21:59:54 -08:00
Dirk Hohndel
2f29380ae2 build-system: attempt to fix transifex.yml syntax
Annoyingly I seem to only work with this if it's in the master branch.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-02-18 19:22:19 -08:00
Dirk Hohndel
867ef10736 build-system: attempt to fix transifex.yml syntax
Annoyingly I seem to only work with this if it's in the master branch.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-02-18 19:19:16 -08:00
Dirk Hohndel
8a56896c4b build-system: add GitHub Transifex integration
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-02-18 15:38:45 -08:00
Dirk Hohndel
32c63f57ab Update translation source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-02-18 15:12:44 -08:00
Berthold Stoeger
3f2e4e8b16 cleanup: replace Q_FOREACH by range-based for in profile code
With Qt-containers, this might be a small pessimization, because
it might lead to a deep copy. This can be "fixed" by
   for (const Type &item: qAsConst(container))
But frankly, I don't care. Ultimately it is probably best to
replace the Qt containers by standard containers.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-02-17 06:46:46 -08:00
Berthold Stoeger
4128fec1ea profile: register event names on creation of events
The event names were registered in add_event(). However,
the undo system did not use that function, but add_event_to_dc(),
which takes an already allocated event.

That gave the following unfortunate situation:

Load a log without setpoint changes.
Add a setpoint change.
The setpoint change event type now was not registered and
therefore couldn't be hidden.

Admittedly, a subtle bug, but still a bug. Fix by registering
event names on event creation.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-02-17 06:46:46 -08:00
Berthold Stoeger
0d3c9954f4 profile: redo eventname handling
The eventname handling code was splattered all over the place.
Collect it in a single source file and use C++ idioms to avoid
nasty memory management. Provide a C-only interface, however.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-02-17 06:46:46 -08:00
Michael Keller
ab7b9329c0 Standardised how divedatapoints are created.
Changed the way dive data points for OC cylinders to be added to the
dive plan are created in `createTemporaryPlan()` in
`diveplannermodel.cpp`. This now uses `plan_add_segment()` like all
other places where dive data points are added, in particular the planner
tests.
This also allowed for `create_dp()` to be made static.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-17 10:53:04 +01:00
Michael Keller
ec0c6833a0 Fix invalid bailout gas choice when planning a CCR dive.
Fixes a bug reported in
https://groups.google.com/g/subsurface-divelog/c/8N3cTz2Zv5E:
When planning a CCR dive with OC bailout, the diluent gas may be chosen
as the first OC bailout gas, despite being set up with a use type of
'diluent', and likely not being available for open circuit breathing.
`best_first_ascend_cylinder` is now initialised to an invalid value
(instead of the first cylinder, which may or may not be a diluent
 cylinder), and its subsequent use is guarded by a validity check.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-17 10:49:24 +01:00
Berthold Stoeger
eb5d4f2a15 desktop: fix multi-dive editing of cylinders
3629a87 changed the handling of cylinders in multi-dives edit.
Not only should the cylinders be the "same", but also at the
same position. The code did not check whether the edited dives
even had that many cylinders, leading to a null-pointer
dereference.

Check whether the cylinder exists before comparing it.

Fixes #3578.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-02-10 20:09:34 +01:00
Michael Keller
b4af03751d Improve accuracy of the 'unlikely dive gas' warning.
Change the values supplied in the warning to be fractions. This is what
is actually reported by libdivecomputer. The currently used thousandths
are hard to interpret for users, as they are only used internally in
Subsurface.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-09 05:18:56 -08:00
rmorris
a1a834568a Correct paths, to allow libmtp to build
Signed-off-by: rmorris <rmorris@rkmorris.us>
2023-02-09 05:17:23 -08:00
Michael Keller
40fc037aa4 Fix handling of gas type for CCR dives.
Fix bug introduced in #3576: On CCR dives cylinders listed as open
circuit bailout by the dive computer need to be set to `OC_GAS`.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-09 10:51:39 +01:00
Michał Sawicz (Saviq)
8fe5564059 ci: bring Snap USNs back
Ref. https://bugs.launchpad.net/snapstore-server/+bug/2004008

While that gets resolved, ignore the extra packages when checking for
security notices.

Signed-off-by: Michał Sawicz (Saviq) <michal@sawicz.net>
2023-02-08 07:48:34 -08:00
Berthold Stoeger
7b44689c8e parser: fix char-not-found checks in import-csv.c
These were two weird and clearly wrong constructs of the
type "if (iter && iter + 1)", where iter is a pointer. This
is always true at best and undefined at worst. Another
instance was removed in 096de0efd0.

The original code probably wanted to check whether the
found character was the last character in the string.
But that likewise seems to make no particular sense in
this context. Therefore, just remove the second part of
the boolean expression.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-02-07 23:43:04 +01:00
Michael Keller
1e3d378ad9 Cylindermodel: Improve editing of tank use
Use the drop down for editing the tank use in the gas list in both the
equipment tab and the dive planner.
The tank use column is now available in the equipment tab for all dives
and not just CCR dives, as 'not used' is a valid entry in both cases.
However, if the current dive is an OC dive, only 'OC-gas' and 'not used' are
shown.
There still seems to be a problem that in some cases, when opening the
planner after selecting an existing CCR dive the drop down in the
planner does not list CCR gas uses - for some reason `displayed_dive`
does not seem to be updated correctly on opening of the planner. But I have not been able to
reproduce this consistently, and changing 'Dive mode' fixes this.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-07 14:20:29 +01:00
Kim Delmar
1ed995aa7a html export: update CHANGELOG.md
Signed-off-by: Kim Delmar <62100831+KimDelmar@users.noreply.github.com>
2023-02-05 14:32:09 +01:00
Kim Delmar
3c771e2ee2 html export: fix diveguide display
Signed-off-by: Kim Delmar <62100831+KimDelmar@users.noreply.github.com>
2023-02-05 14:32:09 +01:00
Michael Keller
de4cad22b6 Desktop: Clarified the Dive Computer Firmware Update Message.
Clarified the message that is shown when a newer dive computer firmware
version is available, informing the user that
using an older firmware version may result in problems when using
Subsurface, as discussed in #3568.
This is currently only supported for Heinrichs-Weikamp dive computers.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-03 13:37:52 +01:00
Michael Keller
a92ee1e05d Refactoring: Use core functions to find gasmixes in TankItem.
Small refactoring to use `get_gasmix_at_time` from `core` in `TankItem`
to find the first gasmix used during a dive.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-03 08:24:56 +01:00
Michael Keller
72c40a18c2 Desktop: Fix brightness configuration for OSTC4
The Heinrichs Weikamp OSTC4 introduced an additional
'Cave' brightness level that is dimmer than all existing ones.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-03 08:22:13 +01:00
Michael Keller
321c8d92dc Improvement: Show gases as diluent by default for CCR dives.
Instead of adding all gases read from a dive computer as part of a dive
log as 'OC-gas', add gases as 'diluent' if the dive has a dive mode of
'CCR'. This creates consistency with the ppO2 for CCR dives being
tracked as sensor readings or a fixed setpoint, and not as the ppO2 of
the current gas ad depth.
A follow up question from this is whether gas use in the cylinders list
on the Equipment tab should be user editable. This seems to be
inconsistent at the moment, with gas constituent percentages downloaded
from the dive computer being editable, but gas use not.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-01 21:26:48 +01:00
Michael Keller
ada32f999e Cleanup: Remove 'data' field from 'DeviceDetails'.
`device_data_t data` in DeviceDetails has never been populated since it was first
added, and consequently is not used. This is confusing, especially as certain
fields inside `device_data_t` have been added directly to `DeviceDetails` in the meantime (e.g. `firmwareVersion`).

Separated from #3568 as per
https://github.com/subsurface/subsurface/pull/3568#pullrequestreview-1274995287.

Signed-off-by: Michael Keller <github@ike.ch>
2023-01-31 10:54:39 +01:00
Michael Keller
7ecc4c7034 Cleanup: Fix typos in comments.
Fixed some typos in comments.
Separated from #3568 as per
https://github.com/subsurface/subsurface/pull/3568#pullrequestreview-1274995287.

Signed-off-by: Michael Keller <github@ike.ch>
2023-01-31 00:03:06 +01:00
Dirk Hohndel
0ccb762a09 build-system: disable the daily Snap build for now
Apparently these currently end up in a rebuild loop.

Suggested-by: Michał Sawicz <michal@sawicz.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-01-27 09:25:55 -08:00
Michał Sawicz (Saviq)
a21cddc69a snap: use version: git
Snapcraft can determine the version from git on its own.

Signed-off-by: Michał Sawicz (Saviq) <michal@sawicz.net>
2023-01-19 10:37:48 -08:00
Michał Sawicz (Saviq)
e335c7a20d snap: fix GitHub Action warnings
`set-output` is getting deprecated, so need to move to newer ways.

Signed-off-by: Michał Sawicz (Saviq) <michal@sawicz.net>
2023-01-19 10:37:48 -08:00
Michał Sawicz (Saviq)
76c4b76027 snap: refresh for ubuntu-latest being 22.04
Signed-off-by: Michał Sawicz (Saviq) <michal@sawicz.net>
2023-01-19 10:37:48 -08:00
Martin Splitt
1b5de2d33b Update CHANGELOG.md
Signed-off-by: Martin Splitt <martinsplitt@google.com>
Signed-off-by: Martin Splitt <splitti@google.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-01-19 06:56:52 -08:00
Martin Splitt
30c5dfce00 HTML export: make element ids more consistent
Signed-off-by: Martin Splitt <martinsplitt@google.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-01-19 06:56:52 -08:00
Martin Splitt
02f4eb6904 HTML export: rename divemaster references to diveguide
This fixes the search in the web export.

Signed-off-by: Martin Splitt <splitti@google.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-01-19 06:56:52 -08:00
Berthold Stoeger
d7ca0c7253 planner: avoid out-of-bounds access
When exiting the loop, stopidx is 0, which means that if there
are no stoplevels, stoplevels[stopidx + 1] generates an
out-of-bounds access. Instead, suppose a stop at 3m or 10ft.

Suggested-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-01-19 14:26:00 +01:00
Berthold Stoeger
687f65bf77 planner: avoid out-of-bound access when initializing the planner
For dives with many samples (i.e. logged dives), samples are merged.

I'm not exactly sure how this code works, but it does an
out-of-bound access in some cases. Avoid that by a simple
check.

That said, I wonder if this downsampling is a good idea. A user
reports that they have logged dives marked as manually added dives.
We now load them into edit mode, which means a significant loss
of information.

Perhaps we should consider dives with more than 100 samples as
non-manual dives?

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-01-19 14:26:00 +01:00
Berthold Stoeger
063a20a406 desktop: pass dive list to ShiftTimesDialog
Users report that the ShiftTimesDialog does not work on Mac and
Windows. Apparently, get_first_selected_dive returns NULL, which
should not be possible because the dialog is only created when
dives are selected. Very omninous.

Get the selected dives in the caller and pass them down. This
bug at least should not happen anylonger. Perhaps now the
dialog does not show at all, but that will narrow down the
root cause of the problem.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-01-18 15:42:47 -08:00
Andrei Rybak
f45379e97c CONTRIBUTING.md: update link to transifex.com
URL https://www.transifex.com/projects/p/subsurface/ now redirects to
https://explore.transifex.com/.  Update the link to

    https://explore.transifex.com/subsurface/subsurface/

which is the landing page for Subsurface on transifex.com.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
a8eaa3e391 CONTRIBUTING.md: link to CODINGSTYLE.md
File `CodingStyle` was renamed to `CodingStyle.md` in 0ceb7e01d (Convert
CodingStyle file to Markdown notations, 2018-04-14) and then to
`CODINGSTYLE.md` in 4ef1e9cb2 (documentation: coding style.,
2019-12-25).  However, a link to the file in `CONTRIBUTING.md` wasn't
updated.

Fix the dead link to the coding style guidelines in `CONTRIBUTING.md`.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
5de9c2b30b CONTRIBUTING.md: capitalize "Git"
Git's own documentation consistency capitalizes the word "Git" in prose.
Follow its example and capitalize the word "Git" in prose of file
`CONTRIBUTING.md`.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
4996d90d53 CONTRIBUTING.md: emphasize image caption
Markdown doesn't have a syntax for image captions.  While we could use
table syntax (an extension in GitHub's flavor of Markdown) to align the
caption more clearly with the image, it wouldn't be very readable in
plain text and Markdown renderers that don't have such an extension.

Reduce confusion of readers by makimg the caption of the gitk screenshot
formatted differently than the surrounding paragraphs.  Use emphasis
syntax for that.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
43cdcd0c4b CONTRIBUTING.md: link to "imperative mood" inline
Replace raw URL to English Wikipedia article about imperative mood with
an inline link.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
1cc6981b62 CONTRIBUTING.md: use paragraph breaks consistently
Replace hard-line break (rendered in HTML as a `<br />` tag) between two
paragraphs in `CONTRIBUTING.md` with an paragraph break (blank line) for
consistency with the rest of the document.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
8f7abb2581 CONTRIBUTING.md: add a blank line before a list
List of code areas in `CONTRIBUTING.md` immediately follows the previous
line.  While GitHub's Markdown parser doesn't mind, some Markdown
parsers don't consider it a list.  Add a blank line between the list and
the preceding paragraph to ensure that the list is rendered correctly in
more Markdown renderers.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
bec625eb01 CONTRIBUTING.md: format filenames in monospace
Wrap filenames in paragraphs in `CONTRIBUTING.md` in backticks to render
them in monospace font.  Fix an accidental double space before the
reference to `CHANGELOG.md`, while we're here.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
b607140a2a CONTRIBUTING.md: format command example in monospace
Replace double quotes around `git commit --amend` command example in
`CONTRIBUTING.md` with single backticks to format it in monospace font.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
be1c5b574b CONTRIBUTING.md: use block syntax for prose examples
Use Markdown block syntax for the example of a commit message instead of
hard-line breaks with double spaces at the end.  Such formatting
separates it from the other parts of the text in `CONTRIBUTING.md` and
makes the wrapping at 74 characters easier to understand with monospace
font.  Do the same to the examples of `CHANGELOG.md` entries.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
4899a04505 CONTRIBUTING.md: use block syntax for commands
Replace combination of Markdown inline code syntax (single backticks)
and its hard-line break syntax (double space at end of the line) in file
`CONTRIBUTING.md` with block syntax (four-spaces-wide indentation) and
paragraph breaks (empty lines) for examples of commands to run to make
them look nicer and easier to read in plain text.  Add a missing colon
before the `format-patch` example, while we're here.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Andrei Rybak
062533d0ac CONTRIBUTING.md: use dashes instead of hyphens
Make `CONTRIBUTING.md` look a tiny bit nicer when rendered by replacing
double hyphens with en-dashes.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-01-17 08:09:33 -08:00
Dirk Hohndel
763ce015ff update libdc
garmin: relax string parsing sanity checks

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-01-02 17:01:53 -08:00
Dirk Hohndel
31277daa71 Update libdc
Add parsing of the CCR setpoint information for Garmin Descent computers

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-12-05 21:09:14 -05:00
Dirk Hohndel
7e43943541 GitHub actions: adjust to Ubuntu 22.04 builds
The qt5-default package was dropped (and isn't needed anymore).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-11-26 11:42:25 -08:00