From de9319c41d5413800c06c6a6e5c16bb30232ab59 Mon Sep 17 00:00:00 2001 From: Burt P Date: Sat, 6 Jul 2019 15:36:37 -0500 Subject: [PATCH 1/2] computer/security: colored icons for CPU vulnerabilities [v3] 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 295a3ed42..605537f34 100644 --- a/modules/computer.c +++ b/modules/computer.c @@ -658,9 +658,16 @@ gchar *callback_security(void) continue; const gchar *icon = NULL; + if (g_strstr_len(contents, -1, "Not affected") ) + icon = "circle_green_check.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, "Vulnerable") || g_strstr_len(contents, -1, "vulnerable")) - icon = "dialog-warning.png"; + icon = "circle_red_x.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 c116c023f..cf245e8e0 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 }; From e0aaaf986eac63016919908cc2bc6e84aeaefcea Mon Sep 17 00:00:00 2001 From: Burt P Date: Sat, 23 Nov 2019 00:40:55 -0600 Subject: [PATCH 2/2] computer/security: change icon colors Change colors to match previously existing icons. * Red is from dialog-error.png * Green is from memory.png Signed-off-by: Burt P --- pixmaps/circle_green_check.svg | 2 +- pixmaps/circle_red_x.svg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pixmaps/circle_green_check.svg b/pixmaps/circle_green_check.svg index 39ba61352..88f6b5672 100644 --- a/pixmaps/circle_green_check.svg +++ b/pixmaps/circle_green_check.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/pixmaps/circle_red_x.svg b/pixmaps/circle_red_x.svg index a44b2fad2..05ae16003 100644 --- a/pixmaps/circle_red_x.svg +++ b/pixmaps/circle_red_x.svg @@ -1 +1 @@ - \ No newline at end of file +