From ec328b5c31da2accae0a52e47a259fb15c07ad8c Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Sun, 11 Nov 2007 22:37:37 +0000 Subject: Hide Back/Forward buttons when disable_history lockdown key is enabled. Make the call to gtk_widget_show() in editable toolbar's create_item_from_action() conditional. Fixes bug #394795. svn path=/trunk/; revision=7663 --- lib/egg/egg-editable-toolbar.c | 6 +++++- src/ephy-lockdown.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c index d65b7eb97..2a6780f54 100644 --- a/lib/egg/egg-editable-toolbar.c +++ b/lib/egg/egg-editable-toolbar.c @@ -579,12 +579,14 @@ create_item_from_action (EggEditableToolbar *etoolbar, const char *name) { GtkToolItem *item; + gboolean visible; g_return_val_if_fail (name != NULL, NULL); if (strcmp (name, "_separator") == 0) { item = gtk_separator_tool_item_new (); + visible = TRUE; } else { @@ -601,9 +603,11 @@ create_item_from_action (EggEditableToolbar *etoolbar, g_signal_connect_object (action, "notify::sensitive", G_CALLBACK (action_sensitive_cb), item, 0); + visible = gtk_action_get_visible (action); } - gtk_widget_show (GTK_WIDGET (item)); + if (visible) + gtk_widget_show (GTK_WIDGET (item)); g_object_set_data_full (G_OBJECT (item), EGG_ITEM_NAME, g_strdup (name), g_free); diff --git a/src/ephy-lockdown.c b/src/ephy-lockdown.c index 5e447f770..526caa5c7 100644 --- a/src/ephy-lockdown.c +++ b/src/ephy-lockdown.c @@ -166,9 +166,11 @@ update_window (EphyWindow *window, action = gtk_action_group_get_action (action_group, "GoHistory"); ephy_action_change_sensitivity_flags (action, LOCKDOWN_FLAG, disabled); action = gtk_action_group_get_action (special_toolbar_action_group, "NavigationBack"); + gtk_action_set_visible (action, !disabled); ephy_action_change_sensitivity_flags (action, LOCKDOWN_FLAG, disabled); action = gtk_action_group_get_action (special_toolbar_action_group, "NavigationForward"); ephy_action_change_sensitivity_flags (action, LOCKDOWN_FLAG, disabled); + gtk_action_set_visible (action, !disabled); disabled = eel_gconf_get_boolean (CONF_LOCKDOWN_DISABLE_BOOKMARK_EDITING); action = gtk_action_group_get_action (action_group, "GoBookmarks"); -- cgit v1.2.3