From 75c96db2e105085d12295990d44b8427eb8230c2 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Sun, 12 Apr 1998 21:38:59 +0000 Subject: We now connect to the range_activated signal of the fullday widget instead 1998-04-12 Federico Mena Quintero * gnome-cal.c (setup_day_view): We now connect to the range_activated signal of the fullday widget instead of catching key presses ourselves. (day_view_range_activated): New function that creates a new iCalObject and inserts it into the calendar, not finished yet. 1998-04-11 Federico Mena Quintero * gncal-full-day.c (get_time_from_rows): New function, calculates a pair of time_t values from the specified start and number of rows. * gncal-full-day.h (GncalFullDayClass): New signal "range_activated". It is emitted when a range is selected and the user hits Return. (gncal_full_day_selection_range): New function, returns the selected range. * gncal-full-day.c (struct drag_info): Moved selection information to their own fields instead of sharing the child's drag fields. This allows us to keep the selection when a child is moved. (recompute_motion): Made the case when (row < di->sel_click_row) work correctly. svn path=/trunk/; revision=128 --- calendar/gnome-cal.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'calendar/gnome-cal.c') diff --git a/calendar/gnome-cal.c b/calendar/gnome-cal.c index 00344a79f0..9fa59a22d8 100644 --- a/calendar/gnome-cal.c +++ b/calendar/gnome-cal.c @@ -6,7 +6,6 @@ */ #include -#include #include "calendar.h" #include "gnome-cal.h" #include "gncal-full-day.h" @@ -40,19 +39,21 @@ gnome_calendar_get_type (void) } static void -day_view_key_press (GncalFullDay *fday, GdkEventKey *kevent, GnomeCalendar *gcal) +day_view_range_activated (GncalFullDay *fullday, GnomeCalendar *gcal) { iCalObject *ical; time_t start, end; - - if (kevent->keyval != GDK_Return) - return; - /* Create a new event on the selected range */ ical = ical_new ("", user_name, ""); ical->new = 1; -/* gncal_full_day_selection_range (gcal->day_view, &ical->dtstart, &ical->dtend); */ - event_editor_new (gcal, ical); + + gncal_full_day_selection_range (fullday, &start, &end); + + /* FIXME: this should insert the ical object into the calendar and somehow ask + * the fullday to update itself and focus the new child. + */ + +/* event_editor_new (gcal, ical); */ } static void @@ -65,16 +66,15 @@ setup_day_view (GnomeCalendar *gcal) b = time_end_of_day (now); gcal->day_view = gncal_full_day_new (gcal, a, b); - gtk_widget_set_events (gcal->day_view, - gtk_widget_get_events (gcal->day_view) | GDK_KEY_PRESS_MASK); + gtk_signal_connect (GTK_OBJECT (gcal->day_view), "range_activated", + (GtkSignalFunc) day_view_range_activated, + gcal); gcal->day_view_container = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (gcal->day_view_container), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (gcal->day_view_container), gcal->day_view); gtk_widget_show (gcal->day_view); - gtk_signal_connect (GTK_OBJECT (gcal->day_view), "key_press_event", - GTK_SIGNAL_FUNC (day_view_key_press), gcal); } static void -- cgit v1.2.3