Merge separate language preferences into one

This commit is contained in:
Christian Dywan 2010-12-05 23:14:19 +01:00
parent a5c0b8539b
commit 40d25a4e10
2 changed files with 26 additions and 29 deletions

View file

@ -413,22 +413,16 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
#if !HAVE_HILDON #if !HAVE_HILDON
button = katze_property_proxy (settings, "auto-load-images", NULL); button = katze_property_proxy (settings, "auto-load-images", NULL);
INDENTED_ADD (button); INDENTED_ADD (button);
#endif #if WEBKIT_CHECK_VERSION (1, 1, 6)
#if WEBKIT_CHECK_VERSION (1, 1, 15) || HAVE_HILDON button = katze_property_proxy (settings, "enable-spell-checking", NULL);
if (katze_widget_has_touchscreen_mode (parent ? gtk_button_set_label (GTK_BUTTON (button), _("Enable Spell Checking"));
GTK_WIDGET (parent) : GTK_WIDGET (preferences))) gtk_widget_set_tooltip_text (button, _("Enable spell checking while typing"));
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"));
}
#else #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 #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);
INDENTED_ADD (button); INDENTED_ADD (button);
button = katze_property_proxy (settings, "enable-plugins", NULL); 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")); gtk_widget_set_tooltip_text (button, _("Whether scripts are allowed to open popup windows automatically"));
SPANNED_ADD (button); SPANNED_ADD (button);
#endif #endif
#if WEBKIT_CHECK_VERSION (1, 1, 6) button = NULL;
FRAME_NEW (_("Spell Checking")); #if WEBKIT_CHECK_VERSION (1, 1, 15) || HAVE_HILDON
button = katze_property_proxy (settings, "enable-spell-checking", NULL); if (katze_widget_has_touchscreen_mode (parent ?
gtk_button_set_label (GTK_BUTTON (button), _("Enable Spell Checking")); GTK_WIDGET (parent) : GTK_WIDGET (preferences)))
gtk_widget_set_tooltip_text (button, _("Enable spell checking while typing")); button = katze_property_proxy (settings, "kinetic-scrolling", NULL);
INDENTED_ADD (button); #else
entry = katze_property_proxy (settings, "spell-checking-languages", "languages"); button = katze_property_proxy (settings, "middle-click-opens-selection", NULL);
/* 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\""));
SPANNED_ADD (entry);
#endif #endif
if (button != NULL)
INDENTED_ADD (button);
button = katze_property_label (settings, "preferred-languages");
INDENTED_ADD (button);
entry = katze_property_proxy (settings, "preferred-languages", "languages");
SPANNED_ADD (entry);
/* Page "Interface" */ /* Page "Interface" */
PAGE_NEW (GTK_STOCK_CONVERT, _("Interface")); PAGE_NEW (GTK_STOCK_CONVERT, _("Interface"));
@ -521,10 +517,6 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
INDENTED_ADD (label); INDENTED_ADD (label);
button = katze_property_proxy (settings, "identify-as", "custom-user-agent"); button = katze_property_proxy (settings, "identify-as", "custom-user-agent");
SPANNED_ADD (button); 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 "Privacy" */
PAGE_NEW (GTK_STOCK_INDEX, _("Privacy")); PAGE_NEW (GTK_STOCK_INDEX, _("Privacy"));

View file

@ -1071,7 +1071,8 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
/** /**
* MidoriWebSettings:preferred-languages: * 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 * Since: 0.2.3
*/ */
@ -1523,6 +1524,10 @@ midori_web_settings_set_property (GObject* object,
break; break;
case PROP_PREFERRED_LANGUAGES: case PROP_PREFERRED_LANGUAGES:
katze_assign (web_settings->http_accept_language, g_value_dup_string (value)); 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; break;
case PROP_CLEAR_PRIVATE_DATA: case PROP_CLEAR_PRIVATE_DATA:
web_settings->clear_private_data = g_value_get_int (value); web_settings->clear_private_data = g_value_get_int (value);