From 1bd22eb65b2d1fa1cb8a589871337290c1cb258f Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Fri, 12 Oct 2001 22:09:57 +0000 Subject: return fill_component success 2001-10-12 JP Rosevear * gui/dialogs/alarm-page.c: return fill_component success * gui/dialogs/task-page.c: ditto * gui/dialogs/task-details-page.c: ditto * gui/dialogs/schedule-page.c: ditto * gui/dialogs/recurrence-page.c: ditto * gui/dialogs/event-page.c: ditto * gui/dialogs/meeting-page.c: use e_notice instead of duplicate_error (meeting_page_get_cancel_comp): duh, deleted_attendees is an array now (meeting_page_fill_component): spew gui errors if there is no organizer or no attendees, return success * gui/dialogs/event-editor.c (event_editor_send_comp): always call parent method and don't send the cancellation comp if the method is publish (refresh_meeting_cmd): use the orginal comp to refresh (forward_cmd): prompt the user for the version they want to send (current, original) * gui/dialogs/task-editor.c (forward_cmd): as above (refresh_task_cmd): ditto * gui/dialogs/comp-editor-page.c (comp_editor_page_fill_component): return boolean of whether the component could be filled or not * gui/dialogs/comp-editor-page.h: update proto * gui/dialogs/comp-editor.c (prompt_to_save_changes): take a param on whether to try and send or not (comp_editor_get_current_comp): only fill component if its changed (comp_editor_save_comp): prompt user as well * gui/dialogs/comp-editor.h: change proto * gui/itip-utils.c: replace error_dialog with e_notice (comp_content_type): specify charset svn path=/trunk/; revision=13635 --- calendar/ChangeLog | 47 +++++++ calendar/gui/dialogs/alarm-page.c | 10 +- calendar/gui/dialogs/comp-editor-page.c | 14 +- calendar/gui/dialogs/comp-editor-page.h | 6 +- calendar/gui/dialogs/comp-editor.c | 230 +++++++++++++++++-------------- calendar/gui/dialogs/comp-editor.h | 3 +- calendar/gui/dialogs/event-editor.c | 19 +-- calendar/gui/dialogs/event-page.c | 6 +- calendar/gui/dialogs/meeting-page.c | 36 ++--- calendar/gui/dialogs/recurrence-page.c | 11 +- calendar/gui/dialogs/schedule-page.c | 6 +- calendar/gui/dialogs/task-details-page.c | 6 +- calendar/gui/dialogs/task-editor.c | 5 +- calendar/gui/dialogs/task-page.c | 6 +- calendar/gui/itip-utils.c | 23 ++-- 15 files changed, 252 insertions(+), 176 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index e49218709c..e479fff38f 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,50 @@ +2001-10-12 JP Rosevear + + * gui/dialogs/alarm-page.c: return fill_component success + + * gui/dialogs/task-page.c: ditto + + * gui/dialogs/task-details-page.c: ditto + + * gui/dialogs/schedule-page.c: ditto + + * gui/dialogs/recurrence-page.c: ditto + + * gui/dialogs/event-page.c: ditto + + * gui/dialogs/meeting-page.c: use e_notice instead of + duplicate_error + (meeting_page_get_cancel_comp): duh, deleted_attendees is an array + now + (meeting_page_fill_component): spew gui errors if there is no + organizer or no attendees, return success + + * gui/dialogs/event-editor.c (event_editor_send_comp): always call + parent method and don't send the cancellation comp if the method + is publish + (refresh_meeting_cmd): use the orginal comp to refresh + (forward_cmd): prompt the user for the version they want to send + (current, original) + + * gui/dialogs/task-editor.c (forward_cmd): as above + (refresh_task_cmd): ditto + + * gui/dialogs/comp-editor-page.c + (comp_editor_page_fill_component): return boolean of whether the + component could be filled or not + + * gui/dialogs/comp-editor-page.h: update proto + + * gui/dialogs/comp-editor.c (prompt_to_save_changes): take a param + on whether to try and send or not + (comp_editor_get_current_comp): only fill component if its changed + (comp_editor_save_comp): prompt user as well + + * gui/dialogs/comp-editor.h: change proto + + * gui/itip-utils.c: replace error_dialog with e_notice + (comp_content_type): specify charset + 2001-10-11 Larry Ewing * gui/e-itip-control.c: large reworking of i18n tagging and now diff --git a/calendar/gui/dialogs/alarm-page.c b/calendar/gui/dialogs/alarm-page.c index 649a86f025..0824f410c5 100644 --- a/calendar/gui/dialogs/alarm-page.c +++ b/calendar/gui/dialogs/alarm-page.c @@ -119,7 +119,7 @@ static void alarm_page_destroy (GtkObject *object); static GtkWidget *alarm_page_get_widget (CompEditorPage *page); static void alarm_page_focus_main_widget (CompEditorPage *page); static void alarm_page_fill_widgets (CompEditorPage *page, CalComponent *comp); -static void alarm_page_fill_component (CompEditorPage *page, CalComponent *comp); +static gboolean alarm_page_fill_component (CompEditorPage *page, CalComponent *comp); static void alarm_page_set_summary (CompEditorPage *page, const char *summary); static void alarm_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates); @@ -359,9 +359,7 @@ get_alarm_string (CalComponentAlarm *alarm) CalAlarmAction action; CalAlarmTrigger trigger; char string[256]; - char *base; - char *str; - char *dur; + char *base, *str = NULL, *dur; string [0] = '\0'; @@ -536,7 +534,7 @@ alarm_page_fill_widgets (CompEditorPage *page, CalComponent *comp) } /* fill_component handler for the alarm page */ -static void +static gboolean alarm_page_fill_component (CompEditorPage *page, CalComponent *comp) { AlarmPage *apage; @@ -576,6 +574,8 @@ alarm_page_fill_component (CompEditorPage *page, CalComponent *comp) cal_component_add_alarm (comp, alarm_copy); cal_component_alarm_free (alarm_copy); } + + return TRUE; } /* set_summary handler for the alarm page */ diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c index 27f4041d3a..9f006a9979 100644 --- a/calendar/gui/dialogs/comp-editor-page.c +++ b/calendar/gui/dialogs/comp-editor-page.c @@ -239,16 +239,20 @@ comp_editor_page_fill_widgets (CompEditorPage *page, CalComponent *comp) * Takes the data from the widgets of an editor page and sets it on a calendar * component, replacing the contents of the properties that the editor page * knows how to manipulate. + * + * Returns: TRUE if the component could be filled, FALSE otherwise **/ -void +gboolean comp_editor_page_fill_component (CompEditorPage *page, CalComponent *comp) { - g_return_if_fail (page != NULL); - g_return_if_fail (IS_COMP_EDITOR_PAGE (page)); - g_return_if_fail (comp != NULL); + g_return_val_if_fail (page != NULL, FALSE); + g_return_val_if_fail (IS_COMP_EDITOR_PAGE (page), FALSE); + g_return_val_if_fail (comp != NULL, FALSE); if (CLASS (page)->fill_component != NULL) - (* CLASS (page)->fill_component) (page, comp); + return (* CLASS (page)->fill_component) (page, comp); + + return TRUE; } /** diff --git a/calendar/gui/dialogs/comp-editor-page.h b/calendar/gui/dialogs/comp-editor-page.h index af8fe1f389..caf0486337 100644 --- a/calendar/gui/dialogs/comp-editor-page.h +++ b/calendar/gui/dialogs/comp-editor-page.h @@ -68,8 +68,8 @@ typedef struct { GtkWidget *(* get_widget) (CompEditorPage *page); void (* focus_main_widget) (CompEditorPage *page); - void (* fill_widgets) (CompEditorPage *page, CalComponent *comp); - void (* fill_component) (CompEditorPage *page, CalComponent *comp); + void (* fill_widgets) (CompEditorPage *page, CalComponent *comp); + gboolean (* fill_component) (CompEditorPage *page, CalComponent *comp); void (* set_summary) (CompEditorPage *page, const char *summary); void (* set_dates) (CompEditorPage *page, CompEditorPageDates *dates); @@ -81,7 +81,7 @@ GtkWidget *comp_editor_page_get_widget (CompEditorPage *page); void comp_editor_page_focus_main_widget (CompEditorPage *page); void comp_editor_page_fill_widgets (CompEditorPage *page, CalComponent *comp); -void comp_editor_page_fill_component (CompEditorPage *page, +gboolean comp_editor_page_fill_component (CompEditorPage *page, CalComponent *comp); void comp_editor_page_set_cal_client (CompEditorPage *page, CalClient *client); diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 6a51cf75a3..b6d6e233db 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -79,8 +79,6 @@ static void comp_editor_destroy (GtkObject *object); static void real_set_cal_client (CompEditor *editor, CalClient *client); static void real_edit_comp (CompEditor *editor, CalComponent *comp); static void real_send_comp (CompEditor *editor, CalComponentItipMethod method); -static void save_comp (CompEditor *editor); -static void save_comp_with_send (CompEditor *editor); static void delete_comp (CompEditor *editor); static void close_dialog (CompEditor *editor); @@ -273,6 +271,117 @@ comp_editor_destroy (GtkObject *object) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } + +static gboolean +save_comp (CompEditor *editor) +{ + CompEditorPrivate *priv; + CalComponent *clone; + GList *l; + + priv = editor->priv; + + if (!priv->changed) + return TRUE; + + clone = cal_component_clone (priv->comp); + for (l = priv->pages; l != NULL; l = l->next) { + if (!comp_editor_page_fill_component (l->data, clone)) { + gtk_object_unref (GTK_OBJECT (clone)); + return FALSE; + } + } + cal_component_commit_sequence (clone); + gtk_object_unref (GTK_OBJECT (priv->comp)); + priv->comp = clone; + + priv->updating = TRUE; + + if (!cal_client_update_object (priv->client, priv->comp)) { + g_message ("save_comp (): Could not update the object!"); + return FALSE; + } else { + priv->changed = FALSE; + } + + priv->updating = FALSE; + + return TRUE; +} + +static gboolean +save_comp_with_send (CompEditor *editor) +{ + CompEditorPrivate *priv; + gboolean send; + + priv = editor->priv; + + send = priv->changed && priv->needs_send; + + if (!save_comp (editor)) + return FALSE; + + if (send && send_component_dialog (priv->comp)) + comp_editor_send_comp (editor, CAL_COMPONENT_METHOD_REQUEST); + + return TRUE; +} + +static void +delete_comp (CompEditor *editor) +{ + CompEditorPrivate *priv; + const char *uid; + + priv = editor->priv; + + cal_component_get_uid (priv->comp, &uid); + priv->updating = TRUE; + cal_client_remove_object (priv->client, uid); + priv->updating = FALSE; + close_dialog (editor); +} + +static gboolean +prompt_to_save_changes (CompEditor *editor, gboolean send) +{ + CompEditorPrivate *priv; + + priv = editor->priv; + + if (!priv->changed) + return TRUE; + + switch (save_component_dialog (GTK_WINDOW (priv->window))) { + case 0: /* Save */ + if (send && save_comp_with_send (editor)) + return TRUE; + else if (!send && save_comp (editor)) + return TRUE; + else + return FALSE; + case 1: /* Discard */ + return TRUE; + case 2: /* Cancel */ + default: + return FALSE; + } +} + +/* Closes the dialog box and emits the appropriate signals */ +static void +close_dialog (CompEditor *editor) +{ + CompEditorPrivate *priv; + + priv = editor->priv; + + g_assert (priv->window != NULL); + + gtk_object_destroy (GTK_OBJECT (editor)); +} + /** @@ -676,18 +785,20 @@ comp_editor_edit_comp (CompEditor *editor, CalComponent *comp) CalComponent * comp_editor_get_current_comp (CompEditor *editor) { - CompEditorPrivate *priv; + CompEditorPrivate *priv; CalComponent *comp; GList *l; - + g_return_val_if_fail (editor != NULL, NULL); g_return_val_if_fail (IS_COMP_EDITOR (editor), NULL); priv = editor->priv; comp = cal_component_clone (priv->comp); - for (l = priv->pages; l != NULL; l = l->next) - comp_editor_page_fill_component (l->data, comp); + if (priv->changed) { + for (l = priv->pages; l != NULL; l = l->next) + comp_editor_page_fill_component (l->data, comp); + } return comp; } @@ -698,10 +809,10 @@ comp_editor_get_current_comp (CompEditor *editor) * * **/ -void -comp_editor_save_comp (CompEditor *editor) +gboolean +comp_editor_save_comp (CompEditor *editor, gboolean send) { - save_comp (editor); + return prompt_to_save_changes (editor, send); } /** @@ -823,99 +934,6 @@ comp_editor_focus (CompEditor *editor) raise_and_focus (priv->window); } -static void -save_comp (CompEditor *editor) -{ - CompEditorPrivate *priv; - GList *l; - - priv = editor->priv; - - if (!priv->changed) - return; - - for (l = priv->pages; l != NULL; l = l->next) - comp_editor_page_fill_component (l->data, priv->comp); - cal_component_commit_sequence (priv->comp); - - priv->updating = TRUE; - - if (!cal_client_update_object (priv->client, priv->comp)) - g_message ("save_comp (): Could not update the object!"); - else - priv->changed = FALSE; - - priv->updating = FALSE; -} - -static void -save_comp_with_send (CompEditor *editor) -{ - CompEditorPrivate *priv; - gboolean send; - - priv = editor->priv; - - send = priv->changed && priv->needs_send; - - save_comp (editor); - - if (send && send_component_dialog (priv->comp)) - comp_editor_send_comp (editor, CAL_COMPONENT_METHOD_REQUEST); -} - -static void -delete_comp (CompEditor *editor) -{ - CompEditorPrivate *priv; - const char *uid; - - priv = editor->priv; - - cal_component_get_uid (priv->comp, &uid); - priv->updating = TRUE; - cal_client_remove_object (priv->client, uid); - priv->updating = FALSE; - close_dialog (editor); -} - -static gboolean -prompt_to_save_changes (CompEditor *editor) -{ - CompEditorPrivate *priv; - - priv = editor->priv; - - if (!priv->changed) - return TRUE; - - switch (save_component_dialog (GTK_WINDOW (priv->window))) { - case 0: /* Save */ - /* FIXME: If an error occurs here, we should popup a dialog - and then return FALSE. */ - save_comp_with_send (editor); - return TRUE; - case 1: /* Discard */ - return TRUE; - case 2: /* Cancel */ - default: - return FALSE; - } -} - -/* Closes the dialog box and emits the appropriate signals */ -static void -close_dialog (CompEditor *editor) -{ - CompEditorPrivate *priv; - - priv = editor->priv; - - g_assert (priv->window != NULL); - - gtk_object_destroy (GTK_OBJECT (editor)); -} - /* Menu Commands */ static void save_cmd (GtkWidget *widget, gpointer data) @@ -930,8 +948,8 @@ save_close_cmd (GtkWidget *widget, gpointer data) { CompEditor *editor = COMP_EDITOR (data); - save_comp_with_send (editor); - close_dialog (editor); + if (save_comp_with_send (editor)) + close_dialog (editor); } static void @@ -1090,7 +1108,7 @@ close_cmd (GtkWidget *widget, gpointer data) { CompEditor *editor = COMP_EDITOR (data); - if (prompt_to_save_changes (editor)) + if (prompt_to_save_changes (editor, TRUE)) close_dialog (editor); } @@ -1200,7 +1218,7 @@ delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) { CompEditor *editor = COMP_EDITOR (data); - if (prompt_to_save_changes (editor)) + if (prompt_to_save_changes (editor, TRUE)) close_dialog (editor); return TRUE; diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h index f19ac706b6..d03f67ac9b 100644 --- a/calendar/gui/dialogs/comp-editor.h +++ b/calendar/gui/dialogs/comp-editor.h @@ -77,7 +77,8 @@ CalClient *comp_editor_get_cal_client (CompEditor *editor); void comp_editor_edit_comp (CompEditor *ee, CalComponent *comp); CalComponent *comp_editor_get_current_comp (CompEditor *editor); -void comp_editor_save_comp (CompEditor *editor); +gboolean comp_editor_save_comp (CompEditor *editor, + gboolean send); void comp_editor_delete_comp (CompEditor *editor); void comp_editor_send_comp (CompEditor *editor, CalComponentItipMethod method); diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index f464015fb0..435cfeefb5 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -286,16 +286,18 @@ event_editor_send_comp (CompEditor *editor, CalComponentItipMethod method) priv = ee->priv; - /* Don't cancel more than once */ - if (method == CAL_COMPONENT_METHOD_CANCEL) - return; + /* Don't cancel more than once or when just publishing */ + if (method == CAL_COMPONENT_METHOD_PUBLISH || + method == CAL_COMPONENT_METHOD_CANCEL) + goto parent; comp = meeting_page_get_cancel_comp (priv->meet_page); if (comp != NULL) { itip_send_comp (CAL_COMPONENT_METHOD_CANCEL, comp); gtk_object_unref (GTK_OBJECT (comp)); } - + + parent: if (parent_class->send_comp) parent_class->send_comp (editor, method); } @@ -369,8 +371,7 @@ static void refresh_meeting_cmd (GtkWidget *widget, gpointer data) { EventEditor *ee = EVENT_EDITOR (data); - - comp_editor_save_comp (COMP_EDITOR (ee)); + comp_editor_send_comp (COMP_EDITOR (ee), CAL_COMPONENT_METHOD_REFRESH); } @@ -391,9 +392,9 @@ static void forward_cmd (GtkWidget *widget, gpointer data) { EventEditor *ee = EVENT_EDITOR (data); - - comp_editor_save_comp (COMP_EDITOR (ee)); - comp_editor_send_comp (COMP_EDITOR (ee), CAL_COMPONENT_METHOD_PUBLISH); + + if (comp_editor_save_comp (COMP_EDITOR (ee), TRUE)) + comp_editor_send_comp (COMP_EDITOR (ee), CAL_COMPONENT_METHOD_PUBLISH); } static void diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 8a1415b9d2..c57a849a24 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -96,7 +96,7 @@ static void event_page_destroy (GtkObject *object); static GtkWidget *event_page_get_widget (CompEditorPage *page); static void event_page_focus_main_widget (CompEditorPage *page); static void event_page_fill_widgets (CompEditorPage *page, CalComponent *comp); -static void event_page_fill_component (CompEditorPage *page, CalComponent *comp); +static gboolean event_page_fill_component (CompEditorPage *page, CalComponent *comp); static void event_page_set_summary (CompEditorPage *page, const char *summary); static void event_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates); @@ -550,7 +550,7 @@ event_page_fill_widgets (CompEditorPage *page, CalComponent *comp) } /* fill_component handler for the event page */ -static void +static gboolean event_page_fill_component (CompEditorPage *page, CalComponent *comp) { EventPage *epage; @@ -684,6 +684,8 @@ event_page_fill_component (CompEditorPage *page, CalComponent *comp) /* Contacts */ comp_editor_contacts_to_component (priv->contacts_entry, comp); + + return TRUE; } /* set_summary handler for the event page */ diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c index 22c8f6e05a..bef302cb9f 100644 --- a/calendar/gui/dialogs/meeting-page.c +++ b/calendar/gui/dialogs/meeting-page.c @@ -37,9 +37,8 @@ #include #include #include -#include -#include #include +#include #include #include #include @@ -128,7 +127,7 @@ static void meeting_page_destroy (GtkObject *object); static GtkWidget *meeting_page_get_widget (CompEditorPage *page); static void meeting_page_focus_main_widget (CompEditorPage *page); static void meeting_page_fill_widgets (CompEditorPage *page, CalComponent *comp); -static void meeting_page_fill_component (CompEditorPage *page, CalComponent *comp); +static gboolean meeting_page_fill_component (CompEditorPage *page, CalComponent *comp); static gint right_click_cb (ETable *etable, gint row, gint col, GdkEvent *event, gpointer data); @@ -409,13 +408,13 @@ meeting_page_fill_widgets (CompEditorPage *page, CalComponent *comp) } /* fill_component handler for the meeting page */ -static void +static gboolean meeting_page_fill_component (CompEditorPage *page, CalComponent *comp) { MeetingPage *mpage; MeetingPagePrivate *priv; CalComponentOrganizer organizer = {NULL, NULL, NULL, NULL}; - + mpage = MEETING_PAGE (page); priv = mpage->priv; @@ -438,10 +437,12 @@ meeting_page_fill_component (CompEditorPage *page, CalComponent *comp) g_free (str); } - if (addr == NULL || strlen (addr) == 0) { + if (addr == NULL || strlen (addr) == 0) { + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, + _("An organizer is required.")); g_free (addr); - g_free (cn); - return; + g_free (cn); + return FALSE; } else { gchar *tmp; @@ -457,7 +458,14 @@ meeting_page_fill_component (CompEditorPage *page, CalComponent *comp) g_free (cn); } + if (e_meeting_model_count_attendees (priv->model) < 1) { + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, + "Atleast one attendee is required."); + return FALSE; + } set_attendees (comp, e_meeting_model_get_attendees (priv->model)); + + return TRUE; } @@ -504,13 +512,6 @@ get_widgets (MeetingPage *mpage) && priv->existing_organizer_btn); } -static void -duplicate_error (void) -{ - GtkWidget *dlg = gnome_error_dialog (_("That person is already attending the meeting!")); - gnome_dialog_run_and_close (GNOME_DIALOG (dlg)); -} - static void invite_entry_changed (BonoboListener *listener, char *event_name, @@ -760,7 +761,8 @@ popup_delegate_cb (GtkWidget *widget, gpointer data) /* Make sure we can add the new delegatee person */ if (e_meeting_model_find_attendee (priv->model, address, NULL) != NULL) { - duplicate_error (); + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, + _("That person is already attending the meeting!")); goto cleanup; } @@ -963,7 +965,7 @@ meeting_page_get_cancel_comp (MeetingPage *mpage) priv = mpage->priv; - if (priv->deleted_attendees == NULL) + if (priv->deleted_attendees->len == 0) return NULL; set_attendees (priv->comp, priv->deleted_attendees); diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index ddd37fa3b2..28858bd950 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -33,8 +33,9 @@ #include #include #include -#include "e-util/e-dialog-widgets.h" -#include "widgets/misc/e-dateedit.h" +#include +#include +#include #include #include "../calendar-config.h" #include "../tag-calendar.h" @@ -173,7 +174,7 @@ static void recurrence_page_destroy (GtkObject *object); static GtkWidget *recurrence_page_get_widget (CompEditorPage *page); static void recurrence_page_focus_main_widget (CompEditorPage *page); static void recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp); -static void recurrence_page_fill_component (CompEditorPage *page, CalComponent *comp); +static gboolean recurrence_page_fill_component (CompEditorPage *page, CalComponent *comp); static void recurrence_page_set_summary (CompEditorPage *page, const char *summary); static void recurrence_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates); @@ -1712,13 +1713,15 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp) } /* fill_component handler for the recurrence page */ -static void +static gboolean recurrence_page_fill_component (CompEditorPage *page, CalComponent *comp) { RecurrencePage *rpage; rpage = RECURRENCE_PAGE (page); fill_component (rpage, comp); + + return TRUE; } /* set_summary handler for the recurrence page */ diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index 37d94c76b7..510bd3070b 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -85,7 +85,7 @@ static void schedule_page_destroy (GtkObject *object); static GtkWidget *schedule_page_get_widget (CompEditorPage *page); static void schedule_page_focus_main_widget (CompEditorPage *page); static void schedule_page_fill_widgets (CompEditorPage *page, CalComponent *comp); -static void schedule_page_fill_component (CompEditorPage *page, CalComponent *comp); +static gboolean schedule_page_fill_component (CompEditorPage *page, CalComponent *comp); static CompEditorPageClass *parent_class = NULL; @@ -245,7 +245,7 @@ schedule_page_fill_widgets (CompEditorPage *page, CalComponent *comp) } /* fill_component handler for the schedule page */ -static void +static gboolean schedule_page_fill_component (CompEditorPage *page, CalComponent *comp) { SchedulePage *spage; @@ -253,6 +253,8 @@ schedule_page_fill_component (CompEditorPage *page, CalComponent *comp) spage = SCHEDULE_PAGE (page); priv = spage->priv; + + return TRUE; } diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index 3196994bd1..1128d54deb 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -91,7 +91,7 @@ static void task_details_page_destroy (GtkObject *object); static GtkWidget *task_details_page_get_widget (CompEditorPage *page); static void task_details_page_focus_main_widget (CompEditorPage *page); static void task_details_page_fill_widgets (CompEditorPage *page, CalComponent *comp); -static void task_details_page_fill_component (CompEditorPage *page, CalComponent *comp); +static gboolean task_details_page_fill_component (CompEditorPage *page, CalComponent *comp); static CompEditorPageClass *parent_class = NULL; @@ -374,7 +374,7 @@ task_details_page_fill_widgets (CompEditorPage *page, CalComponent *comp) } /* fill_component handler for the task page */ -static void +static gboolean task_details_page_fill_component (CompEditorPage *page, CalComponent *comp) { TaskDetailsPage *tdpage; @@ -436,6 +436,8 @@ task_details_page_fill_component (CompEditorPage *page, CalComponent *comp) cal_component_set_url (comp, url); if (url) g_free (url); + + return TRUE; } diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 774a9cc1c3..03c4f87a54 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -306,7 +306,6 @@ refresh_task_cmd (GtkWidget *widget, gpointer data) { TaskEditor *te = TASK_EDITOR (data); - comp_editor_save_comp (COMP_EDITOR (te)); comp_editor_send_comp (COMP_EDITOR (te), CAL_COMPONENT_METHOD_REFRESH); } @@ -328,8 +327,8 @@ forward_cmd (GtkWidget *widget, gpointer data) { TaskEditor *te = TASK_EDITOR (data); - comp_editor_save_comp (COMP_EDITOR (te)); - comp_editor_send_comp (COMP_EDITOR (te), CAL_COMPONENT_METHOD_PUBLISH); + if (comp_editor_save_comp (COMP_EDITOR (te), TRUE)) + comp_editor_send_comp (COMP_EDITOR (te), CAL_COMPONENT_METHOD_PUBLISH); } static void diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 2c3f8d18ec..dd2b3839cc 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -96,7 +96,7 @@ static void task_page_destroy (GtkObject *object); static GtkWidget *task_page_get_widget (CompEditorPage *page); static void task_page_focus_main_widget (CompEditorPage *page); static void task_page_fill_widgets (CompEditorPage *page, CalComponent *comp); -static void task_page_fill_component (CompEditorPage *page, CalComponent *comp); +static gboolean task_page_fill_component (CompEditorPage *page, CalComponent *comp); static void task_page_set_summary (CompEditorPage *page, const char *summary); static void task_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates); @@ -455,7 +455,7 @@ task_page_fill_widgets (CompEditorPage *page, CalComponent *comp) } /* fill_component handler for the task page */ -static void +static gboolean task_page_fill_component (CompEditorPage *page, CalComponent *comp) { TaskPage *tpage; @@ -565,6 +565,8 @@ task_page_fill_component (CompEditorPage *page, CalComponent *comp) /* Contacts */ comp_editor_contacts_to_component (priv->contacts_entry, comp); + + return TRUE; } /* set_summary handler for the task page */ diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 9180fbc400..356690855a 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -32,9 +32,8 @@ #include #include #include -#include -#include #include +#include #include #include #include @@ -69,15 +68,6 @@ static icalproperty_method itip_methods_enum[] = { ICAL_METHOD_DECLINECOUNTER, }; -static void -error_dialog (gchar *str) -{ - GtkWidget *dlg; - - dlg = gnome_error_dialog (str); - gnome_dialog_run_and_close (GNOME_DIALOG (dlg)); -} - static Bonobo_ConfigDatabase db = NULL; static ItipAddress * @@ -250,7 +240,8 @@ comp_to_list (CalComponentItipMethod method, CalComponent *comp) cal_component_get_attendee_list (comp, &attendees); len = g_slist_length (attendees); if (len <= 0) { - error_dialog (_("Atleast one attendee is necessary")); + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, + _("Atleast one attendee is necessary")); cal_component_free_attendee_list (attendees); return NULL; } @@ -280,7 +271,8 @@ comp_to_list (CalComponentItipMethod method, CalComponent *comp) case CAL_COMPONENT_METHOD_DECLINECOUNTER: cal_component_get_organizer (comp, &organizer); if (organizer.value == NULL) { - error_dialog (_("An organizer must be set.")); + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, + _("An organizer must be set.")); return NULL; } @@ -336,7 +328,7 @@ comp_content_type (CalComponentItipMethod method) { char tmp[256]; - sprintf (tmp, "text/calendar;METHOD=%s", itip_methods[method]); + sprintf (tmp, "text/calendar; charset=utf-8; METHOD=%s", itip_methods[method]); return CORBA_string_dup (tmp); } @@ -575,7 +567,8 @@ comp_minimal (CalComponent *comp, gboolean attendee) cal_component_set_attendee_list (clone, attendees); if (!comp_limit_attendees (clone)) { - error_dialog ("You are not an attendee!"); + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, + _("You must be an attendee of the event.")); goto error; } } -- cgit v1.2.3