Commit graph

19578 commits

Author SHA1 Message Date
Berthold Stoeger
59d678b5b1 cleanup: use range based for instead of loop with index
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-04-14 21:20:23 +02:00
Berthold Stoeger
7d5c6be188 core: use divelog struct in git parser state
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-04-14 21:20:23 +02:00
Berthold Stoeger
40275ea56b core: use divelog struct in parser state
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-04-14 21:20:23 +02:00
Berthold Stoeger
8cd451fc33 core: use divelog in importDives() and process_imported_dives()
Instead of a long argument list.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-04-14 21:20:23 +02:00
Berthold Stoeger
9c253ee6c5 core: introduce divelog structure
The parser API was very annoying, as a number of tables
to-be-filled were passed in as pointers. The goal of this
commit is to collect all these tables in a single struct.
This should make it (more or less) clear what is actually
written into the divelog files.

Moreover, it should now be rather easy to search for
instances, where the global logfile is accessed (and it
turns out that there are many!).

The divelog struct does not contain the tables as substructs,
but only collects pointers. The idea is that the "divelog.h"
file can be included without all the other files describing
the numerous tables.

To make it easier to use from C++ parts of the code, the
struct implements a constructor and a destructor. Sadly,
we can't use smart pointers, since the pointers are accessed
from C code. Therfore the constructor and destructor are
quite complex.

The whole commit is large, but was mostly an automatic
conversion.

One oddity of note: the divelog structure also contains
the "autogroup" flag, since that is saved in the divelog.
This actually fixes a bug: Before, when importing dives
from a different log, the autogroup flag was overwritten.
This was probably not intended and does not happen anymore.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-04-14 21:20:23 +02:00
Dirk Hohndel
eebb47ec22 Update libdc to address build issue
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-03-29 11:25:35 -07:00
Dirk Hohndel
ad8aa988f0 Merge branch 'add_ostc4_force_firmware_update' of https://github.com/mikeller/subsurface
together with the libdc change this should now work

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-03-29 10:36:29 -07:00
Dirk Hohndel
1e3427c7cd Update libdc
- Add option to force overwrite firmware for OSTC4

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-03-29 10:35:21 -07:00
Robert C. Helling
e27653374d Add printing option for page orientation
Strangely enough, half of the infrastructure was
already there, it just wasn't hooked up to a UI
element

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2023-03-28 21:08:37 -07:00
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