# HG changeset patch # User ib # Date 1390238961 0 # Node ID bec86410237f8fec9b50c501d6fbae0ba8d79fbf # Parent d22374047528d2f64b95b4c79e1289504acbb0b9 Improve the dialog for subtitle encodings. Disable the check button for option 'sub_unicode' in case option 'sub_utf8' is active. diff -r d22374047528 -r bec86410237f gui/dialog/preferences.c --- a/gui/dialog/preferences.c Mon Jan 20 17:09:47 2014 +0000 +++ b/gui/dialog/preferences.c Mon Jan 20 17:29:21 2014 +0000 @@ -246,7 +246,7 @@ mplayer( MPLAYER_SET_SUB_ENCODING,0,(char *)comment ); } gtk_widget_set_sensitive( CBSubUtf8,(comment == NULL) ); - gtk_widget_set_sensitive( CBSubUnicode,(comment == NULL) ); + gtk_widget_set_sensitive( CBSubUnicode,((comment == NULL) && !gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(CBSubUtf8) )) ); break; #endif } @@ -260,6 +260,13 @@ #define bLSubtitle 4 #define bLFont 5 +static void button_toggled( GtkToggleButton *button, gpointer user_data ) +{ + (void) user_data; + + gtk_widget_set_sensitive( CBSubUnicode,!gtk_toggle_button_get_active(button) ); +} + static void prButton( GtkButton * button, gpointer user_data ) { (void) button; @@ -1075,6 +1082,7 @@ #endif gtk_signal_connect( GTK_OBJECT( BLoadFont ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bLFont ); + gtk_signal_connect( GTK_OBJECT( CBSubUtf8 ),"toggled",GTK_SIGNAL_FUNC( button_toggled ),NULL ); #if 0 gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( on_CBNormalize_toggled ),NULL ); gtk_signal_connect( GTK_OBJECT( CBSoftwareMixer ),"toggled",GTK_SIGNAL_FUNC( on_CBSoftwareMixer_toggled ),NULL );