aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/dialogs/comp-editor.c17
-rw-r--r--calendar/gui/dialogs/event-page.c56
-rw-r--r--calendar/gui/dialogs/event-page.glade15
-rw-r--r--calendar/gui/e-calendar-view.c6
-rw-r--r--calendar/gui/e-calendar-view.h11
-rw-r--r--calendar/gui/e-day-view.c87
-rw-r--r--calendar/gui/e-timezone-entry.c2
-rw-r--r--calendar/gui/e-week-view.c120
8 files changed, 245 insertions, 69 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 86c8116bdb..290b25afa3 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -1169,6 +1169,22 @@ key_press_event(GtkWidget *widget, GdkEventKey *event)
return FALSE;
}
+static gint
+editor_key_press_event(GtkWidget *widget, GdkEventKey *event, CompEditor *editor)
+{
+ EAttachmentBar *bar = E_ATTACHMENT_BAR (widget);
+
+ if (event->keyval == GDK_Escape) {
+ commit_all_fields (editor);
+
+ if (prompt_to_save_changes (editor, TRUE))
+ close_dialog (editor);
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
/* Menu callbacks */
static void
menu_file_save_cb (BonoboUIComponent *uic,
@@ -1338,6 +1354,7 @@ setup_widgets (CompEditor *editor)
gtk_notebook_set_show_tabs (priv->notebook, FALSE);
g_signal_connect (editor, "delete_event", G_CALLBACK (delete_event_cb), editor);
+ g_signal_connect (editor, "key_press_event", G_CALLBACK (editor_key_press_event), editor);
/*Attachments */
priv->attachment_scrolled_window = gtk_scrolled_window_new (NULL, NULL);
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index b4aaa77930..f58fc61829 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -45,6 +45,7 @@
#include "../e-timezone-entry.h"
#include <e-util/e-dialog-utils.h>
#include <e-util/e-dialog-widgets.h>
+#include <e-util/e-icon-factory.h>
#include <e-util/e-util-private.h>
#include "../e-meeting-attendee.h"
@@ -64,7 +65,6 @@
struct _EventPagePrivate {
/* Glade XML data */
GladeXML *xml;
-
/* Widgets from the Glade file */
GtkWidget *main;
@@ -98,6 +98,9 @@ struct _EventPagePrivate {
GtkWidget *end_timezone;
GtkWidget *timezone_label;
gboolean all_day_event;
+ GtkWidget *status_icons;
+ GtkWidget *alarm_icon;
+ GtkWidget *recur_icon;
GtkWidget *description;
@@ -214,6 +217,9 @@ event_page_init (EventPage *epage)
priv->end_timezone = NULL;
priv->timezone_label = NULL;
priv->all_day_event = FALSE;
+ priv->status_icons = NULL;
+ priv->alarm_icon = NULL;
+ priv->recur_icon = NULL;
priv->description = NULL;
priv->classification = E_CAL_COMPONENT_CLASS_NONE;
priv->show_time_as_busy = FALSE;
@@ -752,6 +758,23 @@ event_page_set_classification (EventPage *epage, ECalComponentClassification cla
epage->priv->classification = class;
}
+static GtkWidget *
+create_image_event_box (const char *image_text, const char *tip_text)
+{
+ GtkWidget *image, *box;
+ GtkTooltips *tip;
+
+ box = gtk_event_box_new ();
+ tip = gtk_tooltips_new ();
+ image = e_icon_factory_get_image (image_text, E_ICON_SIZE_MENU);
+
+ gtk_container_add ((GtkContainer *) box, image);
+ gtk_widget_show_all (box);
+ gtk_tooltips_set_tip (tip, box, tip_text, NULL);
+
+ return box;
+}
+
static void
sensitize_widgets (EventPage *epage)
{
@@ -772,6 +795,11 @@ sensitize_widgets (EventPage *epage)
custom = is_custom_alarm_store (priv->alarm_list_store, priv->old_summary, priv->alarm_units, priv->alarm_interval, NULL);
alarm = e_dialog_toggle_get (priv->alarm);
+
+ if (alarm && !priv->alarm_icon) {
+ priv->alarm_icon = create_image_event_box ("stock_bell", "This event has alarms");
+ gtk_box_pack_start ((GtkBox *)priv->status_icons, priv->alarm_icon, FALSE, FALSE, 3);
+ }
gtk_entry_set_editable (GTK_ENTRY (priv->summary), sensitize);
gtk_entry_set_editable (GTK_ENTRY (priv->location), sensitize);
@@ -2027,6 +2055,9 @@ get_widgets (EventPage *epage)
priv->timezone_label = GW ("timezone-label");
priv->start_timezone = GW ("start-timezone");
priv->end_timezone = priv->start_timezone;
+ priv->status_icons = GW ("status-icons");
+
+ gtk_widget_show (priv->status_icons);
if (!calendar_config_get_show_timezone()) {
gtk_widget_hide (priv->timezone_label);
@@ -2502,8 +2533,17 @@ alarm_changed_cb (GtkWidget *widget, gpointer data)
icalcomponent_add_property (icalcomp, icalprop);
e_alarm_list_append (priv->alarm_list_store, NULL, ca);
+
+ if (!priv->alarm_icon) {
+ priv->alarm_icon = create_image_event_box ("stock_bell", "This event has alarms");
+ gtk_box_pack_start ((GtkBox *)priv->status_icons, priv->alarm_icon, FALSE, FALSE, 3);
+ }
} else {
e_alarm_list_clear (priv->alarm_list_store);
+ if (priv->alarm_icon) {
+ gtk_container_remove (priv->status_icons, priv->alarm_icon);
+ priv->alarm_icon = NULL;
+ }
}
sensitize_widgets (epage);
@@ -2692,8 +2732,10 @@ init_widgets (EventPage *epage)
}
g_signal_connect (priv->alarm,
- "toggled", G_CALLBACK (alarm_changed_cb),
+ "toggled", G_CALLBACK (field_changed_cb),
epage);
+ g_signal_connect (priv->alarm_time, "changed",
+ G_CALLBACK (field_changed_cb), epage);
g_signal_connect (priv->alarm_custom, "clicked",
G_CALLBACK (alarm_custom_clicked_cb), epage);
@@ -2715,8 +2757,6 @@ init_widgets (EventPage *epage)
g_signal_connect (priv->alarm,
"toggled", G_CALLBACK (alarm_changed_cb),
epage);
- g_signal_connect (priv->alarm_custom, "clicked",
- G_CALLBACK (alarm_custom_clicked_cb), epage);
/* Set the default timezone, so the timezone entry may be hidden. */
zone = calendar_config_get_icaltimezone ();
@@ -2889,6 +2929,14 @@ event_page_create_source_option_menu (void)
return menu;
}
+GtkWidget *make_status_icons (void);
+
+GtkWidget *
+make_status_icons (void)
+{
+ return gtk_hbox_new (FALSE, 2);
+}
+
static void
set_attendees (ECalComponent *comp, const GPtrArray *attendees)
{
diff --git a/calendar/gui/dialogs/event-page.glade b/calendar/gui/dialogs/event-page.glade
index c86b8b5890..e55bfedbb8 100644
--- a/calendar/gui/dialogs/event-page.glade
+++ b/calendar/gui/dialogs/event-page.glade
@@ -689,6 +689,21 @@
<property name="fill">True</property>
</packing>
</child>
+
+ <child>
+ <widget class="Custom" id="status-icons">
+ <property name="visible">True</property>
+ <property name="creation_function">make_status_icons</property>
+ <property name="int1">0</property>
+ <property name="int2">0</property>
+ <property name="last_modification_time">Thu, 24 Nov 2005 07:10:06 GMT</property>
+ </widget>
+ <packing>
+ <property name="padding">4</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="padding">0</property>
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index e137fd079c..0fae38bdf9 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -1903,7 +1903,7 @@ get_label (struct icaltimetype *tt)
gboolean
-e_calendar_view_get_tooltips (ECalendarViewEvent *pevent)
+e_calendar_view_get_tooltips (ECalendarViewEventData *data)
{
GtkWidget *label, *box, *hbox, *ebox, *frame;
const char *str;
@@ -1912,7 +1912,11 @@ e_calendar_view_get_tooltips (ECalendarViewEvent *pevent)
ECalComponentDateTime dtstart, dtend;
icalcomponent *clone_comp;
time_t t_start, t_end;
+ ECalendarViewEvent *pevent;
+ pevent = data->get_view_event (data->cal_view, data->day, data->event_num);
+ g_free (data);
+
ECalComponent *newcomp = e_cal_component_new ();
icaltimezone *zone;
GdkColor color, outer_color;
diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h
index 8e2d67c477..bbf95da71e 100644
--- a/calendar/gui/e-calendar-view.h
+++ b/calendar/gui/e-calendar-view.h
@@ -75,7 +75,7 @@ typedef enum {
typedef struct {
E_CALENDAR_VIEW_EVENT_FIELDS
} ECalendarViewEvent;
-
+
typedef struct _ECalendarView ECalendarView;
typedef struct _ECalendarViewClass ECalendarViewClass;
typedef struct _ECalendarViewPrivate ECalendarViewPrivate;
@@ -85,6 +85,13 @@ struct _ECalendarView {
ECalendarViewPrivate *priv;
};
+typedef struct {
+ ECalendarViewEvent * (* get_view_event) (ECalendarView *view, int day, int event_num);
+ ECalendarView *cal_view;
+ int day;
+ int event_num;
+} ECalendarViewEventData;
+
struct _ECalendarViewClass {
GtkTableClass parent_class;
@@ -158,7 +165,7 @@ void e_calendar_view_modify_and_send (ECalComponent *comp,
GtkWindow *toplevel,
gboolean new);
-gboolean e_calendar_view_get_tooltips (ECalendarViewEvent *pevent);
+gboolean e_calendar_view_get_tooltips (ECalendarViewEventData *data);
G_END_DECLS
#endif
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 1c655ad7f2..6720b08143 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -4466,9 +4466,10 @@ e_day_view_reshape_long_event (EDayView *day_view,
"fill_color_gdk", &widget->style->text[GTK_STATE_NORMAL],
"im_context", E_CANVAS (day_view->top_canvas)->im_context,
NULL);
+ g_object_set_data (event->canvas_item, "event-num", GINT_TO_POINTER (event_num));
+ g_object_set_data (event->canvas_item, "event-day", GINT_TO_POINTER (E_DAY_VIEW_LONG_EVENT));
g_signal_connect (event->canvas_item, "event",
G_CALLBACK (e_day_view_on_text_item_event), day_view);
- g_object_set_data ((GObject *)event->canvas_item, "event", (gpointer)event);
g_signal_emit_by_name (G_OBJECT(day_view),
"event_added", event);
@@ -4648,9 +4649,10 @@ e_day_view_reshape_day_event (EDayView *day_view,
"fill_color_gdk", &widget->style->text[GTK_STATE_NORMAL],
"im_context", E_CANVAS (day_view->main_canvas)->im_context,
NULL);
+ g_object_set_data (event->canvas_item, "event-num", GINT_TO_POINTER (event_num));
+ g_object_set_data (event->canvas_item, "event-day", GINT_TO_POINTER (day));
g_signal_connect (event->canvas_item, "event",
G_CALLBACK (e_day_view_on_text_item_event), day_view);
- g_object_set_data ((GObject *)event->canvas_item, "event", (gpointer)event);
g_signal_emit_by_name (G_OBJECT(day_view),
"event_added", event);
@@ -5770,6 +5772,44 @@ cancel_editing (EDayView *day_view)
e_day_view_stop_editing_event (day_view);
}
+static EDayViewEvent *
+tooltip_get_view_event (EDayView *day_view, int day, int event_num)
+{
+ EDayViewEvent *pevent;
+
+
+ if (day == E_DAY_VIEW_LONG_EVENT) {
+ pevent = &g_array_index (day_view->long_events, EDayViewEvent,
+ event_num);
+ } else {
+ pevent = &g_array_index (day_view->events[day], EDayViewEvent,
+ event_num);
+ }
+
+ return pevent;
+}
+
+static void
+tooltip_destroy (EDayView *day_view, GnomeCanvasItem *item)
+{
+ int day = GPOINTER_TO_INT (g_object_get_data (item, "event-day"));
+ int event_num = GPOINTER_TO_INT (g_object_get_data (item, "event-num"));
+ EDayViewEvent *pevent;
+
+ pevent = tooltip_get_view_event (day_view, day, event_num);
+ if (pevent) {
+ if (pevent->tooltip) {
+ gtk_widget_destroy (pevent->tooltip);
+ pevent->tooltip = NULL;
+ }
+
+ if (pevent->timeout != -1) {
+ g_source_remove (pevent->timeout);
+ pevent->timeout = -1;
+ }
+ }
+}
+
static gboolean
e_day_view_on_text_item_event (GnomeCanvasItem *item,
GdkEvent *event,
@@ -5777,8 +5817,10 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item,
{
switch (event->type) {
case GDK_KEY_PRESS:
+ tooltip_destroy (day_view, item);
if (event && event->key.keyval == GDK_Return) {
day_view->resize_event_num = -1;
+ day_view->resize_event_num = -1;
/* We set the keyboard focus to the EDayView, so the
EText item loses it and stops the edit. */
@@ -5817,6 +5859,7 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item,
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
+ tooltip_destroy (day_view, item);
/* Only let the EText handle the event while editing. */
if (!E_TEXT (item)->editing)
gtk_signal_emit_stop_by_name (GTK_OBJECT (item),
@@ -5831,35 +5874,37 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item,
return FALSE;
case GDK_ENTER_NOTIFY:
{
- EDayViewEvent *pevent = (EDayViewEvent *)g_object_get_data ((GObject *)item, "event");
+ int day = GPOINTER_TO_INT (g_object_get_data (item, "event-day"));
+ int event_num = GPOINTER_TO_INT (g_object_get_data (item, "event-num"));
+ EDayViewEvent *pevent;
+ ECalendarViewEventData *data;
+ pevent = tooltip_get_view_event (day_view, day, event_num);
+
+ data = g_malloc (sizeof (ECalendarViewEventData));
pevent->x = ((GdkEventCrossing *)event)->x_root;
pevent->y = ((GdkEventCrossing *)event)->y_root;
- pevent->tooltip = NULL;
- pevent->timeout = g_timeout_add (500, (GSourceFunc)e_calendar_view_get_tooltips, pevent);
+ pevent->tooltip = NULL;
+
+ data->cal_view = day_view;
+ data->day = day;
+ data->event_num = event_num;
+ data->get_view_event = tooltip_get_view_event;
+ pevent->timeout = g_timeout_add (500, (GSourceFunc)e_calendar_view_get_tooltips, data);
return TRUE;
}
case GDK_LEAVE_NOTIFY:
- {
- EDayViewEvent *pevent = (EDayViewEvent *)g_object_get_data ((GObject *)item, "event");
-
- if (pevent && pevent->tooltip) {
- gtk_widget_destroy (pevent->tooltip);
- pevent->tooltip = NULL;
- }
-
- if (pevent && pevent->timeout != -1) {
- g_source_remove (pevent->timeout);
- pevent->timeout = -1;
- }
-
+ tooltip_destroy (day_view, item);
return TRUE;
- }
case GDK_MOTION_NOTIFY:
{
- EDayViewEvent *pevent = (EDayViewEvent *)g_object_get_data ((GObject *)item, "event");
-
+ int day = GPOINTER_TO_INT (g_object_get_data (item, "event-day"));
+ int event_num = GPOINTER_TO_INT (g_object_get_data (item, "event-num"));
+ EDayViewEvent *pevent;
+
+ pevent = tooltip_get_view_event (day_view, day, event_num);
+
pevent->x = ((GdkEventMotion *)event)->x_root;
pevent->y = ((GdkEventMotion *)event)->y_root;
diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c
index 4004ae2cb8..56ac16901d 100644
--- a/calendar/gui/e-timezone-entry.c
+++ b/calendar/gui/e-timezone-entry.c
@@ -120,7 +120,7 @@ e_timezone_entry_init (ETimezoneEntry *tentry)
priv->entry = gtk_entry_new ();
gtk_entry_set_editable (GTK_ENTRY (priv->entry), FALSE);
/*gtk_widget_set_usize (priv->date_entry, 90, 0);*/
- gtk_box_pack_start (GTK_BOX (tentry), priv->entry, TRUE, TRUE, 6);
+ gtk_box_pack_start (GTK_BOX (tentry), priv->entry, TRUE, TRUE, 0);
gtk_widget_show (priv->entry);
g_signal_connect (priv->entry, "changed", G_CALLBACK (on_entry_changed), tentry);
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index d6a0aba123..8bb548bed6 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -2549,35 +2549,65 @@ e_week_view_reshape_events (EWeekView *week_view)
}
}
+static EWeekViewEvent *
+tooltip_get_view_event (EWeekView *week_view, int day, int event_num)
+{
+ EWeekViewEvent *pevent;
+
+ pevent = &g_array_index (week_view->events, EWeekViewEvent, event_num);
+
+ return pevent;
+}
+
+static void
+tooltip_destroy (EWeekView *week_view, GnomeCanvasItem *item)
+{
+ int event_num = GPOINTER_TO_INT (g_object_get_data (item, "event-num"));
+ EWeekViewEvent *pevent;
+
+ pevent = tooltip_get_view_event (week_view, -1, event_num);
+ if (pevent) {
+ if (pevent->tooltip) {
+ gtk_widget_destroy (pevent->tooltip);
+ pevent->tooltip = NULL;
+ }
+
+ if (pevent->timeout != -1) {
+ g_source_remove (pevent->timeout);
+ pevent->timeout = -1;
+ }
+ }
+}
static gboolean
tooltip_event_cb (GnomeCanvasItem *item,
GdkEvent *event,
EWeekView *view)
{
- EWeekViewEvent *pevent = g_object_get_data ((GObject *)item, "event");
+ int event_num = GPOINTER_TO_INT (g_object_get_data (item, "event-num"));
+ EWeekViewEvent *pevent;
+
+ pevent = tooltip_get_view_event (view, -1, event_num);
switch (event->type) {
case GDK_ENTER_NOTIFY:
+ {
+ ECalendarViewEventData *data;
+
+ data = g_malloc (sizeof (ECalendarViewEventData));
pevent->x = ((GdkEventCrossing *)event)->x_root;
pevent->y = ((GdkEventCrossing *)event)->y_root;
pevent->tooltip = NULL;
- pevent->timeout = g_timeout_add (500, (GSourceFunc)e_calendar_view_get_tooltips, pevent);
-
- return TRUE;
-
- case GDK_LEAVE_NOTIFY:
- if (pevent && pevent->tooltip) {
- gtk_widget_destroy (pevent->tooltip);
- pevent->tooltip = NULL;
- }
- if (pevent && pevent->timeout != -1) {
- g_source_remove (pevent->timeout);
- pevent->timeout = -1;
- }
- return TRUE;
+ data->cal_view = view;
+ data->day = -1;
+ data->event_num = event_num;
+ data->get_view_event = tooltip_get_view_event;
+ pevent->timeout = g_timeout_add (500, (GSourceFunc)e_calendar_view_get_tooltips, data);
+
+ return TRUE;
+ }
case GDK_MOTION_NOTIFY:
pevent->x = ((GdkEventMotion *)event)->x_root;
pevent->y = ((GdkEventMotion *)event)->y_root;
@@ -2587,6 +2617,10 @@ tooltip_event_cb (GnomeCanvasItem *item,
}
return TRUE;
+ case GDK_LEAVE_NOTIFY:
+ case GDK_KEY_PRESS:
+ case GDK_BUTTON_PRESS:
+ tooltip_destroy (view, item);
default:
return FALSE;
}
@@ -2992,7 +3026,10 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item,
{
EWeekViewEvent *event;
gint event_num, span_num;
- EWeekViewEvent *pevent = g_object_get_data ((GObject *)item, "event");
+ int nevent = GPOINTER_TO_INT (g_object_get_data (item, "event-num"));
+ EWeekViewEvent *pevent;
+
+ pevent = tooltip_get_view_event (week_view, -1, nevent);
#if 0
g_print ("In e_week_view_on_text_item_event\n");
@@ -3000,6 +3037,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item,
switch (gdkevent->type) {
case GDK_KEY_PRESS:
+ tooltip_destroy (week_view, item);
if (gdkevent && gdkevent->key.keyval == GDK_Return) {
/* We set the keyboard focus to the EDayView, so the
EText item loses it and stops the edit. */
@@ -3033,6 +3071,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item,
gtk_signal_emit_stop_by_name (GTK_OBJECT (item), "event");
return TRUE;
case GDK_BUTTON_PRESS:
+ tooltip_destroy (week_view, item);
if (!e_week_view_find_event_from_item (week_view, item,
&event_num, &span_num))
return FALSE;
@@ -3108,35 +3147,36 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item,
}
week_view->pressed_event_num = -1;
break;
- case GDK_ENTER_NOTIFY:
+ case GDK_ENTER_NOTIFY:
+ {
+ ECalendarViewEventData *data;
- pevent->x = ((GdkEventCrossing *)gdkevent)->x_root;
- pevent->y = ((GdkEventCrossing *)gdkevent)->y_root;
- pevent->tooltip = NULL;
- pevent->timeout = g_timeout_add (500, (GSourceFunc)e_calendar_view_get_tooltips, pevent);
+ data = g_malloc (sizeof (ECalendarViewEventData));
- return TRUE;
+ pevent->x = ((GdkEventCrossing *)gdkevent)->x_root;
+ pevent->y = ((GdkEventCrossing *)gdkevent)->y_root;
+ pevent->tooltip = NULL;
+
+ data->cal_view = week_view;
+ data->day = -1;
+ data->event_num = event_num;
+ data->get_view_event = tooltip_get_view_event;
+ pevent->timeout = g_timeout_add (500, (GSourceFunc)e_calendar_view_get_tooltips, data);
+
+ return TRUE;
+ }
+ case GDK_LEAVE_NOTIFY:
+ tooltip_destroy (week_view, item);
- case GDK_LEAVE_NOTIFY:
- if (pevent && pevent->tooltip) {
- gtk_widget_destroy (pevent->tooltip);
- pevent->tooltip = NULL;
- }
-
- if (pevent && pevent->timeout != -1) {
- g_source_remove (pevent->timeout);
- pevent->timeout = -1;
- }
- return TRUE;
- case GDK_MOTION_NOTIFY:
- pevent->x = ((GdkEventMotion *)gdkevent)->x_root;
- pevent->y = ((GdkEventMotion *)gdkevent)->y_root;
+ return FALSE;
+ case GDK_MOTION_NOTIFY:
+ pevent->x = ((GdkEventMotion *)gdkevent)->x_root;
+ pevent->y = ((GdkEventMotion *)gdkevent)->y_root;
- if (pevent->tooltip) {
- gtk_window_move ((GtkWindow *)pevent->tooltip, ((int)((GdkEventMotion *)gdkevent)->x_root)+16, ((int)((GdkEventMotion *)gdkevent)->y_root) +16);
- }
+ if (pevent->tooltip)
+ gtk_window_move ((GtkWindow *)pevent->tooltip, ((int)((GdkEventMotion *)gdkevent)->x_root)+16, ((int)((GdkEventMotion *)gdkevent)->y_root) +16);
- return TRUE;
+ return TRUE;
case GDK_FOCUS_CHANGE:
if (gdkevent->focus_change.in) {
e_week_view_on_editing_started (week_view, item);