From d06c1026db12ff8da45a2f16e81768aaca90c1c7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 4 Aug 2010 12:49:54 -0500 Subject: Adding in a base signal handler for the label change --- src/indicator-application.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/indicator-application.c') diff --git a/src/indicator-application.c b/src/indicator-application.c index 32284d3..be47be6 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -107,6 +107,7 @@ static gboolean disconnected_kill (gpointer user_data); static void disconnected_kill_helper (gpointer data, gpointer user_data); static void application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_path, const gchar * label, const gchar * guide, IndicatorApplication * application); static void application_removed (DBusGProxy * proxy, gint position , IndicatorApplication * application); +static void application_label_changed (DBusGProxy * proxy, gint position, const gchar * label, const gchar * guide, IndicatorApplication * application); static void application_icon_changed (DBusGProxy * proxy, gint position, const gchar * iconname, IndicatorApplication * application); static void get_applications (DBusGProxy *proxy, GPtrArray *OUT_applications, GError *error, gpointer userdata); static void get_applications_helper (gpointer data, gpointer user_data); @@ -145,6 +146,12 @@ indicator_application_class_init (IndicatorApplicationClass *klass) G_TYPE_INT, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_object_register_marshaller(_application_service_marshal_VOID__INT_STRING_STRING, + G_TYPE_NONE, + G_TYPE_INT, + G_TYPE_STRING, + G_TYPE_STRING, + G_TYPE_INVALID); return; } @@ -282,6 +289,12 @@ connected (IndicatorApplication * application) G_TYPE_INT, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_add_signal(priv->service_proxy, + "ApplicationLabelChanged", + G_TYPE_INT, + G_TYPE_STRING, + G_TYPE_STRING, + G_TYPE_INVALID); /* Connect to them */ g_debug("Connect to them."); @@ -300,6 +313,11 @@ connected (IndicatorApplication * application) G_CALLBACK(application_icon_changed), application, NULL /* Disconnection Signal */); + dbus_g_proxy_connect_signal(priv->service_proxy, + "ApplicationLabelChanged", + G_CALLBACK(application_label_changed), + application, + NULL /* Disconnection Signal */); } /* Query it for existing applications */ @@ -516,6 +534,22 @@ application_removed (DBusGProxy * proxy, gint position, IndicatorApplication * a return; } +/* The callback for the signal that the label for an application + has changed. */ +static void +application_label_changed (DBusGProxy * proxy, gint position, const gchar * label, const gchar * guide, IndicatorApplication * application) +{ + IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(application); + ApplicationEntry * app = (ApplicationEntry *)g_list_nth_data(priv->applications, position); + + if (app == NULL) { + g_warning("Unable to find application at position: %d", position); + return; + } + + return; +} + /* The callback for the signal that the icon for an application has changed. */ static void -- cgit v1.2.3