From 0597b877c5bf4d21ac4048742ddf6b11e24877ba Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 18 Jul 2008 16:23:26 +0000 Subject: ** Fixes bug #542125 2008-07-18 Matthew Barnes ** Fixes bug #542125 ** This set of changes migrates CompEditor, CompEditorPage and the various subclasses from using BonoboUI to GtkUIManager for menus and toolbars. It also substantially cleans up the code and streamlines the CompEditorPage API, making more effective use of GObject properties. Core changes: * gui/dialogs/comp-editor-page.c: * gui/dialogs/comp-editor-page.h: * gui/dialogs/comp-editor.c: * gui/dialogs/comp-editor.h: * gui/dialogs/event-editor.c: * gui/dialogs/event-editor.h: * gui/dialogs/event-page.c: * gui/dialogs/event-page.h: * gui/dialogs/memo-editor.c: * gui/dialogs/memo-editor.h: * gui/dialogs/memo-page.c: * gui/dialogs/memo-page.h: * gui/dialogs/recurrence-page.c: * gui/dialogs/recurrence-page.h: * gui/dialogs/schedule-page.c: * gui/dialogs/schedule-page.h: * gui/dialogs/task-details-page.c: * gui/dialogs/task-details-page.h: * gui/dialogs/task-editor.c: * gui/dialogs/task-editor.h: * gui/dialogs/task-page.c: * gui/dialogs/task-page.h: Supporting changes: * gui/calendar-component.c: * gui/comp-editor-factory.c: * gui/e-cal-popup.c: * gui/e-calendar-table.c: * gui/e-calendar-view.c: * gui/e-comp-editor-registry.c: * gui/e-memo-table.c: * gui/e-tasks.c: * gui/gnome-cal.c: * gui/memos-component.c: * gui/tasks-component.c: * gui/dialogs/alarm-dialog.c: * gui/dialogs/comp-editor-util.c: * art/Makefile.am: Move query-free-busy.png to data/icons. svn path=/trunk/; revision=35753 --- calendar/gui/gnome-cal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 58911b9cc8..85ae1349cd 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -3263,7 +3263,7 @@ gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtstart, time_t *dtend) GnomeCalendarPrivate *priv; ECal *ecal; ECalModel *model; - TaskEditor *tedit; + CompEditor *editor; ECalComponent *comp; icalcomponent *icalcomp; const char *category; @@ -3281,7 +3281,7 @@ gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtstart, time_t *dtend) return; flags |= COMP_EDITOR_NEW_ITEM; - tedit = task_editor_new (ecal, flags); + editor = task_editor_new (ecal, flags); icalcomp = e_cal_model_create_component_with_defaults (model); comp = e_cal_component_new (); @@ -3306,10 +3306,10 @@ gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtstart, time_t *dtend) if (dtstart || dtend) e_cal_component_commit_sequence (comp); - comp_editor_edit_comp (COMP_EDITOR (tedit), comp); + comp_editor_edit_comp (editor, comp); g_object_unref (comp); - comp_editor_focus (COMP_EDITOR (tedit)); + gtk_window_present (GTK_WINDOW (editor)); } -- cgit v1.2.3 From f86754c329d9411893abd98bfe98b45d5ccfc943 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Wed, 13 Aug 2008 09:09:33 +0000 Subject: Fixes #347287 2008-08-15 Chenthill Palanisamy Fixes #347287 * gui/e-cal-list-view-config.c: * (e_cal_list_view_config_set_view): * gui/e-cal-list-view.c: (e_cal_list_view_new): * gui/e-cal-list-view.h: * gui/e-cal-model.c: (e_cal_model_set_timezone), * (add_instance_cb), (e_cal_view_objects_added_cb), (e_cal_view_done_cb), (update_e_cal_view_for_client), (cal_opened_cb), (add_new_client), (e_cal_model_component_class_init), (e_cal_model_component_finalize), (e_cal_model_component_init), (e_cal_model_component_get_type), (e_cal_model_copy_component_data), (e_cal_model_free_component_data): * gui/e-cal-model.h: * gui/e-calendar-view.c: (e_calendar_view_init), (e_calendar_view_set_model): * gui/e-calendar-view.h: * gui/e-day-view-config.c: (e_day_view_config_set_view): * gui/e-day-view.c: (time_range_changed_cb), (model_row_changed_cb), (model_cell_changed_cb), (model_rows_inserted_cb), (model_rows_deleted_cb), (timezone_changed_cb), (e_day_view_init), (init_model), (e_day_view_new), (e_day_view_set_mins_per_row), (e_day_view_add_event), (e_day_view_check_layout): * gui/e-day-view.h: * gui/e-week-view-config.c: (e_week_view_config_set_view): * gui/e-week-view.c: (time_range_changed_cb), (model_row_changed_cb), (model_cell_changed_cb), (model_rows_inserted_cb), (model_rows_deleted_cb), (timezone_changed_cb), (e_week_view_init), (init_model), (e_week_view_new), (e_week_view_add_event), (e_week_view_check_layout): * gui/e-week-view.h: * gui/gnome-cal.c: (message_proxy), (create_thread_pool), (message_push), (update_query_async), (update_query), (set_search_query), (set_timezone), (setup_widgets), (update_view_times), (display_view), (display_view_cb), (add_mclient_async), (add_mclient), (client_cal_opened_cb), (default_client_cal_opened_cb), (gnome_calendar_remove_source_by_uid), (gnome_calendar_on_date_navigator_selection_changed): Use a single model for all the views. svn path=/trunk/; revision=35977 --- calendar/gui/gnome-cal.c | 252 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 173 insertions(+), 79 deletions(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 85ae1349cd..d2fd8f551b 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -91,7 +91,7 @@ #define G_MAXINT32 ((gint32) 0x7fffffff) #endif - +#define d(x) x /* Private part of the GnomeCalendar structure */ struct _GnomeCalendarPrivate { @@ -249,6 +249,41 @@ static void update_query (GnomeCalendar *gcal); static void update_todo_view (GnomeCalendar *gcal); static void update_memo_view (GnomeCalendar *gcal); +static void default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal); +static void client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal); + +/* Simple asynchronous message dispatcher */ +typedef struct _Message Message; +typedef void (*MessageFunc) (Message *msg); + +struct _Message { + MessageFunc func; +}; + +static void +message_proxy (Message *msg) +{ + g_return_if_fail (msg->func != NULL); + + msg->func (msg); +} + +static gpointer +create_thread_pool (void) +{ + /* once created, run forever */ + return g_thread_pool_new ((GFunc) message_proxy, NULL, 1, FALSE, NULL); +} + +static void +message_push (Message *msg) +{ + static GOnce once = G_ONCE_INIT; + + g_once (&once, (GThreadFunc) create_thread_pool, NULL); + + g_thread_pool_push ((GThreadPool *) once.retval, msg, NULL); +} G_DEFINE_TYPE (GnomeCalendar, gnome_calendar, GTK_TYPE_VBOX) @@ -813,24 +848,22 @@ adjust_e_cal_view_sexp (GnomeCalendar *gcal, const char *sexp) return new_sexp; } -/* Restarts a query for the date navigator in the calendar */ -static void -update_query (GnomeCalendar *gcal) +struct _date_query_msg { + Message header; + GnomeCalendar *gcal; +}; + +static void +update_query_async (struct _date_query_msg *msg) { + GnomeCalendar *gcal = msg->gcal; GnomeCalendarPrivate *priv; ECalView *old_query; char *real_sexp; GList *l; priv = gcal->priv; - - if (priv->updating == TRUE) { - return; - } - e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), _("Updating query"), -1); - e_calendar_item_clear_marks (priv->date_navigator->calitem); - - priv->updating = TRUE; + /* free the previous queries */ for (l = priv->dn_queries; l != NULL; l = l->next) { old_query = l->data; @@ -849,20 +882,33 @@ update_query (GnomeCalendar *gcal) real_sexp = adjust_e_cal_view_sexp (gcal, priv->sexp); if (!real_sexp) { - e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL, -1); - priv->updating = FALSE; return; /* No time range is set, so don't start a query */ } - + /* create queries for each loaded client */ for (l = priv->clients_list[E_CAL_SOURCE_TYPE_EVENT]; l != NULL; l = l->next) { + GError *error = NULL; + gint tries = 0; + /* don't create queries for clients not loaded yet */ if (e_cal_get_load_state ((ECal *) l->data) != E_CAL_LOAD_LOADED) continue; +try_again: old_query = NULL; - if (!e_cal_get_query ((ECal *) l->data, real_sexp, &old_query, NULL)) { - g_warning (G_STRLOC ": Could not create the query"); + if (!e_cal_get_query ((ECal *) l->data, real_sexp, &old_query, &error)) { + /* If calendar is busy try again for 3 times. */ + if (error->code == E_CALENDAR_STATUS_BUSY && tries != 3) { + tries++; + /*TODO chose an optimal value */ + g_usleep (50); + + g_clear_error (&error); + goto try_again; + } + + g_warning (G_STRLOC ": Could not create the query: %s ", error->message); + g_clear_error (&error); continue; } @@ -882,10 +928,26 @@ update_query (GnomeCalendar *gcal) } /* free memory */ - priv->updating = FALSE; g_free (real_sexp); - e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL, -1); update_todo_view (gcal); + + g_object_unref (msg->gcal); + g_slice_free (struct _date_query_msg, msg); +} + +/* Restarts a query for the date navigator in the calendar */ +static void +update_query (GnomeCalendar *gcal) +{ + struct _date_query_msg *msg; + + e_calendar_item_clear_marks (gcal->priv->date_navigator->calitem); + + msg = g_slice_new0 (struct _date_query_msg); + msg->header.func = (MessageFunc) update_query_async; + msg->gcal = g_object_ref (gcal); + + message_push ((Message *) msg); } static void @@ -908,26 +970,28 @@ set_search_query (GnomeCalendar *gcal, const char *sexp) priv->sexp = g_strdup (sexp); + d(g_print ("Changing the queries %s \n", sexp)); + update_query (gcal); + i = priv->current_view_type; + /* Set the query on the views */ - for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { - if (i == GNOME_CAL_LIST_VIEW) { - if (!priv->lview_select_daten_range) { - cal_search_bar_get_time_range ((CalSearchBar *)priv->search_bar, &start, &end); - e_cal_model_set_search_query_with_time_range (e_calendar_view_get_model (priv->views [i]), sexp, start, end); - } else { - start = priv->base_view_time; - get_times_for_views (gcal, GNOME_CAL_LIST_VIEW, &start, &end); - - e_cal_model_set_search_query_with_time_range (e_calendar_view_get_model (priv->views [i]), sexp, start, end); - - if (priv->current_view_type == GNOME_CAL_LIST_VIEW) - gnome_calendar_update_date_navigator (gcal); - } - } else - e_cal_model_set_search_query (e_calendar_view_get_model (priv->views[i]), sexp); - } + if (i == GNOME_CAL_LIST_VIEW) { + if (!priv->lview_select_daten_range) { + cal_search_bar_get_time_range ((CalSearchBar *)priv->search_bar, &start, &end); + e_cal_model_set_search_query_with_time_range (e_calendar_view_get_model (priv->views [i]), sexp, start, end); + } else { + start = priv->base_view_time; + get_times_for_views (gcal, GNOME_CAL_LIST_VIEW, &start, &end); + + e_cal_model_set_search_query_with_time_range (e_calendar_view_get_model (priv->views [i]), sexp, start, end); + + if (priv->current_view_type == GNOME_CAL_LIST_VIEW) + gnome_calendar_update_date_navigator (gcal); + } + } else + e_cal_model_set_search_query (e_calendar_view_get_model (priv->views[i]), sexp); /* Set the query on the task pad */ update_todo_view (gcal); @@ -1224,6 +1288,9 @@ set_timezone (GnomeCalendar *calendar) /* FIXME Error checking */ e_cal_set_default_timezone (priv->default_client[i], priv->zone, NULL); } + + if (priv->views [priv->current_view_type]) + e_calendar_view_set_timezone (priv->views [priv->current_view_type], priv->zone); } static void @@ -1506,6 +1573,7 @@ setup_widgets (GnomeCalendar *gcal) ECalModel *w_model; GtkWidget *vbox; GtkWidget *label; + ECalModel *cal_model; int i; char *tmp; @@ -1610,8 +1678,12 @@ setup_widgets (GnomeCalendar *gcal) /* Timeout check to hide completed items */ priv->update_timeout = g_timeout_add_full (G_PRIORITY_LOW, 60000, (GSourceFunc) update_todo_view_cb, gcal, NULL); + /* Create the model for the views */ + cal_model = (ECalModel *) e_cal_model_calendar_new (); + e_cal_model_set_flags (cal_model, E_CAL_MODEL_FLAGS_EXPAND_RECURRENCES); + /* The Day View. */ - priv->day_view = e_day_view_new (); + priv->day_view = e_day_view_new (cal_model); e_calendar_view_set_calendar (E_CALENDAR_VIEW (priv->day_view), gcal); e_calendar_view_set_timezone (E_CALENDAR_VIEW (priv->day_view), priv->zone); g_signal_connect (priv->day_view, "selection_changed", @@ -1619,7 +1691,7 @@ setup_widgets (GnomeCalendar *gcal) connect_day_view_focus (gcal, E_DAY_VIEW (priv->day_view)); /* The Work Week View. */ - priv->work_week_view = e_day_view_new (); + priv->work_week_view = e_day_view_new (cal_model); e_day_view_set_work_week_view (E_DAY_VIEW (priv->work_week_view), TRUE); e_day_view_set_days_shown (E_DAY_VIEW (priv->work_week_view), 5); @@ -1631,7 +1703,7 @@ setup_widgets (GnomeCalendar *gcal) priv->update_marcus_bains_line_timeout = g_timeout_add_full (G_PRIORITY_LOW, 60000, (GSourceFunc) update_marcus_bains_line_cb, gcal, NULL); /* The Week View. */ - priv->week_view = e_week_view_new (); + priv->week_view = e_week_view_new (cal_model); e_calendar_view_set_calendar (E_CALENDAR_VIEW (priv->week_view), gcal); e_calendar_view_set_timezone (E_CALENDAR_VIEW (priv->week_view), priv->zone); g_signal_connect (priv->week_view, "selection_changed", @@ -1650,7 +1722,7 @@ setup_widgets (GnomeCalendar *gcal) G_CALLBACK (view_done_cb), gcal); /* The Month View. */ - priv->month_view = e_week_view_new (); + priv->month_view = e_week_view_new (cal_model); e_calendar_view_set_calendar (E_CALENDAR_VIEW (priv->month_view), gcal); e_calendar_view_set_timezone (E_CALENDAR_VIEW (priv->month_view), priv->zone); e_week_view_set_multi_week_view (E_WEEK_VIEW (priv->month_view), TRUE); @@ -1666,7 +1738,7 @@ setup_widgets (GnomeCalendar *gcal) gcal); /* The List View. */ - priv->list_view = e_cal_list_view_new (); + priv->list_view = e_cal_list_view_new (cal_model); e_calendar_view_set_calendar (E_CALENDAR_VIEW (priv->list_view), gcal); e_calendar_view_set_timezone (E_CALENDAR_VIEW (priv->list_view), priv->zone); @@ -1733,10 +1805,6 @@ setup_widgets (GnomeCalendar *gcal) g_signal_connect (e_memo_table_get_model ((EMemoTable *)priv->memo), "cal_view_done", G_CALLBACK (view_done_cb), gcal); - - /* make sure we set the initial time ranges for the views */ - update_view_times (gcal, time (NULL)); - gnome_calendar_update_date_navigator (gcal); } /* Object initialization function for the gnome calendar */ @@ -2041,25 +2109,21 @@ static void update_view_times (GnomeCalendar *gcal, time_t start_time) { GnomeCalendarPrivate *priv; - int i; + ECalModel *model; + time_t real_start_time = start_time; + time_t end_time; priv = gcal->priv; priv->base_view_time = start_time; - for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { - ECalModel *model; - time_t real_start_time = start_time; - time_t end_time; - - model = e_calendar_view_get_model (priv->views[i]); - get_times_for_views (gcal, i, &real_start_time, &end_time); + model = e_calendar_view_get_model (priv->views [priv->current_view_type]); + get_times_for_views (gcal, priv->current_view_type, &real_start_time, &end_time); - if (i == GNOME_CAL_LIST_VIEW && !priv->lview_select_daten_range) - continue; + if (priv->current_view_type == GNOME_CAL_LIST_VIEW && !priv->lview_select_daten_range) + return; - e_cal_model_set_time_range (model, real_start_time, end_time); - } + e_cal_model_set_time_range (model, real_start_time, end_time); } static void @@ -2233,6 +2297,7 @@ display_view (GnomeCalendar *gcal, GnomeCalendarViewType view_type, gboolean gra { GnomeCalendarPrivate *priv; gboolean preserve_day; + int i; priv = gcal->priv; @@ -2276,10 +2341,17 @@ display_view (GnomeCalendar *gcal, GnomeCalendarViewType view_type, gboolean gra } priv->current_view_type = view_type; + E_CALENDAR_VIEW (priv->views [view_type])->in_focus = TRUE; gtk_notebook_set_current_page ( GTK_NOTEBOOK (priv->notebook), (int) view_type); + for (i = 0; i < GNOME_CAL_LAST_VIEW ; i++) { + if (i == view_type) + continue; + E_CALENDAR_VIEW (priv->views [i])->in_focus = FALSE; + } + if (grab_focus) focus_current_view (gcal); @@ -2331,12 +2403,15 @@ display_view_cb (GalViewInstance *view_instance, GalView *view, gpointer data) display_view (gcal, view_type, TRUE); + + if (!priv->base_view_time) + update_view_times (gcal, time (NULL)); + else + update_view_times (gcal, priv->base_view_time); + gnome_calendar_update_date_navigator (gcal); gnome_calendar_notify_dates_shown_changed (gcal); - if (!priv->lview_select_daten_range && priv->current_view_type != GNOME_CAL_LIST_VIEW) - update_query (gcal); - } /** @@ -2607,15 +2682,44 @@ gnome_calendar_set_pane_positions (GnomeCalendar *gcal) } } +struct _mclient_msg { + Message header; + ECalModel *model; + ECal *client; +}; + +static void +add_mclient_async (struct _mclient_msg *msg) +{ + e_cal_model_add_client (msg->model, msg->client); + + g_object_unref (msg->client); + g_object_unref (msg->model); + g_slice_free (struct _mclient_msg, msg); +} + +static void +add_mclient (ECalModel *model, ECal *client) +{ + struct _mclient_msg *msg; + + msg = g_slice_new0 (struct _mclient_msg); + msg->header.func = (MessageFunc) add_mclient_async; + msg->model = g_object_ref (model); + msg->client = g_object_ref (client); + + message_push ((Message *) msg); +} + static void client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) { GnomeCalendarPrivate *priv; ECalSourceType source_type; ESource *source; + ECalModel *model; ECalLoadState state; char *msg; - int i; priv = gcal->priv; @@ -2682,7 +2786,6 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, client_cal_opened_cb, NULL); - switch (source_type) { case E_CAL_SOURCE_TYPE_EVENT : msg = g_strdup_printf (_("Loading appointments at %s"), e_cal_get_uri (ecal)); @@ -2690,12 +2793,8 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) g_free (msg); /* add client to the views */ - for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { - ECalModel *model; - - model = e_calendar_view_get_model (priv->views[i]); - e_cal_model_add_client (model, ecal); - } + model = e_calendar_view_get_model (priv->views[priv->current_view_type]); + add_mclient (model, ecal); /* update date navigator query */ update_query (gcal); @@ -2731,7 +2830,6 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar ECalSourceType source_type; ESource *source; ECalLoadState state; - int i; priv = gcal->priv; @@ -2788,11 +2886,9 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar switch (source_type) { case E_CAL_SOURCE_TYPE_EVENT: - for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { e_cal_model_set_default_client ( - e_calendar_view_get_model (E_CALENDAR_VIEW (priv->views[i])), + e_calendar_view_get_model (E_CALENDAR_VIEW (priv->views[priv->current_view_type])), ecal); - } break; case E_CAL_SOURCE_TYPE_TODO: @@ -3111,7 +3207,6 @@ gnome_calendar_remove_source_by_uid (GnomeCalendar *gcal, ECalSourceType source_ GnomeCalendarPrivate *priv; ECal *client; ECalModel *model; - int i; GList *l; g_return_val_if_fail (gcal != NULL, FALSE); @@ -3143,10 +3238,8 @@ gnome_calendar_remove_source_by_uid (GnomeCalendar *gcal, ECalSourceType source_ } } - for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { - model = e_calendar_view_get_model (priv->views[i]); - e_cal_model_remove_client (model, client); - } + model = e_calendar_view_get_model (priv->views[priv->current_view_type]); + e_cal_model_remove_client (model, client); /* update date navigator query */ update_query (gcal); @@ -3413,8 +3506,9 @@ gnome_calendar_on_date_navigator_selection_changed (ECalendarItem *calitem, Gnom /* If the selection hasn't changed just return. */ if (!g_date_compare (&start_date, &new_start_date) - && !g_date_compare (&end_date, &new_end_date)) + && !g_date_compare (&end_date, &new_end_date)) { return; + } new_days_shown = g_date_get_julian (&new_end_date) - g_date_get_julian (&new_start_date) + 1; @@ -3458,8 +3552,8 @@ gnome_calendar_on_date_navigator_selection_changed (ECalendarItem *calitem, Gnom /* Make the views display things properly */ update_view_times (gcal, new_time); - set_view (gcal, view_type, TRUE); + gnome_calendar_notify_dates_shown_changed (gcal); } -- cgit v1.2.3 From 2e2cef24bc9275c29d013cdcee6517d921d26c15 Mon Sep 17 00:00:00 2001 From: Suman Manjunath Date: Mon, 18 Aug 2008 05:14:43 +0000 Subject: Milan Crha ** Part of fix for bug #462242 (Do not unref NULL pointers). svn path=/trunk/; revision=36011 --- calendar/gui/gnome-cal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index d2fd8f551b..4d65f094b8 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -2870,7 +2870,8 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar g_hash_table_remove (priv->clients[source_type], e_source_peek_uid (source)); /* FIXME Is there a better way to handle this? */ - g_object_unref (priv->default_client[source_type]); + if (priv->default_client[source_type]) + g_object_unref (priv->default_client[source_type]); priv->default_client[source_type] = NULL; g_signal_emit (gcal, gnome_calendar_signals[SOURCE_REMOVED], 0, source_type, source); -- cgit v1.2.3 From c3aad49dee688ae227615fa738d8dee32110844c Mon Sep 17 00:00:00 2001 From: Sankarasivasubramanian Pasupathilingam Date: Tue, 14 Oct 2008 09:35:11 +0000 Subject: Remove improper FSF copyright statements; was never signed over to them * Remove improper FSF copyright statements; was never signed over to them and was incorrectly added to this file due to a mistake made by the original developer. svn path=/trunk/; revision=36616 --- calendar/gui/gnome-cal.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 4d65f094b8..cb5a2fbd79 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1,9 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* Evolution calendar - Main calendar view widget * - * Copyright (C) 1998 The Free Software Foundation - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * * Authors: Miguel de Icaza -- cgit v1.2.3 From 808c62577c212151fe8f088a51fa88f0136cd922 Mon Sep 17 00:00:00 2001 From: Sankarasivasubramanian Pasupathilingam Date: Tue, 14 Oct 2008 14:45:21 +0000 Subject: Change License from GPL to LGPL svn path=/trunk/; revision=36617 --- calendar/gui/gnome-cal.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index cb5a2fbd79..2273ec65b3 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1,25 +1,28 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* Evolution calendar - Main calendar view widget - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - * Authors: Miguel de Icaza - * Federico Mena-Quintero - * Seth Alves - * Rodrigo Moya +/* + * Evolution calendar - Main calendar view widget * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see + * + * + * Authors: + * Miguel de Icaza + * Federico Mena-Quintero + * Seth Alves + * Rodrigo Moya + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H -- cgit v1.2.3 From 26fe8fb76ea445c87fd72997f97e7c4950b53bd1 Mon Sep 17 00:00:00 2001 From: Ashish Shrivastava Date: Mon, 3 Nov 2008 12:10:48 +0000 Subject: ** Fix for bug #559086 2008-11-03 Ashish Shrivastava ** Fix for bug #559086 * Most of the calendar errors are now non-intrusive * calendar.error.xml: Added a new error message for non-intrusive backend_died. * apps_evolution_calendar.schemas.in: * calendar-commands.c: Added new verb for help debug message (help_debug): * gnome-cal.c: Support for non-intrusive error. (client_cal_opened_cb), Define fash table and accessing errors: * e-calendar-view.c: (error_response): (e_calendar_utils_show_error_silent), (e_calendar_utils_show_info_silent): * e-calendar-view.h: * calendar-component.c: Added EActivityHandler and ELogger: (calendar_component_peek_activity_handler), (calendar_component_show_logger): * calendar-component.h: svn path=/trunk/; revision=36727 --- calendar/gui/gnome-cal.c | 96 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 77 insertions(+), 19 deletions(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 2273ec65b3..ef9e3b7f25 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -93,6 +93,9 @@ #define d(x) x +/* hash table define for non intrusive error dialog */ +static GHashTable *non_intrusive_error_table = NULL; + /* Private part of the GnomeCalendar structure */ struct _GnomeCalendarPrivate { /* The clients for display */ @@ -1820,6 +1823,9 @@ gnome_calendar_init (GnomeCalendar *gcal) for (i = 0; i < E_CAL_SOURCE_TYPE_LAST; i++) priv->clients[i] = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + if (non_intrusive_error_table == NULL) + non_intrusive_error_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + e_categories_register_change_listener (G_CALLBACK (categories_changed_cb), gcal); priv->current_view_type = GNOME_CAL_DAY_VIEW; @@ -1889,7 +1895,7 @@ gnome_calendar_destroy (GtkObject *object) } for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { - if (priv->configs[i]) + if (priv->configs[i]) g_object_unref (priv->configs[i]); priv->configs[i] = NULL; } @@ -1925,6 +1931,11 @@ gnome_calendar_destroy (GtkObject *object) priv->dn_queries = NULL; } + if (non_intrusive_error_table) { + g_hash_table_destroy (non_intrusive_error_table); + non_intrusive_error_table = NULL; + } + if (priv->sexp) { g_free (priv->sexp); priv->sexp = NULL; @@ -2711,6 +2722,12 @@ add_mclient (ECalModel *model, ECal *client) message_push ((Message *) msg); } +static void +non_intrusive_error_remove(GtkWidget *w, void *data) +{ + g_hash_table_remove(non_intrusive_error_table, data); +} + static void client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) { @@ -2720,6 +2737,8 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) ECalModel *model; ECalLoadState state; char *msg; + GtkWidget *w = NULL; + gchar *id; priv = gcal->priv; @@ -2751,14 +2770,26 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) e_cal_open_async (ecal, FALSE); return; case E_CALENDAR_STATUS_INVALID_SERVER_VERSION: - e_error_run (NULL, "calendar:server-version", NULL); + id = g_strdup ("calendar:server-version"); + + if (g_hash_table_lookup(non_intrusive_error_table, id)) { + /* We already have it */ + g_message("Error occurred while existing dialog active:\n"); + return; + } + + w = e_error_new(NULL, "calendar:server-version", NULL); + e_calendar_utils_show_error_silent (w); + g_hash_table_insert (non_intrusive_error_table, id, g_object_ref(w)); + g_signal_connect(w, "destroy", G_CALLBACK(non_intrusive_error_remove), id); + status = E_CALENDAR_STATUS_OK; break; case E_CALENDAR_STATUS_AUTHENTICATION_FAILED: { const gchar *auth_domain = e_source_get_property (source, "auth-domain"); const gchar *component_name; - + component_name = auth_domain ? auth_domain : "Calendar"; /* Warn the user password is wrong */ @@ -2767,8 +2798,21 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) } case E_CALENDAR_STATUS_REPOSITORY_OFFLINE: if (source_type == E_CAL_SOURCE_TYPE_EVENT) - e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), - "calendar:prompt-no-contents-offline-calendar", NULL); + { + /* check to see if we have dialog already running for this operation */ + id = g_strdup ("calendar:unable-to-load-the-calendar"); + + if (g_hash_table_lookup(non_intrusive_error_table, id)) { + /* We already have it */ + g_message("Error occurred while existing dialog active:\n"); + return; + } + + w = e_error_new(GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), "calendar:unable-to-load-the-calendar", e_cal_get_error_message (status), NULL); + e_calendar_utils_show_error_silent (w); + g_hash_table_insert (non_intrusive_error_table, id, g_object_ref(w)); + g_signal_connect(w, "destroy", G_CALLBACK(non_intrusive_error_remove), id); + } default: /* Make sure the source doesn't disappear on us */ g_object_ref (source); @@ -2870,7 +2914,7 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar g_hash_table_remove (priv->clients[source_type], e_source_peek_uid (source)); /* FIXME Is there a better way to handle this? */ - if (priv->default_client[source_type]) + if (priv->default_client[source_type]) g_object_unref (priv->default_client[source_type]); priv->default_client[source_type] = NULL; @@ -2948,21 +2992,25 @@ backend_error_cb (ECal *client, const char *message, gpointer data) GnomeCalendar *gcal; GtkDialog *dialog; char *uristr; + gchar *id; gcal = GNOME_CALENDAR (data); uristr = get_uri_without_password (e_cal_get_uri (client)); + id = g_strdup ("calendar:error-on-loading-the-calendar"); + + if (g_hash_table_lookup(non_intrusive_error_table,id)) { + /* We already have it */ + g_message("Error occurred while existing dialog active:\n"); + return; + } - dialog = GTK_DIALOG (gtk_message_dialog_new ( - GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - _("Error on %s:\n %s"), - uristr, message)); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (GTK_WIDGET (dialog)); + dialog = (GtkDialog *)e_error_new(GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), "calendar:error-on-loading-the-calendar", uristr, message, NULL); + e_calendar_utils_show_error_silent(GTK_WIDGET (dialog)); + g_hash_table_insert (non_intrusive_error_table, id, g_object_ref(dialog)); + g_signal_connect(GTK_WIDGET (dialog), "destroy", G_CALLBACK(non_intrusive_error_remove), id); + g_free (uristr); } @@ -2975,6 +3023,7 @@ backend_died_cb (ECal *ecal, gpointer data) ECalSourceType source_type; ESource *source; const char *id; + GtkWidget *w = NULL; gcal = GNOME_CALENDAR (data); priv = gcal->priv; @@ -2990,7 +3039,7 @@ backend_died_cb (ECal *ecal, gpointer data) switch (source_type) { case E_CAL_SOURCE_TYPE_EVENT: - id = "calendar:calendar-crashed"; + id = g_strdup ("calendar:calendar-crashed"); e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL, -1); @@ -2998,7 +3047,7 @@ backend_died_cb (ECal *ecal, gpointer data) break; case E_CAL_SOURCE_TYPE_TODO: - id = "calendar:tasks-crashed"; + id = g_strdup ("calendar:calendar-crashed"); e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL, -1); @@ -3006,7 +3055,7 @@ backend_died_cb (ECal *ecal, gpointer data) break; case E_CAL_SOURCE_TYPE_JOURNAL: - id = "calendar:memos-crashed"; + id = g_strdup ("calendar:calendar-crashed"); e_memo_table_set_status_message (E_MEMO_TABLE (priv->memo), NULL); @@ -3018,7 +3067,16 @@ backend_died_cb (ECal *ecal, gpointer data) g_object_unref (source); - e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), id, NULL); + if (g_hash_table_lookup(non_intrusive_error_table,id)) { + /* We already have it */ + g_message("Error occurred while existing dialog active:\n"); + return; + } + + w = e_error_new(GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), "calendar:backend_died", NULL); + e_calendar_utils_show_error_silent (w); + g_hash_table_insert (non_intrusive_error_table, id, g_object_ref(w)); + g_signal_connect((GtkObject *)w, "destroy", G_CALLBACK(non_intrusive_error_remove),id); } GtkWidget * -- cgit v1.2.3 From 4e7597a4a2732baeeda9dd4876a873ec6588d6f7 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 4 Nov 2008 13:27:22 +0000 Subject: Fix compiler warnings. 2008-11-04 Matthew Barnes * calendar/gui/calendar-commands.c: * calendar/gui/calendar-component.h: * calendar/gui/gnome-cal.c: * e-util/e-non-intrusive-error-dialog.c: * e-util/e-non-intrusive-error-dialog.h: Fix compiler warnings. svn path=/trunk/; revision=36738 --- calendar/gui/gnome-cal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index ef9e3b7f25..1e08f727c5 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -3075,8 +3075,8 @@ backend_died_cb (ECal *ecal, gpointer data) w = e_error_new(GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), "calendar:backend_died", NULL); e_calendar_utils_show_error_silent (w); - g_hash_table_insert (non_intrusive_error_table, id, g_object_ref(w)); - g_signal_connect((GtkObject *)w, "destroy", G_CALLBACK(non_intrusive_error_remove),id); + g_hash_table_insert (non_intrusive_error_table, (gpointer) id, g_object_ref(w)); + g_signal_connect((GtkObject *)w, "destroy", G_CALLBACK(non_intrusive_error_remove), (gpointer) id); } GtkWidget * -- cgit v1.2.3 From 3a98f1caa7bd4783696897f3fbe9fb5fa2cadd3f Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 19 Nov 2008 12:11:50 +0000 Subject: ** Fix for bug #556224 2008-11-19 Milan Crha ** Fix for bug #556224 * gui/gnome-cal.c: (struct _GnomeCalendarPrivate), (setup_widgets), (update_todo_view_async), (update_todo_view), (gnome_calendar_init), (gnome_calendar_destroy): Run always 'update_todo_view' in a separate thread and guard its body with a mutex. * gui/gnome-cal.c: (update_query_async): Do not leak. svn path=/trunk/; revision=36803 --- calendar/gui/gnome-cal.c | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 1e08f727c5..4325a4d36a 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -194,6 +194,9 @@ struct _GnomeCalendarPrivate { /* We should know which calendar has been used to create object, so store it here before emitting "user_created" signal and make it NULL just after the emit. */ ECal *user_created_cal; + + /* used in update_todo_view, to prevent interleaving when called in separate thread */ + GMutex *todo_update_lock; }; /* Signal IDs */ @@ -885,6 +888,8 @@ update_query_async (struct _date_query_msg *msg) real_sexp = adjust_e_cal_view_sexp (gcal, priv->sexp); if (!real_sexp) { + g_object_unref (msg->gcal); + g_slice_free (struct _date_query_msg, msg); return; /* No time range is set, so don't start a query */ } @@ -1304,18 +1309,30 @@ timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer set_timezone (calendar); } +struct _mupdate_todo_msg { + Message header; + GnomeCalendar *gcal; +}; + static void -update_todo_view (GnomeCalendar *gcal) +update_todo_view_async (struct _mupdate_todo_msg *msg) { + GnomeCalendar *gcal; GnomeCalendarPrivate *priv; ECalModel *model; char *sexp = NULL; + g_return_if_fail (msg != NULL); + + gcal = msg->gcal; priv = gcal->priv; + g_mutex_lock (priv->todo_update_lock); + /* Set the query on the task pad */ if (priv->todo_sexp) { g_free (priv->todo_sexp); + priv->todo_sexp = NULL; } model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)); @@ -1330,6 +1347,22 @@ update_todo_view (GnomeCalendar *gcal) e_cal_model_set_search_query (model, priv->todo_sexp); } + g_mutex_unlock (priv->todo_update_lock); + + g_object_unref (msg->gcal); + g_slice_free (struct _mupdate_todo_msg, msg); +} + +static void +update_todo_view (GnomeCalendar *gcal) +{ + struct _mupdate_todo_msg *msg; + + msg = g_slice_new0 (struct _mupdate_todo_msg); + msg->header.func = (MessageFunc) update_todo_view_async; + msg->gcal = g_object_ref (gcal); + + message_push ((Message *) msg); } static void @@ -1661,7 +1694,7 @@ setup_widgets (GnomeCalendar *gcal) "TaskPad", NULL); e_calendar_table_load_state (E_CALENDAR_TABLE (priv->todo), filename); - update_todo_view (gcal); + /* update_todo_view (gcal); */ g_free (filename); etable = e_calendar_table_get_table (E_CALENDAR_TABLE (priv->todo)); @@ -1828,6 +1861,8 @@ gnome_calendar_init (GnomeCalendar *gcal) e_categories_register_change_listener (G_CALLBACK (categories_changed_cb), gcal); + priv->todo_update_lock = g_mutex_new (); + priv->current_view_type = GNOME_CAL_DAY_VIEW; priv->range_selected = FALSE; priv->lview_select_daten_range = TRUE; @@ -2004,6 +2039,8 @@ gnome_calendar_destroy (GtkObject *object) g_signal_handlers_disconnect_by_func (cal_model, G_CALLBACK (view_done_cb), gcal); + g_mutex_free (priv->todo_update_lock); + g_free (priv); gcal->priv = NULL; } -- cgit v1.2.3 From 97e48e352419d360934a46a05c944d604fd968e9 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 10 Jan 2009 23:41:27 +0000 Subject: ** Fixes bug #567276 2009-01-10 Matthew Barnes ** Fixes bug #567276 * addressbook/gui/widgets/e-addressbook-view.c: * addressbook/printing/test-print.c: * calendar/gui/calendar-commands.c: * calendar/gui/control-factory.c: * calendar/gui/e-itip-control.c: * calendar/gui/gnome-cal.c: * calendar/gui/goto.c: * calendar/gui/memos-control.c: * calendar/gui/print.c: * calendar/gui/tasks-control.c: * calendar/gui/alarm-notify/alarm-queue.c: * calendar/gui/dialogs/schedule-page.c: * widgets/menus/gal-view-menus.c: Remove unneeded #include . * calendar/gui/calendar-config.c: * calendar/gui/calendar-config.h: Removed unused function calendar_config_check_timezone_set(). * widgets/misc/test-color.c: We don't ship this. Remove it. svn path=/trunk/; revision=37030 --- calendar/gui/gnome-cal.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 4325a4d36a..32a2a4c746 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -37,8 +37,6 @@ #include #include #include -#include -#include #include #include #include -- cgit v1.2.3 From 577f9fdffbbb9e57b44b0290f1aea8088c6f0976 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 11 Jan 2009 04:52:38 +0000 Subject: Remove unneeded #include . 2009-01-10 Matthew Barnes * addressbook/gui/contact-editor/e-contact-editor-address.c: * addressbook/gui/contact-editor/e-contact-editor-fullname.c: * addressbook/gui/contact-editor/e-contact-editor-im.c: * addressbook/gui/widgets/e-addressbook-view.c: * addressbook/printing/e-contact-print.c: * calendar/gui/calendar-commands.c: * calendar/gui/e-cal-list-view.c: * calendar/gui/e-day-view.c: * calendar/gui/e-itip-control.c: * calendar/gui/e-meeting-list-view.c: * calendar/gui/e-meeting-store.c: * calendar/gui/e-week-view.c: * calendar/gui/gnome-cal.c: * calendar/gui/memos-control.c: * calendar/gui/tasks-control.c: * e-util/e-dialog-utils.c: * mail/em-folder-view.c: * mail/importers/mail-importer.c: * shell/e-shell.c: * shell/evolution-shell-component-utils.c: * shell/importer/intelligent.c: * shell/main.c: * widgets/menus/gal-view-collection.c: * widgets/menus/gal-view-instance.c: Remove unneeded #include . svn path=/trunk/; revision=37036 --- calendar/gui/gnome-cal.c | 1 - 1 file changed, 1 deletion(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 32a2a4c746..dcec360953 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.3 From 19265d6114dbc5ab7b4cc78a38dcafde13f37789 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 15 Jan 2009 15:07:46 +0000 Subject: ** Fix for bug #303738 2009-01-15 Milan Crha ** Fix for bug #303738 * gui/gnome-cal.c: (client_cal_opened_cb), (default_client_cal_opened_cb): * gui/e-memos.c: (client_cal_opened_cb), (default_client_cal_opened_cb): * gui/e-tasks.c: (client_cal_opened_cb), (default_client_cal_opened_cb): Forget password on AuthFailed or AuthRequired and try to reopen on AuthFailed status, which will ask for a password again. * gui/comp-editor-factory.c: (cal_opened_cb): Show "Authentication Required" on such status returned. * common/authentication.c: (auth_cal_forget_password): Do not free memory which hold ECal. Also always forget password for calendar with the URL key. svn path=/trunk/; revision=37080 --- calendar/gui/gnome-cal.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index dcec360953..c2b1cb3d6c 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -2793,7 +2793,7 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) break; } - if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED && source_type == E_CAL_SOURCE_TYPE_EVENT) + if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED || status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED) auth_cal_forget_password (ecal); switch (status) { @@ -2819,17 +2819,10 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) status = E_CALENDAR_STATUS_OK; break; - case E_CALENDAR_STATUS_AUTHENTICATION_FAILED: - { - const gchar *auth_domain = e_source_get_property (source, "auth-domain"); - const gchar *component_name; - - component_name = auth_domain ? auth_domain : "Calendar"; - - /* Warn the user password is wrong */ - e_passwords_forget_password (component_name, e_cal_get_uri(ecal)); - return; - } + case E_CALENDAR_STATUS_AUTHENTICATION_FAILED: + /* try to reopen calendar - it'll ask for a password once again */ + e_cal_open_async (ecal, FALSE); + return; case E_CALENDAR_STATUS_REPOSITORY_OFFLINE: if (source_type == E_CAL_SOURCE_TYPE_EVENT) { @@ -2851,6 +2844,8 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) /* Make sure the source doesn't disappear on us */ g_object_ref (source); + g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gcal); + priv->clients_list[source_type] = g_list_remove (priv->clients_list[source_type], ecal); g_hash_table_remove (priv->clients[source_type], e_source_peek_uid (source)); @@ -2915,6 +2910,9 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar source = e_cal_get_source (ecal); state = e_cal_get_load_state (ecal); + if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED || status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED) + auth_cal_forget_password (ecal); + switch (source_type) { case E_CAL_SOURCE_TYPE_EVENT: e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL, -1); @@ -2936,13 +2934,18 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar if (state == E_CAL_LOAD_NOT_LOADED) e_cal_open_async (ecal, FALSE); return; - case E_CALENDAR_STATUS_INVALID_SERVER_VERSION : + case E_CALENDAR_STATUS_AUTHENTICATION_FAILED: + /* try to reopen calendar - it'll ask for a password once again */ + e_cal_open_async (ecal, FALSE); + return; + case E_CALENDAR_STATUS_INVALID_SERVER_VERSION: e_error_run (NULL, "calendar:server-version", NULL); - status = E_CALENDAR_STATUS_OK; default: /* Make sure the source doesn't disappear on us */ g_object_ref (source); + g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gcal); + /* FIXME should we do this to prevent multiple error dialogs? */ priv->clients_list[source_type] = g_list_remove (priv->clients_list[source_type], ecal); g_hash_table_remove (priv->clients[source_type], e_source_peek_uid (source)); @@ -2962,7 +2965,6 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, default_client_cal_opened_cb, NULL); - switch (source_type) { case E_CAL_SOURCE_TYPE_EVENT: e_cal_model_set_default_client ( -- cgit v1.2.3 From fa2e93cedc1396a3e323c3a4a1bfdfee8ac3bf53 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 19 Jan 2009 16:41:40 +0000 Subject: ** Fix for bug #567850 2009-01-19 Milan Crha ** Fix for bug #567850 * gui/e-cal-model.h: (e_cal_model_set_default_time_func): * gui/e-cal-model.c: (struct _ECalModelPrivate), (ecm_append_row), (e_cal_model_set_default_time_func): New functionality to retrieve a default time for a model's new event created from a "click-to-add" row. * gui/gnome-cal.c: (gc_get_default_time), (setup_widgets): Set the new time callback for the memo table. svn path=/trunk/; revision=37100 --- calendar/gui/gnome-cal.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index c2b1cb3d6c..782d1b76cb 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1595,6 +1595,20 @@ gnome_calendar_get_tag (GnomeCalendar *gcal) return GTK_WIDGET (gcal->priv->date_navigator); } +static time_t +gc_get_default_time (ECalModel *model, gpointer user_data) +{ + GnomeCalendar *gcal = user_data; + time_t res = 0, end; + + g_return_val_if_fail (model != NULL, 0); + g_return_val_if_fail (GNOME_IS_CALENDAR (user_data), 0); + + gnome_calendar_get_current_time_range (gcal, &res, &end); + + return res; +} + static void setup_widgets (GnomeCalendar *gcal) { @@ -1821,6 +1835,8 @@ setup_widgets (GnomeCalendar *gcal) "MemoPad", NULL); e_memo_table_load_state (E_MEMO_TABLE (priv->memo), filename); + e_cal_model_set_default_time_func (e_memo_table_get_model (E_MEMO_TABLE (priv->memo)), gc_get_default_time, gcal); + update_memo_view (gcal); g_free (filename); -- cgit v1.2.3 From 5829c4926dad0589d16e858a65d0703c1668aa64 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 20 Jan 2009 18:15:07 +0000 Subject: ** Fix for bug #353460 2009-01-20 Milan Crha ** Fix for bug #353460 * gui/gnome-cal.c: (setup_widgets): Do not allow shrinking of Tasks/Memos components in calendar view. svn path=/trunk/; revision=37109 --- calendar/gui/gnome-cal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 782d1b76cb..76b43b8e5b 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1693,7 +1693,7 @@ setup_widgets (GnomeCalendar *gcal) priv->todo = e_calendar_table_new (); priv->todo_config = e_calendar_table_config_new (E_CALENDAR_TABLE (priv->todo)); - gtk_paned_pack1 (GTK_PANED (priv->vpane), vbox, FALSE, TRUE); + gtk_paned_pack1 (GTK_PANED (priv->vpane), vbox, FALSE, FALSE); gtk_box_pack_end ((GtkBox *)vbox, priv->todo, TRUE, TRUE, 0); gtk_widget_show (priv->todo); @@ -1824,7 +1824,7 @@ setup_widgets (GnomeCalendar *gcal) gtk_box_pack_start ((GtkBox *)vbox, label, FALSE, TRUE, 0); priv->memo = e_memo_table_new (); priv->memo_config = e_memo_table_config_new (E_MEMO_TABLE (priv->memo)); - gtk_paned_pack2 (GTK_PANED (priv->vpane), vbox, TRUE, TRUE); + gtk_paned_pack2 (GTK_PANED (priv->vpane), vbox, TRUE, FALSE); gtk_box_pack_end ((GtkBox *)vbox, priv->memo, TRUE, TRUE, 0); gtk_widget_show (priv->memo); -- cgit v1.2.3 From 708696127f3702bdf1bdb424dce490d679420842 Mon Sep 17 00:00:00 2001 From: Suman Manjunath Date: Wed, 21 Jan 2009 06:42:45 +0000 Subject: ** Fix for bug #541209 2009-01-21 Suman Manjunath ** Fix for bug #541209 ** Adapt to the new APIs from upstream libical. Changes made include using the "_r" counterpart for the following APIs: + icalproperty_as_ical_string () + icalvalue_as_ical_string () + icalcomponent_as_ical_string () + icalparameter_as_ical_string () + icaldurationtype_as_ical_string () + icalenum_reqstat_code () + icallangbind_property_eval_string () + icallangbind_quote_as_ical () + icalmime_text_end_part () + icalperiodtype_as_ical_string () + icalproperty_enum_to_string () + icalproperty_get_parameter_as_string () + icalproperty_get_value_as_string () + icalproperty_get_property_name () + icalrecurrencetype_as_string () + icaltime_as_ical_string () + icalreqstattype_as_string () + icalvalue_binary_as_ical_string () + icalvalue_int_as_ical_string () + icalvalue_utcoffset_as_ical_string () + icalvalue_string_as_ical_string () + icalvalue_recur_as_ical_string () + icalvalue_text_as_ical_string () + icalvalue_attach_as_ical_string () + icalvalue_duration_as_ical_string () + icalvalue_date_as_ical_string () + icalvalue_datetime_as_ical_string () + icalvalue_float_as_ical_string () + icalvalue_geo_as_ical_string () + icalvalue_datetimeperiod_as_ical_string () + icalvalue_period_as_ical_string () + icalvalue_trigger_as_ical_string () + icalvalue_as_ical_string () svn path=/trunk/; revision=37113 --- calendar/gui/gnome-cal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 76b43b8e5b..3b08f16390 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -4020,7 +4020,7 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than) struct icaltimetype recur_id = icalcomponent_get_recurrenceid (m->data); if (!icaltime_is_null_time (recur_id) ) - rid = icaltime_as_ical_string (recur_id); + rid = icaltime_as_ical_string_r (recur_id); e_cal_remove_object_with_mod (client, uid, rid, CALOBJ_MOD_ALL, &error); g_free (rid); -- cgit v1.2.3 From bf4820e7210c70abc7fd4249dc838115bdec6727 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Fri, 30 Jan 2009 09:28:55 +0000 Subject: Fixes #347287. svn path=/trunk/; revision=37187 --- calendar/gui/gnome-cal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 3b08f16390..560c55dd2a 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -903,10 +903,10 @@ try_again: old_query = NULL; if (!e_cal_get_query ((ECal *) l->data, real_sexp, &old_query, &error)) { /* If calendar is busy try again for 3 times. */ - if (error->code == E_CALENDAR_STATUS_BUSY && tries != 3) { + if (error->code == E_CALENDAR_STATUS_BUSY && tries != 10) { tries++; /*TODO chose an optimal value */ - g_usleep (50); + g_usleep (500); g_clear_error (&error); goto try_again; -- cgit v1.2.3 From 51dba6bd0c19773ba8b631efbf51c07d548fc75c Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 1 Feb 2009 01:18:42 +0000 Subject: ** Disable debug macros (#define d(x) x) throughout. (#569638) 2009-01-31 Matthew Barnes ** Disable debug macros (#define d(x) x) throughout. (#569638) svn path=/trunk/; revision=37202 --- calendar/gui/gnome-cal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 560c55dd2a..3a539cb1b2 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -88,7 +88,7 @@ #define G_MAXINT32 ((gint32) 0x7fffffff) #endif -#define d(x) x +#define d(x) /* hash table define for non intrusive error dialog */ static GHashTable *non_intrusive_error_table = NULL; -- cgit v1.2.3 From 9b05720ea654afc2083e652461c76dd76af33914 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 25 Feb 2009 11:44:54 +0000 Subject: ** Fix for bug #529037 2009-02-25 Milan Crha ** Fix for bug #529037 * gui/gnome-cal.c: (gnome_calendar_destroy): Disconnect signals on ESource-s too, not only on ECal-s. svn path=/trunk/; revision=37335 --- calendar/gui/gnome-cal.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 3a539cb1b2..1bae7d2879 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1923,8 +1923,13 @@ gnome_calendar_destroy (GtkObject *object) /* Clean up the clients */ for (i = 0; i < E_CAL_SOURCE_TYPE_LAST; i++) { for (l = priv->clients_list[i]; l != NULL; l = l->next) { + ESource *source = e_cal_get_source (l->data); + g_signal_handlers_disconnect_matched (l->data, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gcal); + + if (source) + g_signal_handlers_disconnect_matched (source, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gcal); } g_hash_table_destroy (priv->clients[i]); @@ -1934,9 +1939,15 @@ gnome_calendar_destroy (GtkObject *object) priv->clients_list[i] = NULL; if (priv->default_client[i]) { + ESource *source = e_cal_get_source (priv->default_client[i]); + g_signal_handlers_disconnect_matched (priv->default_client[i], G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gcal); + + if (source) + g_signal_handlers_disconnect_matched (source, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gcal); + g_object_unref (priv->default_client[i]); } priv->default_client[i] = NULL; -- cgit v1.2.3 From e42f27652709397453431b75c32601a4f4effd48 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 23 Apr 2009 10:02:07 -0400 Subject: =?UTF-8?q?Bug=20577929=20=E2=80=93=20Consolidate=20marshallers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consolidate all marshalling specifications to e-util/e-marshal.list. This reduces code duplication and makes it slightly easier to locate unused marshallers. --- calendar/gui/gnome-cal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 1bae7d2879..c2e4511ce6 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -47,6 +47,7 @@ #include #include #include "widgets/menus/gal-view-menus.h" +#include "e-util/e-util.h" #include "e-util/e-error.h" #include "e-util/e-util-private.h" #include "e-comp-editor-registry.h" @@ -54,7 +55,6 @@ #include "dialogs/event-editor.h" #include "dialogs/task-editor.h" #include "comp-util.h" -#include "e-calendar-marshal.h" #include "e-cal-model-calendar.h" #include "e-day-view.h" #include "e-day-view-config.h" @@ -372,7 +372,7 @@ gnome_calendar_class_init (GnomeCalendarClass *class) G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GnomeCalendarClass, source_added), NULL, NULL, - e_calendar_marshal_VOID__INT_OBJECT, + e_marshal_VOID__INT_OBJECT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_OBJECT); @@ -383,7 +383,7 @@ gnome_calendar_class_init (GnomeCalendarClass *class) G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GnomeCalendarClass, source_removed), NULL, NULL, - e_calendar_marshal_VOID__INT_OBJECT, + e_marshal_VOID__INT_OBJECT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_OBJECT); -- cgit v1.2.3