[evolution-patches] Gal patch to fix #41830 (summary: Keyboard: Can only select two categories with keyboard.)



Hi,
This patch is aimed for Head.

Fix the Bug #41830 on http://bugzilla.ximian.com.
(summary: Keyboard: Can only select two categories with keyboard.)

Would you like to spend a little time to review it, please?

Best regards
hao.sheng

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gal/ChangeLog,v
retrieving revision 1.869
diff -u -r1.869 ChangeLog
--- ChangeLog	19 May 2004 16:59:04 -0000	1.869
+++ ChangeLog	23 May 2004 05:23:45 -0000
@@ -1,3 +1,15 @@
+2004-05-23  Hao Sheng  <hao sheng sun com>
+
+	Fixes #41830 
+
+	* gal/widgets/e-categories.c:
+	(e_categories_rebuild): grab the focus on the cell of the Etable
+	again after rebuilt the e-categories.
+	(focus_first_etable_item): Finds the first descendant of the group
+	that is an ETableItem and focuses it.
+	(e_categories_has_save_id): return null and make the Etable widget
+	can't be focused.
+
 2004-05-19  JP Rosevear  <jpr novell com>
 
 	* configure.in: bump version
Index: gal/widgets/e-categories.c
===================================================================
RCS file: /cvs/gnome/gal/gal/widgets/e-categories.c,v
retrieving revision 1.34
diff -u -r1.34 e-categories.c
--- gal/widgets/e-categories.c	28 Apr 2004 20:18:34 -0000	1.34
+++ gal/widgets/e-categories.c	23 May 2004 05:23:45 -0000
@@ -732,6 +732,30 @@
 		return categories->priv->category_list[row];
 }
 
+/* Finds the first descendant of the group that is an ETableItem and focuses it */
+static void
+focus_first_etable_item (ETableGroup *group)
+{
+	GnomeCanvasGroup *cgroup;
+	GList *l;
+	
+	cgroup = GNOME_CANVAS_GROUP (group);
+	
+	for (l = cgroup->item_list; l; l = l->next) {
+		GnomeCanvasItem *i;
+
+		i = GNOME_CANVAS_ITEM (l->data);
+		
+		if (E_IS_TABLE_GROUP (i))
+			focus_first_etable_item (E_TABLE_GROUP (i));
+		else if (E_IS_TABLE_ITEM (i)) {
+			e_table_item_set_cursor (E_TABLE_ITEM (i), 0, 0);
+			gnome_canvas_item_grab_focus (i);
+		}
+	}
+}
+
+
 static void
 e_categories_rebuild (ECategories *categories)
 {
@@ -747,6 +771,7 @@
 	strs[j] = 0;
 	string = g_strjoinv(", ", strs);
 	e_utf8_gtk_entry_set_text(GTK_ENTRY(categories->priv->entry), string);
+	focus_first_etable_item (E_TABLE_GROUP(categories->priv->table->group));
 	g_free(string);
 	g_free(strs);
 }
@@ -782,7 +807,7 @@
 static gboolean
 e_categories_has_save_id (ETableModel *etc, gpointer data)
 {
-	return TRUE;
+	return NULL;
 }
 
 static char *



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