From: Christian Dywan Date: Sun, 10 May 2009 12:57:26 +0000 (+0200) Subject: Make AddSpeedDial visible/ hidden instead of sensitive/ grayed X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db826d348a60aa2206eac9ef7acb396417b55179;p=midori Make AddSpeedDial visible/ hidden instead of sensitive/ grayed --- 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);