mirror of
https://github.com/mpv-player/mpv
synced 2025-01-05 03:06:28 +01:00
gtk dialog bug fix
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6855 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
6b3417b657
commit
c1ce20d7a0
@ -15,7 +15,7 @@ void ShowAboutBox( void )
|
||||
if ( gtkVAboutBox ) gtkActive( AboutBox );
|
||||
else AboutBox=create_About();
|
||||
gtk_widget_show( AboutBox );
|
||||
gtkVisible++;
|
||||
gtkIncVisible();
|
||||
}
|
||||
|
||||
void ab_AboutBox_show( GtkButton * button,gpointer user_data )
|
||||
@ -25,7 +25,7 @@ void ab_Ok_released( GtkButton * button,gpointer user_data )
|
||||
{
|
||||
gtkVAboutBox=(int)user_data;
|
||||
gtk_widget_destroy( AboutBox );
|
||||
gtkVisible--;
|
||||
gtkDecVisible();
|
||||
}
|
||||
|
||||
GtkWidget * create_About( void )
|
||||
|
@ -142,13 +142,13 @@ void ShowEqualizer( void )
|
||||
|
||||
if ( gtk_notebook_get_current_page( GTK_NOTEBOOK( Notebook ) ) == 0 ) gtk_widget_show( Config );
|
||||
gtk_widget_show( Equalizer );
|
||||
gtkVisible++;
|
||||
gtkIncVisible();
|
||||
}
|
||||
|
||||
void HideEqualizer( void )
|
||||
{
|
||||
if ( !gtkVEqualizer ) return;
|
||||
gtkVEqualizer=0; gtkVisible--;
|
||||
gtkVEqualizer=0; gtkDecVisible();
|
||||
gtk_widget_hide( Equalizer );
|
||||
gtk_widget_destroy( Equalizer );
|
||||
if ( gtkVEquConfig ) HideEquConfig();
|
||||
|
@ -286,7 +286,7 @@ void ShowFileSelect( int type,int modal )
|
||||
|
||||
gtk_window_set_modal( GTK_WINDOW( fsFileSelect ),modal );
|
||||
|
||||
gtk_widget_show( fsFileSelect ); gtkVisible++;
|
||||
gtk_widget_show( fsFileSelect ); gtkIncVisible();
|
||||
}
|
||||
|
||||
void HideFileSelect( void )
|
||||
@ -294,7 +294,7 @@ void HideFileSelect( void )
|
||||
if ( !gtkVFileSelect ) return;
|
||||
gtk_widget_hide( fsFileSelect );
|
||||
gtk_widget_destroy( fsFileSelect );
|
||||
gtkVFileSelect=0; gtkVisible--;
|
||||
gtkVFileSelect=0; gtkDecVisible();
|
||||
}
|
||||
|
||||
void fs_fsFileSelect_destroy( GtkObject * object,gpointer user_data )
|
||||
|
@ -20,11 +20,11 @@ void ShowMessageBox( char * msg )
|
||||
else MessageBox=create_MessageBox( 0 );
|
||||
gtkSetLayer( MessageBox );
|
||||
if ( strlen( msg ) < 20 ) gtk_widget_set_usize( MessageBox,196,-1 );
|
||||
gtkVisible++;
|
||||
gtkIncVisible();
|
||||
}
|
||||
|
||||
static void on_Ok_released( GtkButton * button,gpointer user_data )
|
||||
{ gtkVMessageBox=0; gtk_widget_hide( MessageBox ); gtk_widget_destroy( MessageBox ); gtkVisible--; }
|
||||
{ gtkVMessageBox=0; gtk_widget_hide( MessageBox ); gtk_widget_destroy( MessageBox ); gtkDecVisible(); }
|
||||
|
||||
static void on_MessageBox_show( GtkButton * button,gpointer user_data )
|
||||
{ gtkVMessageBox=(int)user_data; }
|
||||
|
@ -228,7 +228,7 @@ void ShowPreferences( void )
|
||||
gtk_signal_connect( GTK_OBJECT( CLADrivers ),"select_row",GTK_SIGNAL_FUNC( prCListRow ),(void*)0 );
|
||||
gtk_signal_connect( GTK_OBJECT( CLVDrivers ),"select_row",GTK_SIGNAL_FUNC( prCListRow ),(void*)1 );
|
||||
|
||||
gtkVPreferences=1; gtkVisible++;
|
||||
gtkVPreferences=1; gtkIncVisible();
|
||||
gtk_widget_show( Preferences );
|
||||
gtkSetLayer( Preferences );
|
||||
gtkMessageBox( GTK_MB_WARNING,MSGTR_PREFERENCES_Message );
|
||||
@ -237,7 +237,7 @@ void ShowPreferences( void )
|
||||
void HidePreferences( void )
|
||||
{
|
||||
if ( !gtkVPreferences ) return;
|
||||
gtkVPreferences=0; gtkVisible--;
|
||||
gtkVPreferences=0; gtkDecVisible();
|
||||
gtk_widget_hide( Preferences ); gtk_widget_destroy( Preferences );
|
||||
HideOSSConfig();
|
||||
}
|
||||
@ -1465,7 +1465,7 @@ void ShowOSSConfig( void )
|
||||
|
||||
gtk_widget_show( OSSConfig );
|
||||
gtkSetLayer( OSSConfig );
|
||||
gtkVOSSConfig=1; gtkVisible++;
|
||||
gtkVOSSConfig=1; gtkIncVisible();
|
||||
}
|
||||
|
||||
void HideOSSConfig( void )
|
||||
@ -1473,7 +1473,7 @@ void HideOSSConfig( void )
|
||||
if ( !gtkVOSSConfig ) return;
|
||||
gtk_widget_hide( OSSConfig );
|
||||
gtk_widget_destroy( OSSConfig );
|
||||
gtkVOSSConfig=0; gtkVisible--;
|
||||
gtkVOSSConfig=0; gtkDecVisible();
|
||||
}
|
||||
|
||||
static void ossDestroy( GtkObject * object,gpointer user_data )
|
||||
|
@ -169,7 +169,7 @@ void ShowPlayList( void )
|
||||
}
|
||||
gtk_clist_thaw( GTK_CLIST( CLSelected ) );
|
||||
|
||||
gtk_widget_show( PlayList ); gtkVisible++;
|
||||
gtk_widget_show( PlayList ); gtkIncVisible();
|
||||
}
|
||||
|
||||
void HidePlayList( void )
|
||||
@ -180,7 +180,7 @@ void HidePlayList( void )
|
||||
if ( CLFileSelected ) free( CLFileSelected ); CLFileSelected=NULL;
|
||||
if ( old_path ) free( old_path ); old_path=strdup( current_path );
|
||||
gtk_widget_hide( PlayList );
|
||||
gtk_widget_destroy( PlayList ); gtkVisible--;
|
||||
gtk_widget_destroy( PlayList ); gtkDecVisible();
|
||||
}
|
||||
|
||||
static void plDestroy( GtkObject * object,gpointer user_data )
|
||||
|
@ -29,13 +29,13 @@ void ShowSkinBrowser( void )
|
||||
{
|
||||
if ( gtkVSkinBrowser ) gtkActive( SkinBrowser );
|
||||
else SkinBrowser=create_SkinBrowser();
|
||||
gtkVisible++;
|
||||
gtkIncVisible();
|
||||
}
|
||||
|
||||
void HideSkinBrowser( void )
|
||||
{
|
||||
if ( !gtkVSkinBrowser ) return;
|
||||
gtkVSkinBrowser=0; gtkVisible--;
|
||||
gtkVSkinBrowser=0; gtkDecVisible();
|
||||
gtk_widget_destroy( SkinBrowser );
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ void ShowURLDialogBox( void )
|
||||
}
|
||||
|
||||
gtk_widget_show( URL );
|
||||
gtkVURLDialogBox=1; gtkVisible++;
|
||||
gtkVURLDialogBox=1; gtkIncVisible();
|
||||
}
|
||||
|
||||
void HideURLDialogBox( void )
|
||||
@ -42,7 +42,7 @@ void HideURLDialogBox( void )
|
||||
if ( !gtkVURLDialogBox ) return;
|
||||
gtk_widget_hide( URL );
|
||||
gtk_widget_destroy( URL );
|
||||
gtkVURLDialogBox=0; gtkVisible--;
|
||||
gtkVURLDialogBox=0; gtkDecVisible();
|
||||
}
|
||||
|
||||
static gboolean on_URL_destroy_event( GtkWidget * widget,GdkEvent * event,gpointer user_data )
|
||||
|
@ -184,7 +184,7 @@ void gtkShow( int type,char * param )
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_destroy( SkinBrowser ); gtkVisible--;
|
||||
gtk_widget_destroy( SkinBrowser ); gtkDecVisible();
|
||||
gtkMessageBox( GTK_MB_ERROR,"Skin dirs not found ... Please install skins." );
|
||||
}
|
||||
break;
|
||||
@ -218,10 +218,10 @@ void gtkShow( int type,char * param )
|
||||
case evShowPopUpMenu:
|
||||
gtkPopupMenu=evNone;
|
||||
gtkPopupMenuParam=0;
|
||||
if ( PopUpMenu ) { gtk_widget_hide_on_delete( PopUpMenu ); gtkVisible--; }
|
||||
if ( PopUpMenu ) { gtk_widget_hide_on_delete( PopUpMenu ); gtkDecVisible(); }
|
||||
PopUpMenu=create_PopUpMenu();
|
||||
gtk_menu_popup( GTK_MENU( PopUpMenu ),NULL,NULL,NULL,NULL,0,0 );
|
||||
gtkVisible++;
|
||||
gtkIncVisible();
|
||||
break;
|
||||
case evHidePopUpMenu:
|
||||
if ( PopUpMenu ) { gtk_widget_hide_on_delete( PopUpMenu ); /*gtkVisible--;*/ PopUpMenu=NULL; }
|
||||
@ -233,4 +233,6 @@ void gtkShow( int type,char * param )
|
||||
}
|
||||
}
|
||||
|
||||
void gtkIncVisible( void ) { gtkVisible++; }
|
||||
void gtkDecVisible( void ) { if ( gtkVisible > 0 ) gtkVisible--; }
|
||||
|
||||
|
@ -61,4 +61,7 @@ extern void gtkMessageBox( int type,gchar * str );
|
||||
extern void gtkSetLayer( GtkWidget * wdg );
|
||||
extern void gtkActive( GtkWidget * wdg );
|
||||
|
||||
extern void gtkIncVisible( void );
|
||||
extern void gtkDecVisible( void );
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user