aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2003-05-09 05:54:58 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2003-05-09 05:54:58 +0800
commit56e678a74896006f89657d2ac86fa03c846a6d7a (patch)
treee0bcb4fa7efbecae8f3a3e8b215910f3513f3b11
parentb352ae1f19ca558ba8fd61e0a277a2a9020406bf (diff)
downloadgsoc2013-evolution-56e678a74896006f89657d2ac86fa03c846a6d7a.tar.gz
gsoc2013-evolution-56e678a74896006f89657d2ac86fa03c846a6d7a.tar.zst
gsoc2013-evolution-56e678a74896006f89657d2ac86fa03c846a6d7a.zip
[#42342] New function to update the Send/Receive menu and toolbar items
[#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. svn path=/trunk/; revision=21135
-rw-r--r--shell/ChangeLog10
-rw-r--r--shell/e-shell-view.c32
2 files changed, 30 insertions, 12 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index eb5603f8ad..e2bcae1ae9 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -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.
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index e44a152601..081e3d32a3 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -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 *shell,
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 *shell_view,
setup_defaults (view);
update_other_users_folder_items_sensitivity (view);
+ update_send_receive_sensitivity (view);
if (uri != NULL) {
uri_to_load = g_strdup (uri);
@@ -2111,6 +2105,20 @@ update_offline_toggle_status (EShellView *shell_view)
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. */
static void