[evolution-patches] Menu Context for Calendar List View



As per NotZed's complaints.  This took a while to sort out, I'll commit
this to head right now, but this should probably go into 2.0 as well.

-JP
-- 
JP Rosevear <jpr novell com>
Novell, Inc.
? focus.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gal/gal/e-table/ChangeLog,v
retrieving revision 1.939
diff -u -r1.939 ChangeLog
--- ChangeLog	12 Aug 2004 05:10:42 -0000	1.939
+++ ChangeLog	19 Oct 2004 15:37:37 -0000
@@ -1,3 +1,8 @@
+2004-10-19  JP Rosevear  <jpr novell com>
+
+	* e-table.c (table_canvas_focus_event_cb): return FALSE so we
+	don't kill the focus event chain
+
 2004-08-09  Not Zed  <NotZed Ximian com>
 
 	* e-cell-combo.c (e_cell_combo_get_popup_pos): include scrollbar
Index: e-table.c
===================================================================
RCS file: /cvs/gnome/gal/gal/e-table/e-table.c,v
retrieving revision 1.228
diff -u -r1.228 e-table.c
--- e-table.c	2 Dec 2003 07:55:14 -0000	1.228
+++ e-table.c	19 Oct 2004 15:37:37 -0000
@@ -1101,7 +1101,7 @@
 table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data)
 {
 	GnomeCanvas *canvas;
-	ECanvas *ecanvas;
+	ECanvas *ecanvas; 
 	ETable *etable;
 
 	gtk_widget_queue_draw (widget);
@@ -1110,7 +1110,7 @@
 
 	if (!event->in) {
 		gtk_im_context_focus_out(ecanvas->im_context);
-		return TRUE;
+		return FALSE;
 	} else {
 		gtk_im_context_focus_in(ecanvas->im_context);
 	}
@@ -1120,7 +1120,7 @@
 	if (!canvas->focused_item && etable->group)
 		focus_first_etable_item (etable->group);
 
-	return TRUE;
+	return FALSE;
 }
 
 static void
? context.patch
? gui/apps_evolution_calendar-2.2.schemas
? gui/menu.patch
? gui/non-cursor.patch
? gui/temp.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2547
diff -u -r1.2547 ChangeLog
--- ChangeLog	19 Oct 2004 03:51:00 -0000	1.2547
+++ ChangeLog	19 Oct 2004 15:45:36 -0000
@@ -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):
Index: gui/e-cal-list-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-list-view.c,v
retrieving revision 1.12
diff -u -r1.12 e-cal-list-view.c
--- gui/e-cal-list-view.c	14 Oct 2004 15:22:32 -0000	1.12
+++ gui/e-cal-list-view.c	19 Oct 2004 15:45:36 -0000
@@ -86,6 +86,7 @@
 							 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 @@
 			  "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 */
 
@@ -399,6 +402,14 @@
 
 	e_cal_list_view_show_popup_menu (cal_list_view, row, event);
 	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
Index: gui/gnome-cal.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/gnome-cal.c,v
retrieving revision 1.354
diff -u -r1.354 gnome-cal.c
--- gui/gnome-cal.c	18 Oct 2004 04:08:47 -0000	1.354
+++ gui/gnome-cal.c	19 Oct 2004 15:45:36 -0000
@@ -935,9 +935,13 @@
 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 @@
 
 	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));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]