Merge lp:~elementary-pantheon/switchboard-plug-security-privacy/firewall-status into lp:~elementary-apps/switchboard-plug-security-privacy/trunk

Proposed by Danielle Foré
Status: Merged
Approved by: David Hewitt
Approved revision: 303
Merged at revision: 304
Proposed branch: lp:~elementary-pantheon/switchboard-plug-security-privacy/firewall-status
Merge into: lp:~elementary-apps/switchboard-plug-security-privacy/trunk
Diff against target: 71 lines (+13/-2)
4 files modified
src/Plug.vala (+2/-1)
src/Views/FirewallPanel.vala (+2/-1)
src/Widgets/ServiceItem.vala (+1/-0)
src/Widgets/ServiceList.vala (+8/-0)
To merge this branch: bzr merge lp:~elementary-pantheon/switchboard-plug-security-privacy/firewall-status
Reviewer Review Type Date Requested Status
David Hewitt code, function Approve
Review via email: mp+318406@code.launchpad.net

Commit message

Show firewall status in the sidebar

To post a comment you must log in.
Revision history for this message
David Hewitt (davidmhewitt) wrote :

It's a shame that you have to be root to determine whether the firewall is running or not. I think moving to firewalld instead of UFW will fix that. Would be nice to have the status indicator always visible instead of just after you'd put an admin password in.

All looks good though.

review: Approve (code, function)
Revision history for this message
Danielle Foré (danrabbit) wrote :

Definitely agree!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Plug.vala'
--- src/Plug.vala 2017-02-27 19:50:25 +0000
+++ src/Plug.vala 2017-02-27 20:49:38 +0000
@@ -25,6 +25,7 @@
25 public static Plug plug;25 public static Plug plug;
26 public static Gtk.LockButton lock_button;26 public static Gtk.LockButton lock_button;
27 public static Blacklist blacklist;27 public static Blacklist blacklist;
28 public static FirewallPanel firewall;
2829
29 public class Plug : Switchboard.Plug {30 public class Plug : Switchboard.Plug {
30 Gtk.Grid main_grid;31 Gtk.Grid main_grid;
@@ -109,7 +110,7 @@
109110
110 tracking = new TrackPanel ();111 tracking = new TrackPanel ();
111 var locking = new LockPanel ();112 var locking = new LockPanel ();
112 var firewall = new FirewallPanel ();113 firewall = new FirewallPanel ();
113114
114 stack.add_titled (tracking, "tracking", _("Privacy"));115 stack.add_titled (tracking, "tracking", _("Privacy"));
115 stack.add_titled (locking, "locking", _("Locking"));116 stack.add_titled (locking, "locking", _("Locking"));
116117
=== modified file 'src/Views/FirewallPanel.vala'
--- src/Views/FirewallPanel.vala 2017-02-27 19:28:39 +0000
+++ src/Views/FirewallPanel.vala 2017-02-27 20:49:38 +0000
@@ -27,6 +27,7 @@
27 private bool loading = false;27 private bool loading = false;
28 private Gtk.Popover add_popover;28 private Gtk.Popover add_popover;
29 private Gtk.ToolButton remove_button;29 private Gtk.ToolButton remove_button;
30 public Gtk.Switch status_switch;
3031
31 private enum Columns {32 private enum Columns {
32 ACTION,33 ACTION,
@@ -52,7 +53,7 @@
52 status_label.hexpand = true;53 status_label.hexpand = true;
53 status_label.xalign = 0;54 status_label.xalign = 0;
5455
55 var status_switch = new Gtk.Switch ();56 status_switch = new Gtk.Switch ();
56 status_switch.valign = Gtk.Align.CENTER;57 status_switch.valign = Gtk.Align.CENTER;
5758
58 status_switch.notify["active"].connect (() => {59 status_switch.notify["active"].connect (() => {
5960
=== modified file 'src/Widgets/ServiceItem.vala'
--- src/Widgets/ServiceItem.vala 2017-02-26 20:21:42 +0000
+++ src/Widgets/ServiceItem.vala 2017-02-27 20:49:38 +0000
@@ -17,6 +17,7 @@
17 break;17 break;
18 }18 }
19 status_label.no_show_all = false;19 status_label.no_show_all = false;
20 status_label.show ();
20 status_label.label = "<span font_size='small'>" + status_label.label + "</span>";21 status_label.label = "<span font_size='small'>" + status_label.label + "</span>";
21 }22 }
22 }23 }
2324
=== modified file 'src/Widgets/ServiceList.vala'
--- src/Widgets/ServiceList.vala 2017-02-27 01:30:20 +0000
+++ src/Widgets/ServiceList.vala 2017-02-27 20:49:38 +0000
@@ -12,5 +12,13 @@
12 add (privacy_item);12 add (privacy_item);
13 add (lock_item);13 add (lock_item);
14 add (firewall_item);14 add (firewall_item);
15
16 SecurityPrivacy.firewall.status_switch.notify["active"].connect (() => {
17 if (SecurityPrivacy.firewall.status_switch.active) {
18 firewall_item.status = ServiceItem.Status.ENABLED;
19 } else {
20 firewall_item.status = ServiceItem.Status.DISABLED;
21 }
22 });
15 }23 }
16}24}

Subscribers

People subscribed via source and target branches