[epiphany] Update the status message from within the EphyWebView



commit 1cda73c6a5be184e90cc998b1d51c30de4ec95bb
Author: Xan Lopez <xan gnome org>
Date:   Tue May 18 16:15:56 2010 +0200

    Update the status message from within the EphyWebView
    
    There's no need anymore for the EphyWindow to do this, we can get rid
    of one extra roundtrip.

 embed/ephy-web-view.c |   24 ++++++++++++++++++++++++
 src/ephy-window.c     |   24 ------------------------
 2 files changed, 24 insertions(+), 24 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 65298eb..1072bdb 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -104,6 +104,8 @@ struct _EphyWebViewPrivate {
   guint seq_context_id;
   guint seq_message_id;
 
+  guint tab_message_id;
+
   char *text;
   GdkRectangle text_rectangle;
 
@@ -2278,6 +2280,23 @@ set_scroll_adjustments_cb (EphyWebView *view, GtkAdjustment *hadj, GtkAdjustment
 }
 
 static void
+status_message_notify_cb (EphyWebView *view, GParamSpec *pspec, gpointer data)
+{
+  const char *message;
+  EphyWebViewPrivate *priv;
+
+  message = ephy_web_view_get_status_message (view);
+
+  priv = view->priv;
+
+  ephy_web_view_statusbar_pop (view, priv->tab_message_id);
+
+  if (message)
+    ephy_web_view_statusbar_push (view, priv->tab_message_id, message);
+
+}
+
+static void
 ephy_web_view_init (EphyWebView *web_view)
 {
   EphyWebViewPrivate *priv;
@@ -2294,6 +2313,7 @@ ephy_web_view_init (EphyWebView *web_view)
   priv->monitor_directory = FALSE;
   priv->seq_context_id = 1;
   priv->seq_message_id = 1;
+  priv->tab_message_id = ephy_web_view_statusbar_get_context_id (web_view, TAB_MESSAGE_CONTEXT_DESCRIPTION);
 
   priv->non_search_regex = g_regex_new ("(^localhost(\\.[^[:space:]]+)?(:\\d+)?(/.*)?$|"
                                         "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]$|"
@@ -2338,6 +2358,10 @@ ephy_web_view_init (EphyWebView *web_view)
                     G_CALLBACK (set_scroll_adjustments_cb),
                     NULL);
 
+  g_signal_connect (web_view, "notify::status-message",
+                    G_CALLBACK (status_message_notify_cb),
+                    NULL);
+
   cache = EPHY_FAVICON_CACHE
           (ephy_embed_shell_get_favicon_cache (embed_shell));
   g_signal_connect_object (G_OBJECT (cache), "changed",
diff --git a/src/ephy-window.c b/src/ephy-window.c
index a627dc5..e4e9e34 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1608,23 +1608,6 @@ sync_tab_load_progress (EphyWebView *view, GParamSpec *pspec, EphyWindow *window
 }
 
 static void
-sync_tab_message (EphyWebView *view, GParamSpec *pspec, EphyWindow *window)
-{
-	const char *message;
-
-	if (window->priv->closing) return;
-
-	message = ephy_web_view_get_status_message (view);
-
-	ephy_web_view_statusbar_pop (view, window->priv->tab_message_cid);
-
-	if (message)
-	{
-		ephy_web_view_statusbar_push (view, window->priv->tab_message_cid, message);
-	}
-}
-
-static void
 sync_tab_navigation (EphyWebView *view,
 		     GParamSpec *pspec,
 		     EphyWindow *window)
@@ -2603,9 +2586,6 @@ ephy_window_set_active_tab (EphyWindow *window, EphyEmbed *new_embed)
 						      G_CALLBACK (sync_tab_icon),
 						      window);
 		g_signal_handlers_disconnect_by_func (view,
-						      G_CALLBACK (sync_tab_message),
-						      window);
-		g_signal_handlers_disconnect_by_func (view,
 						      G_CALLBACK (ephy_window_visibility_cb),
 						      window);
 
@@ -2632,7 +2612,6 @@ ephy_window_set_active_tab (EphyWindow *window, EphyEmbed *new_embed)
 		sync_tab_title		(view, NULL, window);
 		sync_tab_address	(view, NULL, window);
 		sync_tab_icon		(view, NULL, window);
-		sync_tab_message	(view, NULL, window);
 		sync_tab_popup_windows	(view, NULL, window);
 		sync_tab_popups_allowed	(view, NULL, window);
 
@@ -2678,9 +2657,6 @@ ephy_window_set_active_tab (EphyWindow *window, EphyEmbed *new_embed)
 		g_signal_connect_object (view, "notify::icon",
 					 G_CALLBACK (sync_tab_icon),
 					 window, 0);
-		g_signal_connect_object (view, "notify::status-message",
-					 G_CALLBACK (sync_tab_message),
-					 window, 0);
 		g_signal_connect_object (view, "notify::security-level",
 					 G_CALLBACK (sync_tab_security),
 					 window, 0);



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