diff options
author | Ted Gould <ted@canonical.com> | 2009-11-23 14:55:06 -0600 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-11-23 14:55:06 -0600 |
commit | 59b0398609ef5ce6ee991c633eb84c3b55a42ac3 (patch) | |
tree | b81beec36b41653eb49717110b3655515a5637c3 /src/libcustomindicator/custom-indicator.c | |
parent | 97388871ba0a4669792bead5878ec1eec24a2118 (diff) | |
parent | 2c04418795e644efafc0204656dd575844ba0976 (diff) | |
download | libayatana-appindicator-59b0398609ef5ce6ee991c633eb84c3b55a42ac3.tar.gz libayatana-appindicator-59b0398609ef5ce6ee991c633eb84c3b55a42ac3.tar.bz2 libayatana-appindicator-59b0398609ef5ce6ee991c633eb84c3b55a42ac3.zip |
Adding more fun. Now we're cookin'!
Diffstat (limited to 'src/libcustomindicator/custom-indicator.c')
-rw-r--r-- | src/libcustomindicator/custom-indicator.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/libcustomindicator/custom-indicator.c b/src/libcustomindicator/custom-indicator.c index a4835cc..b2d1384 100644 --- a/src/libcustomindicator/custom-indicator.c +++ b/src/libcustomindicator/custom-indicator.c @@ -11,6 +11,8 @@ #include "notification-item-server.h" #include "notification-watcher-client.h" +#include "dbus-shared.h" + /** CustomIndicatorPrivate: @id: The ID of the indicator. Maps to CustomIndicator::id. @@ -91,6 +93,7 @@ static void custom_indicator_set_property (GObject * object, guint prop_id, cons static void custom_indicator_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); /* Other stuff */ static void check_connect (CustomIndicator * self); +static void register_service_cb (DBusGProxy * proxy, GError * error, gpointer data); /* GObject type */ G_DEFINE_TYPE (CustomIndicator, custom_indicator, G_TYPE_OBJECT); @@ -277,10 +280,25 @@ custom_indicator_init (CustomIndicator *self) g_error_free(error); return; } + dbus_g_connection_register_g_object(connection, "/need/a/path", G_OBJECT(self)); + priv->watcher_proxy = dbus_g_proxy_new_for_name_owner(connection, + INDICATOR_CUSTOM_DBUS_ADDR, + NOTIFICATION_WATCHER_DBUS_OBJ, + NOTIFICATION_WATCHER_DBUS_IFACE, + &error); + if (error != NULL) { + g_warning("Unable to create Ayatana Watcher proxy! %s", error->message); + /* TODO: This is where we should start looking at fallbacks */ + g_error_free(error); + return; + } + + org_ayatana_indicator_custom_NotificationWatcher_register_service_async(priv->watcher_proxy, "/need/a/path", register_service_cb, self); + return; } @@ -598,6 +616,15 @@ check_connect (CustomIndicator * self) } +static void +register_service_cb (DBusGProxy * proxy, GError * error, gpointer data) +{ + if (error != NULL) { + g_warning("Unable to connect to the Notification Watcher: %s", error->message); + } + return; +} + /* ************************* */ /* Public Functions */ |