[evolution-patches] Fix for #42342 (shell)



Makes sure Send/Receive sensitivity status is correctly initialized at
startup.

-- Ettore
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.1269
diff -u -p -r1.1269 ChangeLog
--- ChangeLog	8 May 2003 19:36:47 -0000	1.1269
+++ ChangeLog	8 May 2003 19:51:35 -0000
@@ -1,5 +1,15 @@
 2003-05-08  Ettore Perazzoli  <ettore ximian com>
 
+	[#42342]
+	* e-shell-view.c (update_send_receive_sensitivity): New function
+	to update the Send/Receive menu and toolbar items according to the
+	current line status.
+	(e_shell_view_construct): Call it here to set up the initial
+	state.
+	(shell_line_status_changed_cb): Use it here as well.
+
+2003-05-08  Ettore Perazzoli  <ettore ximian com>
+
 	[#36956]
 	* e-shell-view.c (update_for_current_uri): Remove the version
 	number from the window title.
Index: e-shell-view.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-view.c,v
retrieving revision 1.282
diff -u -p -r1.282 e-shell-view.c
--- e-shell-view.c	8 May 2003 19:36:47 -0000	1.282
+++ e-shell-view.c	8 May 2003 19:51:37 -0000
@@ -188,9 +188,10 @@ static GdkPixmap *online_pixmap = NULL;
 static GdkBitmap *online_mask = NULL;
 
 
-static void        update_for_current_uri         (EShellView *shell_view);
-static void        update_offline_toggle_status   (EShellView *shell_view);
-static const char *get_storage_set_path_from_uri  (const char *uri);
+static void        update_for_current_uri          (EShellView *shell_view);
+static void        update_offline_toggle_status    (EShellView *shell_view);
+static void        update_send_receive_sensitivity (EShellView *shell_view);
+static const char *get_storage_set_path_from_uri   (const char *uri);
 
 
 /* Boo.  */
@@ -1760,15 +1761,7 @@ shell_line_status_changed_cb (EShell *sh
 
 	shell_view = E_SHELL_VIEW (data);
 	update_offline_toggle_status (shell_view);
-
-	if (new_status == E_SHELL_LINE_STATUS_OFFLINE)
-		bonobo_ui_component_set_prop (shell_view->priv->ui_component,
-					      "/commands/SendReceive",
-					      "sensitive", "0", NULL);
-	else
-		bonobo_ui_component_set_prop (shell_view->priv->ui_component,
-					      "/commands/SendReceive",
-					      "sensitive", "1", NULL);
+	update_send_receive_sensitivity (shell_view);
 }
 
 static int
@@ -1855,6 +1848,7 @@ e_shell_view_construct (EShellView *shel
 
 	setup_defaults (view);
 	update_other_users_folder_items_sensitivity (view);
+	update_send_receive_sensitivity (view);
 
 	if (uri != NULL) {
 		uri_to_load = g_strdup (uri);
@@ -2110,6 +2104,20 @@ update_offline_toggle_status (EShellView
 	gtk_widget_set_sensitive (priv->offline_toggle, sensitive);
 	gtk_tooltips_set_tip (priv->tooltips, priv->offline_toggle, tooltip, NULL);
 }
+
+static void
+update_send_receive_sensitivity (EShellView *shell_view)
+{
+	if (e_shell_get_line_status (shell_view->priv->shell) == E_SHELL_LINE_STATUS_OFFLINE)
+		bonobo_ui_component_set_prop (shell_view->priv->ui_component,
+					      "/commands/SendReceive",
+					      "sensitive", "0", NULL);
+	else
+		bonobo_ui_component_set_prop (shell_view->priv->ui_component,
+					      "/commands/SendReceive",
+					      "sensitive", "1", NULL);
+}
+
 
 /* This displays the specified page, doing the appropriate Bonobo activation/deactivation
    magic to make sure things work nicely.  FIXME: Crappy way to solve the issue.  */


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