From 170bf19444a9311069cceb1fc16b5b2c1b5936ed 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 99257e9f3..b45fc1d36 100644 --- a/modules/computer.c +++ b/modules/computer.c @@ -642,7 +642,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 };