From db826d348a60aa2206eac9ef7acb396417b55179 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 10 May 2009 14:57:26 +0200 Subject: [PATCH] Make AddSpeedDial visible/ hidden instead of sensitive/ grayed --- midori/midori-browser.c | 2 +- midori/midori-view.c | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index b6af5cdb..8a9156b4 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -249,7 +249,7 @@ _midori_browser_update_interface (MidoriBrowser* browser) _action_set_sensitive (browser, "Forward", midori_view_can_go_forward (MIDORI_VIEW (view))); - _action_set_sensitive (browser, "AddSpeedDial", + gtk_action_set_visible (_action_by_name (browser, "AddSpeedDial"), browser->customized_homepage_in_new_tabs); /* Currently views that don't support source, don't support saving either. If that changes, we need to think of something. */ diff --git a/midori/midori-view.c b/midori/midori-view.c index 14283525..95491e71 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -1250,14 +1250,15 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view, G_CALLBACK (midori_web_view_menu_action_activate_cb), view); gtk_widget_show (menuitem); - menuitem = gtk_image_menu_item_new_with_mnemonic (_("Add to customized _homepage")); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); - g_object_set_data (G_OBJECT (menuitem), "action", "AddSpeedDial"); - g_signal_connect (menuitem, "activate", - G_CALLBACK (midori_web_view_menu_action_add_speed_dial_cb), view); - gtk_widget_show (menuitem); - if (!view->customized_homepage_in_new_tabs) - gtk_widget_set_sensitive (menuitem, FALSE); + if (view->customized_homepage_in_new_tabs) + { + menuitem = gtk_image_menu_item_new_with_mnemonic (_("Add to customized _homepage")); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); + g_object_set_data (G_OBJECT (menuitem), "action", "AddSpeedDial"); + g_signal_connect (menuitem, "activate", + G_CALLBACK (midori_web_view_menu_action_add_speed_dial_cb), view); + gtk_widget_show (menuitem); + } menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_SAVE_AS, NULL); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);