From 4e4136a14c342e8aaa0d55a86d9aa83c5f4e70e6 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Fri, 13 Jun 2003 18:36:01 +0000 Subject: Persist the language selected for the fonts preferences. Make the 2003-06-13 Christian Persch * src/prefs-dialog.c: (create_language_menu): Persist the language selected for the fonts preferences. Make the initialiser of the languages menu safe for NULL list from eel_gconf_get_string_list. --- src/prefs-dialog.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index 87e62d64b..80e0dc931 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -243,6 +243,8 @@ enum MEMORY_CACHE_PROP }; +#define CONF_FONTS_FOR_LANGUAGE "/apps/epiphany/dialogs/preferences_fonts_for_lang" + static const EphyDialogProperty properties [] = { @@ -257,7 +259,7 @@ EphyDialogProperty properties [] = { LANGUAGE_PROP, "language_optionmenu", NULL, PT_NORMAL, NULL }, /* Appeareance */ - { FONTS_LANGUAGE_PROP, "fonts_language_optionmenu", NULL, PT_NORMAL, NULL }, + { FONTS_LANGUAGE_PROP, "fonts_language_optionmenu", CONF_FONTS_FOR_LANGUAGE, PT_AUTOAPPLY, NULL }, { SERIF_PROP, "serif_combo", NULL, PT_NORMAL, NULL }, { SANSSERIF_PROP, "sansserif_combo", NULL, PT_NORMAL, NULL }, { MONOSPACE_PROP, "monospace_combo", NULL, PT_NORMAL, NULL }, @@ -1005,22 +1007,23 @@ create_language_menu (PrefsDialog *dialog) /* init value from first element of the list */ list = eel_gconf_get_string_list (CONF_RENDERING_LANGUAGE); - g_return_if_fail (list != NULL); /* FIXME: doesn't connect the handler! */ + if (list) + { + code = (const gchar *) list->data; + lang = g_list_find_custom (dialog->priv->langs, code, + (GCompareFunc)find_lang_code); - code = (const gchar *) list->data; - lang = g_list_find_custom (dialog->priv->langs, code, - (GCompareFunc)find_lang_code); + if (lang) + { + i = g_list_position (dialog->priv->langs, lang); + } - if (lang) - { - i = g_list_position (dialog->priv->langs, lang); + g_slist_foreach (list, (GFunc) g_free, NULL); + g_slist_free (list); } gtk_option_menu_set_history (GTK_OPTION_MENU(optionmenu), i); - g_slist_foreach (list, (GFunc) g_free, NULL); - g_slist_free (list); - g_signal_connect (optionmenu, "changed", G_CALLBACK (language_menu_changed_cb), dialog); -- cgit