From: Christian Dywan Date: Sat, 31 Oct 2009 21:43:58 +0000 (+0100) Subject: Hide permanently unavailable actions instead of disabling them X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d550d2c5208e040968806ab50ad34310407f8c81;p=midori Hide permanently unavailable actions instead of disabling them --- diff --git a/midori/main.c b/midori/main.c index f76e29a3..0deeb490 100644 --- a/midori/main.c +++ b/midori/main.c @@ -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)); diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 2ef5c0a1..57e44487 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -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 ( diff --git a/midori/midori-view.c b/midori/midori-view.c index 97e52e11..9899e435 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -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 (