[evolution-patches] Patch for adding the name of the minicard view[a11y-addressbook]



Hi,
    I have attached the patch for bug #319308.         
    http://bugzilla.gnome.org/show_bug.cgi?id=319308
    Evolution | Contacts [was: Addressbook] | Ver: 2.4.x

    I have completed it with adding some code to the function
'ea_minicard_view_get_name'. New name of minicard view is
something like this "current addrssbook folder [folder name] has n
cards". The name is bracketed by square brackets, which makes it easy to
extract the folder name from the string.

Boby.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/a11y/ChangeLog,v
retrieving revision 1.43.2.1
diff -u -r1.43.2.1 ChangeLog
--- ChangeLog	28 Sep 2005 02:49:48 -0000	1.43.2.1
+++ ChangeLog	7 Dec 2005 09:33:26 -0000
@@ -1,3 +1,10 @@
+2005-12-07 Boby Wang <boby wang sun com> 
+
+	Fix for #319308
+
+	* addressbook/ea-minicard-view.c: (ea_minicard_view_get_name):
+	add the folder name to the name of current minicard view
+
 2005-09-27  Harry Lu <harry lu sun com>
 
 	Fix for #316351
Index: addressbook/ea-minicard-view.c
===================================================================
RCS file: /cvs/gnome/evolution/a11y/addressbook/ea-minicard-view.c,v
retrieving revision 1.6
diff -u -r1.6 ea-minicard-view.c
--- addressbook/ea-minicard-view.c	7 Apr 2005 07:42:28 -0000	1.6
+++ addressbook/ea-minicard-view.c	7 Dec 2005 09:33:26 -0000
@@ -141,18 +141,27 @@
 {
 	EReflow *reflow;
 	gchar *string;
-	
+	EMinicardView *card_view;
+	EBook *book = NULL;
+	const gchar *source_name;
+
 	g_return_val_if_fail (EA_IS_MINICARD_VIEW (accessible), NULL);
 
 	reflow = E_REFLOW(atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)));
 
 	if (!reflow)
 		return NULL;
-
-	string = g_strdup_printf (ngettext ("current addressbook folder has %d card", 
-				   "current addressbook folder has %d cards", 
-				   reflow->count), reflow->count);
 	
+/* Get the current name of minicard view*/
+	card_view = E_MINICARD_VIEW (reflow);
+	g_object_get (card_view->adapter, "book", &book, NULL);
+	source_name = e_source_peek_name (e_book_get_source (book));
+	if (!source_name)
+		source_name="";
+
+	string = g_strdup_printf (ngettext ("current address book folder [%s] has %d card",
+	                          "current address book folder [%s] has %d cards",
+	                          reflow->count), source_name, reflow->count);
 
 	ATK_OBJECT_CLASS (parent_class)->set_name (accessible, string);
 	g_free (string);


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