diff options
author | Federico Mena Quintero <federico@helixcode.com> | 2000-08-30 17:29:17 +0800 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2000-08-30 17:29:17 +0800 |
commit | 6c6dba281e93d9f5aff9dc9f7260c470857ae400 (patch) | |
tree | 52542ee3f04ef6ad66a97b02fc92159d245b5113 /calendar/gui | |
parent | 1273d446f27ca4ef89d564bb76c8e42e0df71af4 (diff) | |
download | gsoc2013-evolution-6c6dba281e93d9f5aff9dc9f7260c470857ae400.tar gsoc2013-evolution-6c6dba281e93d9f5aff9dc9f7260c470857ae400.tar.gz gsoc2013-evolution-6c6dba281e93d9f5aff9dc9f7260c470857ae400.tar.bz2 gsoc2013-evolution-6c6dba281e93d9f5aff9dc9f7260c470857ae400.tar.lz gsoc2013-evolution-6c6dba281e93d9f5aff9dc9f7260c470857ae400.tar.xz gsoc2013-evolution-6c6dba281e93d9f5aff9dc9f7260c470857ae400.tar.zst gsoc2013-evolution-6c6dba281e93d9f5aff9dc9f7260c470857ae400.zip |
Oops, set the dtstart/dtend on the component before adding it.
2000-08-30 Federico Mena Quintero <federico@helixcode.com>
* gui/e-day-view.c (e_day_view_key_press): Oops, set the
dtstart/dtend on the component before adding it.
(e_day_view_on_editing_stopped): No need to check for an UID.
Update the summary properly.
svn path=/trunk/; revision=5113
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/e-day-view.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 8d7bcebf01..1767624627 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -4074,6 +4074,8 @@ e_day_view_key_press (GtkWidget *widget, GdkEventKey *event) guint keyval; gboolean stop_emission; time_t dtstart, dtend; + CalComponentDateTime dt; + struct icaltimetype itt; const char *uid; g_return_val_if_fail (widget != NULL, FALSE); @@ -4156,13 +4158,22 @@ e_day_view_key_press (GtkWidget *widget, GdkEventKey *event) initial_text = event->string; } - /* Add a new event covering the selected range. - Note that user_name is a global variable. */ + /* Add a new event covering the selected range */ + comp = cal_component_new (); cal_component_set_new_vtype (comp, CAL_COMPONENT_EVENT); e_day_view_get_selected_time_range (day_view, &dtstart, &dtend); + dt.value = &itt; + dt.tzid = NULL; + + *dt.value = icaltime_from_timet (dtstart, FALSE, FALSE); + cal_component_set_dtstart (comp, &dt); + + *dt.value = icaltime_from_timet (dtend, FALSE, FALSE); + cal_component_set_dtend (comp, &dt); + /* We add the event locally and start editing it. When we get the "update_event" callback from the server, we basically ignore it. If we were to wait for the "update_event" callback it wouldn't be @@ -4611,7 +4622,6 @@ e_day_view_on_editing_stopped (EDayView *day_view, EDayViewEvent *event; gchar *text = NULL; CalComponentText summary; - const char *uid; /* Note: the item we are passed here isn't reliable, so we just stop the edit of whatever item was being edited. We also receive this @@ -4623,11 +4633,6 @@ e_day_view_on_editing_stopped (EDayView *day_view, if (day == -1) return; -#if 0 - g_print ("In e_day_view_on_editing_stopped Day:%i Event:%i\n", - day, event_num); -#endif - if (day == E_DAY_VIEW_LONG_EVENT) { editing_long_event = TRUE; event = &g_array_index (day_view->long_events, EDayViewEvent, @@ -4649,11 +4654,6 @@ e_day_view_on_editing_stopped (EDayView *day_view, day_view->resize_bars_event_day = -1; day_view->resize_bars_event_num = -1; - /* Check that the event is still valid. */ - cal_component_get_uid (event->comp, &uid); - if (!uid) - return; - gtk_object_get (GTK_OBJECT (event->canvas_item), "text", &text, NULL); @@ -4668,8 +4668,14 @@ e_day_view_on_editing_stopped (EDayView *day_view, return; } - cal_component_set_summary (event->comp, &summary); - g_free (text); + if (text) { + summary.value = text; + summary.altrep = NULL; + cal_component_set_summary (event->comp, &summary); + + g_free (text); + } else + cal_component_set_summary (event->comp, NULL); if (!cal_client_update_object (day_view->client, event->comp)) g_message ("e_day_view_on_editing_stopped(): Could not update the object!"); |