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
1=== modified file 'src/Views/FirewallPanel.vala'
2--- src/Views/FirewallPanel.vala 2017-02-26 20:21:42 +0000
3+++ src/Views/FirewallPanel.vala 2017-02-27 19:29:35 +0000
4@@ -39,20 +39,22 @@
5 }
6
7 public FirewallPanel () {
8- column_spacing = 12;
9- row_spacing = 6;
10- margin = 12;
11- orientation = Gtk.Orientation.VERTICAL;
12-
13- var status_grid = new Gtk.Grid ();
14- status_grid.orientation = Gtk.Orientation.HORIZONTAL;
15- status_grid.column_spacing = 12;
16- status_grid.halign = Gtk.Align.CENTER;
17-
18- var status_label = new Gtk.Label ("");
19- status_label.set_markup ("<b>%s</b>".printf (_("Firewall Status:")));
20+ Object (column_spacing: 12,
21+ margin: 12,
22+ row_spacing: 6);
23+ }
24+
25+ construct {
26+ var status_icon = new Gtk.Image.from_icon_name ("network-firewall", Gtk.IconSize.DIALOG);
27+
28+ var status_label = new Gtk.Label (_("Firewall"));
29+ status_label.get_style_context ().add_class ("h2");
30+ status_label.hexpand = true;
31+ status_label.xalign = 0;
32
33 var status_switch = new Gtk.Switch ();
34+ status_switch.valign = Gtk.Align.CENTER;
35+
36 status_switch.notify["active"].connect (() => {
37 if (loading == false) {
38 view.sensitive = status_switch.active;
39@@ -61,11 +63,14 @@
40 show_rules ();
41 });
42
43- status_grid.add (status_label);
44- status_grid.add (status_switch);
45-
46- add (status_grid);
47+ attach (status_icon, 0, 0, 1, 1);
48+ attach (status_label, 1, 0, 1, 1);
49+ attach (status_switch, 2, 0, 1, 1);
50+
51+ create_treeview ();
52+
53 sensitive = false;
54+
55 lock_button.get_permission ().notify["allowed"].connect (() => {
56 loading = true;
57 sensitive = lock_button.get_permission ().allowed;
58@@ -82,8 +87,6 @@
59 }
60 loading = false;
61 });
62-
63- create_treeview ();
64 }
65
66 private void show_rules () {
67@@ -260,8 +263,9 @@
68 view_grid.attach (list_toolbar, 0, 1, 1, 1);
69
70 var frame = new Gtk.Frame (null);
71+ frame.margin_top = 12;
72 frame.add (view_grid);
73
74- add (frame);
75+ attach (frame, 0, 1, 3, 1);
76 }
77 }

Subscribers

People subscribed via source and target branches