diff options
author | Rajeev ramanathan <rajeevramanathan_2004@yahoo.co.in> | 2006-01-30 13:17:24 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2006-01-30 13:17:24 +0800 |
commit | 3fc81ed934db3384694edd38b46e78393c0db640 (patch) | |
tree | 38b9af996bea3c4b8139d6d98fd99cee3ed761e9 /shell | |
parent | 93acd6f496c863f385eb6fd995f964c84e89a9d2 (diff) | |
download | gsoc2013-evolution-3fc81ed934db3384694edd38b46e78393c0db640.tar.gz gsoc2013-evolution-3fc81ed934db3384694edd38b46e78393c0db640.tar.zst gsoc2013-evolution-3fc81ed934db3384694edd38b46e78393c0db640.zip |
** Fixes Bug #257654
2006-01-26 Rajeev ramanathan <rajeevramanathan_2004@yahoo.co.in>
** Fixes Bug #257654
* e-shell-window.c:
* e-shell-window-commands.c: Added code to show/hide sidebar.
svn path=/trunk/; revision=31345
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 7 | ||||
-rw-r--r-- | shell/apps_evolution_shell.schemas.in.in | 12 | ||||
-rw-r--r-- | shell/e-shell-window-commands.c | 20 | ||||
-rw-r--r-- | shell/e-shell-window.c | 31 |
4 files changed, 70 insertions, 0 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 44a5c49b2c..4d636697e3 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,10 @@ +2006-01-26 Rajeev ramanathan <rajeevramanathan_2004@yahoo.co.in> + + ** Fixes Bug #257654 + + * e-shell-window.c: + * e-shell-window-commands.c: Added code to show/hide sidebar. + 2006-01-29 Harish Krishnaswamy <kharish@novell.com> * main.c: (show_development_warning): diff --git a/shell/apps_evolution_shell.schemas.in.in b/shell/apps_evolution_shell.schemas.in.in index c32189cb06..911c4fc902 100644 --- a/shell/apps_evolution_shell.schemas.in.in +++ b/shell/apps_evolution_shell.schemas.in.in @@ -130,6 +130,18 @@ </locale> </schema> + <schema> + <key>/schemas/apps/evolution/shell/view_defaults/sidebar_visible</key> + <applyto>/apps/evolution/shell/view_defaults/sidebar_visible</applyto> + <owner>evolution</owner> + <type>bool</type> + <default>TRUE</default> + <locale name="C"> + <short>Sidebar is visible</short> + <long>Whether the sidebar should be visible.</long> + </locale> + </schema> + <schema> <key>/schemas/apps/evolution/shell/view_defaults/component_id</key> <applyto>/apps/evolution/shell/view_defaults/component_id</applyto> diff --git a/shell/e-shell-window-commands.c b/shell/e-shell-window-commands.c index 36aea2de78..f7da6157be 100644 --- a/shell/e-shell-window-commands.c +++ b/shell/e-shell-window-commands.c @@ -922,6 +922,23 @@ view_statusbar_item_toggled_handler (BonoboUIComponent *ui_component, gconf_client_set_bool (gconf_client_get_default (),"/apps/evolution/shell/view_defaults/statusbar_visible", is_visible, NULL); } +static void +view_sidebar_item_toggled_handler (BonoboUIComponent *ui_component, + const char *path, + Bonobo_UIComponent_EventType type, + const char *state, + EShellWindow *shell_window) +{ + GtkWidget *side_bar = GTK_WIDGET(e_shell_window_peek_sidebar (shell_window)); + gboolean is_visible; + is_visible = state[0] == '1'; + if(is_visible) + gtk_widget_show (side_bar); + else + gtk_widget_hide (side_bar); + gconf_client_set_bool (gconf_client_get_default (),"/apps/evolution/shell/view_defaults/sidebar_visible", is_visible, NULL); +} + /* Public API. */ void @@ -962,6 +979,9 @@ e_shell_window_commands_setup (EShellWindow *shell_window) bonobo_ui_component_add_listener (uic, "ViewStatusBar", (BonoboUIListenerFn)view_statusbar_item_toggled_handler, (gpointer)shell_window); + bonobo_ui_component_add_listener (uic, "ViewSideBar", + (BonoboUIListenerFn)view_sidebar_item_toggled_handler, + (gpointer)shell_window); e_pixmaps_update (uic, pixmaps); diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index fb45157513..41540126a5 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -730,6 +730,16 @@ setup_widgets (EShellWindow *window) visible ? "1" : "0", NULL); + /* Side Bar*/ + visible = gconf_client_get_bool (gconf_client, + "/apps/evolution/shell/view_defaults/sidebar_visible", + NULL); + bonobo_ui_component_set_prop (e_shell_window_peek_bonobo_ui_component (window), + "/commands/ViewSideBar", + "state", + visible ? "1" : "0", + NULL); + /* The tool bar */ visible = gconf_client_get_bool (gconf_client, "/apps/evolution/shell/view_defaults/toolbar_visible", @@ -893,6 +903,7 @@ e_shell_window_init (EShellWindow *shell_window) * requiring a specific component. */ priv->menu = es_menu_new("org.gnome.evolution.shell"); + } @@ -942,6 +953,11 @@ e_shell_window_new (EShell *shell, setup_widgets (window); + if(gconf_client_get_bool (gconf_client_get_default(),"/apps/evolution/shell/view_defaults/sidebar_visible",NULL)) + gtk_widget_show (priv->sidebar); + else + gtk_widget_hide (priv->sidebar); + update_send_receive_sensitivity (window); g_signal_connect_object (shell, "line_status_changed", G_CALLBACK (shell_line_status_changed_callback), window, 0); @@ -1093,6 +1109,21 @@ e_shell_window_save_defaults (EShellWindow *window) NULL); g_free (prop); } + + /* SideBar visibility setting */ + prop = bonobo_ui_component_get_prop (e_shell_window_peek_bonobo_ui_component (window), + "/commands/ViewSideBar", + "state", + NULL); + if (prop) { + visible = prop[0] == '1'; + gconf_client_set_bool (client, + "/apps/evolution/shell/view_defaults/sidebar_visible", + visible, + NULL); + g_free (prop); + } + g_object_unref (client); } |