[epiphany] ephy-window: add _ephy_window_set_navigation_flags()



commit 51e62b6cd9c8f4f0101660a8ff9b4e43aaae3411
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Tue May 8 21:34:06 2012 +0300

    ephy-window: add _ephy_window_set_navigation_flags()
    
    We'll share this code later.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678405

 src/ephy-window.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 337df3d..683dee5 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1548,22 +1548,26 @@ sync_tab_icon (EphyWebView *view,
 }
 
 static void
+_ephy_window_set_navigation_flags (EphyWindow *window,
+				   EphyWebViewNavigationFlags flags)
+{
+	GtkAction *action;
+
+	action = gtk_action_group_get_action (window->priv->toolbar_action_group, "NavigationBack");
+	gtk_action_set_sensitive (action, flags & EPHY_WEB_VIEW_NAV_BACK);
+	action = gtk_action_group_get_action (window->priv->toolbar_action_group, "NavigationForward");
+	gtk_action_set_sensitive (action, flags & EPHY_WEB_VIEW_NAV_FORWARD);
+}
+
+static void
 sync_tab_navigation (EphyWebView *view,
 		     GParamSpec *pspec,
 		     EphyWindow *window)
 {
-	EphyWebViewNavigationFlags flags;
-	GtkAction *action;
-	EphyWindowPrivate *priv = window->priv;
-
 	if (window->priv->closing) return;
 
-	flags = ephy_web_view_get_navigation_flags (view);
-
-	action = gtk_action_group_get_action (priv->toolbar_action_group, "NavigationBack");
-	gtk_action_set_sensitive (action, flags & EPHY_WEB_VIEW_NAV_BACK);
-	action = gtk_action_group_get_action (priv->toolbar_action_group, "NavigationForward");
-	gtk_action_set_sensitive (action, flags & EPHY_WEB_VIEW_NAV_FORWARD);
+	_ephy_window_set_navigation_flags (window,
+					   ephy_web_view_get_navigation_flags (view));
 }
 
 static void



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