diff options
author | Damon Chaplin <damon@helixcode.com> | 2000-05-03 06:27:45 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2000-05-03 06:27:45 +0800 |
commit | 3283a9fcd37fb2b4d5a6a128e93fb19d2a61e15d (patch) | |
tree | 17ac1b5391e04b27d661daa109ce5d5ece327083 /calendar/gui/e-day-view.c | |
parent | 848cacc4905bc5a0423db986119fc708a4ec4ef1 (diff) | |
download | gsoc2013-evolution-3283a9fcd37fb2b4d5a6a128e93fb19d2a61e15d.tar.gz gsoc2013-evolution-3283a9fcd37fb2b4d5a6a128e93fb19d2a61e15d.tar.zst gsoc2013-evolution-3283a9fcd37fb2b4d5a6a128e93fb19d2a61e15d.zip |
set the active radio button here. Oops - it wasn't a Bonobo problem after
2000-05-02 Damon Chaplin <damon@helixcode.com>
* gui/calendar-commands.c (calendar_control_activate): set the active
radio button here. Oops - it wasn't a Bonobo problem after all.
* gui/popup-menu.c (popup_menu): added call to
e_auto_kill_popup_menu_on_hide() to destroy the menu.
* gui/e-week-view.c (e_week_view_show_popup_menu):
* gui/e-day-view.c (e_day_view_on_event_right_click): ico->user_data
isn't useful any more, since the event editor keeps its own iCalObject.
So for now we make the menu commands available even when the event is
being edited in the event editor.
Also corrected misspellings of 'occurance' -> 'occurrence'.
* gui/eventedit.c (event_editor_destroy): destroy the iCalObject.
The event editor now uses its own independent iCalObject.
* gui/e-week-view.c (e_week_view_on_unrecur_appointment):
* gui/e-day-view.c (e_day_view_on_unrecur_appointment): create a new
uid for the new single instance. I'm not sure what we should do about
the creation/last modification times of the objects.
* gui/e-week-view.c (e_week_view_on_edit_appointment):
* gui/e-day-view.c (e_day_view_on_edit_appointment): duplicate the
iCalObject before passing it to the event editor, since it will change
the fields. If we don't duplicate it we won't know what has changed
when we get the "update_event" callback.
* gui/e-week-view.c (e_week_view_key_press):
* gui/e-day-view.c (e_day_view_key_press): set the created and last_mod
times of the new iCalObject. We may want to set the default alarm as
well.
* cal-util/calobj.c (ical_gen_uid): made this function public so we
can generate new uids if necessary.
svn path=/trunk/; revision=2759
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r-- | calendar/gui/e-day-view.c | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 6fa0ad17c1..6a1383d180 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -282,8 +282,8 @@ static void e_day_view_on_new_appointment (GtkWidget *widget, gpointer data); static void e_day_view_on_edit_appointment (GtkWidget *widget, gpointer data); -static void e_day_view_on_delete_occurance (GtkWidget *widget, - gpointer data); +static void e_day_view_on_delete_occurrence (GtkWidget *widget, + gpointer data); static void e_day_view_on_delete_appointment (GtkWidget *widget, gpointer data); static void e_day_view_on_unrecur_appointment (GtkWidget *widget, @@ -2227,10 +2227,10 @@ e_day_view_on_event_right_click (EDayView *day_view, }; static struct menu_item recur_child_items[] = { - { N_("Make this appointment movable"), (GtkSignalFunc) e_day_view_on_unrecur_appointment, NULL, TRUE }, { N_("Edit this appointment..."), (GtkSignalFunc) e_day_view_on_edit_appointment, NULL, TRUE }, - { N_("Delete this occurance"), (GtkSignalFunc) e_day_view_on_delete_occurance, NULL, TRUE }, - { N_("Delete all occurances"), (GtkSignalFunc) e_day_view_on_delete_appointment, NULL, TRUE }, + { N_("Make this appointment movable"), (GtkSignalFunc) e_day_view_on_unrecur_appointment, NULL, TRUE }, + { N_("Delete this occurrence"), (GtkSignalFunc) e_day_view_on_delete_occurrence, NULL, TRUE }, + { N_("Delete all occurrences"), (GtkSignalFunc) e_day_view_on_delete_appointment, NULL, TRUE }, { NULL, NULL, NULL, TRUE }, { N_("New appointment..."), (GtkSignalFunc) e_day_view_on_new_appointment, NULL, TRUE } }; @@ -2250,23 +2250,26 @@ e_day_view_on_event_right_click (EDayView *day_view, event = &g_array_index (day_view->events[day], EDayViewEvent, event_num); - /* Check if the event is being edited in the event editor. */ - not_being_edited = (event->ico->user_data == NULL); + /* This used to be set only if the event wasn't being edited + in the event editor, but we can't check that at present. + We could possibly set up another method of checking it. */ + not_being_edited = TRUE; if (event->ico->recur) { items = 6; context_menu = &recur_child_items[0]; + context_menu[0].sensitive = not_being_edited; + context_menu[1].sensitive = not_being_edited; + context_menu[2].sensitive = not_being_edited; context_menu[3].sensitive = not_being_edited; context_menu[5].sensitive = have_selection; } else { items = 4; context_menu = &child_items[0]; + context_menu[0].sensitive = not_being_edited; + context_menu[1].sensitive = not_being_edited; context_menu[3].sensitive = have_selection; } - /* These settings are common for each context sensitive menu */ - context_menu[0].sensitive = not_being_edited; - context_menu[1].sensitive = not_being_edited; - context_menu[2].sensitive = not_being_edited; } for (i = 0; i < items; i++) @@ -2303,6 +2306,7 @@ e_day_view_on_edit_appointment (GtkWidget *widget, gpointer data) EDayView *day_view; EDayViewEvent *event; GtkWidget *event_editor; + iCalObject *ico; day_view = E_DAY_VIEW (data); @@ -2310,13 +2314,17 @@ e_day_view_on_edit_appointment (GtkWidget *widget, gpointer data) if (event == NULL) return; - event_editor = event_editor_new (day_view->calendar, event->ico); + /* We must duplicate the iCalObject, since the event editor will + change the fields. */ + ico = ical_object_duplicate (event->ico); + + event_editor = event_editor_new (day_view->calendar, ico); gtk_widget_show (event_editor); } static void -e_day_view_on_delete_occurance (GtkWidget *widget, gpointer data) +e_day_view_on_delete_occurrence (GtkWidget *widget, gpointer data) { EDayView *day_view; EDayViewEvent *event; @@ -2362,16 +2370,21 @@ e_day_view_on_unrecur_appointment (GtkWidget *widget, gpointer data) if (event == NULL) return; - /* New object */ - /* FIXME: generate a new uid. */ + /* For the unrecurred instance we duplicate the original object, + create a new uid for it, get rid of the recurrence rules, and set + the start & end times to the instances times. */ ico = ical_object_duplicate (event->ico); + g_free (ico->uid); + ico->uid = ical_gen_uid (); g_free (ico->recur); ico->recur = 0; ico->dtstart = event->start; ico->dtend = event->end; - /* Duplicate, and eliminate the recurrency fields */ + /* For the recurring object, we add a exception to get rid of the + instance. */ ical_object_add_exdate (event->ico, event->start); + gnome_calendar_object_changed (day_view->calendar, event->ico, CHANGE_ALL); gnome_calendar_add_object (day_view->calendar, ico); @@ -3745,6 +3758,8 @@ e_day_view_key_press (GtkWidget *widget, GdkEventKey *event) Note that user_name is a global variable. */ ico = ical_new ("", user_name, ""); ico->new = 1; + ico->created = time (NULL); + ico->last_mod = ico->created; e_day_view_get_selected_time_range (day_view, &ico->dtstart, &ico->dtend); |