aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Rosevear <jpr@novell.com>2004-10-19 23:51:23 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-10-19 23:51:23 +0800
commit7ab239d8f72fd456db372060227c6256a9c8db6d (patch)
tree18ceef27c14ece2bd18fa7e9f4fd94c34603e8da
parent2b5f7894090d1dcc8fa5b0b17e0f26c3114ad164 (diff)
downloadgsoc2013-evolution-7ab239d8f72fd456db372060227c6256a9c8db6d.tar.gz
gsoc2013-evolution-7ab239d8f72fd456db372060227c6256a9c8db6d.tar.zst
gsoc2013-evolution-7ab239d8f72fd456db372060227c6256a9c8db6d.zip
listen to the canvas for focus events (setup_widgets): listen for listen
2004-10-19 JP Rosevear <jpr@novell.com> * gui/gnome-cal.c (connect_list_view_focus): listen to the canvas for focus events (setup_widgets): listen for listen view selection changes * gui/e-cal-list-view.c (setup_e_table): listen for the cursor to move (e_cal_list_view_cursor_change_cb): indicate the selection changed svn path=/trunk/; revision=27623
-rw-r--r--calendar/ChangeLog10
-rw-r--r--calendar/gui/e-cal-list-view.c11
-rw-r--r--calendar/gui/gnome-cal.c10
3 files changed, 29 insertions, 2 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 040625a5b7..eef8c9ac11 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,13 @@
+2004-10-19 JP Rosevear <jpr@novell.com>
+
+ * gui/gnome-cal.c (connect_list_view_focus): listen to the canvas
+ for focus events
+ (setup_widgets): listen for listen view selection changes
+
+ * gui/e-cal-list-view.c (setup_e_table): listen for the cursor to
+ move
+ (e_cal_list_view_cursor_change_cb): indicate the selection changed
+
2004-10-19 Harish Krishnaswamy <kharish@novell.com>
* gui/calendar-component.c (create_new_event):
diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c
index 8e13003b12..2b244fbc41 100644
--- a/calendar/gui/e-cal-list-view.c
+++ b/calendar/gui/e-cal-list-view.c
@@ -86,6 +86,7 @@ static gboolean e_cal_list_view_on_table_double_click (GtkWidget *table, gint
GdkEvent *event, gpointer data);
static gboolean e_cal_list_view_on_table_right_click (GtkWidget *table, gint row, gint col,
GdkEvent *event, gpointer data);
+static void e_cal_list_view_cursor_change_cb (ETable *etable, gint row, gpointer data);
G_DEFINE_TYPE (ECalListView, e_cal_list_view, E_TYPE_CALENDAR_VIEW);
@@ -284,6 +285,8 @@ setup_e_table (ECalListView *cal_list_view)
"double_click", G_CALLBACK (e_cal_list_view_on_table_double_click), cal_list_view);
g_signal_connect (e_table_scrolled_get_table (cal_list_view->table_scrolled),
"right-click", G_CALLBACK (e_cal_list_view_on_table_right_click), cal_list_view);
+ g_signal_connect_after (e_table_scrolled_get_table (cal_list_view->table_scrolled),
+ "cursor_change", G_CALLBACK (e_cal_list_view_cursor_change_cb), cal_list_view);
/* Attach and show widget */
@@ -401,6 +404,14 @@ e_cal_list_view_on_table_right_click (GtkWidget *table, gint row, gint col, GdkE
return TRUE;
}
+static void
+e_cal_list_view_cursor_change_cb (ETable *etable, gint row, gpointer data)
+{
+ ECalListView *cal_list_view = E_CAL_LIST_VIEW (data);
+
+ g_signal_emit_by_name (cal_list_view, "selection_changed");
+}
+
static gboolean
e_cal_list_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time)
{
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 79cdda1ca3..8b51f895a6 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -935,9 +935,13 @@ connect_week_view_focus (GnomeCalendar *gcal, EWeekView *wv)
static void
connect_list_view_focus (GnomeCalendar *gcal, ECalListView *lv)
{
- g_signal_connect (lv, "focus_in_event",
+ ETable *etable;
+
+ etable = e_table_scrolled_get_table (lv->table_scrolled);
+
+ g_signal_connect (etable->table_canvas, "focus_in_event",
G_CALLBACK (calendar_focus_change_cb), gcal);
- g_signal_connect (lv, "focus_out_event",
+ g_signal_connect (etable->table_canvas, "focus_out_event",
G_CALLBACK (calendar_focus_change_cb), gcal);
}
@@ -1318,6 +1322,8 @@ setup_widgets (GnomeCalendar *gcal)
e_calendar_view_set_calendar (E_CALENDAR_VIEW (priv->list_view), gcal);
e_calendar_view_set_timezone (E_CALENDAR_VIEW (priv->list_view), priv->zone);
+ g_signal_connect (priv->list_view, "selection_changed",
+ G_CALLBACK (view_selection_changed_cb), gcal);
connect_list_view_focus (gcal, E_CAL_LIST_VIEW (priv->list_view));