diff options
author | Chenthill Palanisamy <pchen@src.gnome.org> | 2005-06-22 16:16:27 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2005-06-22 16:16:27 +0800 |
commit | a837b9e89989e1ddf2750099f8f06e807dd0f510 (patch) | |
tree | 8a5cae1f4aad278e9875c3d0cebaa4b92f11e4b4 /calendar/gui | |
parent | 7145e440a5be056332cd1210eb45e746ba25e527 (diff) | |
download | gsoc2013-evolution-a837b9e89989e1ddf2750099f8f06e807dd0f510.tar.gz gsoc2013-evolution-a837b9e89989e1ddf2750099f8f06e807dd0f510.tar.zst gsoc2013-evolution-a837b9e89989e1ddf2750099f8f06e807dd0f510.zip |
Commiting the delegation support for recurrence events
svn path=/trunk/; revision=29564
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 16 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 7 | ||||
-rw-r--r-- | calendar/gui/dialogs/recur-comp.c | 7 | ||||
-rw-r--r-- | calendar/gui/dialogs/recur-comp.h | 3 | ||||
-rw-r--r-- | calendar/gui/e-cal-model-calendar.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-day-view.c | 12 | ||||
-rw-r--r-- | calendar/gui/e-week-view.c | 4 |
7 files changed, 33 insertions, 18 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index abd16741c4..e7bc7efa9c 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -666,6 +666,14 @@ save_comp (CompEditor *editor) e_cal_component_set_exrule_list (priv->comp, NULL); } result = e_cal_modify_object (priv->client, icalcomp, priv->mod, &error); + + if (result && priv->mod == CALOBJ_MOD_THIS) { + /* FIXME do we really need to do this ? */ + if ((priv->flags & COMP_EDITOR_DELEGATE) || !e_cal_component_has_organizer (clone) || itip_organizer_is_user (clone, priv->client)) + e_cal_component_commit_sequence (clone); + else + e_cal_component_abort_sequence (clone); + } } /* If the delay delivery is set, the items will not be created in the server immediately, @@ -773,7 +781,7 @@ prompt_to_save_changes (CompEditor *editor, gboolean send) switch (save_component_dialog (GTK_WINDOW(editor), priv->comp)) { case GTK_RESPONSE_YES: /* Save */ if (e_cal_component_is_instance (priv->comp)) - if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor))) + if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor), FALSE)) return FALSE; if (send && save_comp_with_send (editor)) @@ -796,8 +804,10 @@ response_cb (GtkWidget *widget, int response, gpointer data) CompEditor *editor = COMP_EDITOR (data); CompEditorPrivate *priv; ECalComponentText text; + gboolean delegated; priv = editor->priv; + delegated = (priv->flags & COMP_EDITOR_DELEGATE); switch (response) { case GTK_RESPONSE_OK: @@ -822,7 +832,7 @@ response_cb (GtkWidget *widget, int response, gpointer data) commit_all_fields (editor); if (e_cal_component_is_instance (priv->comp)) - if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor))) + if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor), delegated)) return; if (save_comp_with_send (editor)) { @@ -858,7 +868,6 @@ delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) { CompEditor *editor = COMP_EDITOR (data); CompEditorPrivate *priv; - ECalComponentText text; priv = editor->priv; @@ -1822,7 +1831,6 @@ real_edit_comp (CompEditor *editor, ECalComponent *comp) static void set_attendees_for_delegation (ECalComponent *comp, const char *address, ECalComponentItipMethod method) { - GSList *attendees, *l, *new; icalproperty *prop; icalparameter *param; icalcomponent *icalcomp; diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 3671e7267e..5c934f338f 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -638,6 +638,9 @@ sensitize_widgets (EventPage *epage) gtk_widget_set_sensitive (priv->categories_btn, !read_only && sens); gtk_widget_set_sensitive (priv->sendoptions_button, !read_only && sens); gtk_entry_set_editable (GTK_ENTRY (priv->categories), !read_only && sens); + + if (COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_DELEGATE) + gtk_widget_set_sensitive (priv->sendoptions_button, TRUE); } void @@ -677,7 +680,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) ECalComponentClassification cl; ECalComponentTransparency transparency; ECalComponentDateTime start_date, end_date; - icalcomponent *icalcomp; + icalcomponent *icalcomp = NULL; const char *location, *uid = NULL; const char *categories; ESource *source; @@ -799,7 +802,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) e_source_option_menu_select (E_SOURCE_OPTION_MENU (priv->source_selector), source); e_cal_component_get_uid (comp, &uid); - if (e_cal_get_object (COMP_EDITOR_PAGE (epage)->client, uid, NULL, &icalcomp, NULL)) { + if (!(COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_DELEGATE) && e_cal_get_object (COMP_EDITOR_PAGE (epage)->client, uid, NULL, &icalcomp, NULL)) { icalcomponent_free (icalcomp); event_page_hide_options (epage); } diff --git a/calendar/gui/dialogs/recur-comp.c b/calendar/gui/dialogs/recur-comp.c index cfffa29c69..de6d4ca0be 100644 --- a/calendar/gui/dialogs/recur-comp.c +++ b/calendar/gui/dialogs/recur-comp.c @@ -34,7 +34,7 @@ gboolean recur_component_dialog (ECal *client, ECalComponent *comp, CalObjModType *mod, - GtkWindow *parent) + GtkWindow *parent, gboolean delegated) { char *str; GtkWidget *dialog, *rb_this, *rb_prior, *rb_future, *rb_all, *hbox; @@ -48,7 +48,10 @@ recur_component_dialog (ECal *client, switch (vtype) { case E_CAL_COMPONENT_EVENT: - str = g_strdup_printf (_("You are modifying a recurring event, what would you like to modify?")); + if (!delegated) + str = g_strdup_printf (_("You are modifying a recurring event, what would you like to modify?")); + else + str = g_strdup_printf (_("You are delegating a recurring event, what would like to delegate?")); break; case E_CAL_COMPONENT_TODO: diff --git a/calendar/gui/dialogs/recur-comp.h b/calendar/gui/dialogs/recur-comp.h index 94ccbdae87..6016ece436 100644 --- a/calendar/gui/dialogs/recur-comp.h +++ b/calendar/gui/dialogs/recur-comp.h @@ -29,6 +29,7 @@ gboolean recur_component_dialog (ECal *client, ECalComponent *comp, CalObjModType *mod, - GtkWindow *parent); + GtkWindow *parent, + gboolean delegated); #endif diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c index b64dce21c6..312388f2a1 100644 --- a/calendar/gui/e-cal-model-calendar.c +++ b/calendar/gui/e-cal-model-calendar.c @@ -358,7 +358,7 @@ ecmc_set_value_at (ETableModel *etm, int col, int row, const void *value) /* ask about mod type */ if (e_cal_component_is_instance (comp)) { - if (!recur_component_dialog (comp_data->client, comp, &mod, NULL)) { + if (!recur_component_dialog (comp_data->client, comp, &mod, NULL, FALSE)) { g_object_unref (comp); return; } diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index dc24ba258e..7a15196aac 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -3917,7 +3917,7 @@ e_day_view_finish_long_event_resize (EDayView *day_view) e_cal_component_commit_sequence (comp); if (e_cal_component_is_instance (comp)) { - if (!recur_component_dialog (client, comp, &mod, NULL)) { + if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { gtk_widget_queue_draw (day_view->top_canvas); goto out; } @@ -4023,7 +4023,7 @@ e_day_view_finish_resize (EDayView *day_view) day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_NONE; if (e_cal_component_is_instance (comp)) { - if (!recur_component_dialog (client, comp, &mod, NULL)) { + if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { gtk_widget_queue_draw (day_view->top_canvas); goto out; } @@ -5918,7 +5918,7 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_NONE; if (e_cal_component_is_instance (comp)) { - if (!recur_component_dialog (client, comp, &mod, NULL)) { + if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { gtk_widget_queue_draw (day_view->top_canvas); goto out; } @@ -6141,7 +6141,7 @@ e_day_view_on_editing_stopped (EDayView *day_view, CalObjModType mod = CALOBJ_MOD_ALL; GtkWindow *toplevel; if (e_cal_component_is_instance (comp)) { - if (!recur_component_dialog (client, comp, &mod, NULL)) { + if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { goto out; } @@ -7284,7 +7284,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, e_cal_component_commit_sequence (comp); if (e_cal_component_is_instance (comp)) { - if (!recur_component_dialog (client, comp, &mod, NULL)) + if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) return; if (mod == CALOBJ_MOD_THIS) { @@ -7479,7 +7479,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, e_cal_component_commit_sequence (comp); if (e_cal_component_is_instance (comp)) { - if (!recur_component_dialog (client, comp, &mod, NULL)) { + if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { g_object_unref (comp); return; } diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 4f6d3b2f2a..e6d430d157 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -3189,7 +3189,7 @@ e_week_view_change_event_time (EWeekView *week_view, time_t start_dt, time_t end if (e_cal_component_is_instance (comp)) { - if (!recur_component_dialog (client, comp, &mod, NULL)) { + if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { gtk_widget_queue_draw (week_view->main_canvas); goto out; } @@ -3324,7 +3324,7 @@ e_week_view_on_editing_stopped (EWeekView *week_view, GtkWindow *toplevel; if (e_cal_component_is_instance (comp)) { - if (!recur_component_dialog (client, comp, &mod, NULL)) { + if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { goto out; } |