[evolution] EMailAccountStore: Use an appropriate icon for online accounts.



commit e6a149efcee2aa45a4956d1e1da0e8f0b35b4cc7
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Jan 31 17:26:24 2013 -0500

    EMailAccountStore: Use an appropriate icon for online accounts.
    
    Use "goa-panel" for GOA, "credentials-preferences" for UOA.
    
    Also move the icon before the account name.  Looks better.

 mail/e-mail-account-store.c     |    9 +++++++++
 mail/e-mail-account-store.h     |    1 +
 mail/e-mail-account-tree-view.c |   22 ++++++++++++----------
 3 files changed, 22 insertions(+), 10 deletions(-)
---
diff --git a/mail/e-mail-account-store.c b/mail/e-mail-account-store.c
index cb1f4e0..ed635f9 100644
--- a/mail/e-mail-account-store.c
+++ b/mail/e-mail-account-store.c
@@ -978,6 +978,7 @@ e_mail_account_store_init (EMailAccountStore *store)
 	types[ii++] = G_TYPE_BOOLEAN;		/* COLUMN_DEFAULT */
 	types[ii++] = G_TYPE_STRING;		/* COLUMN_BACKEND_NAME */
 	types[ii++] = G_TYPE_STRING;		/* COLUMN_DISPLAY_NAME */
+	types[ii++] = G_TYPE_STRING;		/* COLUMN_ICON_NAME */
 	types[ii++] = G_TYPE_BOOLEAN;		/* COLUMN_ONLINE_ACCOUNT */
 	types[ii++] = G_TYPE_BOOLEAN;		/* COLUMN_ENABLED_VISIBLE */
 
@@ -1110,6 +1111,7 @@ e_mail_account_store_add_service (EMailAccountStore *store,
 	ESource *source;
 	GtkTreeIter iter;
 	const gchar *filename;
+	const gchar *icon_name = NULL;
 	const gchar *uid;
 	gboolean builtin;
 	gboolean enabled;
@@ -1151,6 +1153,9 @@ e_mail_account_store_add_service (EMailAccountStore *store,
 		if (e_source_has_extension (collection, extension_name)) {
 			online_account = TRUE;
 			enabled_visible = FALSE;
+
+			/* Provided by gnome-control-center-data. */
+			icon_name = "goa-panel";
 		}
 
 		/* Check for Ubuntu Online Accounts linkage. */
@@ -1158,6 +1163,9 @@ e_mail_account_store_add_service (EMailAccountStore *store,
 		if (e_source_has_extension (collection, extension_name)) {
 			online_account = TRUE;
 			enabled_visible = FALSE;
+
+			/* Provided by gnome-control-center-signon. */
+			icon_name = "credentials-preferences";
 		}
 
 		g_object_unref (collection);
@@ -1186,6 +1194,7 @@ e_mail_account_store_add_service (EMailAccountStore *store,
 		E_MAIL_ACCOUNT_STORE_COLUMN_SERVICE, service,
 		E_MAIL_ACCOUNT_STORE_COLUMN_BUILTIN, builtin,
 		E_MAIL_ACCOUNT_STORE_COLUMN_ENABLED, enabled,
+		E_MAIL_ACCOUNT_STORE_COLUMN_ICON_NAME, icon_name,
 		E_MAIL_ACCOUNT_STORE_COLUMN_ONLINE_ACCOUNT, online_account,
 		E_MAIL_ACCOUNT_STORE_COLUMN_ENABLED_VISIBLE, enabled_visible,
 		-1);
diff --git a/mail/e-mail-account-store.h b/mail/e-mail-account-store.h
index 5bd696e..59fa54b 100644
--- a/mail/e-mail-account-store.h
+++ b/mail/e-mail-account-store.h
@@ -53,6 +53,7 @@ typedef enum {
 	E_MAIL_ACCOUNT_STORE_COLUMN_DEFAULT,
 	E_MAIL_ACCOUNT_STORE_COLUMN_BACKEND_NAME,
 	E_MAIL_ACCOUNT_STORE_COLUMN_DISPLAY_NAME,
+	E_MAIL_ACCOUNT_STORE_COLUMN_ICON_NAME,
 	E_MAIL_ACCOUNT_STORE_COLUMN_ONLINE_ACCOUNT,
 	E_MAIL_ACCOUNT_STORE_COLUMN_ENABLED_VISIBLE,
 	E_MAIL_ACCOUNT_STORE_NUM_COLUMNS
diff --git a/mail/e-mail-account-tree-view.c b/mail/e-mail-account-tree-view.c
index 424294b..8e36a89 100644
--- a/mail/e-mail-account-tree-view.c
+++ b/mail/e-mail-account-tree-view.c
@@ -108,24 +108,26 @@ mail_account_tree_view_constructed (GObject *object)
 	gtk_tree_view_column_set_expand (column, TRUE);
 	gtk_tree_view_column_set_title (column, _("Account Name"));
 
-	cell_renderer = gtk_cell_renderer_text_new ();
-	g_object_set (cell_renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+	cell_renderer = gtk_cell_renderer_pixbuf_new ();
+	g_object_set (cell_renderer, "stock-size", GTK_ICON_SIZE_MENU, NULL);
 	gtk_tree_view_column_pack_start (column, cell_renderer, FALSE);
 
 	gtk_tree_view_column_add_attribute (
-		column, cell_renderer, "text",
-		E_MAIL_ACCOUNT_STORE_COLUMN_DISPLAY_NAME);
-
-	cell_renderer = gtk_cell_renderer_pixbuf_new ();
-	g_object_set (
-		cell_renderer, "icon-name", "goa-panel",
-		"stock-size", GTK_ICON_SIZE_MENU, NULL);
-	gtk_tree_view_column_pack_start (column, cell_renderer, FALSE);
+		column, cell_renderer, "icon-name",
+		E_MAIL_ACCOUNT_STORE_COLUMN_ICON_NAME);
 
 	gtk_tree_view_column_add_attribute (
 		column, cell_renderer, "visible",
 		E_MAIL_ACCOUNT_STORE_COLUMN_ONLINE_ACCOUNT);
 
+	cell_renderer = gtk_cell_renderer_text_new ();
+	g_object_set (cell_renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+	gtk_tree_view_column_pack_start (column, cell_renderer, FALSE);
+
+	gtk_tree_view_column_add_attribute (
+		column, cell_renderer, "text",
+		E_MAIL_ACCOUNT_STORE_COLUMN_DISPLAY_NAME);
+
 	/* This renderer is just an empty space filler. */
 	cell_renderer = gtk_cell_renderer_pixbuf_new ();
 	gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);



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