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

ib subversion at mplayerhq.hu
Fri Mar 29 18:28:44 CET 2013


Author: ib
Date: Fri Mar 29 18:28:44 2013
New Revision: 36097

Log:
Remove HidePreferences(), HideAudioConfig() and HideDXR3Config().

Simply destroy the windows.

(It's pointless to check whether the window is existing,
because it cannot be called without an existing window.)

In order to do so, relocate definition of AudioConfig.

Additionally, remove unnecessary declarations.

Modified:
   trunk/gui/dialog/preferences.c

Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c	Fri Mar 29 18:23:47 2013	(r36096)
+++ trunk/gui/dialog/preferences.c	Fri Mar 29 18:28:44 2013	(r36097)
@@ -186,10 +186,10 @@ static char * ao_driver[3];
 static char * vo_driver[3];
 static int    old_video_driver = 0;
 
+static GtkWidget *AudioConfig;
+
  void ShowDXR3Config( void );
- void HideDXR3Config( void );
  void ShowAudioConfig( void );
- void HideAudioConfig( void );
 
 static gboolean prHScaler( GtkWidget * widget,GdkEvent * event,gpointer user_data );
 static void prToggled( GtkToggleButton * togglebutton,gpointer user_data );
@@ -198,18 +198,6 @@ static void prCListRow( GtkCList * clist
 static void prEntry( GtkEditable * editable,gpointer user_data );
 #endif
 
-static void HidePreferences( void )
-{
- if ( !Preferences ) return;
- gtk_widget_hide( Preferences );
- gtk_widget_destroy( Preferences );
- Preferences=NULL;
- HideAudioConfig();
-#ifdef CONFIG_DXR3
- HideDXR3Config();
-#endif
-}
-
 #if defined(CONFIG_FREETYPE) || defined(CONFIG_ICONV)
 static void prEntry( GtkEditable * editable,gpointer user_data )
 {
@@ -352,7 +340,20 @@ static void prButton( GtkButton * button
 	setdup( &cdrom_device,gtk_entry_get_text( GTK_ENTRY( prECDRomDevice ) ) );
 
    case bCancel:
-	HidePreferences();
+	gtk_widget_destroy( Preferences );
+	Preferences=NULL;
+	if ( AudioConfig )
+	{
+	 gtk_widget_destroy( AudioConfig );
+	 AudioConfig=NULL;
+	}
+#ifdef CONFIG_DXR3
+	if ( DXR3Config )
+	{
+	 gtk_widget_destroy( DXR3Config );
+	 DXR3Config=NULL;
+	}
+#endif
 	break;
    case bAConfig:
 	if ( !ao_driver[0] ) break;
@@ -1497,7 +1498,6 @@ static void setGtkEntryText(GtkWidget *d
 }
 #endif
 
-static GtkWidget *AudioConfig;
 static GtkWidget *CEAudioDevice;
 static GtkWidget *CBAudioDevice;
 static GtkWidget *CEAudioMixer;
@@ -1507,13 +1507,6 @@ static GtkWidget *CBAudioMixerChannel;
 static GtkWidget *BAudioOk;
 static GtkWidget *BAudioCancel;
 
-void HideAudioConfig( void ) {
-  if (!AudioConfig) return;
-  gtk_widget_hide(AudioConfig);
-  gtk_widget_destroy(AudioConfig);
-  AudioConfig=NULL;
-}
-
 static void audioButton(GtkButton *button, gpointer user_data) {
   switch( (int)user_data ) {
     case 1:
@@ -1550,7 +1543,8 @@ static void audioButton(GtkButton *butto
       }
 #endif
    case 0:
-      HideAudioConfig();
+      gtk_widget_destroy(AudioConfig);
+      AudioConfig=NULL;
       break;
   }
 }
@@ -1734,14 +1728,6 @@ void ShowDXR3Config( void )
  gtkSetLayer( DXR3Config );
 }
 
-void HideDXR3Config( void )
-{
- if ( !DXR3Config ) return;
- gtk_widget_hide( DXR3Config );
- gtk_widget_destroy( DXR3Config );
- DXR3Config=NULL;
-}
-
 static void dxr3Button( GtkButton * button,gpointer user_data )
 {
  switch ( (int)user_data )
@@ -1750,7 +1736,8 @@ static void dxr3Button( GtkButton * butt
        nfree( gtkDXR3Device ); gtkDXR3Device=strdup( gtk_entry_get_text( GTK_ENTRY( CEDXR3Device ) ) );
        gtkVfLAVC=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBVLavc ) );
   case 1: // Cancel
-       HideDXR3Config();
+       gtk_widget_destroy( DXR3Config );
+       DXR3Config=NULL;
        break;
  }
 }


More information about the MPlayer-cvslog mailing list