mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Event name heuristics to show better event icons
This matches the strings for a couple of generic events from libdivecomputer that should obviously info or violation events, and matches quite a few more from the Uemis downloader (as those are much more specific). Everything else is still shown as a yellow warning triangle. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
dcf94bef56
commit
8c2668a6b1
1 changed files with 16 additions and 2 deletions
|
@ -87,8 +87,8 @@ void DiveEventItem::setupPixmap()
|
||||||
#else
|
#else
|
||||||
} else if (
|
} else if (
|
||||||
#endif
|
#endif
|
||||||
strcmp(internalEvent->name, "heading") == 0 ||
|
same_string_caseinsensitive(internalEvent->name, "heading") ||
|
||||||
(same_string(internalEvent->name, "SP change") && internalEvent->time.seconds == 0)) {
|
(same_string_caseinsensitive(internalEvent->name, "SP change") && internalEvent->time.seconds == 0)) {
|
||||||
// 2 cases:
|
// 2 cases:
|
||||||
// a) some dive computers have heading in every sample
|
// a) some dive computers have heading in every sample
|
||||||
// b) at t=0 we might have an "SP change" to indicate dive type
|
// b) at t=0 we might have an "SP change" to indicate dive type
|
||||||
|
@ -115,6 +115,20 @@ void DiveEventItem::setupPixmap()
|
||||||
} else if (((internalEvent->flags & SAMPLE_FLAGS_SEVERITY_MASK) >> SAMPLE_FLAGS_SEVERITY_SHIFT) == 4) {
|
} else if (((internalEvent->flags & SAMPLE_FLAGS_SEVERITY_MASK) >> SAMPLE_FLAGS_SEVERITY_SHIFT) == 4) {
|
||||||
setPixmap(EVENT_PIXMAP(":violation-icon"));
|
setPixmap(EVENT_PIXMAP(":violation-icon"));
|
||||||
#endif
|
#endif
|
||||||
|
} else if (same_string_caseinsensitive(internalEvent->name, "violation") || // generic libdivecomputer
|
||||||
|
same_string_caseinsensitive(internalEvent->name, "Safety stop violation") || // the rest are from the Uemis downloader
|
||||||
|
same_string_caseinsensitive(internalEvent->name, "pO₂ ascend alarm") ||
|
||||||
|
same_string_caseinsensitive(internalEvent->name, "RGT alert") ||
|
||||||
|
same_string_caseinsensitive(internalEvent->name, "Dive time alert") ||
|
||||||
|
same_string_caseinsensitive(internalEvent->name, "Low battery alert") ||
|
||||||
|
same_string_caseinsensitive(internalEvent->name, "Speed alarm")) {
|
||||||
|
setPixmap(EVENT_PIXMAP(":violation-icon"));
|
||||||
|
} else if (same_string_caseinsensitive(internalEvent->name, "non stop time") || // generic libdivecomputer
|
||||||
|
same_string_caseinsensitive(internalEvent->name, "safety stop") ||
|
||||||
|
same_string_caseinsensitive(internalEvent->name, "safety stop (voluntary)") ||
|
||||||
|
same_string_caseinsensitive(internalEvent->name, "Tank change suggested") || // Uemis downloader
|
||||||
|
same_string_caseinsensitive(internalEvent->name, "Marker")) {
|
||||||
|
setPixmap(EVENT_PIXMAP(":info-icon"));
|
||||||
} else {
|
} else {
|
||||||
// we should do some guessing based on the type / name of the event;
|
// we should do some guessing based on the type / name of the event;
|
||||||
// for now they all get the warning icon
|
// for now they all get the warning icon
|
||||||
|
|
Loading…
Add table
Reference in a new issue