Commit graph

19769 commits

Author SHA1 Message Date
rafsalvioni
2f4b415e91 Saves default sea water salinity in log
Some DCs only report water type, without salinity level. Subsurface
fixes most of these cases using default levels, but when the type of water
is Sea/Salt, this fix was not saved.

This causes a bit confusion, mainly if the user defines own salinity level.

Signed-off-by: Rafael M. Salvioni <rafael.salvioni@gmail.com>
2023-03-28 20:51:36 -07:00
Michael Keller
9da7ec4828 Desktop: Fix use of bluetooth address for remembered dive computer.
Fix a bug causing the bluetooth address not being used when downloading
from a 'remembered' dive computer if the device selection is populated.
This specifically excludes MacOS, as 'remembering' bluetooth connections
does not seem to be working there as per
https://github.com/subsurface/subsurface/pull/2158#issuecomment-508933672.
I am not super sure why we are _not_ trying to use the 'remembered'
device if the device selection is populated (`ui.device->currentIndex()
== -1`) - maybe this should be clarified in a comment?

Signed-off-by: Michael Keller <github@ike.ch>
2023-03-28 20:51:07 -07:00
Berthold Stoeger
31cf991afe cleanup: remove pointless idle comment in string-format.cpp
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-03-28 20:39:02 -07:00
Berthold Stoeger
264adacba1 cleanup: move formatting of gas type to string-format.cpp
Since the only caller was C++ code, this can be done in
C++ code, which removes memory-management headaches.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-03-28 20:39:02 -07:00
Michael Keller
468c1d8d61 Desktop: Fix time format in dive planner.
Make the time edit respect the configured time format. Also make the
date and time format change when the preferences are changed.

Fixes #3849.

Signed-off-by: Michael Keller <github@ike.ch>
2023-03-28 20:37:21 -07:00
Michael Keller
f05ec222ff Documentation: Add topic titles to CONTRIBUTING.md
Add titles for the individual topics covered in CONTRIBUTING.md. One
advantage of this is that it makes it possible to link to individual
topics when providing feedback on pull requests.

Signed-off-by: Michael Keller <github@ike.ch>
2023-03-28 20:25:40 -07:00
Andrei Rybak
4946a112b3 CODINGSTYLE.md: use inline monospace formatting
Format keywords, classes, string examples, etc. in prose of
CODINGSTYLE.md using `inline formatting` with single backticks.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-03-26 18:48:03 +02:00
Andrei Rybak
35f0a6af3b CODINGSTYLE.md: use dashes instead of hyphens
Similarly to commit 062533d0a (CONTRIBUTING.md: use dashes instead of
hyphens, 2023-01-14), replace hyphens in prose of CODINGSTYLE.md with
dashes to make the rendered Markdown a bit nicer.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-03-26 18:48:03 +02:00
Andrei Rybak
e130add0c5 CODINGSTYLE.md: fix sample for container iteration
The `for` loop in the sample iterates over `serviceUuids`, but the only
other statement in the sample assigns variable named `l`.  Fix the name
of the variable in the assignment to be the same as in the loop.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-03-26 18:48:03 +02:00
Andrei Rybak
b59b18bfff CODINGSTYLE.md: fix list item indentation
Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-03-26 18:48:03 +02:00
Andrei Rybak
7e74dcccca CODINGSTYLE.md: fix paragraphs in list items
Without an blank line, the pseudo-headers of list items are not
separated from the next paragraph.  An example is rendered as:

    * variable declarations In C code we really ...

instead of intended:

    * variable declarations

      In C code we really ...

Add missing blank lines between paragraphs inside list items and in
between list items to fix the intended rendering.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-03-26 18:48:03 +02:00
Andrei Rybak
4e1206d975 CODINGSTYLE.md: fix indentations in samples
Samples of code in CODINGSTYLE.md are wrapped in triple-backticks to
render them as blocks of code.  For code blocks that are indented within
a list item, Markdown renderer of GitHub treats the leading tab as if it
was four spaces.  Rendered code blocks are formatted in a way that
contradicts the code style written down in prose.

Replace leading tabs in indentation with spaces in blocks of sample code
to render them correctly in Markdown lists.

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
2023-03-26 18:48:03 +02:00
Michael Keller
324fbfa685 Desktop: Add option to force overwrite firmware for OSTC4.
In order to support development of the open source firmware of the
OSTC4.
Requires changes in libdivecomputer.

Signed-off-by: Michael Keller <github@ike.ch>
2023-03-18 00:11:08 +13:00
Michael Keller
5b263a8f4e Desktop: Add notes column to dive list table.
Add a column for dive notes to the dive list table.
The column is disabled by default.
As requested in
https://groups.google.com/g/subsurface-divelog/c/PEFre85Ek1M.

Signed-off-by: Michael Keller <github@ike.ch>
2023-03-16 17:53:20 +01:00
Michael Keller
d44787a0b3 Desktop: Fix units displayed for 'Near dive sites' range.
Fix a bug causing the wrong units (m) to be shown on the Dive site
management view if imperial units are as the system default.

Signed-off-by: Michael Keller <github@ike.ch>
2023-03-02 20:58:21 +01:00
Michael Keller
ffc9502535 Desktop: Disable 'search' button if the vendor does not support it.
Disable the 'search dive computer' ([...]]) button in the 'Import from
dive computer' window if searching is not supported by the currently
selected vendor.

Signed-off-by: Michael Keller <github@ike.ch>
2023-03-01 15:37:56 +01:00
Michael Keller
b9b47092c1 Desktop: Fix bug in diveplan for CCR dives with multiple segments.
Fixes a bug reported in
https://groups.google.com/g/subsurface-divelog/c/8N3cTz2Zv5E:
When planning a CCR dive with multiple segments, the textual dive plan
was showing a non-existent gas change with bogus data.  The first part
of the fix is uncluttering of the message printed: Since this change is
_after_ the current diveplanpoint the data needs to come from `nextdp`
and not `dp`.  The second part is that the message is not printed any
more if the current and the following segments have been manually added:
According to comments in the code the change should only be printed on
the segment _before_ the change if this segment is an ascent segment
that is followed by a manually entered segment.

Signed-off-by: Michael Keller <github@ike.ch>
2023-03-01 15:35:55 +01:00
Robert C. Helling
c47e28fa29 Dive mode for surface intervals
Divers breath air in open circuit mode during surface intervals,
not with their CCR.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2023-03-01 15:33:22 +01:00
Michael Keller
9aed18451a Desktop: Fix planner for CCR dives with first segment on OC.
Fix a bug that results in dive plans outside of the configured risk
profile being produced when planning a CCR dive with the first segment
set to open circuit.
`d->dc.divemode` is already set in `setRebreatherMode`, which is
sufficient, and congruent with the setting of other dive parameters,
like `diveplan.gflow`.

Signed-off-by: Michael Keller <github@ike.ch>
2023-03-01 15:19:40 +01:00
Michael Keller
cb5bc68c59 Desktop: Fix the number of progress steps in the OSTC4 download steps.
Changed the maximum number of steps for the progress bar to match the
number of steps that exist.

Signed-off-by: Michael Keller <github@ike.ch>
2023-02-26 21:31:27 +01:00
Dirk Hohndel
576595bb11 Merge branch 'translations_translations-subsurface-source-ts--master_en_GB' of github.com:subsurface/subsurface
Pull in the en_GB updates - calling that a translation seems like an
overstatement
2023-02-22 15:20:20 -08:00
Dirk Hohndel
3330f9001c Merge branch 'translations_translations-subsurface-source-ts--master_ro_RO' of github.com:subsurface/subsurface
Romanian translation
2023-02-22 15:20:07 -08:00
Dirk Hohndel
43da660220 Merge branch 'translations_translations-subsurface-source-ts--master_pt_PT' of github.com:subsurface/subsurface
Portuguese translation
2023-02-22 15:19:52 -08:00
Dirk Hohndel
a85abbedf6 Merge branch 'translations_translations-subsurface-source-ts--master_nl_NL' of github.com:subsurface/subsurface
Dutch translation
2023-02-22 15:19:38 -08:00
Dirk Hohndel
df6ec04e48 Merge branch 'translations_translations-subsurface-source-ts--master_es_ES' of github.com:subsurface/subsurface
Spanish translation
2023-02-22 15:19:23 -08:00
Dirk Hohndel
c438bce468 Merge branch 'translations_translations-subsurface-source-ts--master_de_DE' of github.com:subsurface/subsurface
German translation
2023-02-22 15:19:07 -08:00
Dirk Hohndel
12e6f219c9 Merge branch 'translations_translations-subsurface-source-ts--master_ca' of github.com:subsurface/subsurface
Catalan translation
2023-02-22 15:18:50 -08:00
Dirk Hohndel
fc1eab3fc8 Merge branch 'translations_translations-subsurface-source-ts--master_bg_BG' of github.com:subsurface/subsurface
Bulgarian translation
2023-02-22 15:18:23 -08:00
transifex-integration[bot]
4192cf2737
Apply translations in ro_RO
translated for the source file 'translations/subsurface_source.ts'
on the 'ro_RO' language.
2023-02-22 09:24:27 +00:00
Dirk Hohndel
e11c196a6a Update libdivecomputer
Merge upstream updates from Jef Driesen:

 - Deepblu Cosmiq+ support has been merged upstream

 - Oceans S1 support has been merged upstream

- Various new models supported: Cressi Donatello, Scubapro G2 TEK, new
  Excursion v6+ firmware.

- misc core changes, most notably supporting a new annoying specialized
  binary format for decomode, because Jef still can't deal with
  strings.

- lots of small details

(all the work done by Linus - I'm just adding this to Surface)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-02-20 12:02:25 -08:00
transifex-integration[bot]
ddb96efa87
Apply translations in nl_NL
translated for the source file 'translations/subsurface_source.ts'
on the 'nl_NL' language.
2023-02-20 19:22:02 +00:00
transifex-integration[bot]
7ffe4c67ef
Apply translations in bg_BG
translation completed for the source file '/translations/subsurface_source.ts'
on the 'bg_BG' language.
2023-02-20 09:19:42 +00:00
transifex-integration[bot]
30ca55be12
Apply translations in de_DE
translation completed updated for the source file '/translations/subsurface_source.ts'
on the 'de_DE' language.
2023-02-20 07:39:07 +00:00
transifex-integration[bot]
5aaafd1728
Apply translations in en_GB
translation completed updated for the source file '/translations/subsurface_source.ts'
on the 'en_GB' language.
2023-02-19 22:45:31 +00:00
transifex-integration[bot]
5069cda05a
Translate /translations/subsurface_source.ts in ca
translation completed for the source file '/translations/subsurface_source.ts'
on the 'ca' language.
2023-02-19 20:34:03 +00:00
transifex-integration[bot]
8766827c17
Apply translations in es_ES
translation completed for the source file '/translations/subsurface_source.ts'
on the 'es_ES' language.
2023-02-19 12:16:05 +00:00
transifex-integration[bot]
9867ff1ec5
Apply translations in pt_PT
translation completed for the source file '/translations/subsurface_source.ts'
on the 'pt_PT' language.
2023-02-19 11:22:43 +00:00
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