From 54b80a7271e8ce1b2f3ccc68bb553940a24b80e2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 17 Oct 2008 03:48:03 +0000 Subject: Get the mail folder tree compiling, though I'm not yet sure why it's not showing anything. Probably something stupid. Also enabled the composer. svn path=/branches/kill-bonobo/; revision=36623 --- shell/e-shell-window.c | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) (limited to 'shell/e-shell-window.c') diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 0d54b92bd8..de68d343e4 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -56,9 +56,8 @@ shell_window_new_view (EShellWindow *shell_window, page_num = gtk_notebook_get_n_pages (notebook); /* Get the switcher action for this view. */ - action_name = g_strdup_printf (SWITCHER_FORMAT, view_name); - action = e_shell_window_get_action (shell_window, action_name); - g_free (action_name); + action = e_shell_window_get_shell_view_action ( + shell_window, view_name); /* Create the shell view. */ shell_view = g_object_new ( @@ -433,6 +432,39 @@ e_shell_window_get_shell_view (EShellWindow *shell_window, return shell_view; } +/** + * e_shell_window_get_shell_view_action: + * @shell_window: an #EShellWindow + * @view_name: name of a shell view + * + * Returns the switcher action for @view_name. + * + * An #EShellWindow creates a #GtkRadioAction for each registered subclass + * of #EShellView. This action gets passed to the #EShellSwitcher, which + * displays a button that proxies the action. The icon at the top of the + * sidebar also proxies the action. When the #EShellView named @view_name + * is active, the action's icon becomes the @shell_window icon. + * + * Returns: the switcher action for the #EShellView named @view_name, + * or %NULL if no such shell view exists + **/ +GtkAction * +e_shell_window_get_shell_view_action (EShellWindow *shell_window, + const gchar *view_name) +{ + GtkAction *action; + gchar *action_name; + + g_return_val_if_fail (E_IS_SHELL_WINDOW (shell_window), NULL); + g_return_val_if_fail (view_name != NULL, NULL); + + action_name = g_strdup_printf (SWITCHER_FORMAT, view_name); + action = e_shell_window_get_action (shell_window, action_name); + g_free (action_name); + + return action; +} + /** * e_shell_window_get_ui_manager: * @shell_window: an #EShellWindow -- cgit v1.2.3