diff options
author | JP Rosevear <jpr@ximian.com> | 2001-09-19 12:33:33 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2001-09-19 12:33:33 +0800 |
commit | d639a620a6438ea93787cedfe9f3eb87014275a3 (patch) | |
tree | 602d9156e8e33197fc27752d8fb976cce99d896c /calendar/gui/dialogs/event-editor.c | |
parent | d284de85386149adba1e94f1b05b6b2d631e8585 (diff) | |
download | gsoc2013-evolution-d639a620a6438ea93787cedfe9f3eb87014275a3.tar gsoc2013-evolution-d639a620a6438ea93787cedfe9f3eb87014275a3.tar.gz gsoc2013-evolution-d639a620a6438ea93787cedfe9f3eb87014275a3.tar.bz2 gsoc2013-evolution-d639a620a6438ea93787cedfe9f3eb87014275a3.tar.lz gsoc2013-evolution-d639a620a6438ea93787cedfe9f3eb87014275a3.tar.xz gsoc2013-evolution-d639a620a6438ea93787cedfe9f3eb87014275a3.tar.zst gsoc2013-evolution-d639a620a6438ea93787cedfe9f3eb87014275a3.zip |
A page that shows the meeting time selector and free/busy data for
2001-09-18 JP Rosevear <jpr@ximian.com>
* gui/dialogs/schedule-page.*: A page that shows the meeting time
selector and free/busy data for attendees
* gui/dialogs/meeting-page.c: use the meeting model to track/edit
attendees, remove table value conversion routines and simple table
routines
(set_attendees): take a pointer array
(meeting_page_destroy): destroy the pointer array, save state
(meeting_page_init): new pointer array
(meeting_page_fill_widgets): don't null the deleted attendees
field
(popup_delegate_cb): array add
(popup_delete_cb): array add
(cleanup_attendees): iterate over the array to unref now
(meeting_page_fill_widgets): don't null out fields, no need to add
attendees here
(invite_entry_changed): use e_meeting_attendee routines
(popup_delegate_cb): ditto
(popup_delete_cb): ditto
(meeting_page_new): take new arg and pass it to construct
(meeting_page_construct): take new arg, use e-meeting-model
routines to construct table
* gui/dialogs/task-editor.c (task_editor_init): new meeting model
(task_editor_destroy): unref the model
* gui/dialogs/event-editor.c (event_editor_init): make new model
and pass it to meeting and schedule pages
(event_editor_set_cal_client): virtual function, set meeting model
client
(event_editor_edit_comp): add the attendees to the model
(event_editor_destroy): unref model
* gui/dialogs/comp-editor.h: add virtual function
* gui/dialogs/comp-editor.c (comp_editor_set_cal_client): make
set_cal_client a virutal function
* gui/e-meeting-types.h: generally useful type defines
* gui/e-meeting-time-sel*.[hc]: Move here and use an e-table for
the attendee list and extract display information from the new
meeting model and attendees
* gui/e-meeting-time-sel.etspec: spec for the table
* gui/e-meeting-attendee.[hc]: meeting attendees for the model,
with to/from conversions for CalComponentAttendee structure, emits
changed signal and allows getting and setting of free busy
periods
* gui/e-meeting-model.[hc]: move the model out on its own
* gui/e-itip-control.c (write_error_html): clean up warnings
svn path=/trunk/; revision=12968
Diffstat (limited to 'calendar/gui/dialogs/event-editor.c')
-rw-r--r-- | calendar/gui/dialogs/event-editor.c | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index a58d1d4b82..f95f201883 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -35,6 +35,7 @@ #include "alarm-page.h" #include "recurrence-page.h" #include "meeting-page.h" +#include "schedule-page.h" #include "cancel-comp.h" #include "event-editor.h" @@ -43,6 +44,9 @@ struct _EventEditorPrivate { AlarmPage *alarm_page; RecurrencePage *recur_page; MeetingPage *meet_page; + SchedulePage *sched_page; + + EMeetingModel *model; gboolean meeting_shown; }; @@ -51,6 +55,7 @@ struct _EventEditorPrivate { static void event_editor_class_init (EventEditorClass *class); static void event_editor_init (EventEditor *ee); +static void event_editor_set_cal_client (CompEditor *editor, CalClient *client); static void event_editor_edit_comp (CompEditor *editor, CalComponent *comp); static void event_editor_send_comp (CompEditor *editor, CalComponentItipMethod method); static void event_editor_destroy (GtkObject *object); @@ -117,6 +122,7 @@ event_editor_class_init (EventEditorClass *klass) parent_class = gtk_type_class (TYPE_COMP_EDITOR); + editor_class->set_cal_client = event_editor_set_cal_client; editor_class->edit_comp = event_editor_edit_comp; editor_class->send_comp = event_editor_send_comp; @@ -164,12 +170,19 @@ event_editor_init (EventEditor *ee) comp_editor_append_page (COMP_EDITOR (ee), COMP_EDITOR_PAGE (priv->recur_page), _("Recurrence")); - - priv->meet_page = meeting_page_new (); + + priv->model = E_MEETING_MODEL (e_meeting_model_new ()); + + priv->meet_page = meeting_page_new (priv->model); comp_editor_append_page (COMP_EDITOR (ee), COMP_EDITOR_PAGE (priv->meet_page), _("Meeting")); + priv->sched_page = schedule_page_new (priv->model); + comp_editor_append_page (COMP_EDITOR (ee), + COMP_EDITOR_PAGE (priv->sched_page), + _("Scheduling")); + comp_editor_merge_ui (COMP_EDITOR (ee), EVOLUTION_DATADIR "/gnome/ui/evolution-event-editor.xml", verbs); @@ -179,6 +192,21 @@ event_editor_init (EventEditor *ee) } static void +event_editor_set_cal_client (CompEditor *editor, CalClient *client) +{ + EventEditor *ee; + EventEditorPrivate *priv; + + ee = EVENT_EDITOR (editor); + priv = ee->priv; + + e_meeting_model_set_cal_client (priv->model, client); + + if (parent_class->set_cal_client) + parent_class->set_cal_client (editor, client); +} + +static void event_editor_edit_comp (CompEditor *editor, CalComponent *comp) { EventEditor *ee; @@ -191,9 +219,20 @@ event_editor_edit_comp (CompEditor *editor, CalComponent *comp) cal_component_get_attendee_list (comp, &attendees); if (attendees == NULL) { comp_editor_remove_page (editor, COMP_EDITOR_PAGE (priv->meet_page)); + comp_editor_remove_page (editor, COMP_EDITOR_PAGE (priv->sched_page)); + e_meeting_model_remove_all_attendees (priv->model); priv->meeting_shown = FALSE; set_menu_sens (ee); - } + } else { + GSList *l; + for (l = attendees; l != NULL; l = l->next) { + CalComponentAttendee *ca = l->data; + EMeetingAttendee *ia = E_MEETING_ATTENDEE (e_meeting_attendee_new_from_cal_component_attendee (ca)); + + e_meeting_model_add_attendee (priv->model, ia); + gtk_object_unref (GTK_OBJECT (ia)); + } + } cal_component_free_attendee_list (attendees); if (parent_class->edit_comp) @@ -240,6 +279,9 @@ event_editor_destroy (GtkObject *object) gtk_object_unref (GTK_OBJECT (priv->alarm_page)); gtk_object_unref (GTK_OBJECT (priv->recur_page)); gtk_object_unref (GTK_OBJECT (priv->meet_page)); + gtk_object_unref (GTK_OBJECT (priv->sched_page)); + + gtk_object_unref (GTK_OBJECT (priv->model)); if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); @@ -271,6 +313,9 @@ schedule_meeting_cmd (GtkWidget *widget, gpointer data) comp_editor_append_page (COMP_EDITOR (ee), COMP_EDITOR_PAGE (priv->meet_page), _("Meeting")); + comp_editor_append_page (COMP_EDITOR (ee), + COMP_EDITOR_PAGE (priv->sched_page), + _("Scheduling")); priv->meeting_shown = TRUE; set_menu_sens (ee); } |