[MPlayer-cvslog] r36703 - trunk/gui/dialog/preferences.c
ib
subversion at mplayerhq.hu
Thu Jan 23 13:09:37 CET 2014
Author: ib
Date: Thu Jan 23 13:09:37 2014
New Revision: 36703
Log:
Improve the dialog for font encodings.
In case iconv is available, add only available encodings from the
full list to avoid possible confusion.
In any case (and especially if iconv isn't available) add UNICODE,
since this is internally provided by MPlayer.
Modified:
trunk/gui/dialog/preferences.c
Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c Wed Jan 22 20:38:44 2014 (r36702)
+++ trunk/gui/dialog/preferences.c Thu Jan 23 13:09:37 2014 (r36703)
@@ -583,6 +583,7 @@ static GtkWidget * CreatePreferences( vo
GtkWidget * hbox7;
#endif
#ifdef CONFIG_ICONV
+ iconv_t cd;
GList * CBSubEncoding_items = NULL;
#endif
GtkWidget * vbox7;
@@ -811,7 +812,7 @@ static GtkWidget * CreatePreferences( vo
CBSubEncoding_items=g_list_append( CBSubEncoding_items,MSGTR_PREFERENCES_DefaultEnc );
{
int i, listed=(sub_cp == NULL);
- iconv_t cd;
+
for ( i=0;lEncoding[i].name;i++ )
{
cd=iconv_open( "UTF-8",lEncoding[i].name );
@@ -908,8 +909,21 @@ static GtkWidget * CreatePreferences( vo
gtk_widget_show( CBFontEncoding );
gtk_table_attach( GTK_TABLE( table1 ),CBFontEncoding,1,2,0,1,(GtkAttachOptions)( GTK_FILL ),(GtkAttachOptions)( 0 ),0,0 );
{
- int i;
- for ( i=0;lEncoding[i].name;i++ ) CBFontEncoding_items=g_list_append( CBFontEncoding_items,lEncoding[i].comment );
+ int i, append;
+ for ( i=0;lEncoding[i].name;i++ )
+ {
+ append=(strcasecmp( lEncoding[i].name,"UNICODE" ) == 0);
+#ifdef CONFIG_ICONV
+ cd=iconv_open( "ucs-4",lEncoding[i].name );
+
+ if (cd != (iconv_t) -1)
+ {
+ iconv_close(cd);
+ append=True;
+ }
+#endif
+ if ( append ) CBFontEncoding_items=g_list_append( CBFontEncoding_items,lEncoding[i].comment );
+ }
}
gtk_combo_set_popdown_strings( GTK_COMBO( CBFontEncoding ),CBFontEncoding_items );
g_list_free( CBFontEncoding_items );
More information about the MPlayer-cvslog
mailing list