From: Christian Dywan Date: Mon, 8 Dec 2008 22:32:05 +0000 (+0100) Subject: Add entry for Custom character encoding X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e20193a0b9c125daba955404edb4997932e4df91;p=midori Add entry for Custom character encoding --- diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index 444c99a7..7f419941 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -220,6 +220,17 @@ proxy_download_manager_icon_cb (GtkWidget* entry, return FALSE; } +static void +midori_preferences_notify_preferred_encoding_cb (MidoriWebSettings* settings, + GParamSpec* pspec, + GtkWidget* entry) +{ + MidoriPreferredEncoding preferred_encoding; + + preferred_encoding = katze_object_get_enum (settings, "preferred-encoding"); + gtk_widget_set_sensitive (entry, preferred_encoding == MIDORI_ENCODING_CUSTOM); +} + static void midori_preferences_notify_identify_as_cb (MidoriWebSettings* settings, GParamSpec* pspec, @@ -399,7 +410,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences, /* Page "Appearance" */ PAGE_NEW (GTK_STOCK_SELECT_FONT, _("Appearance")); FRAME_NEW (_("Font settings")); - TABLE_NEW (5, 2); + TABLE_NEW (6, 2); label = gtk_label_new (_("Default Font Family")); INDENTED_ADD (label, 0, 1, 0, 1); hbox = gtk_hbox_new (FALSE, 4); @@ -416,6 +427,15 @@ midori_preferences_set_settings (MidoriPreferences* preferences, INDENTED_ADD (label, 0, 1, 2, 3); button = katze_property_proxy (settings, "preferred-encoding", NULL); FILLED_ADD (button, 1, 2, 2, 3); + label = katze_property_label (settings, "default-encoding"); + gtk_label_set_label (GTK_LABEL (label), _("Encoding")); + INDENTED_ADD (label, 0, 1, 3, 4); + entry = katze_property_proxy (settings, "default-encoding", NULL); + gtk_widget_set_tooltip_text (entry, _("The character encoding to use by default")); + g_signal_connect (settings, "notify::preferred-encoding", + G_CALLBACK (midori_preferences_notify_preferred_encoding_cb), entry); + midori_preferences_notify_preferred_encoding_cb (settings, NULL, entry); + FILLED_ADD (entry, 1, 2, 3, 4); /* Page "Behavior" */ PAGE_NEW (GTK_STOCK_SELECT_COLOR, _("Behavior"));