diff options
author | Ted Gould <ted@canonical.com> | 2009-09-29 21:29:14 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-09-29 21:29:14 -0500 |
commit | 59b1a709d947252f9eaaecbdf1ffd74ab25e869f (patch) | |
tree | c8620267a0a73b148ab428ca2be82d1853e7baec | |
parent | 362aaab499e95a699f8fa0749293bed840340cc2 (diff) | |
parent | 9efc81691426e023df3a2124a6d65a7f4e4fb327 (diff) | |
download | ayatana-indicator-session-59b1a709d947252f9eaaecbdf1ffd74ab25e869f.tar.gz ayatana-indicator-session-59b1a709d947252f9eaaecbdf1ffd74ab25e869f.tar.bz2 ayatana-indicator-session-59b1a709d947252f9eaaecbdf1ffd74ab25e869f.zip |
Merging in a branch to make the lock item insensitive if autologin is configured in GDM.
-rw-r--r-- | src/users-service.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/users-service.c b/src/users-service.c index dc11e8d..894b832 100644 --- a/src/users-service.c +++ b/src/users-service.c @@ -53,6 +53,8 @@ static DbusmenuMenuitem *root_menuitem = NULL; static GMainLoop *mainloop = NULL; static UsersServiceDbus *dbus_interface = NULL; +static DbusmenuMenuitem *lock_menuitem = NULL; + static DBusGProxy * gdm_settings_proxy = NULL; static gboolean gdm_auto_login = FALSE; static const gchar * gdm_auto_login_string = "daemon/AutomaticLoginEnable"; @@ -78,6 +80,14 @@ gdm_settings_change (DBusGProxy * proxy, const gchar * value, const gchar * old, gdm_auto_login = FALSE; } + if (lock_menuitem != NULL) { + if (gdm_auto_login) { + dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false"); + } else { + dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "true"); + } + } + return; } @@ -277,10 +287,15 @@ rebuild_items (DbusmenuMenuitem *root, g_list_foreach (children, (GFunc)g_object_unref, NULL); g_list_free (children); - mi = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen")); - g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), NULL); - dbusmenu_menuitem_child_append(root, mi); + lock_menuitem = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen")); + g_signal_connect(G_OBJECT(lock_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), NULL); + dbusmenu_menuitem_child_append(root, lock_menuitem); + if (gdm_auto_login) { + dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "false"); + } else { + dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_SENSITIVE, "true"); + } if (can_activate == TRUE) { |