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

ib subversion at mplayerhq.hu
Sun Feb 9 18:53:28 CET 2014


Author: ib
Date: Sun Feb  9 18:53:28 2014
New Revision: 36819

Log:
Show message box only if necessary.

Don't show it when entering the preferences,
but when confirming new preferences.

This is less annoying.

Additionally, rename control variable.

Modified:
   trunk/gui/dialog/preferences.c

Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c	Sun Feb  9 18:52:18 2014	(r36818)
+++ trunk/gui/dialog/preferences.c	Sun Feb  9 18:53:28 2014	(r36819)
@@ -277,6 +277,8 @@ static void button_toggled( GtkToggleBut
 
 static void prButton( GtkButton * button, gpointer user_data )
 {
+ static int inform = True;
+
  (void) button;
 
  switch ( (int)user_data )
@@ -384,6 +386,12 @@ static void prButton( GtkButton * button
 	setdup( &dvd_device,gtk_entry_get_text( GTK_ENTRY( prEDVDDevice ) ) );
 	setdup( &cdrom_device,gtk_entry_get_text( GTK_ENTRY( prECDRomDevice ) ) );
 
+	if ( inform )
+	 {
+	  gtkMessageBox( MSGBOX_INFORMATION,MSGTR_GUI_MSG_PlaybackNeedsRestart );
+	  inform = False;
+	 }
+
    case bCancel:
 	gtk_widget_destroy( Preferences );
 	if ( AudioConfig ) gtk_widget_destroy( AudioConfig );
@@ -1447,14 +1455,6 @@ void ShowPreferences( void )
 
  gtk_widget_show( Preferences );
  gtkSetLayer( Preferences );
- {
-  static int visible = True;
-  if ( visible )
-   {
-    gtkMessageBox( MSGBOX_INFORMATION,MSGTR_GUI_MSG_PlaybackNeedsRestart );
-    visible=False;
-   }
- }
 }
 
 #ifdef CONFIG_OSS_AUDIO


More information about the MPlayer-cvslog mailing list