From 4592bb6927a5a7017403fbcaa4937aa10c263227 Mon Sep 17 00:00:00 2001 From: Mario Sanchez Prada Date: Fri, 9 Apr 2010 19:37:09 +0200 Subject: Change sensitiveness for history buttons when clearing the history Connect to the 'cleared' signal and change the sensitivity flags Bug #539716 Signed-off-by: Xan Lopez --- src/ephy-navigation-history-action.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/ephy-navigation-history-action.c') diff --git a/src/ephy-navigation-history-action.c b/src/ephy-navigation-history-action.c index 90345b2e6..c82f04c34 100644 --- a/src/ephy-navigation-history-action.c +++ b/src/ephy-navigation-history-action.c @@ -23,6 +23,7 @@ #include "config.h" #include "ephy-navigation-history-action.h" +#include "ephy-action-helper.h" #include "ephy-debug.h" #include "ephy-embed-container.h" #include "ephy-embed-shell.h" @@ -133,6 +134,13 @@ deselect_menu_item_cb (GtkWidget *menuitem, gtk_statusbar_pop (GTK_STATUSBAR (statusbar), statusbar_cid); } +static void +ephy_history_cleared_cb (EphyHistory *history, + EphyNavigationHistoryAction *action) +{ + ephy_action_change_sensitivity_flags (GTK_ACTION (action), SENS_FLAG, TRUE); +} + static GList* webkit_construct_history_list (WebKitWebView *web_view, WebKitHistoryType hist_type) { @@ -283,6 +291,10 @@ ephy_navigation_history_action_init (EphyNavigationHistoryAction *action) history = EPHY_HISTORY (ephy_embed_shell_get_global_history (embed_shell)); action->priv->history = EPHY_HISTORY (g_object_ref (history)); + + g_signal_connect (action->priv->history, + "cleared", G_CALLBACK (ephy_history_cleared_cb), + action); } static void @@ -290,6 +302,9 @@ ephy_navigation_history_action_finalize (GObject *object) { EphyNavigationHistoryAction *action = EPHY_NAVIGATION_HISTORY_ACTION (object); + g_signal_handlers_disconnect_by_func (action->priv->history, + ephy_history_cleared_cb, + action); g_object_unref (action->priv->history); action->priv->history = NULL; -- cgit v1.2.3