diff options
author | JP Rosevear <jpr@ximian.com> | 2001-06-20 03:24:08 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2001-06-20 03:24:08 +0800 |
commit | ca603236ed6d7a43bc4587b70d6163ee1d95e310 (patch) | |
tree | 458dd3880e4c65f417758684936ef30a2f7dba7f /calendar/gui/dialogs/event-editor.c | |
parent | 4b11ecbffc519e8dfccdebaa26b021f131254d78 (diff) | |
download | gsoc2013-evolution-ca603236ed6d7a43bc4587b70d6163ee1d95e310.tar.gz gsoc2013-evolution-ca603236ed6d7a43bc4587b70d6163ee1d95e310.tar.zst gsoc2013-evolution-ca603236ed6d7a43bc4587b70d6163ee1d95e310.zip |
itip/imip send dialog
2001-06-19 JP Rosevear <jpr@ximian.com>
* gui/dialogs/send-comp.c: itip/imip send dialog
* gui/dialogs/send-comp.h: new proto
* gui/dialogs/recurrence-page.c (recurrence_page_set_dates): only
use the weekday picker if visible
* gui/dialogs/meeting-page.c: just show the meeting list
* gui/dialogs/event-editor.c (event_editor_edit_comp): remove the
meeting page if no attendees
(schedule_meeting_cmd): schedule a meeting menu item
(refresh_meeting_cmd): refresh meeting request menu item
(cancel_meeting_cmd): ditto for cancel
(forward_cmd): send as attachment
* gui/dialogs/comp-editor.c (comp_editor_remove_page): remove page
from dialog
(comp_editor_show_page): show a given page
(comp_editor_get_current_comp): return a cal component
representing the current widget state
(comp_editor_save_comp): save the cal component
(comp_editor_delete_comp): delete the cal component
(comp_editor_send_comp): send the cal component
(comp_editor_merge_ui): merge xml in to the bonobo gui
(setup_widgets): use a bonobo window instead of a gtk window, add menus again
(save_as_cmd): save to file on disk - still broken
(save_close_cmd): close menu command
(save_close_cmd): save and close menu command
* gui/dialogs/comp-editor.h: new protos
* gui/dialogs/cancel-comp.c (cancel_component_dialog): itip/imip
cancellation dialog
* gui/dialogs/cancel-comp.h: new proto
* gui/dialogs/Makefile.am: build new files
* gui/dialogs/comp-editor-page.c
(comp_editor_page_notify_needs_send): emit needs_send signal
* gui/dialogs/comp-editor-page.h: new signal protos
* gui/itip-utils.c (itip_send_comp): new function to send cal
components
* gui/itip-utils.h: new proto
* gui/e-itip-control.c (pstream_load): trim using cal-component
wrapper stuff
(accept_button_clicked_cb): use itip_send_comp
(tentative_button_clicked_cb): ditto
(decline_button_clicked_cb): ditto
* gui/Makefile.am: compile select name idl stuff
* cal-util/cal-component.c (cal_component_get_organizer): get the organizer
(cal_component_set_organizer): set the organizer
(cal_component_get_recurid): get the recurrence id
(cal_component_set_recurid): set the recurrence id
(set_attendee_list): actually set the attendee list
(get_attendee_list): build the attendee list
* cal-util/cal-component.h: new protos
svn path=/trunk/; revision=10299
Diffstat (limited to 'calendar/gui/dialogs/event-editor.c')
-rw-r--r-- | calendar/gui/dialogs/event-editor.c | 111 |
1 files changed, 107 insertions, 4 deletions
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index b53efe12aa..36c06ff1f1 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -34,21 +34,41 @@ #include "event-page.h" #include "alarm-page.h" #include "recurrence-page.h" +#include "meeting-page.h" +#include "cancel-comp.h" #include "event-editor.h" struct _EventEditorPrivate { EventPage *event_page; AlarmPage *alarm_page; RecurrencePage *recur_page; + MeetingPage *meet_page; + + gboolean meeting_shown; }; static void event_editor_class_init (EventEditorClass *class); static void event_editor_init (EventEditor *ee); +static void event_editor_edit_comp (CompEditor *editor, CalComponent *comp); static void event_editor_destroy (GtkObject *object); -static CompEditor *parent_class; +static void schedule_meeting_cmd (GtkWidget *widget, gpointer data); +static void refresh_meeting_cmd (GtkWidget *widget, gpointer data); +static void cancel_meeting_cmd (GtkWidget *widget, gpointer data); +static void forward_cmd (GtkWidget *widget, gpointer data); + +static BonoboUIVerb verbs [] = { + BONOBO_UI_UNSAFE_VERB ("ActionScheduleMeeting", schedule_meeting_cmd), + BONOBO_UI_UNSAFE_VERB ("ActionRefreshMeeting", refresh_meeting_cmd), + BONOBO_UI_UNSAFE_VERB ("ActionCancelMeeting", cancel_meeting_cmd), + BONOBO_UI_UNSAFE_VERB ("ActionForward", forward_cmd), + + BONOBO_UI_VERB_END +}; + +static CompEditorClass *parent_class; @@ -86,14 +106,18 @@ event_editor_get_type (void) /* Class initialization function for the event editor */ static void -event_editor_class_init (EventEditorClass *class) +event_editor_class_init (EventEditorClass *klass) { GtkObjectClass *object_class; - - object_class = (GtkObjectClass *) class; + CompEditorClass *editor_class; + + object_class = (GtkObjectClass *) klass; + editor_class = (CompEditorClass *) klass; parent_class = gtk_type_class (TYPE_COMP_EDITOR); + editor_class->edit_comp = event_editor_edit_comp; + object_class->destroy = event_editor_destroy; } @@ -120,7 +144,37 @@ 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 (); + comp_editor_append_page (COMP_EDITOR (ee), + COMP_EDITOR_PAGE (priv->meet_page), + _("Meeting")); + + priv->meeting_shown = TRUE; + + comp_editor_merge_ui (COMP_EDITOR (ee), EVOLUTION_DATADIR + "/gnome/ui/evolution-event-editor.xml", + verbs); +} + +static void +event_editor_edit_comp (CompEditor *editor, CalComponent *comp) +{ + EventEditor *ee; + EventEditorPrivate *priv; + GSList *attendees = NULL; + ee = EVENT_EDITOR (editor); + priv = ee->priv; + + cal_component_get_attendee_list (comp, &attendees); + if (attendees == NULL) { + comp_editor_remove_page (editor, COMP_EDITOR_PAGE (priv->meet_page)); + priv->meeting_shown = FALSE; + } + + if (parent_class->edit_comp) + parent_class->edit_comp (editor, comp); } /* Destroy handler for the event editor */ @@ -153,3 +207,52 @@ event_editor_new (void) { return EVENT_EDITOR (gtk_type_new (TYPE_EVENT_EDITOR)); } + +static void +schedule_meeting_cmd (GtkWidget *widget, gpointer data) +{ + EventEditor *ee = EVENT_EDITOR (data); + EventEditorPrivate *priv; + + priv = ee->priv; + + if (!priv->meeting_shown) { + comp_editor_append_page (COMP_EDITOR (ee), + COMP_EDITOR_PAGE (priv->meet_page), + _("Meeting")); + priv->meeting_shown = FALSE; + } + + comp_editor_show_page (COMP_EDITOR (ee), + COMP_EDITOR_PAGE (priv->meet_page)); +} + +static void +refresh_meeting_cmd (GtkWidget *widget, gpointer data) +{ + EventEditor *ee = EVENT_EDITOR (data); + + comp_editor_send_comp (COMP_EDITOR (ee), CAL_COMPONENT_METHOD_REFRESH); +} + +static void +cancel_meeting_cmd (GtkWidget *widget, gpointer data) +{ + EventEditor *ee = EVENT_EDITOR (data); + CalComponent *comp; + + comp = comp_editor_get_current_comp (COMP_EDITOR (ee)); + if (cancel_component_dialog (comp)) { + comp_editor_send_comp (COMP_EDITOR (ee), CAL_COMPONENT_METHOD_CANCEL); + comp_editor_delete_comp (COMP_EDITOR (ee)); + } +} + +static void +forward_cmd (GtkWidget *widget, gpointer data) +{ + EventEditor *ee = EVENT_EDITOR (data); + + comp_editor_send_comp (COMP_EDITOR (ee), CAL_COMPONENT_METHOD_PUBLISH); +} + |