diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-07-23 17:48:34 +0900 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-07-24 09:53:24 +0900 |
commit | 8c2668a6b1d372ad2c3635a9b36b25a3c497e58f (patch) | |
tree | 3bbde46cedbb3be3174b57990bd4868f217631c4 /profile-widget | |
parent | dcf94bef56d93a99649d0cc8ea106b1d0cc3fc7c (diff) | |
download | subsurface-8c2668a6b1d372ad2c3635a9b36b25a3c497e58f.tar.gz |
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>
Diffstat (limited to 'profile-widget')
-rw-r--r-- | profile-widget/diveeventitem.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/profile-widget/diveeventitem.cpp b/profile-widget/diveeventitem.cpp index bd7c012bd..274ac0685 100644 --- a/profile-widget/diveeventitem.cpp +++ b/profile-widget/diveeventitem.cpp @@ -87,8 +87,8 @@ void DiveEventItem::setupPixmap() #else } else if ( #endif - strcmp(internalEvent->name, "heading") == 0 || - (same_string(internalEvent->name, "SP change") && internalEvent->time.seconds == 0)) { + same_string_caseinsensitive(internalEvent->name, "heading") || + (same_string_caseinsensitive(internalEvent->name, "SP change") && internalEvent->time.seconds == 0)) { // 2 cases: // a) some dive computers have heading in every sample // 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) { setPixmap(EVENT_PIXMAP(":violation-icon")); #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 { // we should do some guessing based on the type / name of the event; // for now they all get the warning icon |