Merge lp:~elementary-pantheon/switchboard-plug-security-privacy/track-panel-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: 300
Proposed branch: lp:~elementary-pantheon/switchboard-plug-security-privacy/track-panel-header
Merge into: lp:~elementary-apps/switchboard-plug-security-privacy/trunk
Diff against target: 100 lines (+26/-18)
1 file modified
src/Views/TrackPanel.vala (+26/-18)
To merge this branch: bzr merge lp:~elementary-pantheon/switchboard-plug-security-privacy/track-panel-header
Reviewer Review Type Date Requested Status
David Hewitt code, function Approve
Review via email: mp+318392@code.launchpad.net

Commit message

TrackPanel.vala:
* GObject-style construct
* Rename record_grid to header_grid and move to top, style

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

Much cleaner and easier to understand like this.

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/TrackPanel.vala'
2--- src/Views/TrackPanel.vala 2017-02-27 16:43:21 +0000
3+++ src/Views/TrackPanel.vala 2017-02-27 18:25:32 +0000
4@@ -49,14 +49,24 @@
5 }
6
7 public TrackPanel () {
8+ Object (column_spacing: 12,
9+ margin: 12,
10+ row_spacing: 12);
11+ }
12+
13+ construct {
14 app_blacklist = new ApplicationBlacklist (blacklist);
15 path_blacklist = new PathBlacklist (blacklist);
16 filetype_blacklist = new FileTypeBlacklist (blacklist);
17
18+ create_description_panel ();
19+
20 var privacy_settings = new GLib.Settings ("org.gnome.desktop.privacy");
21
22- var record_label = new Gtk.Label (_("Privacy Mode:"));
23- record_label.get_style_context ().add_class ("h4");
24+ var icon = new Gtk.Image.from_icon_name ("document-open-recent", Gtk.IconSize.DIALOG);
25+
26+ var record_label = new Gtk.Label (_("Privacy"));
27+ record_label.get_style_context ().add_class ("h2");
28
29 record_switch = new Gtk.Switch ();
30 record_switch.valign = Gtk.Align.CENTER;
31@@ -73,16 +83,18 @@
32 }
33 });
34
35- create_description_panel ();
36-
37 var info_button = new Gtk.Image.from_icon_name ("help-info-symbolic", Gtk.IconSize.MENU);
38+ info_button.hexpand = true;
39+ info_button.xalign = 0;
40 info_button.tooltip_text = _("This operating system can gather useful statistics about file and app usage to provide extra functionality. If other people can see or access your account, you may wish to limit which items are recorded.");
41
42- var record_grid = new Gtk.Grid ();
43- record_grid.column_spacing = 12;
44- record_grid.add (record_label);
45- record_grid.add (record_switch);
46- record_grid.add (info_button);
47+ var header_grid = new Gtk.Grid ();
48+ header_grid.column_spacing = 12;
49+ header_grid.margin_bottom = 12;
50+ header_grid.add (icon);
51+ header_grid.add (record_label);
52+ header_grid.add (info_button);
53+ header_grid.add (record_switch);
54
55 var clear_data = new Gtk.ToggleButton.with_label (_("Clear Usage Data…"));
56 clear_data.halign = Gtk.Align.END;
57@@ -99,14 +111,11 @@
58 clear_data.active = false;
59 });
60
61- column_spacing = 12;
62- row_spacing = 12;
63- margin = 12;
64-
65 create_include_treeview ();
66 create_exclude_treeview ();
67- attach (record_grid, 0, 1, 1, 1);
68- attach (clear_data, 1, 1, 1, 1);
69+ attach (header_grid, 0, 0, 2, 1);
70+ attach (exclude_grid, 1, 1, 1, 1);
71+ attach (clear_data, 1, 2, 1, 1);
72
73 record_switch.active = blacklist.get_incognito ();
74 }
75@@ -148,7 +157,7 @@
76
77 description_frame.add (alert);
78
79- attach (description_frame, 0, 0, 2, 1);
80+ attach (description_frame, 0, 1, 2, 1);
81 }
82
83 private void create_include_treeview () {
84@@ -196,7 +205,7 @@
85 record_grid.row_spacing = 6;
86 record_grid.attach (record_label, 0, 0, 1, 1);
87 record_grid.attach (scrolled, 0, 1, 1, 1);
88- attach (record_grid, 0, 0, 1, 1);
89+ attach (record_grid, 0, 1, 1, 1);
90
91 set_inclue_iter_to_liststore (list_store, _("Chat Logs"), "internet-chat", Zeitgeist.NMO.IMMESSAGE);
92 set_inclue_iter_to_liststore (list_store, _("Documents"), "x-office-document", Zeitgeist.NFO.DOCUMENT);
93@@ -314,7 +323,6 @@
94 exclude_grid.orientation = Gtk.Orientation.VERTICAL;
95 exclude_grid.add (record_label);
96 exclude_grid.add (frame);
97- attach (exclude_grid, 1, 0, 1, 1);
98
99 view.cursor_changed.connect (() => {
100 remove_button.sensitive = true;

Subscribers

People subscribed via source and target branches