aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-08-06 13:40:30 -0500
committerTed Gould <ted@gould.cx>2010-08-06 13:40:30 -0500
commitfcf32dbec44550b677610791f905c8dc8d1d097a (patch)
treeef06fcfb7759067f93b7f57fccb961eeb5dab392
parentfbed796878da42ee291f86bfe4ae07ba213b1258 (diff)
downloadayatana-indicator-session-fcf32dbec44550b677610791f905c8dc8d1d097a.tar.gz
ayatana-indicator-session-fcf32dbec44550b677610791f905c8dc8d1d097a.tar.bz2
ayatana-indicator-session-fcf32dbec44550b677610791f905c8dc8d1d097a.zip
Putting the shortcut on the menuitem
-rw-r--r--configure.ac1
-rw-r--r--src/session-service.c16
2 files changed, 16 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 168f5bc..aae4584 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,6 +39,7 @@ AC_SUBST(APPLET_LIBS)
DBUSMENUGLIB_REQUIRED_VERSION=0.1.1
PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION
+ dbusmenu-gtk >= $DBUSMENUGTK_REQUIRED_VERSION
gio-unix-2.0
indicator >= $INDICATOR_REQUIRED_VERSION)
diff --git a/src/session-service.c b/src/session-service.c
index feef5e7..2872de0 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -36,6 +36,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <libdbusmenu-glib/server.h>
#include <libdbusmenu-glib/menuitem.h>
#include <libdbusmenu-glib/client.h>
+#include <libdbusmenu-gtk/menuitem.h>
#include <libindicator/indicator-service.h>
@@ -136,7 +137,10 @@ keybinding_changed (GConfClient *client,
}
if (g_strcmp0 (key, KEY_LOCK_SCREEN) == 0) {
- // TODO: set value
+ g_debug("Keybinding changed to: %s", gconf_value_get_string(value));
+ if (lock_menuitem != NULL) {
+ dbusmenu_menuitem_property_set_shortcut_string(lock_menuitem, gconf_value_get_string(value));
+ }
}
return;
@@ -544,6 +548,16 @@ rebuild_items (DbusmenuMenuitem *root,
if (can_lockscreen) {
lock_menuitem = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set(lock_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen"));
+
+ gchar * shortcut = gconf_client_get_string(gconf_client, KEY_LOCK_SCREEN, NULL);
+ if (shortcut != NULL) {
+ g_debug("Lock screen shortcut: %s", shortcut);
+ dbusmenu_menuitem_property_set_shortcut_string(lock_menuitem, shortcut);
+ g_free(shortcut);
+ } else {
+ g_debug("Unable to get lock screen shortcut.");
+ }
+
g_signal_connect(G_OBJECT(lock_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), NULL);
dbusmenu_menuitem_child_append(root, lock_menuitem);
}