Skip to content

Commit

Permalink
computer/security: colored light icons for CPU vulnerabilities
Browse files Browse the repository at this point in the history
Image Source: https://www.flaticon.com/free-icon/traffic-light_196787
Image license: https://file000.flaticon.com/downloads/license/license.pdf
Attribution required, may alter and create derivative works.

Signed-off-by: Burt P <[email protected]>
  • Loading branch information
bp0 committed Jul 6, 2019
1 parent 8bc6f1d commit 550becb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/computer.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,14 @@ gchar *callback_security(void)
struct InfoField field = info_field(vuln, idle_free(contents));
if (g_strstr_len(contents, -1, "Vulnerable") ||
g_strstr_len(contents, -1, "vulnerable"))
field = info_field_with_icon(field, "dialog-warning.png");
field = info_field_with_icon(field, "light_red.png");

if (g_str_has_prefix(contents, "Mitigation:") ||
g_str_has_prefix(contents, "mitigation:"))
field = info_field_with_icon(field, "light_yellow.png");

if (g_strstr_len(contents, -1, "Not affected") )
field = info_field_with_icon(field, "light_green.png");

info_group_add_fields(vulns, field, info_field_last());
}
Expand Down
Binary file added pixmaps/light_green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pixmaps/light_red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pixmaps/light_yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions shell/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ void cb_about()
_("Tango Project"),
_("The GNOME Project"),
_("VMWare, Inc. (USB icon from VMWare Workstation 6)"),
_("Roundicons (https://roundicons.com)"),
NULL
};

Expand Down

0 comments on commit 550becb

Please sign in to comment.