aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-08-06 12:01:20 -0500
committerTed Gould <ted@gould.cx>2010-08-06 12:01:20 -0500
commitfbed796878da42ee291f86bfe4ae07ba213b1258 (patch)
treeae87de652d07734e860cd000a25470cf11100b61
parentb423aba6638c2862e0ce92093b92225dbf4b172c (diff)
downloadayatana-indicator-session-fbed796878da42ee291f86bfe4ae07ba213b1258.tar.gz
ayatana-indicator-session-fbed796878da42ee291f86bfe4ae07ba213b1258.tar.bz2
ayatana-indicator-session-fbed796878da42ee291f86bfe4ae07ba213b1258.zip
Set up the listener for the keybinding
-rw-r--r--src/session-service.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/session-service.c b/src/session-service.c
index 4a03974..feef5e7 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -122,6 +122,26 @@ lockdown_changed (GConfClient *client,
return;
}
+static void
+keybinding_changed (GConfClient *client,
+ guint cnxd_id,
+ GConfEntry *entry,
+ gpointer user_data)
+{
+ GConfValue *value = gconf_entry_get_value (entry);
+ const gchar *key = gconf_entry_get_key (entry);
+
+ if (value == NULL || key == NULL) {
+ return;
+ }
+
+ if (g_strcmp0 (key, KEY_LOCK_SCREEN) == 0) {
+ // TODO: set value
+ }
+
+ return;
+}
+
/* Ensures that we have a GConf client and if we build one
set up the signal handler. */
static void
@@ -129,8 +149,12 @@ ensure_gconf_client (void)
{
if (!gconf_client) {
gconf_client = gconf_client_get_default ();
+
gconf_client_add_dir(gconf_client, LOCKDOWN_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
gconf_client_notify_add(gconf_client, LOCKDOWN_DIR, lockdown_changed, NULL, NULL, NULL);
+
+ gconf_client_add_dir(gconf_client, KEYBINDING_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ gconf_client_notify_add(gconf_client, KEYBINDING_DIR, keybinding_changed, NULL, NULL, NULL);
}
return;
}