From 7ac4fd8bf939d8f7aef82fa4d21ab26e3d62a072 Mon Sep 17 00:00:00 2001 From: "S.Antony Vincent Pandian" Date: Fri, 23 Sep 2005 09:44:58 +0000 Subject: Have added the "View Status Bar" under the "View" menu This is a toggle 2005-09-23 S.Antony Vincent Pandian * Have added the "View Status Bar" under the "View" menu This is a toggle button to hide/show the status bar svn path=/trunk/; revision=30371 --- shell/ChangeLog | 20 ++++++++++++++++++++ shell/e-shell-window-commands.c | 20 ++++++++++++++++++++ shell/e-shell-window.c | 19 ++++++++++++++++++- shell/e-shell-window.h | 1 + 4 files changed, 59 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index 7617821986..213931c46f 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,23 @@ +2005-09-23 S.Antony Vincent Pandian + + solves bug # 307780 + + * e-shell-window.h : added the prototype for the function + e_shell_window_peek_statusbar(..); + + * e-shell-window.c : show/hide the status bar widget based on the saved + property. + retreive the status bar's previous status and set in UI. + define the function e_shell_window_peek_statusbar() which retrieves + the status bar widget for e-shell-window-commands.c + + * e-shell-window-commands.c : view_statusbar_item_toggled_handler() + is the component listener for the "View Status Bar" menu item.it + handles the click event in the menu item "View status Bar".The + state of the status bar is also saved every time an event occurs + on it. + setting the component listener to the component. + 2005-08-28 Harish Krishnaswamy * e-shell-window-commands.c: Update credits. diff --git a/shell/e-shell-window-commands.c b/shell/e-shell-window-commands.c index 7a307e7c84..51619a09aa 100644 --- a/shell/e-shell-window-commands.c +++ b/shell/e-shell-window-commands.c @@ -50,6 +50,7 @@ #include +#include #include /* Utility functions. */ @@ -904,6 +905,22 @@ view_toolbar_item_toggled_handler (BonoboUIComponent *ui_component, "hidden", is_visible ? "0" : "1", NULL); } +static void +view_statusbar_item_toggled_handler (BonoboUIComponent *ui_component, + const char *path, + Bonobo_UIComponent_EventType type, + const char *state, + EShellWindow *shell_window) +{ + GtkWidget *status_bar = e_shell_window_peek_statusbar (shell_window); + gboolean is_visible; + is_visible = state[0] == '1'; + if(is_visible) + gtk_widget_show (status_bar); + else + gtk_widget_hide (status_bar); + gconf_client_set_bool (gconf_client_get_default (),"/apps/evolution/shell/view_defaults/statusbar_visible", is_visible, NULL); +} /* Public API. */ @@ -942,6 +959,9 @@ e_shell_window_commands_setup (EShellWindow *shell_window) bonobo_ui_component_add_listener (uic, "ViewToolbar", (BonoboUIListenerFn)view_toolbar_item_toggled_handler, (gpointer)shell_window); + bonobo_ui_component_add_listener (uic, "ViewStatusBar", + (BonoboUIListenerFn)view_statusbar_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 cbb3bfc175..f45d047f8c 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -564,7 +564,8 @@ setup_status_bar (EShellWindow *window) priv = window->priv; priv->status_bar = gtk_hbox_new (FALSE, 2); - gtk_widget_show (priv->status_bar); + if(gconf_client_get_bool (gconf_client_get_default(),"/apps/evolution/shell/view_defaults/statusbar_visible",NULL)) + gtk_widget_show (priv->status_bar); setup_offline_toggle (window); setup_menu_hint_label (window); @@ -679,6 +680,16 @@ setup_widgets (EShellWindow *window) } g_free (style); + /* Status Bar*/ + visible = gconf_client_get_bool (gconf_client, + "/apps/evolution/shell/view_defaults/statusbar_visible", + NULL); + bonobo_ui_component_set_prop (e_shell_window_peek_bonobo_ui_component (window), + "/commands/ViewStatusBar", + "state", + visible ? "1" : "0", + NULL); + /* The tool bar */ visible = gconf_client_get_bool (gconf_client, "/apps/evolution/shell/view_defaults/toolbar_visible", @@ -977,6 +988,12 @@ e_shell_window_peek_sidebar (EShellWindow *window) return E_SIDEBAR (window->priv->sidebar); } +GtkWidget * +e_shell_window_peek_statusbar (EShellWindow *window) +{ + return window->priv->status_bar; +} + void e_shell_window_save_defaults (EShellWindow *window) { diff --git a/shell/e-shell-window.h b/shell/e-shell-window.h index 80d5955d51..796e08d050 100644 --- a/shell/e-shell-window.h +++ b/shell/e-shell-window.h @@ -66,6 +66,7 @@ const char *e_shell_window_peek_current_component_id (EShellWindow *shell); EShell *e_shell_window_peek_shell (EShellWindow *window); BonoboUIComponent *e_shell_window_peek_bonobo_ui_component (EShellWindow *window); ESidebar *e_shell_window_peek_sidebar (EShellWindow *window); +GtkWidget *e_shell_window_peek_statusbar (EShellWindow *window); void e_shell_window_save_defaults (EShellWindow *window); void e_shell_window_show_settings (EShellWindow *window); -- cgit