From a6fb391f9420c5ad6be37fdd4d9890ea0dd32ddb Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 8 Nov 2009 21:55:36 +0100 Subject: [PATCH] Override image, script and Netscape plugin properties The properties come from WebKitGTK+, are thus not localized but we want to have localized proxies in the compact (Hildon) menu. --- midori/midori-preferences.c | 6 ----- midori/midori-websettings.c | 53 +++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index f4b804ed..c5f63b9e 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -388,8 +388,6 @@ midori_preferences_set_settings (MidoriPreferences* preferences, 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 @@ -408,12 +406,8 @@ midori_preferences_set_settings (MidoriPreferences* preferences, 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")); INDENTED_ADD (button); button = katze_property_proxy (settings, "enable-plugins", NULL); - gtk_button_set_label (GTK_BUTTON (button), _("Enable Netscape plugins")); - gtk_widget_set_tooltip_text (button, _("Enable embedded Netscape plugin objects")); SPANNED_ADD (button); button = katze_property_proxy (settings, "enforce-96-dpi", NULL); gtk_button_set_label (GTK_BUTTON (button), _("Enforce 96 dots per inch")); diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index 8a7cfcca..d76dd4e1 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -148,6 +148,9 @@ enum PROP_OPEN_TABS_NEXT_TO_CURRENT, PROP_OPEN_POPUPS_IN_TABS, + PROP_AUTO_LOAD_IMAGES, + PROP_ENABLE_SCRIPTS, + PROP_ENABLE_PLUGINS, PROP_ZOOM_TEXT_AND_IMAGES, PROP_FIND_WHILE_TYPING, PROP_KINETIC_SCROLLING, @@ -812,6 +815,32 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + /* Override properties to localize them for preference proxies */ + g_object_class_install_property (gobject_class, + PROP_AUTO_LOAD_IMAGES, + g_param_spec_boolean ( + "auto-load-images", + _("Load images automatically"), + _("Load and display images automatically"), + TRUE, + flags)); + g_object_class_install_property (gobject_class, + PROP_ENABLE_SCRIPTS, + g_param_spec_boolean ( + "enable-scripts", + _("Enable scripts"), + _("Enable embedded scripting languages"), + TRUE, + flags)); + g_object_class_install_property (gobject_class, + PROP_ENABLE_PLUGINS, + g_param_spec_boolean ( + "enable-plugins", + _("Enable Netscape plugins"), + _("Enable embedded Netscape plugin objects"), + TRUE, + flags)); + /** * MidoriWebSettings:zoom-text-and-images: * @@ -1311,6 +1340,18 @@ midori_web_settings_set_property (GObject* object, web_settings->open_popups_in_tabs = g_value_get_boolean (value); break; + case PROP_AUTO_LOAD_IMAGES: + g_object_set (web_settings, "WebKitWebSettings::auto-load-images", + g_value_get_boolean (value), NULL); + break; + case PROP_ENABLE_SCRIPTS: + g_object_set (web_settings, "WebKitWebSettings::enable-scripts", + g_value_get_boolean (value), NULL); + break; + case PROP_ENABLE_PLUGINS: + g_object_set (web_settings, "WebKitWebSettings::enable-plugins", + g_value_get_boolean (value), NULL); + break; case PROP_ZOOM_TEXT_AND_IMAGES: web_settings->zoom_text_and_images = g_value_get_boolean (value); break; @@ -1511,6 +1552,18 @@ midori_web_settings_get_property (GObject* object, g_value_set_boolean (value, web_settings->open_popups_in_tabs); break; + case PROP_AUTO_LOAD_IMAGES: + g_value_set_boolean (value, katze_object_get_boolean (web_settings, + "WebKitWebSettings::auto-load-images")); + break; + case PROP_ENABLE_SCRIPTS: + g_value_set_boolean (value, katze_object_get_boolean (web_settings, + "WebKitWebSettings::enable-scripts")); + break; + case PROP_ENABLE_PLUGINS: + g_value_set_boolean (value, katze_object_get_boolean (web_settings, + "WebKitWebSettings::enable-plugins")); + break; case PROP_ZOOM_TEXT_AND_IMAGES: g_value_set_boolean (value, web_settings->zoom_text_and_images); break;