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



Hi,
This patch is aimed for Head.
There is some different with the patch before.

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	26 May 2004 08:20:25 -0000
@@ -1,3 +1,15 @@
+2004-05-26  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_current_etable_item): Finds the current descendant of the group
+	that is an ETableItem and focuses it.
+	(e_categories_has_save_id): return false 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	26 May 2004 08:20:25 -0000
@@ -732,21 +732,49 @@
 		return categories->priv->category_list[row];
 }
 
+/* Finds the current descendant of the group that is an ETableItem and focuses it */
+static void
+focus_current_etable_item (ETableGroup *group, int row)
+{
+	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_current_etable_item (E_TABLE_GROUP (i), row);
+		else if (E_IS_TABLE_ITEM (i)) {
+			e_table_item_set_cursor (E_TABLE_ITEM (i), 0, row);
+			gnome_canvas_item_grab_focus (i);
+		}
+	}
+}
+
+
 static void
 e_categories_rebuild (ECategories *categories)
 {
 	char **strs;
-	int i, j;
+	int i, j, row;
 	char *string;
 
 	strs = g_new(char *, categories->priv->list_length + 1);
 	for (i = 0, j = 0; i < categories->priv->list_length; i++) {
-		if (categories->priv->selected_list[i])
+		if (categories->priv->selected_list[i]) {
 			strs[j++] = categories->priv->category_list[i];
+			if (i < categories->priv->list_length)
+				row = i;
+		}
 	}
 	strs[j] = 0;
 	string = g_strjoinv(", ", strs);
 	e_utf8_gtk_entry_set_text(GTK_ENTRY(categories->priv->entry), string);
+	focus_current_etable_item (E_TABLE_GROUP(categories->priv->table->group), row);
 	g_free(string);
 	g_free(strs);
 }
@@ -782,7 +810,7 @@
 static gboolean
 e_categories_has_save_id (ETableModel *etc, gpointer data)
 {
-	return TRUE;
+	return FALSE;
 }
 
 static char *


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