aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-05-05 05:04:40 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-05-05 05:04:40 +0800
commitea787be7184b4d0c5d093b3c560b8f1879839d73 (patch)
tree367fc0091afe6bfaaeca7971fce0221319a6bef7 /calendar/gui/e-week-view.c
parentbe8e1b8c1f5e52bdb0e3c674da29dc3ca8bc49f4 (diff)
downloadgsoc2013-evolution-ea787be7184b4d0c5d093b3c560b8f1879839d73.tar
gsoc2013-evolution-ea787be7184b4d0c5d093b3c560b8f1879839d73.tar.gz
gsoc2013-evolution-ea787be7184b4d0c5d093b3c560b8f1879839d73.tar.bz2
gsoc2013-evolution-ea787be7184b4d0c5d093b3c560b8f1879839d73.tar.lz
gsoc2013-evolution-ea787be7184b4d0c5d093b3c560b8f1879839d73.tar.xz
gsoc2013-evolution-ea787be7184b4d0c5d093b3c560b8f1879839d73.tar.zst
gsoc2013-evolution-ea787be7184b4d0c5d093b3c560b8f1879839d73.zip
for the long events pass E_DAY_VIEW_LONG_EVENT as the day. Fixes SEGV.
2000-05-04 Damon Chaplin <damon@helixcode.com> * gui/e-day-view.c (e_day_view_foreach_event_with_uid): for the long events pass E_DAY_VIEW_LONG_EVENT as the day. Fixes SEGV. * gui/calendar-commands.c: when we switch views, grab the focus. * gui/gnome-cal.c (gnome_calendar_tag_calendar): (gnome_calendar_mark_gtk_calendar_day): changed this so it uses cal_client_get_events_in_range(), and doesn't load any objects. Also just return if it isn't visible. * gui/calendar-commands.c (calendar_get_events_in_range): call g_list_sort() to sort the list rather than g_list_insert_sorted() for each element. It is much more efficient. Also changed it so that the co->ev_start/end fields are copied from the CalObjInstance rather than the parameters to the function (that is right, isn't it?) Also freed the list elements, and finally the list. (calendar_iterate): changed this to use cal_client_get_events_in_range since that is more efficient than getting all the uids and then loading and parsing all the events. * pcs/cal-backend.c (save): output the '... saved' message before freeing the string! * gui/gncal-todo.c (gncal_todo_update): * gui/e-week-view.c (e_week_view_update_event): * gui/e-day-view.c (e_day_view_update_event): * gui/calendar-commands.c (calendar_get_events_in_range): (calendar_iterate): free obj_string after it is parsed. svn path=/trunk/; revision=2802
Diffstat (limited to 'calendar/gui/e-week-view.c')
-rw-r--r--calendar/gui/e-week-view.c56
1 files changed, 51 insertions, 5 deletions
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 6f371a10c4..bf01b66831 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -986,6 +986,7 @@ e_week_view_update_event (EWeekView *week_view,
/* Get the event from the server. */
obj_string = cal_client_get_object (week_view->calendar->client, uid);
status = ical_object_find_in_string (uid, obj_string, &ico);
+ g_free (obj_string);
switch (status) {
case CAL_OBJ_FIND_SUCCESS:
@@ -1318,7 +1319,11 @@ e_week_view_on_button_press (GtkWidget *widget,
{
gint x, y, day;
- /* If an event is pressed, just return. */
+#if 0
+ g_print ("In e_week_view_on_button_press\n");
+#endif
+
+ /* If an event is pressed just return. */
if (week_view->pressed_event_num != -1)
return FALSE;
@@ -1360,6 +1365,10 @@ e_week_view_on_button_release (GtkWidget *widget,
{
time_t start, end;
+#if 0
+ g_print ("In e_week_view_on_button_release\n");
+#endif
+
if (week_view->selection_drag_pos != E_WEEK_VIEW_DRAG_NONE) {
week_view->selection_drag_pos = E_WEEK_VIEW_DRAG_NONE;
gdk_pointer_ungrab (event->time);
@@ -1567,6 +1576,13 @@ e_week_view_add_event (iCalObject *ico,
/* Check that the event times are valid. */
num_days = week_view->display_month ? E_WEEK_VIEW_MAX_WEEKS * 7 : 7;
+
+#if 0
+ g_print ("View start:%li end:%li Event start:%li end:%li\n",
+ week_view->day_starts[0], week_view->day_starts[num_days],
+ start, end);
+#endif
+
g_return_val_if_fail (start <= end, TRUE);
g_return_val_if_fail (start < week_view->day_starts[num_days], TRUE);
g_return_val_if_fail (end > week_view->day_starts[0], TRUE);
@@ -2128,6 +2144,8 @@ e_week_view_start_editing_event (EWeekView *week_view,
ETextEventProcessor *event_processor = NULL;
ETextEventProcessorCommand command;
+ g_print ("In e_week_view_start_editing_event\n");
+
/* If we are already editing the event, just return. */
if (event_num == week_view->editing_event_num
&& span_num == week_view->editing_span_num)
@@ -2159,6 +2177,8 @@ e_week_view_start_editing_event (EWeekView *week_view,
gtk_signal_emit_by_name (GTK_OBJECT (event_processor),
"command", &command);
}
+
+ g_print ("Out e_week_view_start_editing_event\n");
}
@@ -2187,8 +2207,13 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item,
{
gint event_num, span_num;
+#if 0
+ g_print ("In e_week_view_on_text_item_event\n");
+#endif
+
switch (event->type) {
case GDK_BUTTON_PRESS:
+ g_print (" button press\n");
if (!e_week_view_find_event_from_item (week_view, item,
&event_num, &span_num))
return FALSE;
@@ -2202,15 +2227,15 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item,
return TRUE;
}
+ week_view->pressed_event_num = event_num;
+ week_view->pressed_span_num = span_num;
+
/* Only let the EText handle the event while editing. */
if (!E_TEXT (item)->editing) {
+ g_print (" stopping signal\n");
gtk_signal_emit_stop_by_name (GTK_OBJECT (item),
"event");
-
- week_view->pressed_event_num = event_num;
- week_view->pressed_span_num = span_num;
-
if (event) {
week_view->drag_event_x = event->button.x;
week_view->drag_event_y = event->button.y;
@@ -2219,10 +2244,14 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item,
/* FIXME: Remember the day offset from the start of
the event. */
+
+ return TRUE;
}
break;
case GDK_BUTTON_RELEASE:
+ g_print (" button release\n");
if (!E_TEXT (item)->editing) {
+ g_print (" stopping signal\n");
gtk_signal_emit_stop_by_name (GTK_OBJECT (item),
"event");
@@ -2242,6 +2271,8 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item,
week_view->pressed_event_num = -1;
return TRUE;
}
+ } else {
+ g_print (" EText may get button release event\n");
}
week_view->pressed_event_num = -1;
break;
@@ -2273,6 +2304,8 @@ e_week_view_on_editing_started (EWeekView *week_view,
&event_num, &span_num))
return;
+ g_print ("In e_week_view_on_editing_started event_num:%i span_num:%i\n", event_num, span_num);
+
week_view->editing_event_num = event_num;
week_view->editing_span_num = span_num;
@@ -2282,6 +2315,8 @@ e_week_view_on_editing_started (EWeekView *week_view,
e_week_view_reshape_event_span (week_view, event_num,
span_num);
}
+
+ g_print ("Out e_week_view_on_editing_started\n");
}
@@ -2294,6 +2329,11 @@ e_week_view_on_editing_stopped (EWeekView *week_view,
EWeekViewEventSpan *span;
gchar *text = NULL;
+ if (e_week_view_find_event_from_item (week_view, item,
+ &event_num, &span_num)) {
+ g_print ("In e_week_view_on_editing_stopped event_num:%i span_num:%i\n", event_num, span_num);
+ }
+
/* 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
event twice for some reason. */
@@ -2372,6 +2412,12 @@ e_week_view_find_event_from_item (EWeekView *week_view,
}
+/* Finds the index of the event with the given uid.
+ Returns TRUE if an event with the uid was found.
+ Note that for recurring events there may be several EWeekViewEvents, one
+ for each instance, all with the same iCalObject and uid. So only use this
+ function if you know the event doesn't recur or you are just checking to
+ see if any events with the uid exist. */
static gboolean
e_week_view_find_event_from_uid (EWeekView *week_view,
const gchar *uid,