← Back to team overview

zeitgeist team mailing list archive

[Merge] lp:~jbicha/activity-log-manager/add-security-tab into lp:activity-log-manager

 

Jeremy Bicha has proposed merging lp:~jbicha/activity-log-manager/add-security-tab into lp:activity-log-manager.

Requested reviews:
  Activity Log Manager (activity-log-manager)
Related bugs:
  Bug #1189313 in Activity Log Manager: "Consider copying from GNOME Privacy panel"
  https://bugs.launchpad.net/activity-log-manager/+bug/1189313

For more details, see:
https://code.launchpad.net/~jbicha/activity-log-manager/add-security-tab/+merge/173295

Based mostly on https://wiki.ubuntu.com/SecurityAndPrivacySettings

- According to the design, there should be one more option for "Require my password when logging in" aka autologin

- Also we probably need a gtkcombobox to set how long after the screen goes blank for the lock to be applied.
(The separate gtkcombox for "delay before the screen blanks" currently is in Brightness & Lock but will be moving to the Power panel.)

- I couldn't figure out how to directly call the Change Password widget from user-accounts.

What do you think about moving the "Include online search results" option in this tab too? It doesn't exactly fit but it would look better than having it on its own tab.
-- 
https://code.launchpad.net/~jbicha/activity-log-manager/add-security-tab/+merge/173295
Your team Activity Log Manager is requested to review the proposed merge of lp:~jbicha/activity-log-manager/add-security-tab into lp:activity-log-manager.
=== modified file 'po/POTFILES.in'
--- po/POTFILES.in	2013-06-12 23:31:37 +0000
+++ po/POTFILES.in	2013-07-06 00:57:27 +0000
@@ -3,6 +3,7 @@
 src/activity-log-manager.vala
 src/alm.vala
 src/alm-cc.c
+src/security-widget.vala
 src/unified-privacy-files.vala
 src/unified-privacy-applications.vala
 src/unified-privacy-history.vala

=== modified file 'po/POTFILES.skip'
--- po/POTFILES.skip	2013-04-19 06:59:09 +0000
+++ po/POTFILES.skip	2013-07-06 00:57:27 +0000
@@ -1,5 +1,6 @@
 src/activity-log-manager.c
 src/alm.c
+src/security-widget.c
 src/unified-privacy-applications.c
 src/unified-privacy-history.c
 src/unified-privacy.c

=== modified file 'src/Makefile.am'
--- src/Makefile.am	2013-07-03 08:09:42 +0000
+++ src/Makefile.am	2013-07-06 00:57:27 +0000
@@ -24,6 +24,7 @@
 SHARED_SOURCES = \
 	blacklist-dbus.vala \
 	activity-log-manager.vala \
+	security-widget.vala \
         unified-privacy-files.vala \
         unified-privacy-applications.vala \
         unified-privacy-history.vala \

=== modified file 'src/activity-log-manager.vala'
--- src/activity-log-manager.vala	2013-06-28 16:24:00 +0000
+++ src/activity-log-manager.vala	2013-07-06 00:57:27 +0000
@@ -25,6 +25,7 @@
 
 	public class ActivityLogManager : Gtk.Box {
 		private Gtk.Notebook notebook;
+		private SecurityWidget security_widget;
 		private PrivacyWidget privacy_widget;
         private Gtk.Widget whoopsie;
 
@@ -45,6 +46,14 @@
 			this.pack_start(notebook, true, true, 0);
 			var privacy_label = new Gtk.Label(_("Files & Applications"));
 			notebook.append_page(privacy_widget, privacy_label);
+
+			if (GLib.Environment.get_variable ("XDG_CURRENT_DESKTOP") == "Unity")
+			{
+				security_widget = new SecurityWidget();
+				var security_label = new Gtk.Label(_("Security"));
+				notebook.prepend_page(security_widget, security_label);
+			}
+
             var whoopsie_label = new Gtk.Label(_("Diagnostics"));
             notebook.append_page(whoopsie, whoopsie_label);
 			this.show_all();

=== added file 'src/security-widget.vala'
--- src/security-widget.vala	1970-01-01 00:00:00 +0000
+++ src/security-widget.vala	2013-07-06 00:57:27 +0000
@@ -0,0 +1,92 @@
+/* -*- Mode: vala; tab-width: 4; intend-tabs-mode: t -*- */
+/* alm
+ *
+ * Copyright (C) 2013 Jeremy Bicha <jbicha@xxxxxxxxxx>
+ *
+ * alm is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * alm is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+using Gtk;
+using Gee;
+
+namespace Alm {
+
+	public class SecurityWidget : Gtk.Box {
+
+		private GLib.Settings power_settings;
+		private GLib.Settings session_settings;
+		private GLib.Settings screensaver_settings;
+
+		public SecurityWidget () {
+			Object (orientation: Orientation.VERTICAL);
+			this.spacing = 5;
+			this.set_border_width(12);
+
+			power_settings = new GLib.Settings ("org.gnome.settings-daemon.plugins.power");
+			session_settings = new GLib.Settings ("org.gnome.desktop.session");
+			screensaver_settings = new GLib.Settings ("org.gnome.desktop.screensaver");
+
+			this.set_up_ui ();
+		}
+
+		private void set_up_ui () {
+			var grid = new Grid();
+			grid.set_halign(Align.START);
+			grid.set_valign(Align.START);
+			grid.set_margin_top(25);
+			grid.set_margin_left(25);
+			grid.set_column_spacing(100);
+			grid.set_row_spacing(5);
+			this.add(grid);
+
+			var header = new Label("");
+			header.set_markup("<b>%s</b>".printf(_("Require my password when:")));
+			grid.attach(header, 0, 0, 1, 1);
+
+			var suspend_lock = new CheckButton.with_mnemonic (_("_Waking from suspend"));
+			screensaver_settings.bind ("ubuntu-lock-on-suspend", suspend_lock, "active", SettingsBindFlags.DEFAULT);
+			grid.attach(suspend_lock, 0, 1, 1, 1);
+
+			var screen_lock = new CheckButton.with_mnemonic (_("_Returning from blank screen"));
+			screensaver_settings.bind ("lock-enabled", screen_lock, "active", SettingsBindFlags.DEFAULT);
+			grid.attach(screen_lock, 0, 2, 1, 1);
+
+			/*column2.set_margin_left(75);*/
+			var password_link = new Gtk.LinkButton (_("Password Settings"));
+			password_link.activate_link.connect (() => {
+				try {
+					Process.spawn_command_line_async ("gnome-control-center user-accounts");
+				} catch (SpawnError e) {
+					stdout.printf ("Error: %s\n", e.message);
+				}
+				return true;
+			});
+			password_link.set_halign(Align.START);
+			grid.attach(password_link, 1, 0, 1, 1);
+
+			var power_link = new Gtk.LinkButton(_("Power Settings"));
+			power_link.activate_link.connect (() => {
+				try {
+					Process.spawn_command_line_async ("gnome-control-center power");
+				} catch (SpawnError e) {
+					stdout.printf ("Error: %s\n", e.message);
+				}
+				return true;
+			});
+			power_link.set_halign(Align.START);
+			grid.attach(power_link, 1, 1, 1, 1);
+		}
+
+	}
+}


Follow ups