diff options
author | JP Rosevear <jpr@ximian.com> | 2002-02-08 03:35:18 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2002-02-08 03:35:18 +0800 |
commit | 70398dd9e66a5b78c847ad45e42a168e99b5893a (patch) | |
tree | 16117c3769876e9fb0415e56ff0c4bcb7de769ef /calendar | |
parent | 91a3039067e05004f73abab588c4838ff7d10f18 (diff) | |
download | gsoc2013-evolution-70398dd9e66a5b78c847ad45e42a168e99b5893a.tar gsoc2013-evolution-70398dd9e66a5b78c847ad45e42a168e99b5893a.tar.gz gsoc2013-evolution-70398dd9e66a5b78c847ad45e42a168e99b5893a.tar.bz2 gsoc2013-evolution-70398dd9e66a5b78c847ad45e42a168e99b5893a.tar.lz gsoc2013-evolution-70398dd9e66a5b78c847ad45e42a168e99b5893a.tar.xz gsoc2013-evolution-70398dd9e66a5b78c847ad45e42a168e99b5893a.tar.zst gsoc2013-evolution-70398dd9e66a5b78c847ad45e42a168e99b5893a.zip |
pass meeting boolean for gnome_calendar_edit_object and
2002-02-07 JP Rosevear <jpr@ximian.com>
* gui/e-day-view.c: pass meeting boolean for
gnome_calendar_edit_object and gnome_calendar_new_appointment_for
* gui/e-week-view-event-item.c: ditto
* gui/e-week-view.c: ditto
* gui/tasks-control.c (confirm_expunge): kill warning
* gui/calendar-commands.c (new_meeting_cb): show a new meeting
dialog
(new_event_cb): pass new param
* gui/gnome-cal.c (gnome_calendar_edit_object): take meeting
boolean and show meeting page if true
(gnome_calendar_new_appointment_for): takeing meeting param and
pass to above
(gnome_calendar_new_appointment): add new param
* gui/gnome-cal.h: update proto
* gui/component-factory.c (create_component): take a comp editor
mode, determine vtype
(sc_user_create_new_item_cb): check for meeting user creatable
item
(create_object): add meeting as user creatable item
* gui/comp-editor-factory.c (edit_new): get a comp editor mode
now, determine vtype and show meeting page if required
(queue_edit_new): get comp editor mode
(impl_editNew): ditto, plus queue the mode directly instead of
determining the vtype
* gui/dialogs/event-editor.c (show_meeting): new internal util
function to show meeting page
(event_editor_show_meeting): show the meeting
(schedule_meeting_cmd): use show_meeting
* gui/dialogs/event-editor.h: new proto
* idl/evolution-calendar.idl: editNew takes a mode rather than a
type now
* cal-util/Makefile.am: fix includes
svn path=/trunk/; revision=15595
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 47 | ||||
-rw-r--r-- | calendar/cal-util/Makefile.am | 2 | ||||
-rw-r--r-- | calendar/gui/calendar-commands.c | 16 | ||||
-rw-r--r-- | calendar/gui/calendar-component.c | 57 | ||||
-rw-r--r-- | calendar/gui/comp-editor-factory.c | 52 | ||||
-rw-r--r-- | calendar/gui/component-factory.c | 57 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-editor.c | 21 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-editor.h | 7 | ||||
-rw-r--r-- | calendar/gui/e-day-view.c | 12 | ||||
-rw-r--r-- | calendar/gui/e-week-view-event-item.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-week-view.c | 11 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 13 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.h | 6 | ||||
-rw-r--r-- | calendar/gui/tasks-control.c | 2 | ||||
-rw-r--r-- | calendar/idl/evolution-calendar.idl | 7 |
15 files changed, 212 insertions, 100 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 211835f769..fa741e5894 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,50 @@ +2002-02-07 JP Rosevear <jpr@ximian.com> + + * gui/e-day-view.c: pass meeting boolean for + gnome_calendar_edit_object and gnome_calendar_new_appointment_for + + * gui/e-week-view-event-item.c: ditto + + * gui/e-week-view.c: ditto + + * gui/tasks-control.c (confirm_expunge): kill warning + + * gui/calendar-commands.c (new_meeting_cb): show a new meeting + dialog + (new_event_cb): pass new param + + * gui/gnome-cal.c (gnome_calendar_edit_object): take meeting + boolean and show meeting page if true + (gnome_calendar_new_appointment_for): takeing meeting param and + pass to above + (gnome_calendar_new_appointment): add new param + + * gui/gnome-cal.h: update proto + + * gui/component-factory.c (create_component): take a comp editor + mode, determine vtype + (sc_user_create_new_item_cb): check for meeting user creatable + item + (create_object): add meeting as user creatable item + + * gui/comp-editor-factory.c (edit_new): get a comp editor mode + now, determine vtype and show meeting page if required + (queue_edit_new): get comp editor mode + (impl_editNew): ditto, plus queue the mode directly instead of + determining the vtype + + * gui/dialogs/event-editor.c (show_meeting): new internal util + function to show meeting page + (event_editor_show_meeting): show the meeting + (schedule_meeting_cmd): use show_meeting + + * gui/dialogs/event-editor.h: new proto + + * idl/evolution-calendar.idl: editNew takes a mode rather than a + type now + + * cal-util/Makefile.am: fix includes + 2002-02-07 Christopher James Lahey <clahey@ximian.com> * gui/e-tasks.c (e_tasks_setup_view_menus), gui/gnome-cal.c diff --git a/calendar/cal-util/Makefile.am b/calendar/cal-util/Makefile.am index c300eb3ad4..e8d63c9860 100644 --- a/calendar/cal-util/Makefile.am +++ b/calendar/cal-util/Makefile.am @@ -10,7 +10,7 @@ INCLUDES = \ -I$(top_builddir) \ -I$(top_srcdir)/libical/src/libical \ -I$(top_builddir)/libical/src/libical \ - $(GNOME_INCLUDEDIR) + $(EVOLUTION_CALENDAR_CFLAGS) # # cal util library diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c index 0b079f8df7..ffa81de654 100644 --- a/calendar/gui/calendar-commands.c +++ b/calendar/gui/calendar-commands.c @@ -81,6 +81,17 @@ new_appointment_cb (BonoboUIComponent *uic, gpointer data, const char *path) } static void +new_meeting_cb (BonoboUIComponent *uic, gpointer data, const char *path) +{ + GnomeCalendar *gcal; + time_t dtstart, dtend; + + gcal = GNOME_CALENDAR (data); + gnome_calendar_get_current_time_range (gcal, &dtstart, &dtend); + gnome_calendar_new_appointment_for (gcal, dtstart, dtend, FALSE, TRUE); +} + +static void new_event_cb (BonoboUIComponent *uic, gpointer data, const char *path) { GnomeCalendar *gcal; @@ -88,7 +99,7 @@ new_event_cb (BonoboUIComponent *uic, gpointer data, const char *path) gcal = GNOME_CALENDAR (data); gnome_calendar_get_current_time_range (gcal, &dtstart, &dtend); - gnome_calendar_new_appointment_for (gcal, dtstart, dtend, TRUE); + gnome_calendar_new_appointment_for (gcal, dtstart, dtend, TRUE, FALSE); } static void @@ -669,6 +680,7 @@ static BonoboUIVerb verbs [] = { BONOBO_UI_VERB ("CalendarPrintPreview", file_print_preview_cb), BONOBO_UI_VERB ("CalendarNewAppointment", new_appointment_cb), + BONOBO_UI_VERB ("CalendarNewMeeting", new_meeting_cb), BONOBO_UI_VERB ("CalendarNewEvent", new_event_cb), BONOBO_UI_VERB ("CalendarNewTask", new_task_cb), @@ -697,6 +709,7 @@ static BonoboUIVerb verbs [] = { static EPixmap pixmaps [] = { E_PIXMAP ("/menu/File/New/NewFirstItem/NewAppointment", "new_appointment.xpm"), + E_PIXMAP ("/menu/File/New/NewFirstItem/NewMeeting", "meeting.xpm"), E_PIXMAP ("/menu/File/New/NewFirstItem/NewTask", "new_task-16.png"), E_PIXMAP ("/menu/EditPlaceholder/Edit/Cut", "16_cut.png"), E_PIXMAP ("/menu/EditPlaceholder/Edit/Copy", "16_copy.png"), @@ -706,6 +719,7 @@ static EPixmap pixmaps [] = E_PIXMAP ("/menu/File/Print/PrintPreview", "print-preview.xpm"), E_PIXMAP ("/menu/ComponentActionsPlaceholder/Actions/NewAppointment", "new_appointment.xpm"), E_PIXMAP ("/menu/ComponentActionsPlaceholder/Actions/NewEvent", "new_appointment.xpm"), + E_PIXMAP ("/menu/ComponentActionsPlaceholder/Actions/NewMeeting", "meeting.xpm"), E_PIXMAP ("/menu/ComponentActionsPlaceholder/Actions/NewTask", "new_task-16.png"), E_PIXMAP ("/menu/Tools/ComponentPlaceholder/CalendarSettings", "configure_16_calendar.xpm"), E_PIXMAP ("/menu/View/ViewBegin/Goto", "goto-16.png"), diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index 979885c10f..26b5a1efb9 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -52,6 +52,7 @@ /* IDs for user creatable items */ #define CREATE_EVENT_ID "event" +#define CREATE_MEETING_ID "meeting" #define CREATE_TASK_ID "task" char *evolution_dir; @@ -527,29 +528,28 @@ get_data_uri (const char *uri, CalComponentVType vtype) * uses the default folder for that type of component. */ static void -create_component (const char *uri, CalComponentVType vtype) +create_component (const char *uri, GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode type) { char *real_uri; CORBA_Environment ev; - GNOME_Evolution_Calendar_CalObjType corba_type; GNOME_Evolution_Calendar_CompEditorFactory factory; + CalComponentVType vtype; - real_uri = get_data_uri (uri, vtype); - - switch (vtype) { - case CAL_COMPONENT_EVENT: - corba_type = GNOME_Evolution_Calendar_TYPE_EVENT; + switch (type) { + case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT: + case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING: + vtype = CAL_COMPONENT_EVENT; break; - - case CAL_COMPONENT_TODO: - corba_type = GNOME_Evolution_Calendar_TYPE_TODO; + case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO: + vtype = CAL_COMPONENT_TODO; break; - default: g_assert_not_reached (); return; } + real_uri = get_data_uri (uri, vtype); + /* Get the factory */ CORBA_exception_init (&ev); @@ -567,7 +567,7 @@ create_component (const char *uri, CalComponentVType vtype) /* Create the item */ CORBA_exception_init (&ev); - GNOME_Evolution_Calendar_CompEditorFactory_editNew (factory, real_uri, corba_type, &ev); + GNOME_Evolution_Calendar_CompEditorFactory_editNew (factory, real_uri, type, &ev); if (ev._major != CORBA_NO_EXCEPTION) g_message ("create_component(): Exception while creating the component"); @@ -594,14 +594,25 @@ sc_user_create_new_item_cb (EvolutionShellComponent *shell_component, { if (strcmp (id, CREATE_EVENT_ID) == 0) { if (strcmp (parent_folder_type, FOLDER_CALENDAR) == 0) - create_component (parent_folder_physical_uri, CAL_COMPONENT_EVENT); + create_component (parent_folder_physical_uri, + GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT); else - create_component (NULL, CAL_COMPONENT_EVENT); + create_component (NULL, + GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT); + } else if (strcmp (id, CREATE_MEETING_ID) == 0) { + if (strcmp (parent_folder_type, FOLDER_CALENDAR) == 0) + create_component (parent_folder_physical_uri, + GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING); + else + create_component (NULL, + GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING); } else if (strcmp (id, CREATE_TASK_ID) == 0) { if (strcmp (parent_folder_type, FOLDER_TASKS) == 0) - create_component (parent_folder_physical_uri, CAL_COMPONENT_TODO); + create_component (parent_folder_physical_uri, + GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO); else - create_component (NULL, CAL_COMPONENT_TODO); + create_component (NULL, + GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO); } else g_assert_not_reached (); } @@ -639,14 +650,20 @@ create_object (void) evolution_shell_component_add_user_creatable_item (shell_component, CREATE_EVENT_ID, - _("Create a new appointment"), - _("New _Appointment"), 'a', + _("New appointment"), + _("_Appointment"), 'a', + NULL); + + evolution_shell_component_add_user_creatable_item (shell_component, + CREATE_MEETING_ID, + _("New meeting"), + _("_Meeting"), 's', NULL); evolution_shell_component_add_user_creatable_item (shell_component, CREATE_TASK_ID, - _("Create a new task"), - _("New _Task"), 't', + _("New task"), + _("_Task"), 't', NULL); gtk_signal_connect (GTK_OBJECT (shell_component), "user_create_new_item", diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c index 928c50f937..fbf81248a7 100644 --- a/calendar/gui/comp-editor-factory.c +++ b/calendar/gui/comp-editor-factory.c @@ -22,6 +22,7 @@ #include <config.h> #endif +#include <evolution-calendar.h> #include <e-util/e-url.h> #include <cal-client/cal-client.h> #include "calendar-config.h" @@ -48,7 +49,7 @@ typedef struct { } existing; struct { - CalComponentVType vtype; + GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode type; } new; } u; } Request; @@ -379,21 +380,23 @@ get_default_component (CalComponentVType vtype) /* Edits a new object in the context of a client */ static void -edit_new (OpenClient *oc, CalComponentVType vtype) +edit_new (OpenClient *oc, const GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode type) { CalComponent *comp; Component *c; CompEditor *editor; - - switch (vtype) { - case CAL_COMPONENT_EVENT: + CalComponentVType vtype; + + switch (type) { + case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT: + case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING: editor = COMP_EDITOR (event_editor_new ()); + vtype = CAL_COMPONENT_EVENT; break; - - case CAL_COMPONENT_TODO: + case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO: editor = COMP_EDITOR (task_editor_new ()); + vtype = CAL_COMPONENT_TODO; break; - default: g_assert_not_reached (); return; @@ -415,6 +418,8 @@ edit_new (OpenClient *oc, CalComponentVType vtype) comp_editor_set_cal_client (editor, oc->client); comp_editor_edit_comp (editor, comp); + if (type == GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING) + event_editor_show_meeting (EVENT_EDITOR (editor)); comp_editor_focus (editor); } @@ -450,7 +455,7 @@ resolve_pending_requests (OpenClient *oc) break; case REQUEST_NEW: - edit_new (oc, request->u.new.vtype); + edit_new (oc, request->u.new.type); break; } @@ -637,7 +642,7 @@ impl_editExisting (PortableServer_Servant servant, /* Queues a request for creating a new object */ static void -queue_edit_new (OpenClient *oc, CalComponentVType vtype) +queue_edit_new (OpenClient *oc, const GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode type) { Request *request; @@ -645,7 +650,7 @@ queue_edit_new (OpenClient *oc, CalComponentVType vtype) request = g_new (Request, 1); request->type = REQUEST_NEW; - request->u.new.vtype = vtype; + request->u.new.type = type; oc->pending = g_slist_append (oc->pending, request); } @@ -654,14 +659,13 @@ queue_edit_new (OpenClient *oc, CalComponentVType vtype) static void impl_editNew (PortableServer_Servant servant, const CORBA_char *str_uri, - const GNOME_Evolution_Calendar_CalObjType corba_type, + const GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode corba_type, CORBA_Environment *ev) { CompEditorFactory *factory; CompEditorFactoryPrivate *priv; OpenClient *oc; - CalComponentVType vtype; - + factory = COMP_EDITOR_FACTORY (bonobo_object_from_servant (servant)); priv = factory->priv; @@ -669,26 +673,10 @@ impl_editNew (PortableServer_Servant servant, if (!oc) return; - switch (corba_type) { - case GNOME_Evolution_Calendar_TYPE_EVENT: - vtype = CAL_COMPONENT_EVENT; - break; - - case GNOME_Evolution_Calendar_TYPE_TODO: - vtype = CAL_COMPONENT_TODO; - break; - - default: - CORBA_exception_set (ev, CORBA_USER_EXCEPTION, - ex_GNOME_Evolution_Calendar_CompEditorFactory_UnsupportedType, - NULL); - return; - } - if (!oc->open) - queue_edit_new (oc, vtype); + queue_edit_new (oc, corba_type); else - edit_new (oc, vtype); + edit_new (oc, corba_type); } diff --git a/calendar/gui/component-factory.c b/calendar/gui/component-factory.c index 979885c10f..26b5a1efb9 100644 --- a/calendar/gui/component-factory.c +++ b/calendar/gui/component-factory.c @@ -52,6 +52,7 @@ /* IDs for user creatable items */ #define CREATE_EVENT_ID "event" +#define CREATE_MEETING_ID "meeting" #define CREATE_TASK_ID "task" char *evolution_dir; @@ -527,29 +528,28 @@ get_data_uri (const char *uri, CalComponentVType vtype) * uses the default folder for that type of component. */ static void -create_component (const char *uri, CalComponentVType vtype) +create_component (const char *uri, GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode type) { char *real_uri; CORBA_Environment ev; - GNOME_Evolution_Calendar_CalObjType corba_type; GNOME_Evolution_Calendar_CompEditorFactory factory; + CalComponentVType vtype; - real_uri = get_data_uri (uri, vtype); - - switch (vtype) { - case CAL_COMPONENT_EVENT: - corba_type = GNOME_Evolution_Calendar_TYPE_EVENT; + switch (type) { + case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT: + case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING: + vtype = CAL_COMPONENT_EVENT; break; - - case CAL_COMPONENT_TODO: - corba_type = GNOME_Evolution_Calendar_TYPE_TODO; + case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO: + vtype = CAL_COMPONENT_TODO; break; - default: g_assert_not_reached (); return; } + real_uri = get_data_uri (uri, vtype); + /* Get the factory */ CORBA_exception_init (&ev); @@ -567,7 +567,7 @@ create_component (const char *uri, CalComponentVType vtype) /* Create the item */ CORBA_exception_init (&ev); - GNOME_Evolution_Calendar_CompEditorFactory_editNew (factory, real_uri, corba_type, &ev); + GNOME_Evolution_Calendar_CompEditorFactory_editNew (factory, real_uri, type, &ev); if (ev._major != CORBA_NO_EXCEPTION) g_message ("create_component(): Exception while creating the component"); @@ -594,14 +594,25 @@ sc_user_create_new_item_cb (EvolutionShellComponent *shell_component, { if (strcmp (id, CREATE_EVENT_ID) == 0) { if (strcmp (parent_folder_type, FOLDER_CALENDAR) == 0) - create_component (parent_folder_physical_uri, CAL_COMPONENT_EVENT); + create_component (parent_folder_physical_uri, + GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT); else - create_component (NULL, CAL_COMPONENT_EVENT); + create_component (NULL, + GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT); + } else if (strcmp (id, CREATE_MEETING_ID) == 0) { + if (strcmp (parent_folder_type, FOLDER_CALENDAR) == 0) + create_component (parent_folder_physical_uri, + GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING); + else + create_component (NULL, + GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING); } else if (strcmp (id, CREATE_TASK_ID) == 0) { if (strcmp (parent_folder_type, FOLDER_TASKS) == 0) - create_component (parent_folder_physical_uri, CAL_COMPONENT_TODO); + create_component (parent_folder_physical_uri, + GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO); else - create_component (NULL, CAL_COMPONENT_TODO); + create_component (NULL, + GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO); } else g_assert_not_reached (); } @@ -639,14 +650,20 @@ create_object (void) evolution_shell_component_add_user_creatable_item (shell_component, CREATE_EVENT_ID, - _("Create a new appointment"), - _("New _Appointment"), 'a', + _("New appointment"), + _("_Appointment"), 'a', + NULL); + + evolution_shell_component_add_user_creatable_item (shell_component, + CREATE_MEETING_ID, + _("New meeting"), + _("_Meeting"), 's', NULL); evolution_shell_component_add_user_creatable_item (shell_component, CREATE_TASK_ID, - _("Create a new task"), - _("New _Task"), 't', + _("New task"), + _("_Task"), 't', NULL); gtk_signal_connect (GTK_OBJECT (shell_component), "user_create_new_item", diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 1c70b36858..9e6f501efe 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -350,9 +350,8 @@ event_editor_new (void) } static void -schedule_meeting_cmd (GtkWidget *widget, gpointer data) +show_meeting (EventEditor *ee) { - EventEditor *ee = EVENT_EDITOR (data); EventEditorPrivate *priv; priv = ee->priv; @@ -375,6 +374,24 @@ schedule_meeting_cmd (GtkWidget *widget, gpointer data) COMP_EDITOR_PAGE (priv->meet_page)); } +void +event_editor_show_meeting (EventEditor *ee) +{ + g_return_if_fail (ee != NULL); + g_return_if_fail (IS_EVENT_EDITOR (ee)); + + + show_meeting (ee); +} + +static void +schedule_meeting_cmd (GtkWidget *widget, gpointer data) +{ + EventEditor *ee = EVENT_EDITOR (data); + + show_meeting (ee); +} + static void refresh_meeting_cmd (GtkWidget *widget, gpointer data) { diff --git a/calendar/gui/dialogs/event-editor.h b/calendar/gui/dialogs/event-editor.h index f32877c864..d27bb8e52d 100644 --- a/calendar/gui/dialogs/event-editor.h +++ b/calendar/gui/dialogs/event-editor.h @@ -51,9 +51,10 @@ struct _EventEditorClass { CompEditorClass parent_class; }; -GtkType event_editor_get_type (void); -EventEditor *event_editor_construct (EventEditor *ee); -EventEditor *event_editor_new (void); +GtkType event_editor_get_type (void); +EventEditor *event_editor_construct (EventEditor *ee); +EventEditor *event_editor_new (void); +void event_editor_show_meeting (EventEditor *ee); diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 6b473950f7..cb4bf37a62 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -2921,7 +2921,7 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget, &dtend); gnome_calendar_new_appointment_for (day_view->calendar, dtstart, dtend, - TRUE); + TRUE, FALSE); return TRUE; } @@ -3055,7 +3055,7 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget, &dtend); gnome_calendar_new_appointment_for (day_view->calendar, dtstart, dtend, - FALSE); + FALSE, FALSE); return TRUE; } @@ -3491,7 +3491,7 @@ e_day_view_on_event_double_click (EDayView *day_view, gtk_signal_disconnect (GTK_OBJECT (event->comp), id); if (day_view->calendar) - gnome_calendar_edit_object (day_view->calendar, event->comp); + gnome_calendar_edit_object (day_view->calendar, event->comp, FALSE); else g_warning ("Calendar not set"); } @@ -3653,7 +3653,7 @@ e_day_view_on_new_appointment (GtkWidget *widget, gpointer data) } gnome_calendar_new_appointment_for ( - day_view->calendar, dtstart, dtend, FALSE); + day_view->calendar, dtstart, dtend, FALSE, FALSE); } static void @@ -3664,7 +3664,7 @@ e_day_view_on_new_event (GtkWidget *widget, gpointer data) e_day_view_get_selected_time_range (day_view, &dtstart, &dtend); gnome_calendar_new_appointment_for ( - day_view->calendar, dtstart, dtend, TRUE); + day_view->calendar, dtstart, dtend, TRUE, FALSE); } static void @@ -3696,7 +3696,7 @@ e_day_view_on_edit_appointment (GtkWidget *widget, gpointer data) return; if (day_view->calendar) - gnome_calendar_edit_object (day_view->calendar, event->comp); + gnome_calendar_edit_object (day_view->calendar, event->comp, FALSE); else g_warning ("Calendar not set"); } diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c index 47df421f5d..4d532be5bf 100644 --- a/calendar/gui/e-week-view-event-item.c +++ b/calendar/gui/e-week-view-event-item.c @@ -855,7 +855,7 @@ e_week_view_event_item_double_click (EWeekViewEventItem *wveitem, e_week_view_stop_editing_event (week_view); if (week_view->calendar) - gnome_calendar_edit_object (week_view->calendar, event->comp); + gnome_calendar_edit_object (week_view->calendar, event->comp, FALSE); else g_warning ("Calendar not set"); diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 7dd9d83cc3..9fbf26b979 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -2137,7 +2137,7 @@ e_week_view_on_button_press (GtkWidget *widget, dtend = week_view->day_starts[day + 1]; gnome_calendar_new_appointment_for (week_view->calendar, dtstart, dtend, - TRUE); + TRUE, FALSE); return TRUE; } @@ -2973,7 +2973,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, if (week_view->calendar) gnome_calendar_edit_object (week_view->calendar, - event->comp); + event->comp, FALSE); else g_warning ("Calendar not set"); @@ -3531,7 +3531,7 @@ e_week_view_on_new_appointment (GtkWidget *widget, gpointer data) } gnome_calendar_new_appointment_for ( - week_view->calendar, dtstart, dtend, FALSE); + week_view->calendar, dtstart, dtend, FALSE, FALSE); } static void @@ -3543,7 +3543,7 @@ e_week_view_on_new_event (GtkWidget *widget, gpointer data) dtstart = week_view->day_starts[week_view->selection_start_day]; dtend = week_view->day_starts[week_view->selection_end_day + 1]; gnome_calendar_new_appointment_for ( - week_view->calendar, dtstart, dtend, TRUE); + week_view->calendar, dtstart, dtend, TRUE, FALSE); } static void @@ -3577,7 +3577,8 @@ e_week_view_on_edit_appointment (GtkWidget *widget, gpointer data) week_view->popup_event_num); if (week_view->calendar) - gnome_calendar_edit_object (week_view->calendar, event->comp); + gnome_calendar_edit_object (week_view->calendar, event->comp, + FALSE); else g_warning ("Calendar not set"); } diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 1590117672..8d75a39c75 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -2123,7 +2123,8 @@ editor_closed_cb (GtkWidget *widget, gpointer data) } void -gnome_calendar_edit_object (GnomeCalendar *gcal, CalComponent *comp) +gnome_calendar_edit_object (GnomeCalendar *gcal, CalComponent *comp, + gboolean meeting) { GnomeCalendarPrivate *priv; EventEditor *ee; @@ -2147,7 +2148,6 @@ gnome_calendar_edit_object (GnomeCalendar *gcal, CalComponent *comp) g_message ("gnome_calendar_edit_object(): Could not create the event editor"); return; } - ec->gcal = gcal; ec->uid = g_strdup (uid); @@ -2159,6 +2159,8 @@ gnome_calendar_edit_object (GnomeCalendar *gcal, CalComponent *comp) comp_editor_set_cal_client (COMP_EDITOR (ee), priv->client); comp_editor_edit_comp (COMP_EDITOR (ee), comp); + if (meeting) + event_editor_show_meeting (ee); } comp_editor_focus (COMP_EDITOR (ee)); @@ -2178,7 +2180,8 @@ gnome_calendar_edit_object (GnomeCalendar *gcal, CalComponent *comp) void gnome_calendar_new_appointment_for (GnomeCalendar *cal, time_t dtstart, time_t dtend, - gboolean all_day) + gboolean all_day, + gboolean meeting) { GnomeCalendarPrivate *priv; struct icaltimetype itt; @@ -2235,7 +2238,7 @@ gnome_calendar_new_appointment_for (GnomeCalendar *cal, cal_component_commit_sequence (comp); - gnome_calendar_edit_object (cal, comp); + gnome_calendar_edit_object (cal, comp, meeting); gtk_object_unref (GTK_OBJECT (comp)); } @@ -2256,7 +2259,7 @@ gnome_calendar_new_appointment (GnomeCalendar *gcal) g_return_if_fail (GNOME_IS_CALENDAR (gcal)); gnome_calendar_get_current_time_range (gcal, &dtstart, &dtend); - gnome_calendar_new_appointment_for (gcal, dtstart, dtend, FALSE); + gnome_calendar_new_appointment_for (gcal, dtstart, dtend, FALSE, FALSE); } /** diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h index 64273277ec..2c4eaaf0af 100644 --- a/calendar/gui/gnome-cal.h +++ b/calendar/gui/gnome-cal.h @@ -115,12 +115,14 @@ void gnome_calendar_get_selected_time_range (GnomeCalendar *gcal, time_t *end_time); void gnome_calendar_edit_object (GnomeCalendar *gcal, - CalComponent *comp); + CalComponent *comp, + gboolean meeting); void gnome_calendar_new_appointment (GnomeCalendar *gcal); void gnome_calendar_new_appointment_for (GnomeCalendar *cal, time_t dtstart, time_t dtend, - gboolean all_day); + gboolean all_day, + gboolean meeting); void gnome_calendar_new_task (GnomeCalendar *gcal); diff --git a/calendar/gui/tasks-control.c b/calendar/gui/tasks-control.c index 0edc2723e7..22d87a1e08 100644 --- a/calendar/gui/tasks-control.c +++ b/calendar/gui/tasks-control.c @@ -418,7 +418,7 @@ static gboolean confirm_expunge (ETasks *tasks) { GtkWidget *dialog, *label, *checkbox; - int button, val; + int button; if (!calendar_config_get_confirm_expunge ()) return TRUE; diff --git a/calendar/idl/evolution-calendar.idl b/calendar/idl/evolution-calendar.idl index d400f13c01..f38bc9b47a 100644 --- a/calendar/idl/evolution-calendar.idl +++ b/calendar/idl/evolution-calendar.idl @@ -328,12 +328,17 @@ module Calendar { exception BackendContactError {}; exception UnsupportedType {}; + typedef long CompEditorMode; + const CompEditorMode EDITOR_MODE_EVENT = 1 << 0; + const CompEditorMode EDITOR_MODE_MEETING = 1 << 1; + const CompEditorMode EDITOR_MODE_TODO = 1 << 2; + /* Loads a calendar and opens an editor for the specified object */ void editExisting (in string uri, in CalObjUID uid) raises (InvalidURI, BackendContactError); /* Loads a calendar and creates a new component of the specified type */ - void editNew (in string uri, in CalObjType type) + void editNew (in string uri, in CompEditorMode mode) raises (InvalidURI, BackendContactError, UnsupportedType); }; }; |