aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-window-commands.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@novell.com>2005-01-05 03:58:45 +0800
committerJP Rosevear <jpr@src.gnome.org>2005-01-05 03:58:45 +0800
commit8541e321f0d39295b315f057516f12a1fb4289f6 (patch)
tree051d0a87ec08bf575513879e014a43546b89ddb2 /shell/e-shell-window-commands.c
parent097c33e75eb2e2d06d643e467285310676d1fe62 (diff)
downloadgsoc2013-evolution-8541e321f0d39295b315f057516f12a1fb4289f6.tar.gz
gsoc2013-evolution-8541e321f0d39295b315f057516f12a1fb4289f6.tar.zst
gsoc2013-evolution-8541e321f0d39295b315f057516f12a1fb4289f6.zip
new protos, modes
2005-01-04 JP Rosevear <jpr@novell.com> * e-sidebar.h: new protos, modes * e-sidebar.c: handle 2 more modes, text only and toolbar style; allow visibility to be set for the buttons * e-shell-window.h: new proto * e-shell-window.c (setup_widgets): set the sidebar setting and visibility based on stored gconf settings (e_shell_window_save_defaults): save the current sidebar setting visibility (e_shell_window_peek_sidebar): return the sidebar * e-shell-window-commands.c (e_shell_window_commands_setup): add listeners for each of the component button radio items and for the hide toggle (view_buttons_icontext_item_toggled_handler): listener callback, set mode (view_buttons_icon_item_toggled_handler): ditto (view_buttons_text_item_toggled_handler): ditto (view_buttons_toolbar_item_toggled_handler): ditto (view_buttons_hide_item_toggled_handler): listener callback, set visibility * apps_evolution_shell.schemas.in.in: add component button style and visibility defaults svn path=/trunk/; revision=28239
Diffstat (limited to 'shell/e-shell-window-commands.c')
-rw-r--r--shell/e-shell-window-commands.c84
1 files changed, 84 insertions, 0 deletions
diff --git a/shell/e-shell-window-commands.c b/shell/e-shell-window-commands.c
index 11fb3dd337..eaa207d63e 100644
--- a/shell/e-shell-window-commands.c
+++ b/shell/e-shell-window-commands.c
@@ -727,6 +727,75 @@ shell_line_status_changed_cb (EShell *shell,
}
static void
+view_buttons_icontext_item_toggled_handler (BonoboUIComponent *ui_component,
+ const char *path,
+ Bonobo_UIComponent_EventType type,
+ const char *state,
+ EShellWindow *shell_window)
+{
+ ESidebar *sidebar;
+
+ sidebar = e_shell_window_peek_sidebar (shell_window);
+ e_sidebar_set_mode (sidebar, E_SIDEBAR_MODE_BOTH);
+}
+
+static void
+view_buttons_icon_item_toggled_handler (BonoboUIComponent *ui_component,
+ const char *path,
+ Bonobo_UIComponent_EventType type,
+ const char *state,
+ EShellWindow *shell_window)
+{
+ ESidebar *sidebar;
+
+ sidebar = e_shell_window_peek_sidebar (shell_window);
+ e_sidebar_set_mode (sidebar, E_SIDEBAR_MODE_ICON);
+}
+
+static void
+view_buttons_text_item_toggled_handler (BonoboUIComponent *ui_component,
+ const char *path,
+ Bonobo_UIComponent_EventType type,
+ const char *state,
+ EShellWindow *shell_window)
+{
+ ESidebar *sidebar;
+
+ sidebar = e_shell_window_peek_sidebar (shell_window);
+ e_sidebar_set_mode (sidebar, E_SIDEBAR_MODE_TEXT);
+}
+
+static void
+view_buttons_toolbar_item_toggled_handler (BonoboUIComponent *ui_component,
+ const char *path,
+ Bonobo_UIComponent_EventType type,
+ const char *state,
+ EShellWindow *shell_window)
+{
+ ESidebar *sidebar;
+
+ sidebar = e_shell_window_peek_sidebar (shell_window);
+ e_sidebar_set_mode (sidebar, E_SIDEBAR_MODE_TOOLBAR);
+}
+
+static void
+view_buttons_hide_item_toggled_handler (BonoboUIComponent *ui_component,
+ const char *path,
+ Bonobo_UIComponent_EventType type,
+ const char *state,
+ EShellWindow *shell_window)
+{
+ ESidebar *sidebar;
+ gboolean is_visible;
+
+ sidebar = e_shell_window_peek_sidebar (shell_window);
+
+ is_visible = state[0] == '0';
+
+ e_sidebar_set_show_buttons (sidebar, is_visible);
+}
+
+static void
view_toolbar_item_toggled_handler (BonoboUIComponent *ui_component,
const char *path,
Bonobo_UIComponent_EventType type,
@@ -761,6 +830,21 @@ 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, "ViewButtonsIconText",
+ (BonoboUIListenerFn)view_buttons_icontext_item_toggled_handler,
+ (gpointer)shell_window);
+ bonobo_ui_component_add_listener (uic, "ViewButtonsIcon",
+ (BonoboUIListenerFn)view_buttons_icon_item_toggled_handler,
+ (gpointer)shell_window);
+ bonobo_ui_component_add_listener (uic, "ViewButtonsText",
+ (BonoboUIListenerFn)view_buttons_text_item_toggled_handler,
+ (gpointer)shell_window);
+ bonobo_ui_component_add_listener (uic, "ViewButtonsToolbar",
+ (BonoboUIListenerFn)view_buttons_toolbar_item_toggled_handler,
+ (gpointer)shell_window);
+ bonobo_ui_component_add_listener (uic, "ViewButtonsHide",
+ (BonoboUIListenerFn)view_buttons_hide_item_toggled_handler,
+ (gpointer)shell_window);
bonobo_ui_component_add_listener (uic, "ViewToolbar",
(BonoboUIListenerFn)view_toolbar_item_toggled_handler,
(gpointer)shell_window);