4 Commits

Author SHA1 Message Date
Berthold Stoeger
8b923e0e22 profile: restore global hiding of all events
26f20b805d3c made the event hiding mechanism more fine grained
(by considering also the severity). The commit inadvertently
removed the feature that "hide similar events" would hide the
events from all dives.

Restore this. It's a bit complex, because the "eventname" now
has to remember the severity. Therefore, change "eventname"
into "eventtype".

The UI is a bit inconsistent, as "hide similar events" affects
all dives and is remembered across switching dives. In contrast,
"hide event" is not remembered. This needs some rework.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-02-12 11:22:41 +01: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
Berthold Stoeger
8212acc992 cleanup: break out event-related code into event.[c|h]
In an effort to reduce the size of dive.h and dive.c, break out
the event related functions. Moreover event-names were handled
by the profile-code, collect that also in the new source files.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-10-25 13:59:52 -07:00