]> spindle.queued.net Git - midori/commitdiff
Hide permanently unavailable actions instead of disabling them
authorChristian Dywan <christian@twotoasts.de>
Sat, 31 Oct 2009 21:43:58 +0000 (22:43 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sat, 31 Oct 2009 21:43:58 +0000 (22:43 +0100)
midori/main.c
midori/midori-browser.c
midori/midori-view.c

index f76e29a39934fc633e3342b8f53ee65c7c788657..0deeb49097d1d33e63163951981f891797a6cb26 100644 (file)
@@ -1424,7 +1424,7 @@ midori_load_session (gpointer data)
         GtkAction* action = gtk_action_group_get_action (action_group, "LastSession");
         g_signal_connect (action, "activate",
             G_CALLBACK (midori_browser_action_last_session_activate_cb), browser);
-        gtk_action_set_sensitive (action, TRUE);
+        gtk_action_set_visible (action, TRUE);
     }
     midori_app_add_browser (app, browser);
     gtk_widget_show (GTK_WIDGET (browser));
index 2ef5c0a16bc37f3e5d4de276ad67352787b3b9db..57e44487892b25c1afbd3852770a203a366708ea 100644 (file)
@@ -199,6 +199,14 @@ _action_set_sensitive (MidoriBrowser* browser,
     gtk_action_set_sensitive (_action_by_name (browser, name), sensitive);
 }
 
+static void
+_action_set_visible (MidoriBrowser* browser,
+                     const gchar*   name,
+                     gboolean       visible)
+{
+    gtk_action_set_visible (_action_by_name (browser, name), visible);
+}
+
 static void
 _action_set_active (MidoriBrowser* browser,
                     const gchar*   name,
@@ -5494,19 +5502,19 @@ midori_browser_init (MidoriBrowser* browser)
         G_CALLBACK (midori_browser_menu_item_middle_click_event_cb), browser);
 
 
-    _action_set_sensitive (browser, "PrivateBrowsing", FALSE);
+    _action_set_visible (browser, "PrivateBrowsing", FALSE);
     #if HAVE_HILDON
-    g_object_set (_action_by_name (browser, "Menubar"), "visible", FALSE, NULL);
-    g_object_set (_action_by_name (browser, "Statusbar"), "visible", FALSE, NULL);
+    _action_set_visible (browser, "Menubar", FALSE);
+    _action_set_visible (browser, "Statusbar", FALSE);
     #endif
     #if !WEBKIT_CHECK_VERSION (1, 1, 3)
-    _action_set_sensitive (browser, "Transferbar", FALSE);
+    _action_set_visible (browser, "Transferbar", FALSE);
     #endif
     _action_set_sensitive (browser, "EncodingCustom", FALSE);
-    _action_set_sensitive (browser, "SelectionSourceView", FALSE);
-    _action_set_sensitive (browser, "LastSession", FALSE);
-    /* FIXME: Enable once implemented */
-    _action_set_sensitive (browser, "AddDesktopShortcut", FALSE);
+    _action_set_visible (browser, "SelectionSourceView", FALSE);
+    _action_set_visible (browser, "LastSession", FALSE);
+    /* FIXME: Show once implemented */
+    _action_set_visible (browser, "AddDesktopShortcut", FALSE);
 
     /* Create the navigationbar */
     browser->navigationbar = gtk_ui_manager_get_widget (
index 97e52e117ec7eb8d53f12c516b84791e6ee79f2d..9899e435e33bc52626f59df465035bf912d13bde 100644 (file)
@@ -2007,6 +2007,7 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view,
         menuitem = sokoke_action_create_popup_menu_item (
                 gtk_action_group_get_action (actions, "AddDesktopShortcut"));
         gtk_menu_shell_append (menu_shell, menuitem);
+        gtk_widget_set_no_show_all (menuitem, TRUE);
         #endif
 
         menuitem = sokoke_action_create_popup_menu_item (