[MPlayer-cvslog] r36661 - trunk/gui/dialog/preferences.c

ib subversion at mplayerhq.hu
Mon Jan 20 18:29:21 CET 2014


Author: ib
Date: Mon Jan 20 18:29:21 2014
New Revision: 36661

Log:
Improve the dialog for subtitle encodings.

Disable the check button for option 'sub_unicode'
in case option 'sub_utf8' is active.

Modified:
   trunk/gui/dialog/preferences.c

Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c	Mon Jan 20 18:09:47 2014	(r36660)
+++ trunk/gui/dialog/preferences.c	Mon Jan 20 18:29:21 2014	(r36661)
@@ -246,7 +246,7 @@ static void prEntry( GtkEditable * edita
 	 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 @@ static void prEntry( GtkEditable * edita
 #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 @@ static GtkWidget * CreatePreferences( vo
 #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 );


More information about the MPlayer-cvslog mailing list