[Xfce4-commits] <midori:master> Merge separate language preferences into one

Christian Dywan noreply at xfce.org
Mon Dec 6 18:22:03 CET 2010


Updating branch refs/heads/master
         to 40d25a4e10b95de56c80616e92ea35c37ba9f3f3 (commit)
       from a5c0b8539bab532a0b5aaaae81c9231c335d9455 (commit)

commit 40d25a4e10b95de56c80616e92ea35c37ba9f3f3
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sun Dec 5 23:14:19 2010 +0100

    Merge separate language preferences into one

 midori/midori-preferences.c |   46 +++++++++++++++++-------------------------
 midori/midori-websettings.c |    7 +++++-
 2 files changed, 25 insertions(+), 28 deletions(-)

diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c
index 07b1a20..9d231fd 100644
--- a/midori/midori-preferences.c
+++ b/midori/midori-preferences.c
@@ -413,22 +413,16 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     #if !HAVE_HILDON
     button = katze_property_proxy (settings, "auto-load-images", NULL);
     INDENTED_ADD (button);
-    #endif
-    #if WEBKIT_CHECK_VERSION (1, 1, 15) || HAVE_HILDON
-    if (katze_widget_has_touchscreen_mode (parent ?
-        GTK_WIDGET (parent) : GTK_WIDGET (preferences)))
-        button = katze_property_proxy (settings, "kinetic-scrolling", NULL);
-    else
-    {
-        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"));
-    }
+    #if WEBKIT_CHECK_VERSION (1, 1, 6)
+    button = katze_property_proxy (settings, "enable-spell-checking", NULL);
+    gtk_button_set_label (GTK_BUTTON (button), _("Enable Spell Checking"));
+    gtk_widget_set_tooltip_text (button, _("Enable spell checking while typing"));
     #else
-    button = katze_property_proxy (settings, "middle-click-opens-selection", NULL);
+    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"));
     #endif
     SPANNED_ADD (button);
-    #if !HAVE_HILDON
     button = katze_property_proxy (settings, "enable-scripts", NULL);
     INDENTED_ADD (button);
     button = katze_property_proxy (settings, "enable-plugins", NULL);
@@ -442,18 +436,20 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     gtk_widget_set_tooltip_text (button, _("Whether scripts are allowed to open popup windows automatically"));
     SPANNED_ADD (button);
     #endif
-    #if WEBKIT_CHECK_VERSION (1, 1, 6)
-    FRAME_NEW (_("Spell Checking"));
-    button = katze_property_proxy (settings, "enable-spell-checking", NULL);
-    gtk_button_set_label (GTK_BUTTON (button), _("Enable Spell Checking"));
-    gtk_widget_set_tooltip_text (button, _("Enable spell checking while typing"));
+    button = NULL;
+    #if WEBKIT_CHECK_VERSION (1, 1, 15) || HAVE_HILDON
+    if (katze_widget_has_touchscreen_mode (parent ?
+        GTK_WIDGET (parent) : GTK_WIDGET (preferences)))
+        button = katze_property_proxy (settings, "kinetic-scrolling", NULL);
+    #else
+    button = katze_property_proxy (settings, "middle-click-opens-selection", NULL);
+    #endif
+    if (button != NULL)
+        INDENTED_ADD (button);
+    button = katze_property_label (settings, "preferred-languages");
     INDENTED_ADD (button);
-    entry = katze_property_proxy (settings, "spell-checking-languages", "languages");
-    /* i18n: The example should be adjusted to contain a good local default */
-    gtk_widget_set_tooltip_text (entry, _("A comma separated list of "
-       "languages to be used for spell checking, for example \"en_GB,de_DE\""));
+    entry = katze_property_proxy (settings, "preferred-languages", "languages");
     SPANNED_ADD (entry);
-    #endif
 
     /* Page "Interface" */
     PAGE_NEW (GTK_STOCK_CONVERT, _("Interface"));
@@ -521,10 +517,6 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     INDENTED_ADD (label);
     button = katze_property_proxy (settings, "identify-as", "custom-user-agent");
     SPANNED_ADD (button);
-    label = katze_property_label (settings, "preferred-languages");
-    INDENTED_ADD (label);
-    entry = katze_property_proxy (settings, "preferred-languages", "languages");
-    SPANNED_ADD (entry);
 
     /* Page "Privacy" */
     PAGE_NEW (GTK_STOCK_INDEX, _("Privacy"));
diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c
index d1c899e..3eaacc5 100644
--- a/midori/midori-websettings.c
+++ b/midori/midori-websettings.c
@@ -1071,7 +1071,8 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
     /**
     * MidoriWebSettings:preferred-languages:
     *
-    * A comma separated list of languages preferred for rendering multilingual webpages.
+    * A comma separated list of languages preferred for rendering multilingual
+    * webpages and spell checking.
     *
     * Since: 0.2.3
     */
@@ -1523,6 +1524,10 @@ midori_web_settings_set_property (GObject*      object,
         break;
     case PROP_PREFERRED_LANGUAGES:
         katze_assign (web_settings->http_accept_language, g_value_dup_string (value));
+        #if WEBKIT_CHECK_VERSION (1, 1, 6)
+        g_object_set (web_settings, "spell-checking-languages",
+                      web_settings->http_accept_language, NULL);
+        #endif
         break;
     case PROP_CLEAR_PRIVATE_DATA:
         web_settings->clear_private_data = g_value_get_int (value);



More information about the Xfce4-commits mailing list