From 49e7dd311ec4652cbd87fe6f7627c54ab20f4782 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Tue, 2 Dec 2003 05:24:02 +0000 Subject: Replace member "activity" with an "activity_id". * gui/e-calendar-table.h (struct _ECalendarTable): Replace member "activity" with an "activity_id". * gui/e-cal-view.c (struct _ECalendarViewPrivate): Replace member "activity" with "activity_id". (e_calendar_view_destroy): Don't unref activity here anymore. (e_calendar_view_set_status_message): Report progress using the EActivityHandler off the CalendarComponent. * gui/calendar-component.c (struct _CalendarComponentPrivate): New member activity_handler. (calendar_component_init): Init. (calendar_component_peek_activity_handler): New. (impl_dispose): Unref. (impl_createControls): Return an ETaskBar for the statusbar control. svn path=/trunk/; revision=23565 --- calendar/gui/e-calendar-table.c | 48 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 25 deletions(-) (limited to 'calendar/gui/e-calendar-table.c') diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index fc14a50800..74be935d5c 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -5,8 +5,7 @@ * Damon Chaplin * Rodrigo Moya * - * Copyright 2000, Ximian, Inc. - * Copyright 2000, Ximian, Inc. + * Copyright 2000, 2001, 2002, 2003 Novell, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public @@ -42,15 +41,17 @@ #include #include #include -#include "e-comp-editor-registry.h" -#include "e-calendar-table.h" -#include "e-cell-date-edit-text.h" + +#include "calendar-component.h" #include "calendar-config.h" -#include "e-cal-model-tasks.h" -#include "print.h" #include "dialogs/delete-comp.h" #include "dialogs/delete-error.h" #include "dialogs/task-editor.h" +#include "e-cal-model-tasks.h" +#include "e-calendar-table.h" +#include "e-cell-date-edit-text.h" +#include "e-comp-editor-registry.h" +#include "print.h" /* Pixmaps. */ #include "art/task.xpm" @@ -316,8 +317,6 @@ e_calendar_table_init (ECalendarTable *cal_table) GdkPixbuf *pixbuf; GList *strings; - cal_table->activity = NULL; - /* Create the model */ cal_table->model = (ECalModel *) e_cal_model_tasks_new (); @@ -1435,32 +1434,31 @@ static char *test[] = { /* Displays messages on the status bar */ #define EVOLUTION_TASKS_PROGRESS_IMAGE "evolution-tasks-mini.png" -static GdkPixbuf *progress_icon[2] = { NULL, NULL }; +static GdkPixbuf *progress_icon = NULL; void e_calendar_table_set_status_message (ECalendarTable *cal_table, const gchar *message) { + EActivityHandler *activity_handler = calendar_component_peek_activity_handler (calendar_component_peek ()); + g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table)); if (!message || !*message) { - if (cal_table->activity) { - g_object_unref (cal_table->activity); - cal_table->activity = NULL; - } - } else if (!cal_table->activity) { - int display; + if (cal_table->activity_id != 0) { + e_activity_handler_operation_finished (activity_handler, cal_table->activity_id); + cal_table->activity_id = 0; + } + } else if (cal_table->activity_id == 0) { char *client_id = g_strdup_printf ("%p", cal_table); - if (progress_icon[0] == NULL) - progress_icon[0] = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_TASKS_PROGRESS_IMAGE, NULL); + if (progress_icon == NULL) + progress_icon = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" EVOLUTION_TASKS_PROGRESS_IMAGE, NULL); -#if 0 /* EPFIXME */ - cal_table->activity = evolution_activity_client_new ( - global_shell_client, client_id, - progress_icon, message, TRUE, &display); -#endif + cal_table->activity_id = e_activity_handler_operation_started (activity_handler, client_id, + progress_icon, message, TRUE); g_free (client_id); - } else - evolution_activity_client_update (cal_table->activity, message, -1.0); + } else { + evolution_activity_client_update (activity_handler, cal_table->activity_id, message, -1.0); + } } -- cgit