From 7c1f28e80e07e3a352947fd089f9b1d127ff77b8 Mon Sep 17 00:00:00 2001 From: Christoph Korn Date: Tue, 8 Sep 2009 21:26:38 +0200 Subject: The menu now immediately is updated when the gconf-key about the logout/shutdown/restart confirmations is changed. --- src/gtk-dialog/Makefile.am | 4 ++-- src/gtk-dialog/gconf-helper.c | 49 +++++++++++++++++++++++++++++++++++++++---- src/gtk-dialog/gconf-helper.h | 21 +++++++++++++++++-- src/session-service.c | 43 ++++++++++++++++++++++--------------- 4 files changed, 92 insertions(+), 25 deletions(-) diff --git a/src/gtk-dialog/Makefile.am b/src/gtk-dialog/Makefile.am index 90a6209..9cdc18e 100644 --- a/src/gtk-dialog/Makefile.am +++ b/src/gtk-dialog/Makefile.am @@ -10,6 +10,6 @@ gtk_logout_helper_SOURCES = \ logout-dialog.c \ logout-dialog.h -gtk_logout_helper_CFLAGS = $(GTKLOGOUTHELPER_CFLAGS) $(GCONF_CFLAGS) -Wall -Werror -gtk_logout_helper_LDADD = $(GTKLOGOUTHELPER_LIBS) $(GCONF_LIBS) +gtk_logout_helper_CFLAGS = $(SESSIONSERVICE_CFLAGS) $(GTKLOGOUTHELPER_CFLAGS) $(GCONF_CFLAGS) -Wall -Werror +gtk_logout_helper_LDADD = $(SESSIONSERVICE_LIBS) $(GTKLOGOUTHELPER_LIBS) $(GCONF_LIBS) diff --git a/src/gtk-dialog/gconf-helper.c b/src/gtk-dialog/gconf-helper.c index 0bd21ad..7fc40d6 100644 --- a/src/gtk-dialog/gconf-helper.c +++ b/src/gtk-dialog/gconf-helper.c @@ -1,6 +1,5 @@ /* -A small wrapper utility to load indicators and put them as menu items -into the gnome-panel using it's applet interface. +A small wrapper utility for connecting to gconf. Copyright 2009 Canonical Ltd. @@ -23,10 +22,52 @@ with this program. If not, see . #include +#include + +#include +#include + +#include +#include + #include "gconf-helper.h" +static GConfClient * gconf_client = NULL; + gboolean supress_confirmations (void) { - GConfClient *client = gconf_client_get_default (); - return gconf_client_get_bool (client, SUPPRESS_KEY, NULL) ; + if(!gconf_client) { + gconf_client = gconf_client_get_default (); + } + return gconf_client_get_bool (gconf_client, SUPPRESS_KEY, NULL) ; +} + +static void update_menu_entries_callback (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer data) { + RestartShutdownLogoutMenuItems * restart_shutdown_logout_mi = (RestartShutdownLogoutMenuItems*) data; + GConfValue * value = gconf_entry_get_value (entry); + const gchar * key = gconf_entry_get_key (entry); + + if(strcmp (key, SUPPRESS_KEY) == 0) { + if (gconf_value_get_bool (value)) { + dbusmenu_menuitem_property_set(restart_shutdown_logout_mi->logout_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out")); + dbusmenu_menuitem_property_set(restart_shutdown_logout_mi->restart_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart")); + dbusmenu_menuitem_property_set(restart_shutdown_logout_mi->shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown")); + } else { + dbusmenu_menuitem_property_set(restart_shutdown_logout_mi->logout_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out ...")); + dbusmenu_menuitem_property_set(restart_shutdown_logout_mi->restart_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart ...")); + dbusmenu_menuitem_property_set(restart_shutdown_logout_mi->shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown ...")); + } + } } + +void +update_menu_entries(RestartShutdownLogoutMenuItems * restart_shutdown_logout_mi) { + if(!gconf_client) { + gconf_client = gconf_client_get_default (); + } + gconf_client_add_dir (gconf_client, GLOBAL_DIR, + GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + gconf_client_notify_add (gconf_client, SUPPRESS_KEY, + update_menu_entries_callback, restart_shutdown_logout_mi, NULL, NULL); +} + diff --git a/src/gtk-dialog/gconf-helper.h b/src/gtk-dialog/gconf-helper.h index 1d78fd8..951bb0f 100644 --- a/src/gtk-dialog/gconf-helper.h +++ b/src/gtk-dialog/gconf-helper.h @@ -1,6 +1,5 @@ /* -A small wrapper utility to load indicators and put them as menu items -into the gnome-panel using it's applet interface. +A small wrapper utility for connecting to gconf. Copyright 2009 Canonical Ltd. @@ -26,8 +25,26 @@ with this program. If not, see . #include +#include + +#include +#include + +#include +#include + #define SUPPRESS_KEY "/apps/indicator-session/suppress_logout_restart_shutdown" +#define GLOBAL_DIR "/apps/indicator-session" + +typedef struct _RestartShutdownLogoutMenuItems +{ + DbusmenuMenuitem * logout_mi; + DbusmenuMenuitem * restart_mi; + DbusmenuMenuitem * shutdown_mi; +} +RestartShutdownLogoutMenuItems; +void update_menu_entries(RestartShutdownLogoutMenuItems*); gboolean supress_confirmations (void); #endif /* __GCONF_HELPER__ */ diff --git a/src/session-service.c b/src/session-service.c index 9e5cbb2..33b58a3 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -6,6 +6,7 @@ Copyright 2009 Canonical Ltd. Authors: Ted Gould + Christoph Korn This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published @@ -47,6 +48,9 @@ static DBusGProxyCall * hibernate_call = NULL; static DbusmenuMenuitem * hibernate_mi = NULL; static DbusmenuMenuitem * suspend_mi = NULL; +static DbusmenuMenuitem * logout_mi = NULL; +static DbusmenuMenuitem * restart_mi = NULL; +static DbusmenuMenuitem * shutdown_mi = NULL; /* Let's put this machine to sleep, with some info on how it should sleep. */ @@ -222,16 +226,14 @@ show_dialog (DbusmenuMenuitem * mi, gchar * type) provides in the UI. It also connects them to the callbacks. */ static void create_items (DbusmenuMenuitem * root) { - DbusmenuMenuitem * mi = NULL; - - mi = dbusmenu_menuitem_new(); + logout_mi = dbusmenu_menuitem_new(); if (supress_confirmations()) { - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out")); + dbusmenu_menuitem_property_set(logout_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out")); } else { - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out ...")); + dbusmenu_menuitem_property_set(logout_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out ...")); } - dbusmenu_menuitem_child_append(root, mi); - g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "logout"); + dbusmenu_menuitem_child_append(root, logout_mi); + g_signal_connect(G_OBJECT(logout_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "logout"); suspend_mi = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set(suspend_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, "false"); @@ -245,23 +247,30 @@ create_items (DbusmenuMenuitem * root) { dbusmenu_menuitem_child_append(root, hibernate_mi); g_signal_connect(G_OBJECT(hibernate_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(sleep), "Hibernate"); - mi = dbusmenu_menuitem_new(); + restart_mi = dbusmenu_menuitem_new(); if (supress_confirmations()) { - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart")); + dbusmenu_menuitem_property_set(restart_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart")); } else { - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart ...")); + dbusmenu_menuitem_property_set(restart_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart ...")); } - dbusmenu_menuitem_child_append(root, mi); - g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "restart"); + dbusmenu_menuitem_child_append(root, restart_mi); + g_signal_connect(G_OBJECT(restart_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "restart"); - mi = dbusmenu_menuitem_new(); + shutdown_mi = dbusmenu_menuitem_new(); if (supress_confirmations()) { - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown")); + dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown")); } else { - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown ...")); + dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown ...")); } - dbusmenu_menuitem_child_append(root, mi); - g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "shutdown"); + dbusmenu_menuitem_child_append(root, shutdown_mi); + g_signal_connect(G_OBJECT(shutdown_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "shutdown"); + + RestartShutdownLogoutMenuItems * restart_shutdown_logout_mi = g_new0 (RestartShutdownLogoutMenuItems, 1); + restart_shutdown_logout_mi->logout_mi = logout_mi; + restart_shutdown_logout_mi->restart_mi = restart_mi; + restart_shutdown_logout_mi->shutdown_mi = shutdown_mi; + + update_menu_entries(restart_shutdown_logout_mi); return; } -- cgit v1.2.3 From 935d113e94596808eb0db0cf1719905b68c237d3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Sep 2009 12:10:07 -0500 Subject: Adding in a disconnected status value and making it so that when it is the global status we should make the menu items to set status insensitive. --- src/status-provider.h | 1 + src/status-service.c | 55 +++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/status-provider.h b/src/status-provider.h index 522e61b..a0e1c55 100644 --- a/src/status-provider.h +++ b/src/status-provider.h @@ -42,6 +42,7 @@ typedef enum STATUS_PROVIDER_STATUS_DND, STATUS_PROVIDER_STATUS_INVISIBLE, STATUS_PROVIDER_STATUS_OFFLINE, + STATUS_PROVIDER_STATUS_DISCONNECTED, /* Leave as last */ STATUS_PROVIDER_STATUS_LAST } diff --git a/src/status-service.c b/src/status-service.c index b210dcd..195529b 100644 --- a/src/status-service.c +++ b/src/status-service.c @@ -55,7 +55,8 @@ static const gchar * status_strings [STATUS_PROVIDER_STATUS_LAST] = { /* STATUS_PROVIDER_STATUS_AWAY, */ N_("Away"), /* STATUS_PROVIDER_STATUS_DND */ N_("Busy"), /* STATUS_PROVIDER_STATUS_INVISIBLE */ N_("Invisible"), - /* STATUS_PROVIDER_STATUS_OFFLINE, */ N_("Offline") + /* STATUS_PROVIDER_STATUS_OFFLINE, */ N_("Offline"), + /* STATUS_PROVIDER_STATUS_DISCONNECTED*/ N_("Offline") }; static const gchar * status_icons[STATUS_PROVIDER_STATUS_LAST] = { @@ -63,21 +64,25 @@ static const gchar * status_icons[STATUS_PROVIDER_STATUS_LAST] = { /* STATUS_PROVIDER_STATUS_AWAY, */ "user-away", /* STATUS_PROVIDER_STATUS_DND, */ "user-busy", /* STATUS_PROVIDER_STATUS_INVISIBLE, */ "user-invisible", - /* STATUS_PROVIDER_STATUS_OFFLINE */ "user-offline" + /* STATUS_PROVIDER_STATUS_OFFLINE */ "user-offline", + /* STATUS_PROVIDER_STATUS_DISCONNECTED */"user-offline" }; static DbusmenuMenuitem * root_menuitem = NULL; static DbusmenuMenuitem * status_menuitem = NULL; +static DbusmenuMenuitem * status_menuitems[STATUS_PROVIDER_STATUS_LAST] = {0}; static GMainLoop * mainloop = NULL; static StatusServiceDbus * dbus_interface = NULL; -static StatusProviderStatus global_status = STATUS_PROVIDER_STATUS_OFFLINE; +static StatusProviderStatus global_status = STATUS_PROVIDER_STATUS_DISCONNECTED; static void status_update (void) { StatusProviderStatus oldglobal = global_status; - global_status = STATUS_PROVIDER_STATUS_OFFLINE; + global_status = STATUS_PROVIDER_STATUS_DISCONNECTED; + /* Ask everyone what they think the status should be, if + they're more connected, up the global level */ int i; for (i = 0; i < STATUS_PROVIDER_CNT; i++) { StatusProviderStatus localstatus = status_provider_get_status(status_providers[i]); @@ -86,11 +91,34 @@ status_update (void) { } } + /* If changed */ if (global_status != oldglobal) { g_debug("Global status changed to: %s", _(status_strings[global_status])); + /* Set the status name on the menu item */ dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[global_status])); + /* Configure the icon on the panel */ status_service_dbus_set_status(dbus_interface, status_icons[global_status]); + + /* If we're now disconnected, make setting the statuses + insensitive. */ + if (global_status == STATUS_PROVIDER_STATUS_DISCONNECTED) { + StatusProviderStatus i; + for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) { + if (status_menuitems[i] == NULL) continue; + dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_SENSITIVE, "false"); + } + } + + /* If we're now back to a state where we have an IM client + connected then we need to resensitize the items. */ + if (oldglobal == STATUS_PROVIDER_STATUS_DISCONNECTED) { + StatusProviderStatus i; + for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) { + if (status_menuitems[i] == NULL) continue; + dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_SENSITIVE, "true"); + } + } } return; @@ -195,14 +223,21 @@ build_menu (gpointer data) StatusProviderStatus i; for (i = STATUS_PROVIDER_STATUS_ONLINE; i < STATUS_PROVIDER_STATUS_LAST; i++) { - DbusmenuMenuitem * mi = dbusmenu_menuitem_new(); + if (i == STATUS_PROVIDER_STATUS_DISCONNECTED) { + /* We don't want an item for the disconnected status. Users + can't set that value through the menu :) */ + continue; + } + + status_menuitems[i] = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(mi, "type", DBUSMENU_CLIENT_TYPES_IMAGE); - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[i])); - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_ICON, status_icons[i]); - g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(status_menu_click), GINT_TO_POINTER(i)); + dbusmenu_menuitem_property_set(status_menuitems[i], "type", DBUSMENU_CLIENT_TYPES_IMAGE); + dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[i])); + dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_ICON, status_icons[i]); + dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_SENSITIVE, "false"); + g_signal_connect(G_OBJECT(status_menuitems[i]), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(status_menu_click), GINT_TO_POINTER(i)); - dbusmenu_menuitem_child_append(status_menuitem, mi); + dbusmenu_menuitem_child_append(status_menuitem, status_menuitems[i]); g_debug("Built %s", status_strings[i]); } -- cgit v1.2.3 From 6fa2a0c95d455ba4eb0a310b0314fb493a6148da Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Sep 2009 12:24:05 -0500 Subject: Adding disconnected to the pidgin handler. --- src/status-provider-pidgin.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/status-provider-pidgin.c b/src/status-provider-pidgin.c index 052ce12..e65dc54 100644 --- a/src/status-provider-pidgin.c +++ b/src/status-provider-pidgin.c @@ -59,7 +59,8 @@ static const pg_status_t sp_to_pg_map[STATUS_PROVIDER_STATUS_LAST] = { /* STATUS_PROVIDER_STATUS_AWAY, */ PG_STATUS_AWAY, /* STATUS_PROVIDER_STATUS_DND */ PG_STATUS_UNAVAILABLE, /* STATUS_PROVIDER_STATUS_INVISIBLE*/ PG_STATUS_INVISIBLE, - /* STATUS_PROVIDER_STATUS_OFFLINE */ PG_STATUS_OFFLINE + /* STATUS_PROVIDER_STATUS_OFFLINE */ PG_STATUS_OFFLINE, + /* STATUS_PROVIDER_STATUS_DISCONNECTED*/ PG_STATUS_OFFLINE }; typedef struct _StatusProviderPidginPrivate StatusProviderPidginPrivate; @@ -346,11 +347,17 @@ set_status (StatusProvider * sp, StatusProviderStatus status) } /* Takes the cached Pidgin status and makes it into the generic - Status provider status */ + Status provider status. If there is no Pidgin proxy then it + returns the disconnected state. */ static StatusProviderStatus get_status (StatusProvider * sp) { - g_return_val_if_fail(IS_STATUS_PROVIDER_PIDGIN(sp), STATUS_PROVIDER_STATUS_OFFLINE); + g_return_val_if_fail(IS_STATUS_PROVIDER_PIDGIN(sp), STATUS_PROVIDER_STATUS_DISCONNECTED); StatusProviderPidginPrivate * priv = STATUS_PROVIDER_PIDGIN_GET_PRIVATE(sp); + + if (priv->proxy == NULL) { + return STATUS_PROVIDER_STATUS_DISCONNECTED; + } + return pg_to_sp_map[priv->pg_status]; } -- cgit v1.2.3 From 2ad97fd722286b1e9780c10efc3a87e42a0796c4 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Sep 2009 12:24:16 -0500 Subject: Adding disconnected to the telepathy handler. --- src/status-provider-telepathy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/status-provider-telepathy.c b/src/status-provider-telepathy.c index e22c27d..31da224 100644 --- a/src/status-provider-telepathy.c +++ b/src/status-provider-telepathy.c @@ -55,7 +55,8 @@ static mc_status_t sp_to_mc_map[] = { /* STATUS_PROVIDER_STATUS_AWAY, */ MC_STATUS_AWAY, /* STATUS_PROVIDER_STATUS_DND */ MC_STATUS_DND, /* STATUS_PROVIDER_STATUS_INVISIBLE*/ MC_STATUS_HIDDEN, - /* STATUS_PROVIDER_STATUS_OFFLINE */ MC_STATUS_OFFLINE + /* STATUS_PROVIDER_STATUS_OFFLINE */ MC_STATUS_OFFLINE, + /* STATUS_PROVIDER_STATUS_DISCONNECTED*/MC_STATUS_OFFLINE }; typedef struct _StatusProviderTelepathyPrivate StatusProviderTelepathyPrivate; @@ -258,10 +259,11 @@ set_status (StatusProvider * sp, StatusProviderStatus status) static StatusProviderStatus get_status (StatusProvider * sp) { + g_return_val_if_fail(IS_STATUS_PROVIDER_TELEPATHY(sp), STATUS_PROVIDER_STATUS_DISCONNECTED); StatusProviderTelepathyPrivate * priv = STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(sp); if (priv->proxy == NULL) { - return mc_to_sp_map[MC_STATUS_OFFLINE]; + return STATUS_PROVIDER_STATUS_DISCONNECTED; } return mc_to_sp_map[priv->mc_status]; -- cgit v1.2.3 From ec17d0a7bae74ab2f276b73e03b7d60877d3bcfa Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Sep 2009 13:08:56 -0500 Subject: Splitting out the building of the Pidgin proxy into it's own function. --- src/status-provider-pidgin.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/status-provider-pidgin.c b/src/status-provider-pidgin.c index e65dc54..f4704db 100644 --- a/src/status-provider-pidgin.c +++ b/src/status-provider-pidgin.c @@ -66,6 +66,7 @@ static const pg_status_t sp_to_pg_map[STATUS_PROVIDER_STATUS_LAST] = { typedef struct _StatusProviderPidginPrivate StatusProviderPidginPrivate; struct _StatusProviderPidginPrivate { DBusGProxy * proxy; + DBusGProxy * dbus_proxy; pg_status_t pg_status; }; @@ -81,6 +82,7 @@ static void status_provider_pidgin_finalize (GObject *object); /* Internal Funcs */ static void set_status (StatusProvider * sp, StatusProviderStatus status); static StatusProviderStatus get_status (StatusProvider * sp); +static void setup_pidgin_proxy (StatusProviderPidgin * self); G_DEFINE_TYPE (StatusProviderPidgin, status_provider_pidgin, STATUS_PROVIDER_TYPE); @@ -179,27 +181,55 @@ status_provider_pidgin_init (StatusProviderPidgin *self) priv->proxy = NULL; priv->pg_status = PG_STATUS_OFFLINE; + DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); + g_return_if_fail(bus != NULL); /* Can't do anymore DBus stuff without this, + all non-DBus stuff should be done */ + + /* GError * error = NULL; */ + + setup_pidgin_proxy(self); + + return; +} + +static void +setup_pidgin_proxy (StatusProviderPidgin * self) +{ + StatusProviderPidginPrivate * priv = STATUS_PROVIDER_PIDGIN_GET_PRIVATE(self); + + if (priv->proxy != NULL) { + g_debug("Odd, we were asked to set up a Pidgin proxy when we already had one."); + return; + } + DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); g_return_if_fail(bus != NULL); /* Can't do anymore DBus stuff without this, all non-DBus stuff should be done */ GError * error = NULL; + + /* Set up the Pidgin Proxy */ priv->proxy = dbus_g_proxy_new_for_name_owner (bus, "im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject", "im.pidgin.purple.PurpleInterface", &error); + /* Report any errors */ if (error != NULL) { g_debug("Unable to get Pidgin proxy: %s", error->message); g_error_free(error); - return; } + /* If we have a proxy, let's start using it */ if (priv->proxy != NULL) { + /* Set the proxy to NULL if it's destroyed */ g_object_add_weak_pointer (G_OBJECT(priv->proxy), (gpointer *)&priv->proxy); + /* If it's destroyed, let's clean up as well */ g_signal_connect(G_OBJECT(priv->proxy), "destroy", G_CALLBACK(proxy_destroy), self); + /* Watching for the status change coming from the + Pidgin side of things. */ g_debug("Adding Pidgin Signals"); dbus_g_object_register_marshaller(_status_provider_pidgin_marshal_VOID__INT_INT, G_TYPE_NONE, @@ -217,6 +247,8 @@ status_provider_pidgin_init (StatusProviderPidgin *self) (void *)self, NULL); + /* Get the current status to update our cached + value of the status. */ dbus_g_proxy_begin_call(priv->proxy, "PurpleSavedstatusGetCurrent", savedstatus_cb, -- cgit v1.2.3 From 0952465001fe38e0872e1472739ae7786aa1761a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Sep 2009 13:28:43 -0500 Subject: Watch dbus namechanges and see if Pidgin comes on the bus. --- src/status-provider-pidgin.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/status-provider-pidgin.c b/src/status-provider-pidgin.c index f4704db..3c0ca15 100644 --- a/src/status-provider-pidgin.c +++ b/src/status-provider-pidgin.c @@ -83,6 +83,7 @@ static void status_provider_pidgin_finalize (GObject *object); static void set_status (StatusProvider * sp, StatusProviderStatus status); static StatusProviderStatus get_status (StatusProvider * sp); static void setup_pidgin_proxy (StatusProviderPidgin * self); +static void dbus_namechange (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, StatusProviderPidgin * self); G_DEFINE_TYPE (StatusProviderPidgin, status_provider_pidgin, STATUS_PROVIDER_TYPE); @@ -185,13 +186,48 @@ status_provider_pidgin_init (StatusProviderPidgin *self) g_return_if_fail(bus != NULL); /* Can't do anymore DBus stuff without this, all non-DBus stuff should be done */ - /* GError * error = NULL; */ + GError * error = NULL; + + /* Set up the dbus Proxy */ + priv->dbus_proxy = dbus_g_proxy_new_for_name_owner (bus, + DBUS_SERVICE_DBUS, + DBUS_PATH_DBUS, + DBUS_INTERFACE_DBUS, + &error); + if (error != NULL) { + g_warning("Unable to connect to DBus events: %s", error->message); + g_error_free(error); + return; + } + + /* Configure the name owner changing */ + dbus_g_proxy_add_signal(priv->dbus_proxy, "NameOwnerChanged", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal(priv->dbus_proxy, "NameOwnerChanged", + G_CALLBACK(dbus_namechange), + self, NULL); setup_pidgin_proxy(self); return; } +/* Watch to see if the Pidgin comes up on Dbus */ +static void +dbus_namechange (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, StatusProviderPidgin * self) +{ + g_return_if_fail(name != NULL); + g_return_if_fail(new != NULL); + + if (g_strcmp0(name, "im.pidgin.purple.PurpleService") == 0) { + setup_pidgin_proxy(self); + } + return; +} + +/* Setup the Pidgin proxy so that we can talk to it + and get signals from it. */ static void setup_pidgin_proxy (StatusProviderPidgin * self) { -- cgit v1.2.3 From acdeaff5212ea63681d0f2b6d623d0780b6350ef Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Sep 2009 13:40:49 -0500 Subject: Checking the global status on whether the menu items should be sensitive or not. --- src/status-service.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/status-service.c b/src/status-service.c index 195529b..d8f60d4 100644 --- a/src/status-service.c +++ b/src/status-service.c @@ -234,7 +234,9 @@ build_menu (gpointer data) dbusmenu_menuitem_property_set(status_menuitems[i], "type", DBUSMENU_CLIENT_TYPES_IMAGE); dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[i])); dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_ICON, status_icons[i]); - dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_SENSITIVE, "false"); + if (global_status == STATUS_PROVIDER_STATUS_DISCONNECTED) { + dbusmenu_menuitem_property_set(status_menuitems[i], DBUSMENU_MENUITEM_PROP_SENSITIVE, "false"); + } g_signal_connect(G_OBJECT(status_menuitems[i]), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(status_menu_click), GINT_TO_POINTER(i)); dbusmenu_menuitem_child_append(status_menuitem, status_menuitems[i]); -- cgit v1.2.3 From d97e28df45374c687c60529b5e868e2910187571 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Sep 2009 13:52:12 -0500 Subject: Function to build the telepathy proxy. --- src/status-provider-telepathy.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/status-provider-telepathy.c b/src/status-provider-telepathy.c index 31da224..4430a8e 100644 --- a/src/status-provider-telepathy.c +++ b/src/status-provider-telepathy.c @@ -75,6 +75,7 @@ static void status_provider_telepathy_init (StatusProviderTelepathy *self) static void status_provider_telepathy_dispose (GObject *object); static void status_provider_telepathy_finalize (GObject *object); /* Internal Funcs */ +static void build_telepathy_proxy (StatusProviderTelepathy * self); static void set_status (StatusProvider * sp, StatusProviderStatus status); static StatusProviderStatus get_status (StatusProvider * sp); static void changed_status (DBusGProxy * proxy, guint status, gchar * message, StatusProvider * sp); @@ -110,6 +111,16 @@ status_provider_telepathy_init (StatusProviderTelepathy *self) priv->proxy = NULL; priv->mc_status = MC_STATUS_OFFLINE; + build_telepathy_proxy(self); + + return; +} + +static void +build_telepathy_proxy (StatusProviderTelepathy * self) +{ + StatusProviderTelepathyPrivate * priv = STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(self); + GError * error = NULL; DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); -- cgit v1.2.3 From ff14ae64765101fc90581d5b927d68ce2b15297c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Sep 2009 13:58:24 -0500 Subject: Checking to see if we have the proxy already. --- src/status-provider-telepathy.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/status-provider-telepathy.c b/src/status-provider-telepathy.c index 4430a8e..58bc6ca 100644 --- a/src/status-provider-telepathy.c +++ b/src/status-provider-telepathy.c @@ -121,8 +121,14 @@ build_telepathy_proxy (StatusProviderTelepathy * self) { StatusProviderTelepathyPrivate * priv = STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(self); + if (priv->proxy != NULL) { + g_debug("Hmm, being asked to build a proxy we alredy have."); + return; + } + GError * error = NULL; + /* Grabbing the session bus */ DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); if (session_bus == NULL) { g_warning("Unable to connect to Session Bus: %s", error == NULL ? "No message" : error->message); @@ -130,7 +136,7 @@ build_telepathy_proxy (StatusProviderTelepathy * self) return; } - priv->proxy = NULL; + /* Get the proxy to Mission Control */ priv->proxy = dbus_g_proxy_new_for_name_owner(session_bus, "org.freedesktop.Telepathy.MissionControl", "/org/freedesktop/Telepathy/MissionControl", @@ -138,10 +144,13 @@ build_telepathy_proxy (StatusProviderTelepathy * self) &error); if (priv->proxy != NULL) { + /* If it goes, we set the proxy to NULL */ g_object_add_weak_pointer (G_OBJECT(priv->proxy), (gpointer *)&priv->proxy); + /* And we clean up other variables associated */ g_signal_connect(G_OBJECT(priv->proxy), "destroy", G_CALLBACK(proxy_destroy), self); + /* Set up the signal handler for watching when status changes. */ dbus_g_object_register_marshaller(_status_provider_telepathy_marshal_VOID__UINT_STRING, G_TYPE_NONE, G_TYPE_UINT, -- cgit v1.2.3 From b93e75aaa4634ac8f995ac3ea7596e3946a59e18 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Sep 2009 14:04:51 -0500 Subject: Watching for Mission Control comming on the bus. --- src/status-provider-telepathy.c | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/status-provider-telepathy.c b/src/status-provider-telepathy.c index 58bc6ca..f33e26f 100644 --- a/src/status-provider-telepathy.c +++ b/src/status-provider-telepathy.c @@ -62,6 +62,7 @@ static mc_status_t sp_to_mc_map[] = { typedef struct _StatusProviderTelepathyPrivate StatusProviderTelepathyPrivate; struct _StatusProviderTelepathyPrivate { DBusGProxy * proxy; + DBusGProxy * dbus_proxy; mc_status_t mc_status; }; @@ -76,6 +77,7 @@ static void status_provider_telepathy_dispose (GObject *object); static void status_provider_telepathy_finalize (GObject *object); /* Internal Funcs */ static void build_telepathy_proxy (StatusProviderTelepathy * self); +static void dbus_namechange (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, StatusProviderTelepathy * self); static void set_status (StatusProvider * sp, StatusProviderStatus status); static StatusProviderStatus get_status (StatusProvider * sp); static void changed_status (DBusGProxy * proxy, guint status, gchar * message, StatusProvider * sp); @@ -109,8 +111,39 @@ status_provider_telepathy_init (StatusProviderTelepathy *self) StatusProviderTelepathyPrivate * priv = STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(self); priv->proxy = NULL; + priv->dbus_proxy = NULL; priv->mc_status = MC_STATUS_OFFLINE; + GError * error = NULL; + + /* Grabbing the session bus */ + DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); + if (bus == NULL) { + g_warning("Unable to connect to Session Bus: %s", error == NULL ? "No message" : error->message); + g_error_free(error); + return; + } + + /* Set up the dbus Proxy */ + priv->dbus_proxy = dbus_g_proxy_new_for_name_owner (bus, + DBUS_SERVICE_DBUS, + DBUS_PATH_DBUS, + DBUS_INTERFACE_DBUS, + &error); + if (error != NULL) { + g_warning("Unable to connect to DBus events: %s", error->message); + g_error_free(error); + return; + } + + /* Configure the name owner changing */ + dbus_g_proxy_add_signal(priv->dbus_proxy, "NameOwnerChanged", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal(priv->dbus_proxy, "NameOwnerChanged", + G_CALLBACK(dbus_namechange), + self, NULL); + build_telepathy_proxy(self); return; @@ -184,6 +217,19 @@ build_telepathy_proxy (StatusProviderTelepathy * self) return; } +/* Watch to see if the Mission Control comes up on Dbus */ +static void +dbus_namechange (DBusGProxy * proxy, const gchar * name, const gchar * prev, const gchar * new, StatusProviderTelepathy * self) +{ + g_return_if_fail(name != NULL); + g_return_if_fail(new != NULL); + + if (g_strcmp0(name, "org.freedesktop.Telepathy.MissionControl") == 0) { + build_telepathy_proxy(self); + } + return; +} + static void status_provider_telepathy_dispose (GObject *object) { -- cgit v1.2.3 From a275332bb21be6dab623738366aaeeff6afc7687 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Sep 2009 14:09:43 -0500 Subject: Adding in a debug message for Telepathy proxy. --- src/status-provider-telepathy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/status-provider-telepathy.c b/src/status-provider-telepathy.c index f33e26f..f2815fb 100644 --- a/src/status-provider-telepathy.c +++ b/src/status-provider-telepathy.c @@ -149,9 +149,13 @@ status_provider_telepathy_init (StatusProviderTelepathy *self) return; } +/* Builds up the proxy to Mission Control and configures all of the + signals for getting info from the proxy. Also does a call to get + the inital value of the status. */ static void build_telepathy_proxy (StatusProviderTelepathy * self) { + g_debug("Building Telepathy Proxy"); StatusProviderTelepathyPrivate * priv = STATUS_PROVIDER_TELEPATHY_GET_PRIVATE(self); if (priv->proxy != NULL) { -- cgit v1.2.3 From c2ed34abf815609d4b0044dc46d6be63a9e5c570 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Sep 2009 15:53:15 -0500 Subject: Removing the space on the elipsis --- src/session-service.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/session-service.c b/src/session-service.c index 9e5cbb2..15c85cb 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -228,7 +228,7 @@ create_items (DbusmenuMenuitem * root) { if (supress_confirmations()) { dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out")); } else { - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out ...")); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out...")); } dbusmenu_menuitem_child_append(root, mi); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "logout"); @@ -249,7 +249,7 @@ create_items (DbusmenuMenuitem * root) { if (supress_confirmations()) { dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart")); } else { - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart ...")); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart...")); } dbusmenu_menuitem_child_append(root, mi); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "restart"); @@ -258,7 +258,7 @@ create_items (DbusmenuMenuitem * root) { if (supress_confirmations()) { dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown")); } else { - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown ...")); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown...")); } dbusmenu_menuitem_child_append(root, mi); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "shutdown"); -- cgit v1.2.3 From edba4f977f7ba9692e48cf40dea2466b07e967e1 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Sep 2009 15:59:38 -0500 Subject: Grabbing the icons from the indicator dir where we install them. --- src/gtk-dialog/Makefile.am | 2 +- src/gtk-dialog/gtk-logout-helper.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gtk-dialog/Makefile.am b/src/gtk-dialog/Makefile.am index 90a6209..5f2df2f 100644 --- a/src/gtk-dialog/Makefile.am +++ b/src/gtk-dialog/Makefile.am @@ -10,6 +10,6 @@ gtk_logout_helper_SOURCES = \ logout-dialog.c \ logout-dialog.h -gtk_logout_helper_CFLAGS = $(GTKLOGOUTHELPER_CFLAGS) $(GCONF_CFLAGS) -Wall -Werror +gtk_logout_helper_CFLAGS = $(GTKLOGOUTHELPER_CFLAGS) $(GCONF_CFLAGS) -Wall -Werror -DINDICATOR_ICONS_DIR="\"$(INDICATORICONSDIR)\"" gtk_logout_helper_LDADD = $(GTKLOGOUTHELPER_LIBS) $(GCONF_LIBS) diff --git a/src/gtk-dialog/gtk-logout-helper.c b/src/gtk-dialog/gtk-logout-helper.c index 13991ca..e6a9ef8 100644 --- a/src/gtk-dialog/gtk-logout-helper.c +++ b/src/gtk-dialog/gtk-logout-helper.c @@ -133,6 +133,10 @@ main (int argc, char * argv[]) return 1; } + /* Init some theme/icon stuff */ + gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), + INDICATOR_ICONS_DIR); + GtkWidget * dialog = NULL; if (!pk_require_auth(type) && !supress_confirmations()) { dialog = logout_dialog_new(type); -- cgit v1.2.3 From 0cb4e60ef1a5034dec49ea28f0545055c0460597 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Sep 2009 16:03:59 -0500 Subject: Setting the window icon now that we have the right path --- src/gtk-dialog/logout-dialog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gtk-dialog/logout-dialog.c b/src/gtk-dialog/logout-dialog.c index a80dbef..a94c649 100644 --- a/src/gtk-dialog/logout-dialog.c +++ b/src/gtk-dialog/logout-dialog.c @@ -298,8 +298,9 @@ logout_dialog_init (LogoutDialog *logout_dialog) GTK_RESPONSE_OK); gtk_widget_grab_default (logout_dialog->ok_button); - /* Title */ + /* Window Title and Icon */ gtk_window_set_title (GTK_WINDOW(logout_dialog), _(title_strings[logout_dialog->action])); + gtk_window_set_icon_name (GTK_WINDOW(logout_dialog), icon_strings[logout_dialog->action]); /* hbox */ logout_dialog->hbox = gtk_hbox_new (FALSE, 12); -- cgit v1.2.3 -- cgit v1.2.3 From 82395ac94e6daaf020d0310602756007a6b89451 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 10 Sep 2009 17:10:37 -0500 Subject: Making a 0.1.3 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 957a471..fa7a941 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-session.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-session, 0.1.2) +AM_INIT_AUTOMAKE(indicator-session, 0.1.3) AM_MAINTAINER_MODE -- cgit v1.2.3 From da34a798d7a04d063206af2c38fa7d2ac63e217d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 14 Sep 2009 20:13:17 -0500 Subject: Fixing shutdown text --- src/session-service.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/session-service.c b/src/session-service.c index 59a3a97..58eb4cf 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -258,9 +258,9 @@ create_items (DbusmenuMenuitem * root) { shutdown_mi = dbusmenu_menuitem_new(); if (supress_confirmations()) { - dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown")); + dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shut Down")); } else { - dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown...")); + dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shut Down...")); } dbusmenu_menuitem_child_append(root, shutdown_mi); g_signal_connect(G_OBJECT(shutdown_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "shutdown"); -- cgit v1.2.3 From c4c208906843e5678e5150e563c23021404cfeff Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 14 Sep 2009 20:58:39 -0500 Subject: Changing label per design --- src/users-service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/users-service.c b/src/users-service.c index 5db832b..bc8911b 100644 --- a/src/users-service.c +++ b/src/users-service.c @@ -120,7 +120,7 @@ create_items (DbusmenuMenuitem * root) { if (check_new_session()) { mi = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("New Session...")); + dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Switch User...")); dbusmenu_menuitem_child_append(root, mi); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_new_session), NULL); } -- cgit v1.2.3 From 41fd33b07ae4dbef02424b1b9c880995f8e8e112 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 14 Sep 2009 21:02:36 -0500 Subject: Moving lock screen from status to users service. --- src/status-service.c | 32 -------------------------------- src/users-service.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/status-service.c b/src/status-service.c index d8f60d4..8ce7962 100644 --- a/src/status-service.c +++ b/src/status-service.c @@ -124,33 +124,6 @@ status_update (void) { return; } -/* A fun little function to actually lock the screen. If, - that's what you want, let's do it! */ -static void -lock_screen (DbusmenuMenuitem * mi, gpointer data) -{ - g_debug("Lock Screen"); - - DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); - g_return_if_fail(session_bus != NULL); - - DBusGProxy * proxy = dbus_g_proxy_new_for_name_owner(session_bus, - "org.gnome.ScreenSaver", - "/", - "org.gnome.ScreenSaver", - NULL); - g_return_if_fail(proxy != NULL); - - dbus_g_proxy_call_no_reply(proxy, - "Lock", - G_TYPE_INVALID, - G_TYPE_INVALID); - - g_object_unref(proxy); - - return; -} - static void status_menu_click (DbusmenuMenuitem * mi, gpointer data) { @@ -244,11 +217,6 @@ build_menu (gpointer data) g_debug("Built %s", status_strings[i]); } - DbusmenuMenuitem * 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), GINT_TO_POINTER(i)); - dbusmenu_menuitem_child_append(root, mi); - return FALSE; } diff --git a/src/users-service.c b/src/users-service.c index bc8911b..6c44781 100644 --- a/src/users-service.c +++ b/src/users-service.c @@ -107,10 +107,42 @@ activate_new_session (DbusmenuMenuitem * mi, gpointer user_data) return; } +/* A fun little function to actually lock the screen. If, + that's what you want, let's do it! */ +static void +lock_screen (DbusmenuMenuitem * mi, gpointer data) +{ + g_debug("Lock Screen"); + + DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); + g_return_if_fail(session_bus != NULL); + + DBusGProxy * proxy = dbus_g_proxy_new_for_name_owner(session_bus, + "org.gnome.ScreenSaver", + "/", + "org.gnome.ScreenSaver", + NULL); + g_return_if_fail(proxy != NULL); + + dbus_g_proxy_call_no_reply(proxy, + "Lock", + G_TYPE_INVALID, + G_TYPE_INVALID); + + g_object_unref(proxy); + + return; +} + static void create_items (DbusmenuMenuitem * root) { DbusmenuMenuitem * mi = NULL; + 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); + if (check_guest_session()) { mi = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Guest Session")); -- cgit v1.2.3 -- cgit v1.2.3 From 35cc4970e77115c83c54bd6a4035a3af761cc0b1 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 15 Sep 2009 09:16:09 -0500 Subject: Changing the menu item to be 'Set Status' instead of the current status. --- src/status-service.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/status-service.c b/src/status-service.c index 8ce7962..c7ef20b 100644 --- a/src/status-service.c +++ b/src/status-service.c @@ -95,8 +95,6 @@ status_update (void) { if (global_status != oldglobal) { g_debug("Global status changed to: %s", _(status_strings[global_status])); - /* Set the status name on the menu item */ - dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[global_status])); /* Configure the icon on the panel */ status_service_dbus_set_status(dbus_interface, status_icons[global_status]); @@ -191,7 +189,7 @@ build_menu (gpointer data) build_user_item(root); status_menuitem = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _(status_strings[global_status])); + dbusmenu_menuitem_property_set(status_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, _("Set Status")); dbusmenu_menuitem_child_append(root, status_menuitem); StatusProviderStatus i; -- cgit v1.2.3 From 0bdc32e6c8475228c1510c428cbed1a3ee13c4e6 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 15 Sep 2009 15:34:14 -0500 Subject: Adding in gettext init stuff. --- src/session-service.c | 7 +++++++ src/status-service.c | 7 +++++++ src/users-service.c | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/src/session-service.c b/src/session-service.c index 59a3a97..4db0a6e 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -21,6 +21,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include #include @@ -282,6 +283,12 @@ main (int argc, char ** argv) { g_type_init(); + /* Setting up i18n and gettext. Apparently, we need + all of these. */ + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); + textdomain (GETTEXT_PACKAGE); + DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); GError * error = NULL; diff --git a/src/status-service.c b/src/status-service.c index d8f60d4..b4a2e09 100644 --- a/src/status-service.c +++ b/src/status-service.c @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include #include #include @@ -257,6 +258,12 @@ main (int argc, char ** argv) { g_type_init(); + /* Setting up i18n and gettext. Apparently, we need + all of these. */ + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); + textdomain (GETTEXT_PACKAGE); + DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); GError * error = NULL; diff --git a/src/users-service.c b/src/users-service.c index 5db832b..d50a277 100644 --- a/src/users-service.c +++ b/src/users-service.c @@ -20,6 +20,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include + #include #include @@ -133,6 +135,12 @@ main (int argc, char ** argv) { g_type_init(); + /* Setting up i18n and gettext. Apparently, we need + all of these. */ + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); + textdomain (GETTEXT_PACKAGE); + session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); bus_proxy = dbus_g_proxy_new_for_name(session_bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); GError * error = NULL; -- cgit v1.2.3 From 234416607f907adb2348ebe369c7e04b6b887a8c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 15 Sep 2009 15:45:56 -0500 Subject: Adding locale stuff in here too! Fun. --- src/gtk-dialog/gtk-logout-helper.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gtk-dialog/gtk-logout-helper.c b/src/gtk-dialog/gtk-logout-helper.c index e6a9ef8..0c03e86 100644 --- a/src/gtk-dialog/gtk-logout-helper.c +++ b/src/gtk-dialog/gtk-logout-helper.c @@ -21,7 +21,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - +#include #include #include #include @@ -121,6 +121,12 @@ main (int argc, char * argv[]) { gtk_init(&argc, &argv); + /* Setting up i18n and gettext. Apparently, we need + all of these. */ + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); + textdomain (GETTEXT_PACKAGE); + GError * error = NULL; GOptionContext * context = g_option_context_new(" - logout of the current session"); g_option_context_add_main_entries(context, options, "gtk-logout-helper"); -- cgit v1.2.3 -- cgit v1.2.3 From 7f1e833c0244470ecfef227d023d49bd1d6b954f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 16 Sep 2009 15:59:37 -0500 Subject: Changing the icon names from online to available --- data/icons/16x16/status/Makefile.am | 2 +- data/icons/16x16/status/user-available.png | Bin 0 -> 685 bytes data/icons/16x16/status/user-online.png | Bin 685 -> 0 bytes data/icons/22x22/status/Makefile.am | 2 +- data/icons/22x22/status/user-available.png | Bin 0 -> 967 bytes data/icons/22x22/status/user-online.png | Bin 967 -> 0 bytes data/icons/24x24/status/Makefile.am | 2 +- data/icons/24x24/status/user-available.png | Bin 0 -> 1075 bytes data/icons/24x24/status/user-online.png | Bin 1075 -> 0 bytes data/icons/32x32/status/Makefile.am | 2 +- data/icons/32x32/status/user-available.png | Bin 0 -> 1433 bytes data/icons/32x32/status/user-online.png | Bin 1433 -> 0 bytes data/icons/48x48/status/Makefile.am | 2 +- data/icons/48x48/status/user-available.png | Bin 0 -> 2211 bytes data/icons/48x48/status/user-online.png | Bin 2211 -> 0 bytes data/icons/scalable/status/Makefile.am | 2 +- data/icons/scalable/status/user-available.svg | 104 ++++++++++++++++++++++++++ data/icons/scalable/status/user-online.svg | 104 -------------------------- 18 files changed, 110 insertions(+), 110 deletions(-) create mode 100644 data/icons/16x16/status/user-available.png delete mode 100644 data/icons/16x16/status/user-online.png create mode 100644 data/icons/22x22/status/user-available.png delete mode 100644 data/icons/22x22/status/user-online.png create mode 100644 data/icons/24x24/status/user-available.png delete mode 100644 data/icons/24x24/status/user-online.png create mode 100644 data/icons/32x32/status/user-available.png delete mode 100644 data/icons/32x32/status/user-online.png create mode 100644 data/icons/48x48/status/user-available.png delete mode 100644 data/icons/48x48/status/user-online.png create mode 100644 data/icons/scalable/status/user-available.svg delete mode 100644 data/icons/scalable/status/user-online.svg diff --git a/data/icons/16x16/status/Makefile.am b/data/icons/16x16/status/Makefile.am index 7b286f6..fa874bf 100644 --- a/data/icons/16x16/status/Makefile.am +++ b/data/icons/16x16/status/Makefile.am @@ -2,7 +2,7 @@ iconsdir = $(INDICATORICONSDIR)/hicolor/16x16/status icons_DATA = \ - user-online.png \ + user-available.png \ user-offline.png \ user-away.png \ user-busy.png \ diff --git a/data/icons/16x16/status/user-available.png b/data/icons/16x16/status/user-available.png new file mode 100644 index 0000000..5435e02 Binary files /dev/null and b/data/icons/16x16/status/user-available.png differ diff --git a/data/icons/16x16/status/user-online.png b/data/icons/16x16/status/user-online.png deleted file mode 100644 index 5435e02..0000000 Binary files a/data/icons/16x16/status/user-online.png and /dev/null differ diff --git a/data/icons/22x22/status/Makefile.am b/data/icons/22x22/status/Makefile.am index c0a7f76..0171b82 100644 --- a/data/icons/22x22/status/Makefile.am +++ b/data/icons/22x22/status/Makefile.am @@ -2,7 +2,7 @@ iconsdir = $(INDICATORICONSDIR)/hicolor/22x22/status icons_DATA = \ - user-online.png \ + user-available.png \ user-offline.png \ user-away.png \ user-busy.png \ diff --git a/data/icons/22x22/status/user-available.png b/data/icons/22x22/status/user-available.png new file mode 100644 index 0000000..ec8c452 Binary files /dev/null and b/data/icons/22x22/status/user-available.png differ diff --git a/data/icons/22x22/status/user-online.png b/data/icons/22x22/status/user-online.png deleted file mode 100644 index ec8c452..0000000 Binary files a/data/icons/22x22/status/user-online.png and /dev/null differ diff --git a/data/icons/24x24/status/Makefile.am b/data/icons/24x24/status/Makefile.am index e26596c..f92e8f1 100644 --- a/data/icons/24x24/status/Makefile.am +++ b/data/icons/24x24/status/Makefile.am @@ -2,7 +2,7 @@ iconsdir = $(INDICATORICONSDIR)/hicolor/24x24/status icons_DATA = \ - user-online.png \ + user-available.png \ user-offline.png \ user-away.png \ user-busy.png \ diff --git a/data/icons/24x24/status/user-available.png b/data/icons/24x24/status/user-available.png new file mode 100644 index 0000000..95f2534 Binary files /dev/null and b/data/icons/24x24/status/user-available.png differ diff --git a/data/icons/24x24/status/user-online.png b/data/icons/24x24/status/user-online.png deleted file mode 100644 index 95f2534..0000000 Binary files a/data/icons/24x24/status/user-online.png and /dev/null differ diff --git a/data/icons/32x32/status/Makefile.am b/data/icons/32x32/status/Makefile.am index e7967f4..92f55f4 100644 --- a/data/icons/32x32/status/Makefile.am +++ b/data/icons/32x32/status/Makefile.am @@ -2,7 +2,7 @@ iconsdir = $(INDICATORICONSDIR)/hicolor/32x32/status icons_DATA = \ - user-online.png \ + user-available.png \ user-offline.png \ user-away.png \ user-busy.png \ diff --git a/data/icons/32x32/status/user-available.png b/data/icons/32x32/status/user-available.png new file mode 100644 index 0000000..5d04e0a Binary files /dev/null and b/data/icons/32x32/status/user-available.png differ diff --git a/data/icons/32x32/status/user-online.png b/data/icons/32x32/status/user-online.png deleted file mode 100644 index 5d04e0a..0000000 Binary files a/data/icons/32x32/status/user-online.png and /dev/null differ diff --git a/data/icons/48x48/status/Makefile.am b/data/icons/48x48/status/Makefile.am index a2ff495..a0f2d82 100644 --- a/data/icons/48x48/status/Makefile.am +++ b/data/icons/48x48/status/Makefile.am @@ -2,7 +2,7 @@ iconsdir = $(INDICATORICONSDIR)/hicolor/48x48/status icons_DATA = \ - user-online.png \ + user-available.png \ user-offline.png \ user-away.png \ user-busy.png \ diff --git a/data/icons/48x48/status/user-available.png b/data/icons/48x48/status/user-available.png new file mode 100644 index 0000000..5bcae55 Binary files /dev/null and b/data/icons/48x48/status/user-available.png differ diff --git a/data/icons/48x48/status/user-online.png b/data/icons/48x48/status/user-online.png deleted file mode 100644 index 5bcae55..0000000 Binary files a/data/icons/48x48/status/user-online.png and /dev/null differ diff --git a/data/icons/scalable/status/Makefile.am b/data/icons/scalable/status/Makefile.am index 2c70d33..479ef2c 100644 --- a/data/icons/scalable/status/Makefile.am +++ b/data/icons/scalable/status/Makefile.am @@ -2,7 +2,7 @@ iconsdir = $(INDICATORICONSDIR)/hicolor/scalable/status icons_DATA = \ - user-online.svg \ + user-available.svg \ user-offline.svg \ user-away.svg \ user-busy.svg \ diff --git a/data/icons/scalable/status/user-available.svg b/data/icons/scalable/status/user-available.svg new file mode 100644 index 0000000..8d4cc58 --- /dev/null +++ b/data/icons/scalable/status/user-available.svg @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/data/icons/scalable/status/user-online.svg b/data/icons/scalable/status/user-online.svg deleted file mode 100644 index 8d4cc58..0000000 --- a/data/icons/scalable/status/user-online.svg +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - -- cgit v1.2.3 From d2be80af54acaf8ef417eeb03860a212222204c5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 16 Sep 2009 16:00:17 -0500 Subject: Using the right icon name. --- src/status-service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/status-service.c b/src/status-service.c index fe02dd0..0cb9185 100644 --- a/src/status-service.c +++ b/src/status-service.c @@ -61,7 +61,7 @@ static const gchar * status_strings [STATUS_PROVIDER_STATUS_LAST] = { }; static const gchar * status_icons[STATUS_PROVIDER_STATUS_LAST] = { - /* STATUS_PROVIDER_STATUS_ONLINE, */ "user-online", + /* STATUS_PROVIDER_STATUS_ONLINE, */ "user-available", /* STATUS_PROVIDER_STATUS_AWAY, */ "user-away", /* STATUS_PROVIDER_STATUS_DND, */ "user-busy", /* STATUS_PROVIDER_STATUS_INVISIBLE, */ "user-invisible", -- cgit v1.2.3 From f1adf67ab9719ad890186713297054f556b58fd8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 17 Sep 2009 11:00:41 -0500 Subject: Making a 0.1.4 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index fa7a941..2c06cb0 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-session.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-session, 0.1.3) +AM_INIT_AUTOMAKE(indicator-session, 0.1.4) AM_MAINTAINER_MODE -- cgit v1.2.3 From a561b45e3e493646f7a52363006bd6173326d329 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 22 Sep 2009 14:45:17 +0200 Subject: Port to polkit-1 --- configure.ac | 4 +- src/gtk-dialog/ck-pk-helper.c | 98 +++++++++++++++++++------------------------ src/gtk-dialog/ck-pk-helper.h | 4 +- 3 files changed, 47 insertions(+), 59 deletions(-) diff --git a/configure.ac b/configure.ac index 2c06cb0..5a838c4 100644 --- a/configure.ac +++ b/configure.ac @@ -28,6 +28,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) GTK_REQUIRED_VERSION=2.12 INDICATOR_REQUIRED_VERSION=0.2.0 DBUSMENUGTK_REQUIRED_VERSION=0.1.1 +POLKIT_REQUIRED_VERSION=0.92 PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION indicator >= $INDICATOR_REQUIRED_VERSION @@ -53,7 +54,8 @@ AC_SUBST(SESSIONERVICE_CFLAGS) AC_SUBST(SESSIONERVICE_LIBS) PKG_CHECK_MODULES(GTKLOGOUTHELPER, gtk+-2.0 >= $GTK_REQUIRED_VERSION - polkit-gnome) + polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION) + AC_SUBST(GTKLOGOUTHELPER_CFLAGS) AC_SUBST(GTKLOGOUTHELPER_LIBS) diff --git a/src/gtk-dialog/ck-pk-helper.c b/src/gtk-dialog/ck-pk-helper.c index 466ccbc..dc7d900 100644 --- a/src/gtk-dialog/ck-pk-helper.c +++ b/src/gtk-dialog/ck-pk-helper.c @@ -24,7 +24,7 @@ with this program. If not, see . #include #include #include -#include +#include #include "logout-dialog.h" #include "ck-pk-helper.h" @@ -170,67 +170,53 @@ pk_require_auth (LogoutDialogAction action) { } } - PolKitResult polres; + PolkitAuthorizationResult *polres = NULL; + gboolean ret = FALSE; if (pk_can_do_action(pk_action, &polres)) { - if (polres == POLKIT_RESULT_YES) { - return FALSE; + if (polkit_authorization_result_get_is_challenge (polres)) { + ret = TRUE; } - return TRUE; + g_debug ("pk_require_auth(%s): authorized, is_challenge: %i", pk_action, ret); + } else { + g_debug ("pk_require_auth(%s): not authorized", pk_action); + } + if (polres) { + g_object_unref (polres); } - return FALSE; + return ret; } gboolean -pk_can_do_action (const gchar *action_id, PolKitResult * pol_result) +pk_can_do_action (const gchar *action_id, PolkitAuthorizationResult ** pol_result) { - PolKitGnomeContext *gnome_context; - PolKitAction *action; - PolKitCaller *caller; - DBusError dbus_error; - PolKitError *error; - PolKitResult result; - - gnome_context = polkit_gnome_context_get (NULL); - - if (gnome_context == NULL) { - return FALSE; - } - - if (gnome_context->pk_tracker == NULL) { - return FALSE; - } - - dbus_error_init (&dbus_error); - caller = polkit_tracker_get_caller_from_pid (gnome_context->pk_tracker, - getpid (), - &dbus_error); - dbus_error_free (&dbus_error); - - if (caller == NULL) { - return FALSE; - } - - action = polkit_action_new (); - if (!polkit_action_set_action_id (action, action_id)) { - polkit_action_unref (action); - polkit_caller_unref (caller); - return FALSE; - } - - result = POLKIT_RESULT_UNKNOWN; - error = NULL; - result = polkit_context_is_caller_authorized (gnome_context->pk_context, - action, caller, FALSE, - &error); - if (polkit_error_is_set (error)) { - polkit_error_free (error); - } - polkit_action_unref (action); - polkit_caller_unref (caller); - - if (pol_result != NULL) { - *pol_result = result; - } + PolkitAuthority *authority; + PolkitSubject *subject; + PolkitAuthorizationResult *result; + gboolean ret; + + authority = polkit_authority_get(); + if (!authority) { + g_warning ("Could not get PolicyKit authority instance"); + return FALSE; + } + subject = polkit_unix_process_new (getpid()); - return result != POLKIT_RESULT_NO && result != POLKIT_RESULT_UNKNOWN; + result = polkit_authority_check_authorization_sync (authority, subject, action_id, NULL, 0, NULL, NULL); + g_object_unref (authority); + + ret = FALSE; + if (result) { + ret = polkit_authorization_result_get_is_authorized (result) || + polkit_authorization_result_get_is_challenge (result); + g_debug ("pk_can_do_action(%s): %i", action_id, ret); + } else { + g_warning ("pk_can_do_action(%s): check_authorization returned NULL", action_id); + } + if (pol_result) { + *pol_result = result; + } else { + g_object_unref (result); + } + return ret; + } diff --git a/src/gtk-dialog/ck-pk-helper.h b/src/gtk-dialog/ck-pk-helper.h index 98bce56..501a8c8 100644 --- a/src/gtk-dialog/ck-pk-helper.h +++ b/src/gtk-dialog/ck-pk-helper.h @@ -24,9 +24,9 @@ with this program. If not, see . #ifndef __CK_PK_HELPER_H__ #define __CK_PK_HELPER_H__ 1 -#include +#include gboolean pk_require_auth (LogoutDialogAction action); -gboolean pk_can_do_action (const gchar *action_id, PolKitResult * pol_result); +gboolean pk_can_do_action (const gchar *action_id, PolkitAuthorizationResult ** pol_result); #endif /* __CK_PK_HELPER__ */ -- cgit v1.2.3