From 899db1fe37a9b8d229a2dc67c9b09ccb48a43521 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 19 Sep 2001 21:13:08 +0000 Subject: Removed globals `activity_client', `progress'. (timeout_callback_3): Get * evolution-test-component.c: Removed globals `activity_client', `progress'. (timeout_callback_3): Get the activity client from @data. (timeout_callback_2): Likewise here. Pass the activity client as the user data pointer for `gtk_timeout_add()'. Put the progress count in a "my_progress" GtkObject data key. (timeout_callback_1): Pass the newly created EActivityClient as the user data pointer for `gtk_timeout_add()'. Also, dispatch itself again with a random timeout delay, for a maximum of NUM_ACTIVITES times. Initialize the "my_progress" GtkObject data to be -1. * e-activity-handler.c: New member `component_id' in `ActivityInfo'. (activity_info_new): New arg @component_id. Init the `component_id' member accordingly. (activity_info_free): Free the `component_id' member. (impl_operationStarted): Pass the component_id to `activity_info_new()'. (task_widget_new_from_activity_info): Pass the component_id to the activity_info. * e-task-widget.c: New member `component_id' in `ETaskWidgetPrivate'. (impl_destroy): Free it. (init): Init to NULL. Also init all the other members to NULL as well. (e_task_widget_construct): New arg @component_id. Assign ->component_id to match it. (e_task_widget_new): New arg @component_id here as well. Pass it over to `e_task_widget_construct()'. (e_task_widget_get_component_id): New. svn path=/trunk/; revision=12988 --- shell/e-task-widget.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'shell/e-task-widget.c') diff --git a/shell/e-task-widget.c b/shell/e-task-widget.c index 22ffecad4d..877d850578 100644 --- a/shell/e-task-widget.c +++ b/shell/e-task-widget.c @@ -44,6 +44,8 @@ static GtkEventBoxClass *parent_class = NULL; struct _ETaskWidgetPrivate { + char *component_id; + GdkPixbuf *icon_pixbuf; GtkWidget *label; GtkWidget *pixmap; @@ -61,6 +63,8 @@ impl_destroy (GtkObject *object) task_widget = E_TASK_WIDGET (object); priv = task_widget->priv; + g_free (priv->component_id); + gdk_pixbuf_unref (priv->icon_pixbuf); g_free (priv); @@ -84,6 +88,11 @@ init (ETaskWidget *task_widget) priv = g_new (ETaskWidgetPrivate, 1); + priv->component_id = NULL; + priv->icon_pixbuf = NULL; + priv->label = NULL; + priv->pixmap = NULL; + task_widget->priv = priv; } @@ -91,6 +100,7 @@ init (ETaskWidget *task_widget) void e_task_widget_construct (ETaskWidget *task_widget, GdkPixbuf *icon_pixbuf, + const char *component_id, const char *information) { ETaskWidgetPrivate *priv; @@ -102,10 +112,13 @@ e_task_widget_construct (ETaskWidget *task_widget, g_return_if_fail (task_widget != NULL); g_return_if_fail (E_IS_TASK_WIDGET (task_widget)); g_return_if_fail (icon_pixbuf != NULL); + g_return_if_fail (component_id != NULL); g_return_if_fail (information != NULL); priv = task_widget->priv; + priv->component_id = g_strdup (component_id); + frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (task_widget), frame); @@ -138,6 +151,7 @@ e_task_widget_construct (ETaskWidget *task_widget, GtkWidget * e_task_widget_new (GdkPixbuf *icon_pixbuf, + const char *component_id, const char *information) { ETaskWidget *task_widget; @@ -146,7 +160,7 @@ e_task_widget_new (GdkPixbuf *icon_pixbuf, g_return_val_if_fail (information != NULL, NULL); task_widget = gtk_type_new (e_task_widget_get_type ()); - e_task_widget_construct (task_widget, icon_pixbuf, information); + e_task_widget_construct (task_widget, icon_pixbuf, component_id, information); return GTK_WIDGET (task_widget); } @@ -194,5 +208,15 @@ e_task_wiget_unalert (ETaskWidget *task_widget) g_return_if_fail (E_IS_TASK_WIDGET (task_widget)); } + +const char * +e_task_widget_get_component_id (ETaskWidget *task_widget) +{ + g_return_val_if_fail (task_widget != NULL, NULL); + g_return_val_if_fail (E_IS_TASK_WIDGET (task_widget), NULL); + + return task_widget->priv->component_id; +} + E_MAKE_TYPE (e_task_widget, "ETaskWidget", ETaskWidget, class_init, init, PARENT_TYPE) -- cgit v1.2.3