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
1=== modified file 'src/Plug.vala'
2--- src/Plug.vala 2017-02-27 19:50:25 +0000
3+++ src/Plug.vala 2017-02-27 20:49:38 +0000
4@@ -25,6 +25,7 @@
5 public static Plug plug;
6 public static Gtk.LockButton lock_button;
7 public static Blacklist blacklist;
8+ public static FirewallPanel firewall;
9
10 public class Plug : Switchboard.Plug {
11 Gtk.Grid main_grid;
12@@ -109,7 +110,7 @@
13
14 tracking = new TrackPanel ();
15 var locking = new LockPanel ();
16- var firewall = new FirewallPanel ();
17+ firewall = new FirewallPanel ();
18
19 stack.add_titled (tracking, "tracking", _("Privacy"));
20 stack.add_titled (locking, "locking", _("Locking"));
21
22=== modified file 'src/Views/FirewallPanel.vala'
23--- src/Views/FirewallPanel.vala 2017-02-27 19:28:39 +0000
24+++ src/Views/FirewallPanel.vala 2017-02-27 20:49:38 +0000
25@@ -27,6 +27,7 @@
26 private bool loading = false;
27 private Gtk.Popover add_popover;
28 private Gtk.ToolButton remove_button;
29+ public Gtk.Switch status_switch;
30
31 private enum Columns {
32 ACTION,
33@@ -52,7 +53,7 @@
34 status_label.hexpand = true;
35 status_label.xalign = 0;
36
37- var status_switch = new Gtk.Switch ();
38+ status_switch = new Gtk.Switch ();
39 status_switch.valign = Gtk.Align.CENTER;
40
41 status_switch.notify["active"].connect (() => {
42
43=== modified file 'src/Widgets/ServiceItem.vala'
44--- src/Widgets/ServiceItem.vala 2017-02-26 20:21:42 +0000
45+++ src/Widgets/ServiceItem.vala 2017-02-27 20:49:38 +0000
46@@ -17,6 +17,7 @@
47 break;
48 }
49 status_label.no_show_all = false;
50+ status_label.show ();
51 status_label.label = "<span font_size='small'>" + status_label.label + "</span>";
52 }
53 }
54
55=== modified file 'src/Widgets/ServiceList.vala'
56--- src/Widgets/ServiceList.vala 2017-02-27 01:30:20 +0000
57+++ src/Widgets/ServiceList.vala 2017-02-27 20:49:38 +0000
58@@ -12,5 +12,13 @@
59 add (privacy_item);
60 add (lock_item);
61 add (firewall_item);
62+
63+ SecurityPrivacy.firewall.status_switch.notify["active"].connect (() => {
64+ if (SecurityPrivacy.firewall.status_switch.active) {
65+ firewall_item.status = ServiceItem.Status.ENABLED;
66+ } else {
67+ firewall_item.status = ServiceItem.Status.DISABLED;
68+ }
69+ });
70 }
71 }

Subscribers

People subscribed via source and target branches