Merge lp:~ted/indicator-session/lock-insensitively into lp:indicator-session/0.1

Proposed by Ted Gould
Status: Merged
Merged at revision: not available
Proposed branch: lp:~ted/indicator-session/lock-insensitively
Merge into: lp:indicator-session/0.1
Diff against target: 47 lines
1 file modified
src/users-service.c (+19/-4)
To merge this branch: bzr merge lp:~ted/indicator-session/lock-insensitively
Reviewer Review Type Date Requested Status
Cody Russell (community) Approve
Review via email: mp+12618@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

Make it so that the lock screen item's sensitivity is also controlled by the gdm autologin setting.

Revision history for this message
Cody Russell (bratsche) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/users-service.c'
2--- src/users-service.c 2009-09-24 21:54:11 +0000
3+++ src/users-service.c 2009-09-29 21:35:17 +0000
4@@ -53,6 +53,8 @@
5 static GMainLoop *mainloop = NULL;
6 static UsersServiceDbus *dbus_interface = NULL;
7
8+static DbusmenuMenuitem *lock_menuitem = NULL;
9+
10 static DBusGProxy * gdm_settings_proxy = NULL;
11 static gboolean gdm_auto_login = FALSE;
12 static const gchar * gdm_auto_login_string = "daemon/AutomaticLoginEnable";
13@@ -78,6 +80,14 @@
14 gdm_auto_login = FALSE;
15 }
16
17+ if (lock_menuitem != NULL) {
18+ if (gdm_auto_login) {
19+ dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false");
20+ } else {
21+ dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "true");
22+ }
23+ }
24+
25 return;
26 }
27
28@@ -277,10 +287,15 @@
29 g_list_foreach (children, (GFunc)g_object_unref, NULL);
30 g_list_free (children);
31
32- mi = dbusmenu_menuitem_new();
33- dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen"));
34- g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), NULL);
35- dbusmenu_menuitem_child_append(root, mi);
36+ lock_menuitem = dbusmenu_menuitem_new();
37+ dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen"));
38+ g_signal_connect(G_OBJECT(lock_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), NULL);
39+ dbusmenu_menuitem_child_append(root, lock_menuitem);
40+ if (gdm_auto_login) {
41+ dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false");
42+ } else {
43+ dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "true");
44+ }
45
46 if (can_activate == TRUE)
47 {

Subscribers

People subscribed via source and target branches