[evolution-patches] Patch for bug#307780



hi

         herewith i have attached with the patch for the bug # 307780 with the changelog .

         this patch implements the feature View Status Bar.

--
Luv,
S.Antony Vincent Pandian
--- e-shell-window.h	2005-07-20 20:28:36.000000000 +0530
+++ /home/evolution/cvs/evo/evolution/shell/e-shell-window.h	2005-07-20 20:46:28.000000000 +0530
@@ -66,6 +66,7 @@ const char *e_shell_window_peek_current_
 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);
--- e-shell-window.c	2005-07-20 20:29:13.000000000 +0530
+++ /home/evolution/cvs/evo/evolution/shell/e-shell-window.c	2005-07-20 20:54:24.000000000 +0530
@@ -557,7 +557,8 @@
 	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);
@@ -672,6 +673,16 @@
 	}
 	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",
@@ -966,6 +977,12 @@
 	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)
 {
@@ -1017,6 +1034,20 @@
 		g_free (prop);
 	}
 
+	/* Statusbar visibility setting */
+	prop = bonobo_ui_component_get_prop (e_shell_window_peek_bonobo_ui_component (window),
+					     "/commands/ViewStatusBar",
+					     "state",
+					     NULL);
+	if (prop) {
+		visible = prop[0] == '1';
+		gconf_client_set_bool (client,
+				       "/apps/evolution/shell/view_defaults/statusbar_visible",
+				       visible,
+				       NULL);
+		g_free (prop);
+	}
+
 	g_object_unref (client);
 }
 
--- e-shell-window-commands.c	2005-07-20 20:29:18.000000000 +0530
+++ /home/evolution/cvs/evo/evolution/shell/e-shell-window-commands.c	2005-07-20 20:51:14.000000000 +0530
@@ -878,6 +878,26 @@
 				      "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(*state == '0')
+		gtk_widget_hide (status_bar);
+	else
+		gtk_widget_show (status_bar);
+
+	bonobo_ui_component_set_prop (ui_component, "/commands/ViewStatusBar",
+				      "state", is_visible ? "1" : "0", NULL);   
+}
 
 /* Public API.  */
 
@@ -916,6 +936,9 @@
 	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);
 
--- evolution.xml	2005-07-21 16:41:27.001206520 +0530
+++ /home/evolution/cvs/evo/evolution/ui/evolution.xml	2005-07-21 16:42:11.946373816 +0530
@@ -28,6 +28,9 @@
     <cmd name="ViewToolbar" _label="Tool_bar" type="toggle"
       _tip="Change the visibility of the toolbar" state="1"/>
 
+    <cmd name="ViewStatusBar" _label="_View Status Bar" type="toggle"
+      _tip="View/Hide the Status Bar" state="1"/>
+
     <cmd name="HelpSubmitBug" _label="Submit Bug Report"
       _tip="Submit a bug report using Bug Buddy"/>
 
@@ -108,6 +111,7 @@
     <submenu name="View" _label="_View">
       <placeholder name="ViewBegin"/>
       <menuitem name="ViewToolbar" id="ViewToolbar" verb="" accel="*Control**Shift*o"/>
+      <menuitem name="ViewStatusBar" id="ViewStatusBar" accel="*Control**Shift*v"/>
       <placeholder name="ViewPreview"/>
       <submenu name="Buttons" _label="_Switcher Appearance">
             <menuitem name="ViewButtonsIconText" id="ViewButtonsIconText" verb=""/>

Attachment: shell_changelog
Description: Binary data

Attachment: ui_changelog
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]