From fc19ebc2ef9f6da7383c6cfec8cdef8e9f848194 Mon Sep 17 00:00:00 2001 From: xSmurf Date: Mon, 25 Sep 2017 20:31:13 +0000 Subject: [PATCH] Fixed icons to passed name > sandbox name > path basename --- gnome-shell/firewall@subgraph.com/dialog.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/gnome-shell/firewall@subgraph.com/dialog.js b/gnome-shell/firewall@subgraph.com/dialog.js index 87b2728..34dbdca 100644 --- a/gnome-shell/firewall@subgraph.com/dialog.js +++ b/gnome-shell/firewall@subgraph.com/dialog.js @@ -444,12 +444,18 @@ const PromptDialogHeader = new Lang.Class({ this.message.text = text; }, - setIcon: function(name) { - this.icon.icon_name = name; + setIcon: function(name, sandbox) { + if (sandbox.length > 0 && Gtk.IconTheme.get_default().has_icon(sandbox)) { + this.icon.icon_name = sandbox; + } else if (name.length > 0 && Gtk.IconTheme.get_default().has_icon(name)) { + this.icon.icon_name = name; + } else { + this.icon.icon_name = 'security-high-symbolic'; + } }, setIconDefault: function() { - this.setIcon('security-high-symbolic'); + this.icon.icon_name = 'security-high-symbolic'; }, }); @@ -515,7 +521,7 @@ const PromptDialog = new Lang.Class({ if(allow) { verb = "ALLOW"; if (this.optionList.tlsGuard) { - verb = "ALLOW_TLSONLY"; + verb = "ALLOW_TLSONLY"; } else { verb = "ALLOW"; } @@ -584,9 +590,10 @@ const PromptDialog = new Lang.Class({ this.details.activate() } if(icon) { - this.header.setIcon(icon); + this.header.setIcon(icon, sandbox); } else { - this.header.setIconDefault(); + this.header.setIcon(path.split(/\//).pop(), sandbox); + //this.header.setIconDefault(); } if (proto == "icmp") {