aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-05-07 00:47:27 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-05-07 00:47:27 +0800
commit9b57702d4d406955ce3ec2e841253ed3efe3bbb8 (patch)
treec2b1ad66aacbc7e4267485c5c34fcc8d0b122c91 /calendar/gui/e-day-view.c
parentfc213a4931c274c8f269b21f168c12e728e45bf7 (diff)
downloadgsoc2013-evolution-9b57702d4d406955ce3ec2e841253ed3efe3bbb8.tar.gz
gsoc2013-evolution-9b57702d4d406955ce3ec2e841253ed3efe3bbb8.tar.zst
gsoc2013-evolution-9b57702d4d406955ce3ec2e841253ed3efe3bbb8.zip
finish editing event when user hits Return key.
2000-05-06 Damon Chaplin <damon@helixcode.com> * gui/e-day-view.c: * gui/e-week-view.c: finish editing event when user hits Return key. (e_week_view_on_text_item_event): stop event signals after doing any other calls, since otherwise it will also stop any other resulting event signals. * gui/e-week-view-event-item.c (e_week_view_event_item_draw): don't draw the start/end times while editing. * gui/eventedit.c: changed the Summary field to a GtkEntry, since we now only want a single line of text. * cal-util/calobj.c (ical_object_normalize_summary): new function to convert the summary field to a single line of text, by converting any sequence of CR & LF characters to a single space. (ical_object_create_from_vobject): call the above function. I think all functions that load iCalObjects go through this. (ical_new): called it here as well just in case. svn path=/trunk/; revision=2827
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r--calendar/gui/e-day-view.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 9524f26807..747f541997 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -1034,8 +1034,6 @@ e_day_view_focus_in (GtkWidget *widget, GdkEventFocus *event)
g_return_val_if_fail (E_IS_DAY_VIEW (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
- g_print ("In e_day_view_focus_in\n");
-
day_view = E_DAY_VIEW (widget);
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
@@ -1056,8 +1054,6 @@ e_day_view_focus_out (GtkWidget *widget, GdkEventFocus *event)
g_return_val_if_fail (E_IS_DAY_VIEW (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
- g_print ("In e_day_view_focus_out\n");
-
day_view = E_DAY_VIEW (widget);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
@@ -1142,7 +1138,6 @@ e_day_view_update_event (EDayView *day_view,
update the event fairly easily without changing the events arrays
or computing a new layout. */
if (e_day_view_find_event_from_uid (day_view, uid, &day, &event_num)) {
- g_print (" updating existing event\n");
if (day == E_DAY_VIEW_LONG_EVENT)
event = &g_array_index (day_view->long_events,
EDayViewEvent, event_num);
@@ -1151,7 +1146,6 @@ e_day_view_update_event (EDayView *day_view,
EDayViewEvent, event_num);
if (ical_object_compare_dates (event->ico, ico)) {
- g_print (" unchanged dates\n");
e_day_view_foreach_event_with_uid (day_view, uid, e_day_view_update_event_cb, ico);
ical_object_unref (ico);
gtk_widget_queue_draw (day_view->top_canvas);
@@ -1161,14 +1155,12 @@ e_day_view_update_event (EDayView *day_view,
/* The dates have changed, so we need to remove the
old occurrrences before adding the new ones. */
- g_print (" changed dates\n");
e_day_view_foreach_event_with_uid (day_view, uid,
e_day_view_remove_event_cb,
NULL);
}
/* Add the occurrences of the event. */
- g_print (" generating events\n");
ical_object_generate_events (ico, day_view->lower, day_view->upper,
e_day_view_add_event, day_view);
ical_object_unref (ico);
@@ -1190,10 +1182,10 @@ e_day_view_update_event_cb (EDayView *day_view,
iCalObject *ico;
ico = data;
-
+#if 0
g_print ("In e_day_view_update_event_cb day:%i event_num:%i\n",
day, event_num);
-
+#endif
if (day == E_DAY_VIEW_LONG_EVENT) {
event = &g_array_index (day_view->long_events, EDayViewEvent,
event_num);
@@ -3940,6 +3932,19 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item,
EDayView *day_view)
{
switch (event->type) {
+ case GDK_KEY_PRESS:
+ if (event && event->key.keyval == GDK_Return) {
+ /* We set the keyboard focus to the EDayView, so the
+ EText item loses it and stops the edit. */
+ gtk_widget_grab_focus (GTK_WIDGET (day_view));
+
+ /* Stop the signal last or we will also stop any
+ other events getting to the EText item. */
+ gtk_signal_emit_stop_by_name (GTK_OBJECT (item),
+ "event");
+ return TRUE;
+ }
+ break;
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
/* Only let the EText handle the event while editing. */