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

Proposed by Danielle Foré
Status: Merged
Approved by: David Hewitt
Approved revision: 300
Merged at revision: 302
Proposed branch: lp:~elementary-pantheon/switchboard-plug-security-privacy/firewall-header
Merge into: lp:~elementary-apps/switchboard-plug-security-privacy/trunk
Diff against target: 77 lines (+23/-19)
1 file modified
src/Views/FirewallPanel.vala (+23/-19)
To merge this branch: bzr merge lp:~elementary-pantheon/switchboard-plug-security-privacy/firewall-header
Reviewer Review Type Date Requested Status
David Hewitt code, function Approve
Review via email: mp+318398@code.launchpad.net

Commit message

FirewallPanel.vala:
* GObject-style construction
* Style header
* Don't nest grids

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

Looks good, tested against the previous regression fix as well.

review: Approve (code, function)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Views/FirewallPanel.vala'
--- src/Views/FirewallPanel.vala 2017-02-26 20:21:42 +0000
+++ src/Views/FirewallPanel.vala 2017-02-27 19:29:35 +0000
@@ -39,20 +39,22 @@
39 }39 }
4040
41 public FirewallPanel () {41 public FirewallPanel () {
42 column_spacing = 12;42 Object (column_spacing: 12,
43 row_spacing = 6;43 margin: 12,
44 margin = 12;44 row_spacing: 6);
45 orientation = Gtk.Orientation.VERTICAL;45 }
4646
47 var status_grid = new Gtk.Grid ();47 construct {
48 status_grid.orientation = Gtk.Orientation.HORIZONTAL;48 var status_icon = new Gtk.Image.from_icon_name ("network-firewall", Gtk.IconSize.DIALOG);
49 status_grid.column_spacing = 12;49
50 status_grid.halign = Gtk.Align.CENTER;50 var status_label = new Gtk.Label (_("Firewall"));
5151 status_label.get_style_context ().add_class ("h2");
52 var status_label = new Gtk.Label ("");52 status_label.hexpand = true;
53 status_label.set_markup ("<b>%s</b>".printf (_("Firewall Status:")));53 status_label.xalign = 0;
5454
55 var status_switch = new Gtk.Switch ();55 var status_switch = new Gtk.Switch ();
56 status_switch.valign = Gtk.Align.CENTER;
57
56 status_switch.notify["active"].connect (() => {58 status_switch.notify["active"].connect (() => {
57 if (loading == false) {59 if (loading == false) {
58 view.sensitive = status_switch.active;60 view.sensitive = status_switch.active;
@@ -61,11 +63,14 @@
61 show_rules ();63 show_rules ();
62 });64 });
6365
64 status_grid.add (status_label);66 attach (status_icon, 0, 0, 1, 1);
65 status_grid.add (status_switch);67 attach (status_label, 1, 0, 1, 1);
6668 attach (status_switch, 2, 0, 1, 1);
67 add (status_grid);69
70 create_treeview ();
71
68 sensitive = false;72 sensitive = false;
73
69 lock_button.get_permission ().notify["allowed"].connect (() => {74 lock_button.get_permission ().notify["allowed"].connect (() => {
70 loading = true;75 loading = true;
71 sensitive = lock_button.get_permission ().allowed;76 sensitive = lock_button.get_permission ().allowed;
@@ -82,8 +87,6 @@
82 }87 }
83 loading = false;88 loading = false;
84 });89 });
85
86 create_treeview ();
87 }90 }
8891
89 private void show_rules () {92 private void show_rules () {
@@ -260,8 +263,9 @@
260 view_grid.attach (list_toolbar, 0, 1, 1, 1);263 view_grid.attach (list_toolbar, 0, 1, 1, 1);
261264
262 var frame = new Gtk.Frame (null);265 var frame = new Gtk.Frame (null);
266 frame.margin_top = 12;
263 frame.add (view_grid);267 frame.add (view_grid);
264268
265 add (frame);269 attach (frame, 0, 1, 3, 1);
266 }270 }
267}271}

Subscribers

People subscribed via source and target branches