diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lock-helper.c | 50 | ||||
-rw-r--r-- | src/lock-helper.h | 2 | ||||
-rw-r--r-- | src/session-service.c | 7 |
3 files changed, 1 insertions, 58 deletions
diff --git a/src/lock-helper.c b/src/lock-helper.c index ba6b182..cdc8d14 100644 --- a/src/lock-helper.c +++ b/src/lock-helper.c @@ -253,53 +253,3 @@ lock_screen_setup (gpointer data) return FALSE; } -/* When the GConf key changes we need to adjust the text on - what we're going to do with the menu item */ -static void -lockscreen_update (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer data) { - DbusmenuMenuitem * mi = (DbusmenuMenuitem*) data; - const gchar * key = gconf_entry_get_key (entry); - - if(g_strcmp0 (key, GCONF_KEY) == 0) { - if (will_lock_screen()) { - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen")); - } else { - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Start Screensaver")); - } - } -} - -/* Notification handler for lock menuitems. */ -static guint lock_notify = 0; - -/* Sets the menu item to be updating. There can - only be one. So we clear and reset if we get - another. */ -void -lock_screen_update_item (DbusmenuMenuitem * mi) -{ - if (gconf_client == NULL) { - gconf_client = gconf_client_get_default(); - } - - if (lock_notify == 0) { - gconf_client_add_dir (gconf_client, - GCONF_DIR, - GCONF_CLIENT_PRELOAD_ONELEVEL, - NULL); - } - - if (lock_notify != 0) { - gconf_client_notify_remove(gconf_client, lock_notify); - lock_notify = 0; - } - - lock_notify = gconf_client_notify_add(gconf_client, - GCONF_KEY, - lockscreen_update, - mi, - NULL, - NULL); - - return; -} diff --git a/src/lock-helper.h b/src/lock-helper.h index 1d707d8..37f1448 100644 --- a/src/lock-helper.h +++ b/src/lock-helper.h @@ -31,6 +31,4 @@ gboolean will_lock_screen (void); void lock_screen (DbusmenuMenuitem * mi, guint timestamp, gpointer data); gboolean lock_screen_setup (gpointer data); -void lock_screen_update_item (DbusmenuMenuitem * mi); - #endif /* LOCK_HELPER_H__ */ diff --git a/src/session-service.c b/src/session-service.c index 4fc12a1..65640c7 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -516,14 +516,9 @@ rebuild_items (DbusmenuMenuitem *root, /* Lock screen item */ if (can_lockscreen) { lock_menuitem = dbusmenu_menuitem_new(); - if (will_lock_screen()) { - dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen")); - } else { - dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Start Screensaver")); - } + 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); - lock_screen_update_item(lock_menuitem); } /* Set to NULL just incase we don't end up building one */ |