diff options
author | Xan Lopez <xan@igalia.com> | 2012-01-28 05:49:51 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-01-28 05:49:51 +0800 |
commit | 224bb2418135604c08e0918c2757bd6b52882acb (patch) | |
tree | c6083e66de7005ea7383871df4be03274e6ae2f9 /src | |
parent | 772d1af3f02e309e9772e88a37e11d5ab426c4db (diff) | |
download | gsoc2013-epiphany-224bb2418135604c08e0918c2757bd6b52882acb.tar gsoc2013-epiphany-224bb2418135604c08e0918c2757bd6b52882acb.tar.gz gsoc2013-epiphany-224bb2418135604c08e0918c2757bd6b52882acb.tar.bz2 gsoc2013-epiphany-224bb2418135604c08e0918c2757bd6b52882acb.tar.lz gsoc2013-epiphany-224bb2418135604c08e0918c2757bd6b52882acb.tar.xz gsoc2013-epiphany-224bb2418135604c08e0918c2757bd6b52882acb.tar.zst gsoc2013-epiphany-224bb2418135604c08e0918c2757bd6b52882acb.zip |
ephy-window: simplify handling of back/forward sensitivity
Back/Forward sensitivity only depends on one factor (whether you can
actually go back or forward), so there is no need to use the ephy
action helper method. This allows to simplify the code quite a bit.
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-window.c | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c index 6ee99613d..26e7a825f 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -1517,46 +1517,22 @@ sync_tab_icon (EphyWebView *view, } static void -_ephy_window_set_navigation_actions (EphyWindow *window, - gboolean back, - gboolean forward, - gboolean up) -{ - EphyWindowPrivate *priv = window->priv; - GtkAction *action; - - action = gtk_action_group_get_action (priv->toolbar_action_group, "NavigationBack"); - ephy_action_change_sensitivity_flags (action, SENS_FLAG, !back); - action = gtk_action_group_get_action (priv->toolbar_action_group, "NavigationForward"); - ephy_action_change_sensitivity_flags (action, SENS_FLAG, !forward); -} - -static void sync_tab_navigation (EphyWebView *view, GParamSpec *pspec, EphyWindow *window) { EphyWebViewNavigationFlags flags; - gboolean up = FALSE, back = FALSE, forward = FALSE; + GtkAction *action; + EphyWindowPrivate *priv = window->priv; if (window->priv->closing) return; flags = ephy_web_view_get_navigation_flags (view); - if (flags & EPHY_WEB_VIEW_NAV_UP) - { - up = TRUE; - } - if (flags & EPHY_WEB_VIEW_NAV_BACK) - { - back = TRUE; - } - if (flags & EPHY_WEB_VIEW_NAV_FORWARD) - { - forward = TRUE; - } - - _ephy_window_set_navigation_actions (window, back, forward, up); + 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); } static void |