From 989ab1d5c8b4ceb9a9689baadab1a55b067f7d05 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Mon, 20 Jun 2005 17:27:52 +0000 Subject: Added support for delegation in personal calendar svn path=/trunk/; revision=29553 --- plugins/itip-formatter/itip-view.c | 68 +++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) (limited to 'plugins/itip-formatter/itip-view.c') diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c index 08256f1f3e..acfcf9527f 100644 --- a/plugins/itip-formatter/itip-view.c +++ b/plugins/itip-formatter/itip-view.c @@ -112,6 +112,10 @@ struct _ItipViewPrivate { GtkWidget *rsvp_comment_entry; gboolean rsvp_show; + GtkWidget *update_box; + GtkWidget *update_check; + gboolean update_show; + GtkWidget *button_box; gboolean buttons_sensitive; }; @@ -339,7 +343,7 @@ set_calendar_sender_text (ItipView *view) case ITIP_VIEW_MODE_REQUEST: /* FIXME is the delegator stuff handled correctly here? */ if (priv->delegator) { - sender = g_strdup_printf (_("%s requests the presence of %s at the following meeting:"), organizer, priv->delegator); + sender = g_strdup_printf (_("%s has delegated the following meeting to you:"), priv->delegator); } else { if (priv->sentby) sender = g_strdup_printf (_("%s through %s requests your presence at the following meeting:"), organizer, priv->sentby); @@ -949,6 +953,14 @@ itip_view_init (ItipView *view) gtk_widget_show (priv->rsvp_comment_entry); gtk_box_pack_start (GTK_BOX (hbox), priv->rsvp_comment_entry, FALSE, TRUE, 0); + /* RSVP area */ + priv->update_box = gtk_vbox_new (FALSE, 12); + gtk_box_pack_start (GTK_BOX (vbox), priv->update_box, FALSE, FALSE, 0); + + priv->update_check = gtk_check_button_new_with_mnemonic (_("Send u_pdates to attendees")); + gtk_widget_show (priv->update_check); + gtk_box_pack_start (GTK_BOX (priv->update_box), priv->update_check, FALSE, FALSE, 0); + /* The buttons for actions */ priv->button_box = gtk_hbutton_box_new (); gtk_button_box_set_layout (GTK_BUTTON_BOX (priv->button_box), GTK_BUTTONBOX_END); @@ -1727,6 +1739,60 @@ itip_view_get_show_rsvp (ItipView *view) return priv->rsvp_show; } +void +itip_view_set_update (ItipView *view, gboolean update) +{ + ItipViewPrivate *priv; + + g_return_if_fail (view != NULL); + g_return_if_fail (ITIP_IS_VIEW (view)); + + priv = view->priv; + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->update_check), update); +} + +gboolean +itip_view_get_update (ItipView *view) +{ + ItipViewPrivate *priv; + + g_return_val_if_fail (view != NULL, FALSE); + g_return_val_if_fail (ITIP_IS_VIEW (view), FALSE); + + priv = view->priv; + + return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->update_check)); +} + +void +itip_view_set_show_update (ItipView *view, gboolean update) +{ + ItipViewPrivate *priv; + + g_return_if_fail (view != NULL); + g_return_if_fail (ITIP_IS_VIEW (view)); + + priv = view->priv; + + priv->update_show = update; + + priv->update_show ? gtk_widget_show (priv->update_box) : gtk_widget_hide (priv->update_box); +} + +gboolean +itip_view_get_show_update (ItipView *view) +{ + ItipViewPrivate *priv; + + g_return_val_if_fail (view != NULL, FALSE); + g_return_val_if_fail (ITIP_IS_VIEW (view), FALSE); + + priv = view->priv; + + return priv->update_show; +} + void itip_view_set_rsvp_comment (ItipView *view, const char *comment) { -- cgit v1.2.3