aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-window.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-05-19 11:50:52 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-05-19 11:50:52 +0800
commite4b42c5e6cfdc6fd2f9245fa61fd4e1f7b2038f6 (patch)
tree232bd7b2597f15959d8a2f0afcbf527e8d9f4107 /shell/e-shell-window.c
parentc0a0310607f8e6de8422e53fbcd6c28a85f2e27f (diff)
downloadgsoc2013-evolution-e4b42c5e6cfdc6fd2f9245fa61fd4e1f7b2038f6.tar
gsoc2013-evolution-e4b42c5e6cfdc6fd2f9245fa61fd4e1f7b2038f6.tar.gz
gsoc2013-evolution-e4b42c5e6cfdc6fd2f9245fa61fd4e1f7b2038f6.tar.bz2
gsoc2013-evolution-e4b42c5e6cfdc6fd2f9245fa61fd4e1f7b2038f6.tar.lz
gsoc2013-evolution-e4b42c5e6cfdc6fd2f9245fa61fd4e1f7b2038f6.tar.xz
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-shell-window.c')
-rw-r--r--shell/e-shell-window.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index 04d096334f..3811c136b2 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -552,6 +552,18 @@ setup_status_bar (EShellWindow *window)
}
static void
+menu_component_selected (BonoboUIComponent *uic,
+ EShellWindow *window,
+ const char *path)
+{
+ char *component_id;
+
+ component_id = strchr(path, '-');
+ if (component_id)
+ e_shell_window_switch_to_component (window, component_id+1);
+}
+
+static void
setup_widgets (EShellWindow *window)
{
EShellWindowPrivate *priv = window->priv;
@@ -559,6 +571,7 @@ setup_widgets (EShellWindow *window)
GConfClient *gconf_client = gconf_client_get_default ();
GtkWidget *contents_vbox;
GSList *p;
+ GString *xml;
int button_id;
priv->paned = gtk_hpaned_new ();
@@ -582,15 +595,47 @@ setup_widgets (EShellWindow *window)
gconf_client_get_int (gconf_client, "/apps/evolution/shell/view_defaults/folder_bar/width", NULL));
button_id = 0;
+ xml = g_string_new("");
for (p = e_component_registry_peek_list (registry); p != NULL; p = p->next) {
+ char *tmp;
EComponentInfo *info = p->data;
ComponentView *view = component_view_new (info->id, info->alias, button_id);
window->priv->component_views = g_slist_prepend (window->priv->component_views, view);
e_sidebar_add_button (E_SIDEBAR (priv->sidebar), info->button_label, info->button_icon, button_id);
+ g_string_printf(xml, "SwitchComponent-%s", info->alias);
+ bonobo_ui_component_add_verb (e_shell_window_peek_bonobo_ui_component (window),
+ xml->str,
+ (BonoboUIVerbFn)menu_component_selected,
+ window);
+
+ g_string_printf(xml, "<submenu name=\"View\">"
+ "<submenu name=\"Window\">"
+ "<placeholder name=\"WindowComponent\">"
+ "<menuitem name=\"SwitchComponent-%s\" "
+ "verb=\"\" label=\"%s\" accel=\"%s\" tip=\"",
+ info->alias,
+ info->menu_label,
+ info->menu_accelerator);
+ g_string_append_printf(xml, _("Switch to %s"), info->button_label);
+ tmp = bonobo_ui_util_pixbuf_to_xml (info->menu_icon),
+ g_string_append_printf(xml, "\" pixtype=\"pixbuf\" pixname=\"%s\"/>"
+ "</placeholder></submenu></submenu>\n",
+ tmp);
+ g_free(tmp);
+ bonobo_ui_component_set_translate (e_shell_window_peek_bonobo_ui_component (window),
+ "/menu",
+ xml->str,
+ NULL);
+ g_string_printf(xml, "<cmd name=\"SwitchComponent-%s\"/>\n", info->alias);
+ bonobo_ui_component_set_translate (e_shell_window_peek_bonobo_ui_component (window),
+ "/commands",
+ xml->str,
+ NULL);
button_id ++;
}
+ g_string_free(xml, TRUE);
setup_status_bar (window);