From 8cda86512ba503a030204855fade1415ac06a614 Mon Sep 17 00:00:00 2001 From: Jesse Pavel Date: Wed, 8 Nov 2000 23:27:06 +0000 Subject: updated the GUI to allow the user to add PUBLISHed events to his calendar, * gui/e-itip-control.c, gui/e-itip-control.glade: updated the GUI to allow the user to add PUBLISHed events to his calendar, and created unworking buttons for meeting requests. svn path=/trunk/; revision=6518 --- calendar/ChangeLog | 6 ++++ calendar/gui/e-itip-control.c | 70 +++++++++++++++++++++++++++++++++--- calendar/gui/e-itip-control.glade | 76 +++++++++++++++++++++++++++------------ 3 files changed, 125 insertions(+), 27 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 9e3ac57452..558cb4c66f 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,9 @@ +2000-11-08 Jesse Pavel + + * gui/e-itip-control.c, gui/e-itip-control.glade: updated the GUI + to allow the user to add PUBLISHed events to his calendar, and created + unworking buttons for meeting requests. + 2000-11-08 Federico Mena Quintero These changes fix bugzilla bugs #874 and #875. diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c index b28ee1a2b1..93825513dd 100644 --- a/calendar/gui/e-itip-control.c +++ b/calendar/gui/e-itip-control.c @@ -21,8 +21,8 @@ #include -#define DEFAULT_WIDTH 450 -#define DEFAULT_HEIGHT 350 +#define DEFAULT_WIDTH 400 +#define DEFAULT_HEIGHT 300 extern gchar *evolution_dir; @@ -33,6 +33,7 @@ struct _EItipControlPrivate { GtkWidget *main_frame; GtkWidget *organizer_entry, *dtstart_label, *dtend_label; GtkWidget *summary_entry, *description_box, *message_text; + GtkWidget *button_box; GtkWidget *address_entry; GtkWidget *add_button; GtkWidget *loading_window; @@ -64,7 +65,7 @@ get_icalparam_by_type (icalproperty *prop, icalparameter_kind kind) /******** * find_attendee() searches through the attendee properties of `comp' - * and returns the one whose value is the same as `address' if such + * and returns the one the value of which is the same as `address' if such * a property exists. Otherwise, it will return NULL. ********/ static icalproperty * @@ -132,10 +133,20 @@ itip_control_destroy_cb (GtkObject *object, static void itip_control_size_request_cb (GtkWidget *widget, GtkRequisition *requisition) { + + /* gtk_widget_set (GTK_WIDGET (widget), "width", DEFAULT_WIDTH, NULL); */ + /* gtk_widget_set (GTK_WIDGET (widget), "height", DEFAULT_HEIGHT, NULL); */ requisition->width = DEFAULT_WIDTH; requisition->height = DEFAULT_HEIGHT; } +static void +itip_control_size_allocation_cb (GtkWidget *widget, GtkRequisition *requisition) +{ + widget->requisition.height = requisition->height; + widget->requisition.width = requisition->width; +} + static void cal_loaded_cb (GtkObject *object, CalClientGetStatus status, gpointer data) { @@ -155,7 +166,7 @@ cal_loaded_cb (GtkObject *object, CalClientGetStatus status, gpointer data) /* We have success. */ GtkWidget *dialog; - dialog = gnome_ok_dialog("Component successfully added."); + dialog = gnome_ok_dialog("Component successfully updated."); gnome_dialog_run (GNOME_DIALOG(dialog)); } } @@ -287,6 +298,26 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream, priv->comp = icalcomponent_get_first_component (priv->main_comp, ICAL_ANY_COMPONENT); + +#if 0 + { + FILE *fp; + + fp = fopen ("evo.debug", "w"); + + fputs ("The raw vCalendar data:\n\n", fp); + fputs (priv->vcalendar, fp); + + fputs ("The main component:\n\n", fp); + fputs (icalcomponent_as_ical_string (priv->main_comp), fp); + + fputs ("The child component:\n\n", fp); + fputs (icalcomponent_as_ical_string (priv->comp), fp); + + fclose (fp); + } +#endif + if (priv->comp == NULL) { g_printerr ("e-itip-control.c: I could not extract a proper component from\n" " the vCalendar data.\n"); @@ -392,11 +423,23 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream, prop = icalcomponent_get_first_property (priv->main_comp, ICAL_METHOD_PROPERTY); switch (icalproperty_get_method (prop)) { case ICAL_METHOD_PUBLISH: + { + GtkWidget *button; + sprintf (message, "%s has published calendar information, " - "which you can add to your own calendar." + "which you can add to your own calendar. " "No reply is necessary.", priv->from_address); + + button = gtk_button_new_with_label ("Add to Calendar"); + gtk_box_pack_start (GTK_BOX (priv->button_box), button, FALSE, FALSE, 3); + gtk_widget_show (button); + + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (add_button_clicked_cb), priv); + break; + } case ICAL_METHOD_REQUEST: { /* I'll check if I have to rsvp. */ @@ -419,6 +462,22 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream, (priv->organizer ? priv->organizer : "an unknown person"), (rsvp ? "should" : "don't have to") ); + if (rsvp) { + GtkWidget *accept_button, *decline_button, *tentative_button; + + accept_button = gtk_button_new_with_label ("Accept"); + decline_button = gtk_button_new_with_label ("Decline"); + tentative_button = gtk_button_new_with_label ("Tentative"); + + gtk_box_pack_start (GTK_BOX (priv->button_box), accept_button, FALSE, FALSE, 3); + gtk_box_pack_start (GTK_BOX (priv->button_box), decline_button, FALSE, FALSE, 3); + gtk_box_pack_start (GTK_BOX (priv->button_box), tentative_button, FALSE, FALSE, 3); + + gtk_widget_show (accept_button); + gtk_widget_show (decline_button); + gtk_widget_show (tentative_button); + } + } break; default: @@ -540,6 +599,7 @@ e_itip_control_factory (BonoboGenericFactory *Factory, void *closure) priv->summary_entry = glade_xml_get_widget (priv->xml, "summary_entry"); priv->description_box = glade_xml_get_widget (priv->xml, "description_box"); /* priv->add_button = glade_xml_get_widget (priv->xml, "add_button"); */ + priv->button_box = glade_xml_get_widget (priv->xml, "button_box"); priv->address_entry = glade_xml_get_widget (priv->xml, "address_entry"); priv->message_text = glade_xml_get_widget (priv->xml, "message_text"); diff --git a/calendar/gui/e-itip-control.glade b/calendar/gui/e-itip-control.glade index 6233f7b409..481874368a 100644 --- a/calendar/gui/e-itip-control.glade +++ b/calendar/gui/e-itip-control.glade @@ -381,42 +381,74 @@ - GtkScrolledWindow - scrolledwindow3 - GTK_POLICY_NEVER - GTK_POLICY_AUTOMATIC - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS + GtkHBox + hbox3 + False + 0 0 True - True + False - GtkText - message_text - True - False - + GtkScrolledWindow + scrolledwindow3 + 3 + 365 + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + False + False + + + + GtkText + message_text + True + False + + + + + + GtkLabel + label12 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + True + False + - GtkHButtonBox + GtkHBox button_box - 35 - GTK_BUTTONBOX_DEFAULT_STYLE - 30 - 85 - 27 - 7 - 0 + 3 + 30 + False + 8 0 - True - True + False + False + + + Placeholder + -- cgit