aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/modules/e-task-shell-view-actions.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-01-18 04:06:17 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-01-18 04:06:17 +0800
commitc22126d54f0cf0637e3d5ddd5d78b3ff5d111582 (patch)
tree64f296a85dd817e3184159126e8dbde39c173363 /calendar/modules/e-task-shell-view-actions.c
parent4d07d219d1f18aeba2c16317ade4b4004d8934b9 (diff)
downloadgsoc2013-evolution-c22126d54f0cf0637e3d5ddd5d78b3ff5d111582.tar
gsoc2013-evolution-c22126d54f0cf0637e3d5ddd5d78b3ff5d111582.tar.gz
gsoc2013-evolution-c22126d54f0cf0637e3d5ddd5d78b3ff5d111582.tar.bz2
gsoc2013-evolution-c22126d54f0cf0637e3d5ddd5d78b3ff5d111582.tar.lz
gsoc2013-evolution-c22126d54f0cf0637e3d5ddd5d78b3ff5d111582.tar.xz
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 'calendar/modules/e-task-shell-view-actions.c')
-rw-r--r--calendar/modules/e-task-shell-view-actions.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/calendar/modules/e-task-shell-view-actions.c b/calendar/modules/e-task-shell-view-actions.c
index 21e9d89767..61a1455809 100644
--- a/calendar/modules/e-task-shell-view-actions.c
+++ b/calendar/modules/e-task-shell-view-actions.c
@@ -980,6 +980,7 @@ e_task_shell_view_update_search_filter (ETaskShellView *task_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;
@@ -989,6 +990,24 @@ e_task_shell_view_update_search_filter (ETaskShellView *task_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);