]> spindle.queued.net Git - midori/commitdiff
Override image, script and Netscape plugin properties
authorChristian Dywan <christian@twotoasts.de>
Sun, 8 Nov 2009 20:55:36 +0000 (21:55 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sun, 8 Nov 2009 20:55:36 +0000 (21:55 +0100)
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
midori/midori-websettings.c

index f4b804ed50307551171f5a60d0f74203791ace44..c5f63b9e2f8d91d35716c614400e724a6025839b 100644 (file)
@@ -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"));
index 8a7cfccae6f1cce084a060e21317e5f525e01581..d76dd4e1c5c6bbf283c369f683cac3854c683697 100644 (file)
@@ -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;