aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@nuclecu.unam.mx>1998-04-13 05:38:59 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-13 05:38:59 +0800
commit75c96db2e105085d12295990d44b8427eb8230c2 (patch)
treefabe5ec93cc297324cfdc056d39e35fea3cb69d9 /calendar/gui/gnome-cal.c
parentfbc607b0edbdc39297d17c0ecc75b45e4bfbb0c8 (diff)
downloadgsoc2013-evolution-75c96db2e105085d12295990d44b8427eb8230c2.tar.gz
gsoc2013-evolution-75c96db2e105085d12295990d44b8427eb8230c2.tar.zst
gsoc2013-evolution-75c96db2e105085d12295990d44b8427eb8230c2.zip
We now connect to the range_activated signal of the fullday widget instead
1998-04-12 Federico Mena Quintero <federico@nuclecu.unam.mx> * 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 <federico@nuclecu.unam.mx> * 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
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 00344a79f0..9fa59a22d8 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -6,7 +6,6 @@
*/
#include <gnome.h>
-#include <gdk/gdkkeysyms.h>
#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