diff options
author | Chenthill Palanisamy <pchenthill@novell.com> | 2009-04-13 17:03:38 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2009-04-13 17:03:38 +0800 |
commit | 9896e4f7db7817087b7c18793682a4ab5f7c63e2 (patch) | |
tree | 54f2dc155338cba91fa82500cbb619f4024e7b46 /calendar/gui/e-day-view.c | |
parent | 064ff85b3b8e06a5347b62e5c80c1273875e719a (diff) | |
download | gsoc2013-evolution-9896e4f7db7817087b7c18793682a4ab5f7c63e2.tar.gz gsoc2013-evolution-9896e4f7db7817087b7c18793682a4ab5f7c63e2.tar.zst gsoc2013-evolution-9896e4f7db7817087b7c18793682a4ab5f7c63e2.zip |
Fixes #561312
2009-04-13 Chenthill Palanisamy <pchenthill@novell.com>
Fixes #561312
* calendar/gui/comp-util.c:
* calendar/gui/comp-util.h: Added a new function to
sanitize master recurrence event before modifying
all instances.
* calendar/gui/dialogs/comp-editor.c:
* calendar/gui/e-day-view.c:
* calendar/gui/e-week-view.c: Used the new util api.
Do not invoke recurrence dialog while modifying detached
instances.
svn path=/trunk/; revision=37518
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r-- | calendar/gui/e-day-view.c | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 91da668000..af812edb31 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -4022,12 +4022,15 @@ e_day_view_finish_long_event_resize (EDayView *day_view) } e_cal_component_commit_sequence (comp); - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { gtk_widget_queue_draw (day_view->top_canvas); goto out; } + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); + if (mod == CALOBJ_MOD_THIS) { /* set the correct DTSTART/DTEND on the individual recurrence */ if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) { @@ -4049,7 +4052,8 @@ e_day_view_finish_long_event_resize (EDayView *day_view) e_cal_component_commit_sequence (comp); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, TRUE); @@ -4129,11 +4133,14 @@ 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 (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { gtk_widget_queue_draw (day_view->top_canvas); goto out; } + + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); if (mod == CALOBJ_MOD_THIS) { /* set the correct DTSTART/DTEND on the individual recurrence */ @@ -4154,7 +4161,8 @@ e_day_view_finish_resize (EDayView *day_view) e_cal_component_set_exdate_list (comp, NULL); e_cal_component_set_exrule_list (comp, NULL); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); @@ -6138,19 +6146,23 @@ 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 (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { gtk_widget_queue_draw (day_view->top_canvas); goto out; } + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); + if (mod == CALOBJ_MOD_THIS) { e_cal_component_set_rdate_list (comp, NULL); e_cal_component_set_rrule_list (comp, NULL); e_cal_component_set_exdate_list (comp, NULL); e_cal_component_set_exrule_list (comp, NULL); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); @@ -6371,11 +6383,14 @@ e_day_view_on_editing_stopped (EDayView *day_view, } else { CalObjModType mod = CALOBJ_MOD_ALL; GtkWindow *toplevel; - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { goto out; } + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); + if (mod == CALOBJ_MOD_THIS) { ECalComponentDateTime olddt, dt; icaltimetype itt; @@ -6423,7 +6438,8 @@ e_day_view_on_editing_stopped (EDayView *day_view, e_cal_component_commit_sequence (comp); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; /* FIXME When sending here, what exactly should we send? */ toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); @@ -7524,11 +7540,14 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, gnome_canvas_item_show (event->canvas_item); e_cal_component_commit_sequence (comp); - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { g_object_unref (comp); return; } + + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); if (mod == CALOBJ_MOD_THIS) { e_cal_component_set_rdate_list (comp, NULL); @@ -7536,7 +7555,8 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, e_cal_component_set_exdate_list (comp, NULL); e_cal_component_set_exrule_list (comp, NULL); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, FALSE); @@ -7726,19 +7746,23 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, gnome_canvas_item_show (event->canvas_item); e_cal_component_commit_sequence (comp); - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { g_object_unref (comp); return; } + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); + if (mod == CALOBJ_MOD_THIS) { e_cal_component_set_rdate_list (comp, NULL); e_cal_component_set_rrule_list (comp, NULL); e_cal_component_set_exdate_list (comp, NULL); e_cal_component_set_exrule_list (comp, NULL); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, FALSE); |