* "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.4.2 mnemonics are automatically stripped.
* 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".
#endif
for (i = 0; i < enum_class->n_values; i++)
{
- const gchar* label = gettext (enum_class->values[i].value_nick);
+ const gchar* raw_label = gettext (enum_class->values[i].value_nick);
+ gchar* label = katze_strip_mnemonics (raw_label);
#ifdef HAVE_HILDON_2_2
hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), label);
#else
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), label);
#endif
+ g_free (label);
}
#ifdef HAVE_HILDON_2_2
hildon_touch_selector_set_active (HILDON_TOUCH_SELECTOR (selector), 0, value);
if (!type)
{
static const GEnumValue values[] = {
- { MIDORI_IDENT_MIDORI, "MIDORI_IDENT_MIDORI", N_("Midori") },
+ { MIDORI_IDENT_MIDORI, "MIDORI_IDENT_MIDORI", N_("_Automatic") },
+ { MIDORI_IDENT_GENUINE, "MIDORI_IDENT_GENUINE", N_("Midori") },
{ MIDORI_IDENT_SAFARI, "MIDORI_IDENT_SAFARI", N_("Safari") },
{ MIDORI_IDENT_IPHONE, "MIDORI_IDENT_IPHONE", N_("iPhone") },
{ MIDORI_IDENT_FIREFOX, "MIDORI_IDENT_FIREFOX", N_("Firefox") },
#endif
static gchar*
-generate_ident_string (MidoriIdentity identify_as)
+generate_ident_string (MidoriWebSettings* web_settings,
+ MidoriIdentity identify_as)
{
const gchar* platform =
#if HAVE_HILDON
const int webcore_major = WEBKIT_USER_AGENT_MAJOR_VERSION;
const int webcore_minor = WEBKIT_USER_AGENT_MINOR_VERSION;
+ #if WEBKIT_CHECK_VERSION (1, 1, 18)
+ g_object_set (web_settings, "enable-site-specific-quirks",
+ identify_as != MIDORI_IDENT_GENUINE, NULL);
+ #endif
+
switch (identify_as)
{
- case MIDORI_IDENT_MIDORI:
+ case MIDORI_IDENT_GENUINE:
return g_strdup_printf ("Mozilla/5.0 (%s %s) AppleWebKit/%d.%d+ %s",
platform, os, webcore_major, webcore_minor, appname);
+ case MIDORI_IDENT_MIDORI:
case MIDORI_IDENT_SAFARI:
+ g_object_set (web_settings, "enable-site-specific-quirks", TRUE, NULL);
return g_strdup_printf ("Mozilla/5.0 (Macintosh; U; Intel Mac OS X; %s) "
"AppleWebKit/%d+ (KHTML, like Gecko) Version/5.0 Safari/%d.%d+ %s",
lang, webcore_major, webcore_major, webcore_minor, appname);
web_settings->identify_as = g_value_get_enum (value);
if (web_settings->identify_as != MIDORI_IDENT_CUSTOM)
{
- gchar* string = generate_ident_string (web_settings->identify_as);
+ gchar* string = generate_ident_string (web_settings, web_settings->identify_as);
katze_assign (web_settings->ident_string, string);
g_object_set (web_settings, "user-agent", string, NULL);
}
case PROP_USER_AGENT:
if (!g_strcmp0 (web_settings->ident_string, ""))
{
- gchar* string = generate_ident_string (web_settings->identify_as);
+ gchar* string = generate_ident_string (web_settings, web_settings->identify_as);
katze_assign (web_settings->ident_string, string);
}
g_value_set_string (value, web_settings->ident_string);