Show script, image and plugin options and views source in app menu

This commit is contained in:
Christian Dywan 2009-10-26 18:07:10 +01:00
parent 8cf6f4fa6c
commit 552c99cd56
3 changed files with 28 additions and 13 deletions

View file

@ -2920,8 +2920,9 @@ _action_compact_menu_populate_popup (GtkAction* action,
#if HAVE_HILDON #if HAVE_HILDON
{ "Find" }, { "Find" },
{ "Homepage" }, { "Homepage" },
{ "ManageSearchEngines" }, { "SourceView" },
#else #else
{ "ManageSearchEngines" },
{ "Print" }, { "Print" },
{ "PrivateBrowsing" }, { "PrivateBrowsing" },
{ NULL }, { NULL },
@ -2930,12 +2931,15 @@ _action_compact_menu_populate_popup (GtkAction* action,
{ "Statusbar" }, { "Statusbar" },
{ NULL }, { NULL },
{ "-" }, { "-" },
#endif
{ "ClearPrivateData" }, { "ClearPrivateData" },
#if !HAVE_HILDON
{ "Fullscreen" }, { "Fullscreen" },
#endif #endif
{ "Preferences" }, { "Preferences" },
#if HAVE_HILDON
{ "auto-load-images" },
{ "enable-scripts" },
{ "enable-plugins" },
#endif
}; };
guint i; guint i;
@ -2954,14 +2958,19 @@ _action_compact_menu_populate_popup (GtkAction* action,
if (!actions[i].name) if (!actions[i].name)
continue; continue;
_action = _action_by_name (browser, actions[i].name); _action = _action_by_name (browser, actions[i].name);
if (_action)
{
label = katze_object_get_string (_action, "label"); label = katze_object_get_string (_action, "label");
button = hildon_gtk_button_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH); button = hildon_gtk_button_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
gtk_widget_show (button);
gtk_button_set_label (GTK_BUTTON (button), label); gtk_button_set_label (GTK_BUTTON (button), label);
gtk_button_set_use_underline (GTK_BUTTON (button), TRUE); gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
g_free (label); g_free (label);
g_signal_connect_swapped (button, "clicked", g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_action_activate), _action); G_CALLBACK (gtk_action_activate), _action);
}
else
button = katze_property_proxy (browser->settings, actions[i].name, NULL);
gtk_widget_show (button);
hildon_app_menu_append (HILDON_APP_MENU (menu), GTK_BUTTON (button)); hildon_app_menu_append (HILDON_APP_MENU (menu), GTK_BUTTON (button));
#else #else
GtkWidget* menuitem; GtkWidget* menuitem;

View file

@ -371,10 +371,12 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
/* Page "Behavior" */ /* Page "Behavior" */
PAGE_NEW (GTK_STOCK_SELECT_COLOR, _("Behavior")); PAGE_NEW (GTK_STOCK_SELECT_COLOR, _("Behavior"));
FRAME_NEW (_("Features")); FRAME_NEW (_("Features"));
#if !HAVE_HILDON
button = katze_property_proxy (settings, "auto-load-images", NULL); button = katze_property_proxy (settings, "auto-load-images", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Load images automatically")); gtk_button_set_label (GTK_BUTTON (button), _("Load images automatically"));
gtk_widget_set_tooltip_text (button, _("Load and display images automatically")); gtk_widget_set_tooltip_text (button, _("Load and display images automatically"));
INDENTED_ADD (button); INDENTED_ADD (button);
#endif
#if WEBKIT_CHECK_VERSION (1, 1, 15) || HAVE_HILDON #if WEBKIT_CHECK_VERSION (1, 1, 15) || HAVE_HILDON
if (katze_object_get_boolean (gtk_settings, "gtk-touchscreen-mode")) if (katze_object_get_boolean (gtk_settings, "gtk-touchscreen-mode"))
button = katze_property_proxy (settings, "kinetic-scrolling", NULL); 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); button = katze_property_proxy (settings, "middle-click-opens-selection", NULL);
#endif #endif
SPANNED_ADD (button); SPANNED_ADD (button);
#if !HAVE_HILDON
button = katze_property_proxy (settings, "enable-scripts", NULL); button = katze_property_proxy (settings, "enable-scripts", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Enable scripts")); gtk_button_set_label (GTK_BUTTON (button), _("Enable scripts"));
gtk_widget_set_tooltip_text (button, _("Enable embedded scripting languages")); 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_button_set_label (GTK_BUTTON (button), _("Enable Netscape plugins"));
gtk_widget_set_tooltip_text (button, _("Enable embedded Netscape plugin objects")); gtk_widget_set_tooltip_text (button, _("Enable embedded Netscape plugin objects"));
SPANNED_ADD (button); SPANNED_ADD (button);
#if !HAVE_HILDON
button = katze_property_proxy (settings, "enforce-96-dpi", NULL); button = katze_property_proxy (settings, "enforce-96-dpi", NULL);
gtk_button_set_label (GTK_BUTTON (button), _("Enforce 96 dots per inch")); 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")); 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); INDENTED_ADD (label);
button = katze_property_proxy (settings, "open-external-pages-in", NULL); button = katze_property_proxy (settings, "open-external-pages-in", NULL);
SPANNED_ADD (button); SPANNED_ADD (button);
#if !HAVE_HILDON
button = katze_property_proxy (settings, "always-show-tabbar", NULL); button = katze_property_proxy (settings, "always-show-tabbar", NULL);
INDENTED_ADD (button); 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); SPANNED_ADD (button);
#endif
button = katze_property_proxy (settings, "open-tabs-next-to-current", NULL); button = katze_property_proxy (settings, "open-tabs-next-to-current", NULL);
INDENTED_ADD (button); 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); SPANNED_ADD (button);
#if !HAVE_HILDON #if !HAVE_HILDON

View file

@ -2017,6 +2017,7 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view,
menuitem = sokoke_action_create_popup_menu_item ( menuitem = sokoke_action_create_popup_menu_item (
gtk_action_group_get_action (actions, "SaveAs")); gtk_action_group_get_action (actions, "SaveAs"));
gtk_menu_shell_append (menu_shell, menuitem); gtk_menu_shell_append (menu_shell, menuitem);
#if !HAVE_HILDON
/* Currently views that don't support source, don't support /* Currently views that don't support source, don't support
saving either. If that changes, we need to think of something. */ saving either. If that changes, we need to think of something. */
if (!midori_view_can_view_source (view)) 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 ( menuitem = sokoke_action_create_popup_menu_item (
gtk_action_group_get_action (actions, "SourceView")); gtk_action_group_get_action (actions, "SourceView"));
gtk_menu_shell_append (menu_shell, menuitem); gtk_menu_shell_append (menu_shell, menuitem);
#endif
} }
gtk_widget_show_all (menu); gtk_widget_show_all (menu);