* "custom-PROPERTY": the last value of an enumeration will be the "custom"
* value, where the user may enter text freely, which then updates
* the property PROPERTY instead. This applies only to enumerations.
+ * Since 0.2.9 the following hints are also supported:
+ * "languages": the widget will be particularly suitable for choosing
+ * multiple language codes, ie. "de,en_GB".
*
* Any other values for @hint are silently ignored.
*
g_object_get (object, property, &string, NULL);
if (!string)
string = g_strdup (G_PARAM_SPEC_STRING (pspec)->default_value);
+ if (!(string && *string) && _hint == I_("languages"))
+ {
+ gchar* lang = g_strjoinv (",", (gchar**)g_get_language_names ());
+ if (g_str_has_suffix (lang, ",C"))
+ {
+ string = g_strndup (lang, strlen (lang) - 2);
+ g_free (lang);
+ }
+ else
+ string = lang;
+ }
gtk_entry_set_text (GTK_ENTRY (widget), string ? string : "");
g_signal_connect (widget, "activate",
G_CALLBACK (proxy_entry_activate_cb), object);
gtk_button_set_label (GTK_BUTTON (button), _("Enable Spell Checking"));
gtk_widget_set_tooltip_text (button, _("Enable spell checking while typing"));
INDENTED_ADD (button);
- button = gtk_label_new (_("Spelling dictionaries:"));
- INDENTED_ADD (button);
- entry = katze_property_proxy (settings, "spell-checking-languages", NULL);
+ 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\""));
SPANNED_ADD (button);
label = katze_property_label (settings, "preferred-languages");
INDENTED_ADD (label);
- entry = katze_property_proxy (settings, "preferred-languages", NULL);
+ entry = katze_property_proxy (settings, "preferred-languages", "languages");
SPANNED_ADD (entry);
/* Page "Privacy" */