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 --- shell/main.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'shell') diff --git a/shell/main.c b/shell/main.c index 6272b6ad18..6dac5f062b 100644 --- a/shell/main.c +++ b/shell/main.c @@ -57,6 +57,7 @@ #include +#include #include #include @@ -166,6 +167,37 @@ kill_old_dataserver (void) } #endif +static void +categories_icon_theme_hack (void) +{ + GtkIconTheme *icon_theme; + const gchar *category_name; + const gchar *filename; + gchar *dirname; + + /* XXX Allow the category icons to be referenced as named + * icons, since GtkAction does not support GdkPixbufs. */ + + /* Get the icon file for some default category. Doesn't matter + * which, so long as it has an icon. We're just interested in + * the directory components. */ + category_name = _("Birthday"); + filename = e_categories_get_icon_file_for (category_name); + g_return_if_fail (filename != NULL && *filename != '\0'); + + /* Extract the directory components. */ + dirname = g_path_get_dirname (filename); + g_debug ("Category Icon Path: %s", dirname); + + /* Add it to the icon theme's search path. This relies on + * GtkIconTheme's legacy feature of using image files found + * directly in the search path. */ + icon_theme = gtk_icon_theme_get_default (); + gtk_icon_theme_append_search_path (icon_theme, dirname); + + g_free (dirname); +} + #ifdef DEVELOPMENT @@ -650,6 +682,7 @@ main (int argc, char **argv) if (setup_only) exit (0); + categories_icon_theme_hack (); gnome_sound_init ("localhost"); gtk_accel_map_load (e_get_accels_filename ()); -- cgit v1.2.3