diff options
author | Not Zed <NotZed@Ximian.com> | 2004-05-19 11:50:52 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-05-19 11:50:52 +0800 |
commit | e4b42c5e6cfdc6fd2f9245fa61fd4e1f7b2038f6 (patch) | |
tree | 232bd7b2597f15959d8a2f0afcbf527e8d9f4107 /shell/e-component-registry.c | |
parent | c0a0310607f8e6de8422e53fbcd6c28a85f2e27f (diff) | |
download | gsoc2013-evolution-e4b42c5e6cfdc6fd2f9245fa61fd4e1f7b2038f6.tar.gz gsoc2013-evolution-e4b42c5e6cfdc6fd2f9245fa61fd4e1f7b2038f6.tar.zst gsoc2013-evolution-e4b42c5e6cfdc6fd2f9245fa61fd4e1f7b2038f6.zip |
use the menu icon not the button icon for the menus. (setup_widgets):
2004-05-19 Not Zed <NotZed@Ximian.com>
* e-shell-window.c (setup_widgets): use the menu icon not the
button icon for the menus.
(setup_widgets): fixed some i18n stuff with the menu xml. no use
putting _x stuff here, it also needs a source. And a memleak.
Yucko.
* e-component-registry.c (component_info_new): take menu icon.
(query_components): setup the menu icon, not a large toolbar sized
icon.
* e-shell-window.c (menu_component_selected): just use '-' as
ascii, its always going to be hte same in utf8. simplifies the
code somewhat.
2004-05-05 William Jon McCann <mccann@jhu.edu>
* e-shell-window.c (menu_component_selected, setup_widgets):
Add components to View menu.
* e-component-registry.[ch] (component_info_new)
(component_info_free, query_components): Add menu_label and
menu_accelerator fields.
svn path=/trunk/; revision=25972
Diffstat (limited to 'shell/e-component-registry.c')
-rw-r--r-- | shell/e-component-registry.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c index f53768983e..e023872257 100644 --- a/shell/e-component-registry.c +++ b/shell/e-component-registry.c @@ -54,20 +54,29 @@ static EComponentInfo * component_info_new (const char *id, const char *alias, const char *button_label, + const char *menu_label, + const char *menu_accelerator, int sort_order, - GdkPixbuf *button_icon) + GdkPixbuf *button_icon, + GdkPixbuf *menu_icon) { EComponentInfo *info = g_new0 (EComponentInfo, 1); info->id = g_strdup (id); info->alias = g_strdup (alias); info->button_label = g_strdup (button_label); + info->menu_label = g_strdup (menu_label); + info->menu_accelerator = g_strdup (menu_accelerator); info->sort_order = sort_order; info->button_icon = button_icon; if (info->button_icon) g_object_ref (info->button_icon); + info->menu_icon = menu_icon; + if (info->menu_icon) + g_object_ref (info->menu_icon); + return info; } @@ -77,10 +86,15 @@ component_info_free (EComponentInfo *info) g_free (info->id); g_free (info->alias); g_free (info->button_label); + g_free (info->menu_label); + g_free (info->menu_accelerator); if (info->button_icon) g_object_unref (info->button_icon); + if (info->menu_icon) + g_object_unref (info->menu_icon); + if (info->iface != NULL) bonobo_object_release_unref (info->iface, NULL); @@ -157,10 +171,12 @@ query_components (EComponentRegistry *registry) for (i = 0; i < info_list->_length; i++) { const char *id; const char *label; + const char *menu_label; + const char *menu_accelerator; const char *alias; const char *icon_name; const char *sort_order_string; - GdkPixbuf *icon; + GdkPixbuf *icon = NULL, *menuicon = NULL; EComponentInfo *info; int sort_order; @@ -169,13 +185,18 @@ query_components (EComponentRegistry *registry) if (label == NULL) label = g_strdup (_("Unknown")); + menu_label = bonobo_server_info_prop_lookup (& info_list->_buffer[i], "evolution:menu_label", language_list); + if (menu_label == NULL) + menu_label = g_strdup (_("Unknown")); + + menu_accelerator = bonobo_server_info_prop_lookup (& info_list->_buffer[i], "evolution:menu_accelerator", language_list); + alias = bonobo_server_info_prop_lookup (& info_list->_buffer[i], "evolution:component_alias", NULL); icon_name = bonobo_server_info_prop_lookup (& info_list->_buffer[i], "evolution:button_icon", NULL); - if (icon_name == NULL) { - icon = NULL; - } else { + if (icon_name) { icon = e_icon_factory_get_icon (icon_name, E_ICON_SIZE_LARGE_TOOLBAR); + menuicon = e_icon_factory_get_icon (icon_name, E_ICON_SIZE_MENU); } sort_order_string = bonobo_server_info_prop_lookup (& info_list->_buffer[i], @@ -185,7 +206,8 @@ query_components (EComponentRegistry *registry) else sort_order = atoi (sort_order_string); - info = component_info_new (id, alias, label, sort_order, icon); + info = component_info_new (id, alias, label, menu_label, + menu_accelerator, sort_order, icon, menuicon); set_schemas (info, & info_list->_buffer [i]); registry->priv->infos = g_slist_prepend (registry->priv->infos, info); |