aboutsummaryrefslogtreecommitdiff
path: root/libindicate
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-01-30 11:27:48 -0600
committerTed Gould <ted@canonical.com>2009-01-30 11:27:48 -0600
commit2adf895800d7dcf96aba23a2b28c49c158dd2dc5 (patch)
treec57c0f7121a89d02420158c96ceb9ee439a52ea7 /libindicate
parentd9e7ed9cad3adee7dfb917605cd38ea70fe54b67 (diff)
downloadlibayatana-indicator-2adf895800d7dcf96aba23a2b28c49c158dd2dc5.tar.gz
libayatana-indicator-2adf895800d7dcf96aba23a2b28c49c158dd2dc5.tar.bz2
libayatana-indicator-2adf895800d7dcf96aba23a2b28c49c158dd2dc5.zip
Adding an interface to call back to an indicator and display it.
Diffstat (limited to 'libindicate')
-rw-r--r--libindicate/listener.c22
-rw-r--r--libindicate/listener.h3
2 files changed, 24 insertions, 1 deletions
diff --git a/libindicate/listener.c b/libindicate/listener.c
index 31fdf4b..c659147 100644
--- a/libindicate/listener.c
+++ b/libindicate/listener.c
@@ -598,7 +598,27 @@ indicate_listener_get_property (IndicateListener * listener, IndicateListenerSer
get_property_data->indicator = indicator;
get_property_data->property = g_strdup(property);
- org_freedesktop_indicator_get_indicator_property_async (proxyt->proxy , (guint)indicator, property, get_property_cb, get_property_data);
+ org_freedesktop_indicator_get_indicator_property_async (proxyt->proxy , INDICATE_LISTENER_INDICATOR_ID(indicator), property, get_property_cb, get_property_data);
return;
}
+static void
+listener_display_cb (DBusGProxy *proxy, GError *error, gpointer userdata)
+{
+ if (error != NULL) {
+ g_warning("Listener display caused an error: %s", error->message);
+ }
+ return;
+}
+
+void
+indicate_listener_display (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator)
+{
+ IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(listener);
+
+ proxy_t * proxyt = g_hash_table_lookup(priv->proxies_working, server);
+
+ org_freedesktop_indicator_show_indicator_to_user_async (proxyt->proxy, INDICATE_LISTENER_INDICATOR_ID(indicator), listener_display_cb, NULL);
+
+ return;
+}
diff --git a/libindicate/listener.h b/libindicate/listener.h
index bc2332f..4cec7e4 100644
--- a/libindicate/listener.h
+++ b/libindicate/listener.h
@@ -60,6 +60,9 @@ void indicate_listener_get_property (IndicateListener * liste
gchar * property,
indicate_listener_get_property_cb callback,
gpointer data);
+void indicate_listener_display (IndicateListener * listener,
+ IndicateListenerServer * server,
+ IndicateListenerIndicator * indicator);