From 552c99cd567282a214249b40b7d4080f6dfbecc5 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Mon, 26 Oct 2009 18:07:10 +0100 Subject: [PATCH] Show script, image and plugin options and views source in app menu --- midori/midori-browser.c | 29 +++++++++++++++++++---------- midori/midori-preferences.c | 10 +++++++--- midori/midori-view.c | 2 ++ 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 7355377d..e675dcf8 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -2920,8 +2920,9 @@ _action_compact_menu_populate_popup (GtkAction* action, #if HAVE_HILDON { "Find" }, { "Homepage" }, - { "ManageSearchEngines" }, + { "SourceView" }, #else + { "ManageSearchEngines" }, { "Print" }, { "PrivateBrowsing" }, { NULL }, @@ -2930,12 +2931,15 @@ _action_compact_menu_populate_popup (GtkAction* action, { "Statusbar" }, { NULL }, { "-" }, - #endif { "ClearPrivateData" }, - #if !HAVE_HILDON { "Fullscreen" }, #endif { "Preferences" }, + #if HAVE_HILDON + { "auto-load-images" }, + { "enable-scripts" }, + { "enable-plugins" }, + #endif }; guint i; @@ -2954,14 +2958,19 @@ _action_compact_menu_populate_popup (GtkAction* action, if (!actions[i].name) continue; _action = _action_by_name (browser, actions[i].name); - label = katze_object_get_string (_action, "label"); - button = hildon_gtk_button_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH); + if (_action) + { + label = katze_object_get_string (_action, "label"); + button = hildon_gtk_button_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH); + gtk_button_set_label (GTK_BUTTON (button), label); + gtk_button_set_use_underline (GTK_BUTTON (button), TRUE); + g_free (label); + g_signal_connect_swapped (button, "clicked", + G_CALLBACK (gtk_action_activate), _action); + } + else + button = katze_property_proxy (browser->settings, actions[i].name, NULL); gtk_widget_show (button); - gtk_button_set_label (GTK_BUTTON (button), label); - gtk_button_set_use_underline (GTK_BUTTON (button), TRUE); - g_free (label); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (gtk_action_activate), _action); hildon_app_menu_append (HILDON_APP_MENU (menu), GTK_BUTTON (button)); #else GtkWidget* menuitem; diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index 2a8256e5..c32a46f3 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -371,10 +371,12 @@ midori_preferences_set_settings (MidoriPreferences* preferences, /* Page "Behavior" */ PAGE_NEW (GTK_STOCK_SELECT_COLOR, _("Behavior")); FRAME_NEW (_("Features")); + #if !HAVE_HILDON button = katze_property_proxy (settings, "auto-load-images", NULL); gtk_button_set_label (GTK_BUTTON (button), _("Load images automatically")); gtk_widget_set_tooltip_text (button, _("Load and display images automatically")); INDENTED_ADD (button); + #endif #if WEBKIT_CHECK_VERSION (1, 1, 15) || HAVE_HILDON if (katze_object_get_boolean (gtk_settings, "gtk-touchscreen-mode")) button = katze_property_proxy (settings, "kinetic-scrolling", NULL); @@ -388,6 +390,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences, button = katze_property_proxy (settings, "middle-click-opens-selection", NULL); #endif SPANNED_ADD (button); + #if !HAVE_HILDON button = katze_property_proxy (settings, "enable-scripts", NULL); gtk_button_set_label (GTK_BUTTON (button), _("Enable scripts")); gtk_widget_set_tooltip_text (button, _("Enable embedded scripting languages")); @@ -396,7 +399,6 @@ midori_preferences_set_settings (MidoriPreferences* preferences, gtk_button_set_label (GTK_BUTTON (button), _("Enable Netscape plugins")); gtk_widget_set_tooltip_text (button, _("Enable embedded Netscape plugin objects")); SPANNED_ADD (button); - #if !HAVE_HILDON button = katze_property_proxy (settings, "enforce-96-dpi", NULL); gtk_button_set_label (GTK_BUTTON (button), _("Enforce 96 dots per inch")); gtk_widget_set_tooltip_text (button, _("Enforce a video dot density of 96 DPI")); @@ -443,13 +445,15 @@ midori_preferences_set_settings (MidoriPreferences* preferences, INDENTED_ADD (label); button = katze_property_proxy (settings, "open-external-pages-in", NULL); SPANNED_ADD (button); + #if !HAVE_HILDON button = katze_property_proxy (settings, "always-show-tabbar", NULL); INDENTED_ADD (button); - button = katze_property_proxy (settings, "open-tabs-in-the-background", NULL); + button = katze_property_proxy (settings, "close-buttons-on-tabs", NULL); SPANNED_ADD (button); + #endif button = katze_property_proxy (settings, "open-tabs-next-to-current", NULL); INDENTED_ADD (button); - button = katze_property_proxy (settings, "close-buttons-on-tabs", NULL); + button = katze_property_proxy (settings, "open-tabs-in-the-background", NULL); SPANNED_ADD (button); #if !HAVE_HILDON diff --git a/midori/midori-view.c b/midori/midori-view.c index 23b9d7bf..2f8bedc0 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -2017,6 +2017,7 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view, menuitem = sokoke_action_create_popup_menu_item ( gtk_action_group_get_action (actions, "SaveAs")); gtk_menu_shell_append (menu_shell, menuitem); + #if !HAVE_HILDON /* Currently views that don't support source, don't support saving either. If that changes, we need to think of something. */ if (!midori_view_can_view_source (view)) @@ -2024,6 +2025,7 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view, menuitem = sokoke_action_create_popup_menu_item ( gtk_action_group_get_action (actions, "SourceView")); gtk_menu_shell_append (menu_shell, menuitem); + #endif } gtk_widget_show_all (menu);