aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-window-commands.c
diff options
context:
space:
mode:
authorWilliam Jon McCann <mccann@jhu.edu>2004-06-03 04:37:14 +0800
committerWilliam Jon McCann <mccann@src.gnome.org>2004-06-03 04:37:14 +0800
commit846953d493d286b63b3345442834591551c6d338 (patch)
treef17d41b9f4fa29a25541cdf59abec326ecbd5424 /shell/e-shell-window-commands.c
parentd9deb731a06228dcb0023e9fe0c00a847c5b65f1 (diff)
downloadgsoc2013-evolution-846953d493d286b63b3345442834591551c6d338.tar
gsoc2013-evolution-846953d493d286b63b3345442834591551c6d338.tar.gz
gsoc2013-evolution-846953d493d286b63b3345442834591551c6d338.tar.bz2
gsoc2013-evolution-846953d493d286b63b3345442834591551c6d338.tar.lz
gsoc2013-evolution-846953d493d286b63b3345442834591551c6d338.tar.xz
gsoc2013-evolution-846953d493d286b63b3345442834591551c6d338.tar.zst
gsoc2013-evolution-846953d493d286b63b3345442834591551c6d338.zip
Add listener for the ViewToolbar command.
2004-06-01 William Jon McCann <mccann@jhu.edu> * e-shell-window-commands.c (e_shell_window_commands_setup): Add listener for the ViewToolbar command. (view_toolbar_item_toggled_handler): New function to handle toggling toolbar visibility and saving state. * e-shell-window.c (e_shell_window_save_defaults): Save the status of the toolbar visibility. (setup_widgets): Set initial state of toolbar visibility. * apps_evolution_shell.schemas.in.in: Added schema for toolbar_visible. svn path=/trunk/; revision=26157
Diffstat (limited to 'shell/e-shell-window-commands.c')
-rw-r--r--shell/e-shell-window-commands.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/shell/e-shell-window-commands.c b/shell/e-shell-window-commands.c
index 35ccb7d40e..b8e067c3d7 100644
--- a/shell/e-shell-window-commands.c
+++ b/shell/e-shell-window-commands.c
@@ -46,6 +46,7 @@
#include <bonobo/bonobo-ui-component.h>
+#include <string.h>
/* Utility functions. */
@@ -608,6 +609,21 @@ shell_line_status_changed_cb (EShell *shell,
update_offline_menu_item (shell_window, new_status);
}
+static void
+view_toolbar_item_toggled_handler (BonoboUIComponent *ui_component,
+ const char *path,
+ Bonobo_UIComponent_EventType type,
+ const char *state,
+ EShellWindow *shell_window)
+{
+ gboolean is_visible;
+
+ is_visible = state[0] == '1';
+
+ bonobo_ui_component_set_prop (ui_component, "/Toolbar",
+ "hidden", is_visible ? "0" : "1", NULL);
+}
+
/* Public API. */
@@ -628,6 +644,9 @@ e_shell_window_commands_setup (EShellWindow *shell_window)
bonobo_ui_component_add_verb_list_with_data (uic, actions_verbs, shell_window);
bonobo_ui_component_add_verb_list_with_data (uic, tools_verbs, shell_window);
bonobo_ui_component_add_verb_list_with_data (uic, help_verbs, shell_window);
+ bonobo_ui_component_add_listener (uic, "ViewToolbar",
+ (BonoboUIListenerFn)view_toolbar_item_toggled_handler,
+ (gpointer)shell_window);
e_pixmaps_update (uic, pixmaps);