aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@gnome.org>2010-05-18 22:15:56 +0800
committerXan Lopez <xan@gnome.org>2010-05-19 00:08:47 +0800
commit1cda73c6a5be184e90cc998b1d51c30de4ec95bb (patch)
tree0144cd14804799894636a0e93b62a567213757e1
parent50c36fdf1c4224c4b2e2a97d635fd9184af7519d (diff)
downloadgsoc2013-epiphany-1cda73c6a5be184e90cc998b1d51c30de4ec95bb.tar
gsoc2013-epiphany-1cda73c6a5be184e90cc998b1d51c30de4ec95bb.tar.gz
gsoc2013-epiphany-1cda73c6a5be184e90cc998b1d51c30de4ec95bb.tar.bz2
gsoc2013-epiphany-1cda73c6a5be184e90cc998b1d51c30de4ec95bb.tar.lz
gsoc2013-epiphany-1cda73c6a5be184e90cc998b1d51c30de4ec95bb.tar.xz
gsoc2013-epiphany-1cda73c6a5be184e90cc998b1d51c30de4ec95bb.tar.zst
gsoc2013-epiphany-1cda73c6a5be184e90cc998b1d51c30de4ec95bb.zip
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.
-rw-r--r--embed/ephy-web-view.c24
-rw-r--r--src/ephy-window.c24
2 files changed, 24 insertions, 24 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 65298ebf5..1072bdb80 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 a627dc554..e4e9e34d1 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);