aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-10-05 08:02:56 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-10-05 08:02:56 +0800
commitaca022a441730b3707c26a6385d8e3c7c492e2cf (patch)
treeda6feb8a311526555f04fbb1ca23d3be50341633 /calendar/gui
parent8fee89d2fb528f546ba2215a0b343068f7afdd3b (diff)
downloadgsoc2013-evolution-aca022a441730b3707c26a6385d8e3c7c492e2cf.tar
gsoc2013-evolution-aca022a441730b3707c26a6385d8e3c7c492e2cf.tar.gz
gsoc2013-evolution-aca022a441730b3707c26a6385d8e3c7c492e2cf.tar.bz2
gsoc2013-evolution-aca022a441730b3707c26a6385d8e3c7c492e2cf.tar.lz
gsoc2013-evolution-aca022a441730b3707c26a6385d8e3c7c492e2cf.tar.xz
gsoc2013-evolution-aca022a441730b3707c26a6385d8e3c7c492e2cf.tar.zst
gsoc2013-evolution-aca022a441730b3707c26a6385d8e3c7c492e2cf.zip
when the user types in a new event, don't create it until the user hits
2000-10-05 Damon Chaplin <damon@helixcode.com> * gui/e-day-view.c: * gui/e-week-view.c: when the user types in a new event, don't create it until the user hits Return or switches focus. Removed the editing_new_event flags. * cal-util/test-recur.c: rewritten to work on ics files. Now I can start testing the recurrence code. * cal-util/cal-recur.c: a few fixes. * gui/e-day-view.c (e_day_view_check_if_new_event_fits): fixed to return TRUE for long events, not FALSE. svn path=/trunk/; revision=5729
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/e-day-view.c42
-rw-r--r--calendar/gui/e-day-view.h9
-rw-r--r--calendar/gui/e-week-view.c27
-rw-r--r--calendar/gui/e-week-view.h5
4 files changed, 10 insertions, 73 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 76925be0bd..d6905959e7 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -493,7 +493,6 @@ e_day_view_init (EDayView *day_view)
day_view->editing_event_day = -1;
day_view->editing_event_num = -1;
- day_view->editing_new_event = FALSE;
day_view->resize_bars_event_day = -1;
day_view->resize_bars_event_num = -1;
@@ -1330,19 +1329,6 @@ obj_updated_cb (CalClient *client, const char *uid, gpointer data)
#warning "FIXME"
#endif
- /* If we are editing an event which we have just created, we
- will get an update_event callback from the server. But we
- need to ignore it or we will lose the text the user has
- already typed in. */
- if (day_view->editing_new_event
- && day_view->editing_event_day == day
- && day_view->editing_event_num == event_num) {
- gtk_object_unref (GTK_OBJECT (event->comp));
- event->comp = comp; /* Takes over ref count. */
- return;
- }
-
-
/* Do this the long way every time for now */
#if 0
if (ical_object_compare_dates (event->ico, ico)) {
@@ -1462,15 +1448,6 @@ e_day_view_update_event_cb (EDayView *day_view,
event->comp = comp;
gtk_object_ref (GTK_OBJECT (comp));
- /* If we are editing an event which we have just created, we will get
- an update_event callback from the server. But we need to ignore it
- or we will lose the text the user has already typed in. */
- if (day_view->editing_new_event
- && day_view->editing_event_day == day
- && day_view->editing_event_num == event_num) {
- return TRUE;
- }
-
if (day == E_DAY_VIEW_LONG_EVENT) {
e_day_view_update_long_event_label (day_view, event_num);
e_day_view_reshape_long_event (day_view, event_num);
@@ -1536,7 +1513,7 @@ e_day_view_remove_event_cb (EDayView *day_view,
{
EDayViewEvent *event;
-#if 1
+#if 0
g_print ("In e_day_view_remove_event_cb day:%i event_num:%i\n",
day, event_num);
#endif
@@ -4432,14 +4409,10 @@ e_day_view_key_press (GtkWidget *widget, GdkEventKey *event)
if (e_day_view_find_event_from_uid (day_view, uid, &day, &event_num)) {
e_day_view_start_editing_event (day_view, day, event_num,
initial_text);
- day_view->editing_new_event = TRUE;
} else {
g_warning ("Couldn't find event to start editing.\n");
}
- if (!cal_client_update_object (day_view->client, comp))
- g_message ("e_day_view_key_press(): Could not update the object!");
-
gtk_object_unref (GTK_OBJECT (comp));
return TRUE;
@@ -4668,9 +4641,9 @@ e_day_view_check_if_new_event_fits (EDayView *day_view)
/* Long events always fit, since we keep adding rows to the top
canvas. */
if (day != day_view->selection_end_day)
- return FALSE;
+ return TRUE;
if (start_row == 0 && end_row == day_view->rows)
- return FALSE;
+ return TRUE;
/* If any of the rows already have E_DAY_VIEW_MAX_COLUMNS columns,
return FALSE. */
@@ -4720,7 +4693,9 @@ e_day_view_start_editing_event (EDayView *day_view,
ETextEventProcessor *event_processor = NULL;
ETextEventProcessorCommand command;
+#if 0
g_print ("In e_day_view_start_editing_event\n");
+#endif
/* If we are already editing the event, just return. */
if (day == day_view->editing_event_day
@@ -4739,8 +4714,6 @@ e_day_view_start_editing_event (EDayView *day_view,
if (!event->canvas_item)
return;
- g_print ("In e_day_view_start_editing_event 2\n");
-
/* We must grab the focus before setting the initial text, since
grabbing the focus will result in a call to
e_day_view_on_editing_started(), which will reset the text to get
@@ -4835,7 +4808,7 @@ e_day_view_on_editing_started (EDayView *day_view,
&day, &event_num))
return;
-#if 1
+#if 0
g_print ("In e_day_view_on_editing_started Day:%i Event:%i\n",
day, event_num);
#endif
@@ -4878,8 +4851,10 @@ e_day_view_on_editing_stopped (EDayView *day_view,
day = day_view->editing_event_day;
event_num = day_view->editing_event_num;
+#if 0
g_print ("In e_day_view_on_editing_stopped Day:%i Event:%i\n",
day, event_num);
+#endif
/* If no item is being edited, just return. */
if (day == -1)
@@ -4901,7 +4876,6 @@ e_day_view_on_editing_stopped (EDayView *day_view,
/* Reset the edit fields. */
day_view->editing_event_day = -1;
day_view->editing_event_num = -1;
- day_view->editing_new_event = FALSE;
day_view->resize_bars_event_day = -1;
day_view->resize_bars_event_num = -1;
diff --git a/calendar/gui/e-day-view.h b/calendar/gui/e-day-view.h
index fda44c1289..09dc3e6f41 100644
--- a/calendar/gui/e-day-view.h
+++ b/calendar/gui/e-day-view.h
@@ -52,11 +52,11 @@ extern "C" {
/* The width of the gap between appointments. This should be at least
E_DAY_VIEW_BAR_WIDTH, since in the top canvas we use this space to draw
the triangle to represent continuing events. */
-#define E_DAY_VIEW_GAP_WIDTH 8
+#define E_DAY_VIEW_GAP_WIDTH 7
/* The width of the bars down the left of each column and appointment.
This includes the borders on each side of it. */
-#define E_DAY_VIEW_BAR_WIDTH 8
+#define E_DAY_VIEW_BAR_WIDTH 7
/* The height of the horizontal bar above & beneath the selected event.
This includes the borders on the top and bottom. */
@@ -349,11 +349,6 @@ struct _EDayView
gint editing_event_day;
gint editing_event_num;
- /* This is TRUE if we are editing an event which we have just created.
- We ignore the "update_event" callback which we will get from the
- server when the event is added. */
- gboolean editing_new_event;
-
/* This is a GnomeCanvasRect which is placed around an item while it
is being resized, so we can raise it above all other EText items. */
GnomeCanvasItem *resize_long_event_rect_item;
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 580941b8bd..33071fa4c9 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -267,7 +267,6 @@ e_week_view_init (EWeekView *week_view)
week_view->pressed_event_num = -1;
week_view->editing_event_num = -1;
- week_view->editing_new_event = FALSE;
week_view->main_gc = NULL;
@@ -873,18 +872,6 @@ obj_updated_cb (CalClient *client, const char *uid, gpointer data)
event = &g_array_index (week_view->events, EWeekViewEvent,
event_num);
- /* If we are editing an event which we have just created, we
- will get an update_event callback from the server. But we
- need to ignore it or we will lose the text the user has
- already typed in. */
- if (week_view->editing_new_event
- && week_view->editing_event_num == event_num) {
- gtk_object_unref (GTK_OBJECT (event->comp));
- event->comp = comp; /* Takes over ref count. */
- return;
- }
-
-
/* Do this the long way every time for now */
#if 0
if (ical_object_compare_dates (event->ico, ico)) {
@@ -1334,14 +1321,6 @@ e_week_view_update_event_cb (EWeekView *week_view,
event->comp = comp;
gtk_object_ref (GTK_OBJECT (comp));
- /* If we are editing an event which we have just created, we will get
- an update_event callback from the server. But we need to ignore it
- or we will lose the text the user has already typed in. */
- if (week_view->editing_new_event
- && week_view->editing_event_num == event_num) {
- return TRUE;
- }
-
for (span_num = 0; span_num < event->num_spans; span_num++) {
span = &g_array_index (week_view->spans, EWeekViewEventSpan,
event->spans_index + span_num);
@@ -1866,7 +1845,6 @@ e_week_view_free_events (EWeekView *week_view)
week_view->editing_event_num = -1;
week_view->editing_span_num = -1;
week_view->popup_event_num = -1;
- week_view->editing_new_event = FALSE;
for (event_num = 0; event_num < week_view->events->len; event_num++) {
event = &g_array_index (week_view->events, EWeekViewEvent,
@@ -2742,7 +2720,6 @@ e_week_view_on_editing_stopped (EWeekView *week_view,
/* Reset the edit fields. */
week_view->editing_event_num = -1;
- week_view->editing_new_event = FALSE;
/* Check that the event is still valid. */
cal_component_get_uid (event->comp, &uid);
@@ -2931,14 +2908,10 @@ e_week_view_key_press (GtkWidget *widget, GdkEventKey *event)
if (e_week_view_find_event_from_uid (week_view, uid, &event_num)) {
e_week_view_start_editing_event (week_view, event_num, 0,
initial_text);
- week_view->editing_new_event = TRUE;
} else {
g_warning ("Couldn't find event to start editing.\n");
}
- if (!cal_client_update_object (week_view->client, comp))
- g_message ("e_week_view_key_press(): Could not update the object!");
-
gtk_object_unref (GTK_OBJECT (comp));
return TRUE;
diff --git a/calendar/gui/e-week-view.h b/calendar/gui/e-week-view.h
index 42a1ced9f7..e4d5ee72db 100644
--- a/calendar/gui/e-week-view.h
+++ b/calendar/gui/e-week-view.h
@@ -298,11 +298,6 @@ struct _EWeekView
gint editing_event_num;
gint editing_span_num;
- /* This is TRUE if we are editing an event which we have just created.
- We ignore the "update_event" callback which we will get from the
- server when the event is added. */
- gboolean editing_new_event;
-
/* The event that the context menu is for. */
gint popup_event_num;