From c22126d54f0cf0637e3d5ddd5d78b3ff5d111582 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 17 Jan 2009 20:06:17 +0000 Subject: Hack GtkIconTheme so we can reference category icons as named icons. Necessary for EActionComboBox, since GtkActions can only handle named or stock icons. Hopefully this is just a temporary hack. Eventually we should make the category icons themeable. Kill the "mail-account-disable" plugin and integrate it properly. More dead plugins to follow... Don't show disabled menu items in pop-up context menus. It does the user no good to see things he CAN'T do with the object he clicked on. svn path=/branches/kill-bonobo/; revision=37093 --- addressbook/gui/component/e-book-shell-view-actions.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'addressbook/gui') diff --git a/addressbook/gui/component/e-book-shell-view-actions.c b/addressbook/gui/component/e-book-shell-view-actions.c index fc9e6b99db..ce044d08f1 100644 --- a/addressbook/gui/component/e-book-shell-view-actions.c +++ b/addressbook/gui/component/e-book-shell-view-actions.c @@ -884,6 +884,7 @@ e_book_shell_view_update_search_filter (EBookShellView *book_shell_view) list = e_categories_get_list (); for (iter = list, ii = 0; iter != NULL; iter = iter->next, ii++) { const gchar *category_name = iter->data; + const gchar *filename; GtkAction *action; gchar *action_name; @@ -893,6 +894,24 @@ e_book_shell_view_update_search_filter (EBookShellView *book_shell_view) action_name, category_name, NULL, NULL, ii); g_free (action_name); + /* Convert the category icon file to a themed icon name. */ + filename = e_categories_get_icon_file_for (category_name); + if (filename != NULL && *filename != '\0') { + gchar *basename; + gchar *cp; + + basename = g_path_get_basename (filename); + + /* Lose the file extension. */ + if ((cp = strrchr (basename, '.')) != NULL) + *cp = '\0'; + + g_object_set ( + radio_action, "icon-name", basename, NULL); + + g_free (basename); + } + gtk_radio_action_set_group (radio_action, group); group = gtk_radio_action_get_group (radio_action); -- cgit