diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2009-01-18 04:06:17 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2009-01-18 04:06:17 +0800 |
commit | c22126d54f0cf0637e3d5ddd5d78b3ff5d111582 (patch) | |
tree | 64f296a85dd817e3184159126e8dbde39c173363 /shell/main.c | |
parent | 4d07d219d1f18aeba2c16317ade4b4004d8934b9 (diff) | |
download | gsoc2013-evolution-c22126d54f0cf0637e3d5ddd5d78b3ff5d111582.tar.gz gsoc2013-evolution-c22126d54f0cf0637e3d5ddd5d78b3ff5d111582.tar.zst gsoc2013-evolution-c22126d54f0cf0637e3d5ddd5d78b3ff5d111582.zip |
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
Diffstat (limited to 'shell/main.c')
-rw-r--r-- | shell/main.c | 33 |
1 files changed, 33 insertions, 0 deletions
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 <bonobo-activation/bonobo-activation.h> +#include <libedataserver/e-categories.h> #include <libedataserverui/e-passwords.h> #include <glade/glade.h> @@ -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 ()); |