Commit graph

19605 commits

Author SHA1 Message Date
Berthold Stoeger
48659c3f7d statistics: fix display of month on continuous axis
tm::tm_mon is 0..11, not 1..12, so we have to add one for
display.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-10-19 14:35:15 -07:00
Berthold Stoeger
7d366b9afe statistics: properly initialized selected scatter items
Scatter items of selected dives were shown in blue when
changing to scatter mode. They should be yellow from the
start, not only when hovering over them.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-10-19 14:35:15 -07:00
Dirk Hohndel
7b5381b6de desktop: make time shift dialog show correct times
This got broken in commit 7417f865cd ("cleanup: un-singletonize
ShiftTimesDialog") and no one ever noticed.

We need to intitialize the when variable and set up the initial texts in
order for the time shift dialog to show the correct information. Doing
this in the ButtonClicked member (right before the dialog is destroyed)
makes absolutely no sense.

Fixes #3535

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-10-19 13:29:29 -07:00
Dirk Hohndel
c88d22462d core: better change message in git save
This rarely gets seen / looked at, but it can help make it easier
to understand what a user was doing when trying to restore dives
that were inadvertantly deleted.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-10-17 16:01:00 -07:00
Dirk Hohndel
cca21cf07f update latest translations from Transifex
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-10-03 13:49:09 -07:00
Dirk Hohndel
6c9c59a2e0 Revert back to latest libdc
Embarrassingly, commit 8c644547fb ("mobile: fix reading of cache dir")
dropped updates to libdivecomputer which went unnoticed for quite a
while. This brings us back to the correct SHA.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-10-01 13:36:40 -07:00
Dirk Hohndel
98f1f670c4 Update README and ReleaseNotes for 5.0.10
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-10-01 13:28:49 -07:00
Dirk Hohndel
f2a96db687 Merge remote-tracking branch 'origin/bstoeger-mobile-dc' 2022-10-01 13:24:26 -07:00
Dirk Hohndel
bcbbda401e Update translation source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-10-01 09:56:34 -07:00
Berthold Stoeger
7c8dc016b5 mobile: flip through dive computers on mobile
UI fixed by Dirk.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-10-01 18:47:16 +02:00
Dirk Hohndel
d66376a8f3 build-system/windows: don't build the libmtp examples
We had that fail in the GitHub Action - but really, why would we build those in
the first place.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-10-01 18:44:37 +02:00
Dirk Hohndel
eb101aab1f build-system: run iOS GitHub action on macOS 11
macOS 10.15 is deprecated on GitHub.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-09-23 12:13:06 -07:00
Dirk Hohndel
884dbc9d5e Merge remote-tracking branch 'origin/bstoeger-divesites' 2022-09-23 08:02:54 -07:00
Dirk Hohndel
eb59d426d1 Merge remote-tracking branch 'origin/bstoeger-gnome' 2022-09-23 07:58:06 -07:00
Dirk Hohndel
99e6e11c8c Merge branch 'sensor-index-fixup' of https://github.com/torvalds/subsurface-for-dirk 2022-09-23 07:57:05 -07:00
Berthold Stoeger
621a0a4e3a desktop: remember previous state when switching to dive site mode
The dive-site editing can be reached from two states: from the
dive view and the dive list view. It always jumped back to
the dive view.

Therefore, remember the state. Use a stack-like structure, so
that the feature can be used for the dive-site view as well.

This is a bit inconsistent, because for example the statistics
view does not remember the previous state and allows a direct
jump to a different state. That should be fixed at some point.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-09-23 15:50:50 +02:00
Berthold Stoeger
17033d0d83 desktop: make dive site list an independent widget
This used to be one of the tab-widgets, which was illogical
and caused confusion. Notably, erroneously clicking on the
tab header led to a reset of the dive selection.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-09-23 15:50:49 +02:00
Berthold Stoeger
86e3ceb0e9 cleanup: remove isGnome3Session function
This is only used for archaic distros.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-09-23 15:40:09 +02:00
Linus Torvalds
02f158b0c2 Fix the dc sensor index fixup
fixup_dc_sample_sensors() would make sure that any pressure sensor
indexes were in range of the cylinders by just clearing the pressure
data if the sensor index was larger than the number of cylinders in the
dive.

That certainly makes the sensor index data consistent, but at the cost
of just dropping the sensor data entirely.

Dirk had some cases of odd sensor data (probably because of an older
version of subsurface, but possibly due to removing cylinders manually
or because of oddities with the downloader for the Atomic Aquatics
Cobalt dive computer he used), and when re-saving the dive, the pressure
data would magically just get removed due to this.

So rewrite the sensor data fixup to strive very hard to avoid throwing
pressure sensor data away.  The simplest way to do that is to just add
the required number of cylinders, and then people can fix up their dives
manually by remapping the sensor data.

This whole "we clear the pressure data" was at least partly hidden by
two things:

 (1) in the git save format, we don't rewrite dives unless you've
     changed the dive some way, so old dives stay around with old data
     in the save until explicitly changed.

 (2) if you had multiple dive computers, and one dive computer does not
     have any pressure data but another one does, our profile will use
     that "other" dive computer pressure data (because often times you
     might have only one dive computer that is air integrated, but you
     still want to see the tank pressure when you look at other dive
     computers - or you have one dive computer give pressure data for
     your deco bottle, and another for your travel gas etc).

So those two facts hid the reality that we had actually cleared the tank
sensor data for Dirk's dive with the Atomic Aquatics dive computer,
because we'd still see pressure data in the profile, and the git data
would still be the old one.

Until Dirk renumbered his dives, and the data was rewritten.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-09-20 09:49:57 -07:00
Linus Torvalds
aa50be9cd5 Use the right type for sanitize_sensor_id()
It returned a 'uint8_t', which clashes pretty badly with NO_SENSOR being
-1, and turned it into 255.  That then ended up historically working,
because before commit 0c84f369c3 ("core: use int16_t for sensor-id")
we actually did that everywhere:

 #define NO_SENSOR ((uint8_t)-1)
 ...
    uint8_t sensor[MAX_SENSORS];

but that was changed to

 #define NO_SENSOR -1
 ...
    int16_t sensor[MAX_SENSORS];

and this helper type became wrong.

Just make it return 'int', avoiding any type narrowing issues.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-09-20 09:41:35 -07:00
Dirk Hohndel
b5889f0f3c Merge remote-tracking branch 'origin/bstoeger-profile' 2022-09-19 09:29:52 -07:00
Dirk Hohndel
13482a961d Merge remote-tracking branch 'origin/bstoeger-tabwidget' 2022-09-19 09:23:47 -07:00
Dirk Hohndel
bb3ddf521b mobile: update version to 3.4.8
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-09-19 09:18:34 -07:00
Berthold Stoeger
724af75722 desktop: disable extradata tab if no site selected
Owing to bit-rot, the extradata tab was not disabled if no dive
is selected. The reason was that there was an additional tab
(dive-computers) that should not be disabled. However that
tab was removed and now the extradata tab was not disabled.

Fix this, but note that there is another of these 'parasitic'
tabs, that should be removed, namely the dive-site tab.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-09-18 13:49:29 +02:00
Berthold Stoeger
24926f6031 profile: don't use displayed_dive to check whether dive changed
The profile replots if the mode of the currently displayed
dive changed. To do so, it compares the changed dive to
the displayed_dive. However, that is only used for planned
dives since quite some time.

Fix the check and make the replotting work again.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-09-17 19:51:53 +02:00
Berthold Stoeger
3abb82bfd5 map: don't explicitly reload the map from the mainwindow
The map listens to the reset signal by itself.

This avoids double reload of the map on open/close.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-09-15 12:16:32 -07:00
Captain Junk
fbb737e85b Update INSTALL
Add some additional info on getting the
FTDI drvier to recognize dive computers on
Raspberry Pi OS.

Signed-off-by: Captain Junk <captainjunk@gmail.com>
2022-09-15 12:16:07 -07:00
Linus Torvalds
3446dd5125 fix up sample sensor indexes before fixing up cylinder pressures
The cylinder pressure fixup depends on the sample sensors indexes having
been fixed.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-09-12 16:58:59 -04:00
Robert C. Helling
77a5ca4234 For warnings, show icon in infobox
Render a warning sign in front of the event string
in the infobox. This is done in rich text.

Note: This shows the warning sign for all events,
not just warnings.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2022-09-12 19:30:31 +02:00
Captain Junk
d306ba9b38 Update INSTALL
Add instructions for building on Raspberry Pi OS (64-bit) Released
April 4, 2022.

Signed-off-by: Captain Junk <captainjunk@gmail.com>
2022-09-03 15:49:00 -07:00
Berthold Stoeger
50d83ab188 profile: show closed-hand cursor while panning
To give visual feedback.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-09-03 13:51:01 -07:00
Berthold Stoeger
edf2a2f4f4 profile: implement panning of profile
When zoomed in, the profile position was moved by hovering with
the mouse. What a horrible user experience. This is especially
useless if we want to implement an interactive profile on mobile.

Instead, let the user start the panning with a mouse click. The
code is somewhat nasty, because the position is given as a
real in the [0,1] range, which represents all possible positions
from completely to the left to completely to the right.

This commit also removes the restriction that the planner handles
can only be moved when fully zoomed out. It is not completely
clear what the implications are. Let's see.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-09-03 13:51:00 -07:00
Berthold Stoeger
0d92ef2835 cleanup: remove unused variable
A QVariant was initialized but never used.

While doing so, remove construct/assign pairs of a number of
QStrings. Directly construct the QStrings with the desired
values.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-09-03 13:49:02 -07:00
Berthold Stoeger
4a7ee872f3 cleanup: move minute formating to format-string.cpp
The get_minutes() function formats a time as m:ss
and returns a static C-string. Since all callers are
C++ anyway and transform directly into QString, let us
move this to the other string formatting function.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-09-03 13:49:02 -07:00
Michael Andreen
1047937197 user-manual: Update documentation on fixing sensor data
Signed-off-by: Michael Andreen <michael@andreen.dev>
2022-09-03 13:38:34 -07:00
Michael Andreen
a39e69c497 Use combo box for moving sensor data
Also allow editing sensor on a cylinder with already attached sensor.
This will swap the sensor data with the cylinder that it is taking the
sensor data from, removing the need for adding an extra temporary
cylinder when swapping two sensors.

Signed-off-by: Michael Andreen <michael@andreen.dev>
2022-09-03 13:38:34 -07:00
Dirk Hohndel
70e43d13a0 cleanup: show the correct build badges
This way the github.com/subsurface/subsurface no longer shows incorrect
build failures.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-08-31 21:32:38 +00:00
Linus Torvalds
34e169aace clean up logging, and add error reports to it too
The SSRF_INFO() macro is widely used, and there's a lot of confusion
about whether the newline at the end should be done by the SSRF_INFO or
be in the format string passed to it.  End result: we end up doing both,
and there are empty lines in the output as a result.

Clean this up by just using our existing 'strip_mb()' to strip any
whitespace at the end of the generated string, and then adding one final
newline when logging it.

Also, make sure to log our 'report_error()' messages, which apparently
only used to be showin in the red error bar on the display.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-08-31 13:58:34 -07:00
Dirk Hohndel
42da08df20 mobile: enable sharing via email
Instead of using the save file dialog (which creates a horrendous user
experience - and isn't even supported on Android), simply allow the user
to email the file in question to a recipient of their choice, e.g.,
themselves.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-08-31 13:58:22 -07:00
Dirk Hohndel
f144fa0a1b mobile: allow sharing files via email
This will allow the user of the mobile app to export dive and dive site
data from their mobile device without using the Subsurface cloud.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-08-31 13:58:22 -07:00
Dirk Hohndel
ead15f622a mobile: remove export as UDDF
The export functionality is horridly poorly implemented, and the UDDF export
isn't actually functional on mobile. And why would we support this in the first
place? That's not a reasonable expectation for the mobile app.

So let's just completely remove that and good riddance.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-08-31 13:58:22 -07:00
Dirk Hohndel
173093d314 Android: correctly check for empty path
The comparison against the empty string caused things to error out
when only one file was given.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-08-31 13:58:22 -07:00
Berthold Stoeger
6d77d814a8 parser: allow import of dive sites without UUID
Fixes #3493.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-08-31 13:56:04 -07:00
Berthold Stoeger
aa4b48f440 core: move floating point functions to own header file
This were in subsurface-string.h for unknown reasons.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-08-30 22:34:38 +02:00
Berthold Stoeger
61701509b0 core: replace IS_FP_SAME macro by inline function
No reason to keep this as a macro - a function is easier to
read, type safe and easier to debug. Moreover, give it the
more appropriate name "nearly_equal()". After all, it precisely
does NOT check floating points for equality.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-08-30 22:34:38 +02:00
Berthold Stoeger
5db4a95a26 core: don't use relative precision when comparing to 0
The FP_IS_SAME macro uses a relative precision to compare
floating points. This fails when comparing to 0. Therefore,
use an absolute precision in this case. Implement as an
inline function.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-08-30 22:34:38 +02:00
Dirk Hohndel
2ae7f3cf6c Android: make support email API consistent with iOS
We have two different API endpoints. supportEmail() which adds the
default subject, recipient, and message body, and the generic
shareViaEmail() which takes all of these as arguments.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-08-30 11:55:54 -07:00
Dirk Hohndel
87387b7e7e mobile: send logfiles as attachments on iOS as well
This was added for Android a while ago, but now this works on iOS as well which
is a very welcome addition for the recipient of these support emails (i.e. me).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-08-30 09:18:06 -07:00
Dirk Hohndel
8164ca56ec iOS: add infrastructure to natively send email
This will allow us to send attachments, just like we do on Android.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-08-30 09:18:06 -07:00
Dirk Hohndel
0af410d6ce iOS: update minimum iOS version to 12.0
None of the tools we use work with older versions, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-08-30 09:18:06 -07:00