From 9bfd3efac5d2a4ff9538121c2c7781e38ce3af45 Mon Sep 17 00:00:00 2001 From: Burt P Date: Sat, 6 Jul 2019 15:36:37 -0500 Subject: [PATCH] computer/security: colored icons for CPU vulnerabilities Image Sources: https://www.flaticon.com/free-icon/warning_196760 https://www.flaticon.com/free-icon/cancel_189678 https://www.flaticon.com/free-icon/checked_189677 Image license: https://file000.flaticon.com/downloads/license/license.pdf Attribution required, may alter and create derivative works. Signed-off-by: Burt P --- modules/computer.c | 9 ++++++++- pixmaps/circle_green_check.svg | 1 + pixmaps/circle_red_x.svg | 1 + pixmaps/circle_yellow_exclaim.svg | 1 + shell/callbacks.c | 1 + 5 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 pixmaps/circle_green_check.svg create mode 100644 pixmaps/circle_red_x.svg create mode 100644 pixmaps/circle_yellow_exclaim.svg diff --git a/modules/computer.c b/modules/computer.c index 8e8672752..f04a1da93 100644 --- a/modules/computer.c +++ b/modules/computer.c @@ -624,7 +624,14 @@ gchar *callback_security(void) const gchar *icon = NULL; if (g_strstr_len(contents, -1, "Vulnerable") || g_strstr_len(contents, -1, "vulnerable")) - icon = "dialog-warning.png"; + icon = "circle_red_x.svg"; + + if (g_str_has_prefix(contents, "Mitigation:") || + g_str_has_prefix(contents, "mitigation:")) + icon = "circle_yellow_exclaim.svg"; + + if (g_strstr_len(contents, -1, "Not affected") ) + icon = "circle_green_check.svg"; info_group_add_fields(vulns, info_field(g_strdup(vuln), diff --git a/pixmaps/circle_green_check.svg b/pixmaps/circle_green_check.svg new file mode 100644 index 000000000..39ba61352 --- /dev/null +++ b/pixmaps/circle_green_check.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pixmaps/circle_red_x.svg b/pixmaps/circle_red_x.svg new file mode 100644 index 000000000..a44b2fad2 --- /dev/null +++ b/pixmaps/circle_red_x.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pixmaps/circle_yellow_exclaim.svg b/pixmaps/circle_yellow_exclaim.svg new file mode 100644 index 000000000..40424f4c6 --- /dev/null +++ b/pixmaps/circle_yellow_exclaim.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/shell/callbacks.c b/shell/callbacks.c index c6cc743fe..66d49bd0e 100644 --- a/shell/callbacks.c +++ b/shell/callbacks.c @@ -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 };