]> spindle.queued.net Git - midori/commitdiff
Make AddSpeedDial visible/ hidden instead of sensitive/ grayed
authorChristian Dywan <christian@twotoasts.de>
Sun, 10 May 2009 12:57:26 +0000 (14:57 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 10 May 2009 12:57:26 +0000 (14:57 +0200)
midori/midori-browser.c
midori/midori-view.c

index b6af5cdb46fb1668b0ccc792d4dcabde65d3f941..8a9156b498b44be02a36c5be1ca83cdae12d410c 100644 (file)
@@ -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. */
index 142835250fbecc2ca19c2492242c243274fb68df..95491e71a6f4652cf5dad79fb93a38692ff67c4f 100644 (file)
@@ -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);