changeset 36723:d115f34f2f23

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.
author ib
date Sun, 09 Feb 2014 17:53:28 +0000
parents af6374499845
children 3561e179b25c
files gui/dialog/preferences.c
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/gui/dialog/preferences.c	Sun Feb 09 17:52:18 2014 +0000
+++ b/gui/dialog/preferences.c	Sun Feb 09 17:53:28 2014 +0000
@@ -277,6 +277,8 @@
 
 static void prButton( GtkButton * button, gpointer user_data )
 {
+ static int inform = True;
+
  (void) button;
 
  switch ( (int)user_data )
@@ -384,6 +386,12 @@
 	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 @@
 
  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