aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-08-14 02:25:28 +0800
committerDan Winship <danw@src.gnome.org>2002-08-14 02:25:28 +0800
commita3f9b35f4fc21de5b9574619d88763a0fbea821a (patch)
tree2a93b017ca40ebf4aeed94d6ca4f898ffd192a2b
parent0c136db74641440b148873d0b7da908b51e598f3 (diff)
downloadgsoc2013-evolution-a3f9b35f4fc21de5b9574619d88763a0fbea821a.tar.gz
gsoc2013-evolution-a3f9b35f4fc21de5b9574619d88763a0fbea821a.tar.zst
gsoc2013-evolution-a3f9b35f4fc21de5b9574619d88763a0fbea821a.zip
Remove a bunch of old #if 0 code. (update_item): Set
* gui/e-itip-control.c: Remove a bunch of old #if 0 code. (update_item): Set X-MICROSOFT-CDO-REPLYTIME here. * gui/itip-utils.c (comp_toplevel_with_zones): Don't set it here. * cal-util/cal-component.c (ensure_mandatory_properties): Use icaltime_current_time_with_zone rather than rolling our own. (cal_component_strip_errors): Remove unused variable. svn path=/trunk/; revision=17770
-rw-r--r--calendar/ChangeLog11
-rw-r--r--calendar/cal-util/cal-component.c5
-rw-r--r--calendar/gui/e-itip-control.c164
-rw-r--r--calendar/gui/itip-utils.c28
4 files changed, 28 insertions, 180 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 2cba686ac0..db920eb809 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,14 @@
+2002-08-13 Dan Winship <danw@ximian.com>
+
+ * gui/e-itip-control.c: Remove a bunch of old #if 0 code.
+ (update_item): Set X-MICROSOFT-CDO-REPLYTIME here.
+
+ * gui/itip-utils.c (comp_toplevel_with_zones): Don't set it here.
+
+ * cal-util/cal-component.c (ensure_mandatory_properties): Use
+ icaltime_current_time_with_zone rather than rolling our own.
+ (cal_component_strip_errors): Remove unused variable.
+
2002-08-13 Rodrigo Moya <rodrigo@ximian.com>
* gui/gnome-cal.c (gnome_calendar_open): set status message on
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c
index 2f5c88e4ca..b91d4b26ad 100644
--- a/calendar/cal-util/cal-component.c
+++ b/calendar/cal-util/cal-component.c
@@ -914,11 +914,9 @@ ensure_mandatory_properties (CalComponent *comp)
}
if (!priv->dtstamp) {
- time_t tim;
struct icaltimetype t;
- tim = time (NULL);
- t = icaltime_from_timet_with_zone (tim, FALSE, icaltimezone_get_utc_timezone ());
+ t = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
priv->dtstamp = icalproperty_new_dtstamp (t);
icalcomponent_add_property (priv->icalcomp, priv->dtstamp);
@@ -1094,7 +1092,6 @@ void
cal_component_strip_errors (CalComponent *comp)
{
CalComponentPrivate *priv;
- icalproperty *prop;
g_return_if_fail (comp != NULL);
g_return_if_fail (IS_CAL_COMPONENT (comp));
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
index e758a9f853..d140c33e6b 100644
--- a/calendar/gui/e-itip-control.c
+++ b/calendar/gui/e-itip-control.c
@@ -57,12 +57,6 @@
struct _EItipControlPrivate {
GtkWidget *html;
-#if 0
- GtkWidget *count;
- GtkWidget *next;
- GtkWidget *prev;
-#endif
-
GPtrArray *event_clients;
CalClient *event_client;
GPtrArray *task_clients;
@@ -90,38 +84,6 @@ struct _EItipControlPrivate {
#define HTML_BODY_END "</body>"
#define HTML_FOOTER "</html>"
-/* We don't use these now, as we need to be able to translate the text.
- But I've left these here, in case there are problems with the new code. */
-#if 0
-#define PUBLISH_OPTIONS "<form><b>Choose an action:</b>&nbsp<select NAME=\"action\" SIZE=\"1\"> \
-<option VALUE=\"U\">Update</option></select>&nbsp &nbsp \
-<input TYPE=Submit name=\"ok\" value=\"OK\"></form>"
-
-#define REQUEST_OPTIONS "<form><b>Choose an action:</b>&nbsp<select NAME=\"action\" SIZE=\"1\"> \
-<option VALUE=\"A\">Accept</option> \
-<option VALUE=\"T\">Tentatively accept</option> \
-<option VALUE=\"D\">Decline</option></select>&nbsp \
-<input TYPE=\"checkbox\" name=\"rsvp\" value=\"1\" checked>RSVP&nbsp&nbsp\
-<input TYPE=\"submit\" name=\"ok\" value=\"OK\"><br> \
-</form>"
-
-#define REQUEST_FB_OPTIONS "<form><b>Choose an action:</b><select NAME=\"action\" SIZE=\"1\"> \
-<option VALUE=\"F\">Send Free/Busy Information</option></select>&nbsp &nbsp \
-<input TYPE=Submit name=\"ok\" value=\"OK\"></form>"
-
-#define REPLY_OPTIONS "<form><b>Choose an action:</b><select NAME=\"action\" SIZE=\"1\"> \
-<option VALUE=\"R\">Update respondent status</option></select>&nbsp &nbsp \
-<input TYPE=Submit name=\"ok\" value=\"OK\"></form>"
-
-#define REFRESH_OPTIONS "<form><b>Choose an action:</b><select NAME=\"action\" SIZE=\"1\"> \
-<option VALUE=\"S\">Send Latest Information</option></select>&nbsp &nbsp \
-<input TYPE=Submit name=\"ok\" value=\"OK\"></form>"
-
-#define CANCEL_OPTIONS "<form><b>Choose an action:</b><select NAME=\"action\" SIZE=\"1\"> \
-<option VALUE=\"C\">Cancel</option></select>&nbsp &nbsp \
-<input TYPE=Submit name=\"ok\" value=\"OK\"></form>"
-#endif
-
extern EvolutionShellClient *global_shell_client;
static const char *calendar_types[] = { "calendar", NULL };
@@ -131,10 +93,6 @@ static void class_init (EItipControlClass *klass);
static void init (EItipControl *itip);
static void destroy (GtkObject *obj);
-#if 0
-static void prev_clicked_cb (GtkWidget *widget, gpointer data);
-static void next_clicked_cb (GtkWidget *widget, gpointer data);
-#endif
static void url_requested_cb (GtkHTML *html, const gchar *url, GtkHTMLStream *handle, gpointer data);
static gboolean object_requested_cb (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data);
static void ok_clicked_cb (GtkHTML *html, const gchar *method, const gchar *url, const gchar *encoding, gpointer data);
@@ -347,25 +305,6 @@ init (EItipControl *itip)
/* Addresses */
priv->addresses = itip_addresses_get ();
- /* Header */
-#if 0
- priv->prev = gnome_stock_button (GNOME_STOCK_BUTTON_PREV);
- gtk_widget_show (priv->prev);
- priv->next = gnome_stock_button (GNOME_STOCK_BUTTON_NEXT);
- gtk_widget_show (priv->next);
-
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), priv->prev, FALSE, FALSE, 4);
- gtk_box_pack_start (GTK_BOX (hbox), priv->count, TRUE, TRUE, 4);
- gtk_box_pack_start (GTK_BOX (hbox), priv->next, FALSE, FALSE, 4);
- gtk_widget_show (hbox);
-
- gtk_signal_connect (GTK_OBJECT (priv->prev), "clicked",
- GTK_SIGNAL_FUNC (prev_clicked_cb), itip);
- gtk_signal_connect (GTK_OBJECT (priv->next), "clicked",
- GTK_SIGNAL_FUNC (next_clicked_cb), itip);
-#endif
-
/* Get the cal clients */
priv->event_clients = get_servers (global_shell_client, calendar_types, FALSE);
priv->event_client = NULL;
@@ -557,39 +496,6 @@ find_attendee (icalcomponent *ical_comp, const char *address)
return prop;
}
-#if 0
-static void
-set_label (EItipControl *itip)
-{
- EItipControlPrivate *priv;
- gchar *text;
-
- priv = itip->priv;
-
- text = g_strdup_printf ("%d of %d", priv->current, priv->total);
- gtk_label_set_text (GTK_LABEL (priv->count), text);
-
-}
-
-static void
-set_button_status (EItipControl *itip)
-{
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- if (priv->current == priv->total)
- gtk_widget_set_sensitive (priv->next, FALSE);
- else
- gtk_widget_set_sensitive (priv->next, TRUE);
-
- if (priv->current == 1)
- gtk_widget_set_sensitive (priv->prev, FALSE);
- else
- gtk_widget_set_sensitive (priv->prev, TRUE);
-}
-#endif
-
static void
write_label_piece (EItipControl *itip, CalComponentDateTime *dt,
char *buffer, int size,
@@ -1309,25 +1215,6 @@ get_next (icalcompiter *iter)
return ret;
}
-#if 0
-static icalcomponent *
-get_prev (icalcompiter *iter)
-{
- icalcomponent *ret = NULL;
- icalcomponent_kind kind = ICAL_NO_COMPONENT;
-
- while (kind != ICAL_VEVENT_COMPONENT
- && kind != ICAL_VTODO_COMPONENT
- && kind != ICAL_VFREEBUSY_COMPONENT) {
- icalcompiter_prior (iter);
- ret = icalcompiter_deref (iter);
- kind = icalcomponent_isa (ret);
- }
-
- return ret;
-}
-#endif
-
static void
show_current (EItipControl *itip)
{
@@ -1338,11 +1225,6 @@ show_current (EItipControl *itip)
priv = itip->priv;
-#if 0
- set_label (itip);
- set_button_status (itip);
-#endif
-
if (priv->comp)
gtk_object_unref (GTK_OBJECT (priv->comp));
if (priv->event_client != NULL)
@@ -1555,6 +1437,8 @@ static void
update_item (EItipControl *itip)
{
EItipControlPrivate *priv;
+ struct icaltimetype stamp;
+ icalproperty *prop;
icalcomponent *clone;
CalClient *client;
CalComponentVType type;
@@ -1563,6 +1447,20 @@ update_item (EItipControl *itip)
priv = itip->priv;
+ /* Set X-MICROSOFT-CDO-REPLYTIME to record the time at which
+ * the user accepted/declined the request. (Outlook ignores
+ * SEQUENCE in REPLY reponses and instead requires that each
+ * updated response have a later REPLYTIME than the previous
+ * one.) This also ends up getting saved in our own copy of
+ * the meeting, though there's currently no way to see that
+ * information (unless it's being saved to an Exchange folder
+ * and you then look at it in Outlook).
+ */
+ stamp = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
+ prop = icalproperty_new_x (icaltime_as_ical_string (stamp));
+ icalproperty_set_x_name (prop, "X-MICROSOFT-CDO-REPLYTIME");
+ icalcomponent_add_property (priv->ical_comp, prop);
+
type = cal_component_get_vtype (priv->comp);
if (type == CAL_COMPONENT_TODO)
client = priv->task_client;
@@ -1806,36 +1704,6 @@ send_freebusy (EItipControl *itip)
gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
}
-#if 0
-static void
-prev_clicked_cb (GtkWidget *widget, gpointer data)
-{
- EItipControl *itip = E_ITIP_CONTROL (data);
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- priv->current--;
- priv->ical_comp = get_prev (&priv->iter);
-
- show_current (itip);
-}
-
-static void
-next_clicked_cb (GtkWidget *widget, gpointer data)
-{
- EItipControl *itip = E_ITIP_CONTROL (data);
- EItipControlPrivate *priv;
-
- priv = itip->priv;
-
- priv->current++;
- priv->ical_comp = get_next (&priv->iter);
-
- show_current (itip);
-}
-#endif
-
static void
button_selected_cb (EvolutionFolderSelectorButton *button, GNOME_Evolution_Folder *folder, gpointer data)
{
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index 7f27749731..8e0879833f 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -311,34 +311,6 @@ comp_toplevel_with_zones (CalComponentItipMethod method, CalComponent *comp, Cal
icomp = cal_component_get_icalcomponent (comp);
- if (method == CAL_COMPONENT_METHOD_REPLY) {
- struct icaltimetype dtstamp;
- gboolean add_it = FALSE;
-
- /* workaround for Outlook expecting a X-MICROSOFT-CDO-REPLYTIME
- on every METHOD=REPLY message. If the component has any of
- the X-MICROSOFT-* properties, we add the REPLYTIME one */
- prop = icalcomponent_get_first_property (icomp, ICAL_X_PROPERTY);
- while (prop) {
- const char *x_name;
-
- x_name = icalproperty_get_x_name (prop);
- if (!strncmp (x_name, "X-MICROSOFT-", strlen ("X-MICROSOFT-"))) {
- add_it = TRUE;
- break;
- }
- prop = icalcomponent_get_next_property (icomp, ICAL_X_PROPERTY);
- }
-
- if (add_it) {
- dtstamp = icaltime_from_timet_with_zone (
- time (NULL), 0, icaltimezone_get_utc_timezone ());
- prop = icalproperty_new_x (icaltime_as_ical_string (dtstamp));
- icalproperty_set_x_name (prop, "X-MICROSOFT-CDO-REPLYTIME");
- icalcomponent_add_property (icomp, prop);
- }
- }
-
tz_data.tzids = g_hash_table_new (g_str_hash, g_str_equal);
tz_data.icomp = top_level;
tz_data.client = client;