1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

fix skin loading bug

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5691 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
pontscho 2002-04-18 21:24:42 +00:00
parent 8081bf7ded
commit 4839b7a2bc
3 changed files with 16 additions and 5 deletions

View File

@ -20,6 +20,7 @@ char * sbMPlayerDirInHome=NULL;
char * sbMPlayerPrefixDir=NULL;
char * gtkOldSkin;
static char * prev;
int gtkFillSkinList( gchar * mdir )
{
@ -30,6 +31,7 @@ int gtkFillSkinList( gchar * mdir )
struct stat fs;
gtkOldSkin=strdup( skinName );
prev=gtkOldSkin;
if ( ( str[0]=(char *)calloc( 1,7 ) ) == NULL )
{
gtkMessageBox( GTK_MB_FATAL,MSGTR_SKINBROWSER_NotEnoughMemory );
@ -64,7 +66,7 @@ void on_SkinBrowser_destroy( GtkObject * object,gpointer user_data )
void on_SkinBrowser_Cancel( GtkObject * object,gpointer user_data )
{
ChangeSkin( skinName );
if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) ChangeSkin( gtkOldSkin );
gtk_widget_hide( SkinBrowser );
}
@ -79,9 +81,18 @@ void on_SkinBrowser_Ok( GtkObject * object,gpointer user_data )
void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data )
{
gtk_clist_get_text( clist,row,0,&sbSelectedSkin );
ChangeSkin( sbSelectedSkin );
if ( strcmp( prev,sbSelectedSkin ) )
{
prev=sbSelectedSkin;
ChangeSkin( sbSelectedSkin );
}
if( !bevent ) return;
if( bevent->type == GDK_2BUTTON_PRESS ) gtk_widget_hide( SkinBrowser );
if( bevent->type == GDK_2BUTTON_PRESS )
{
if ( skinName ) free( skinName );
skinName=strdup( sbSelectedSkin );
gtk_widget_hide( SkinBrowser );
}
}
GtkWidget * create_SkinBrowser( void )

View File

@ -141,7 +141,7 @@ listItems tmpList;
void ChangeSkin( char * name )
{
int ret;
// if ( !strcmp( skinName,name ) ) return;
mainVisible=0;
appInitStruct( &tmpList );

View File

@ -612,7 +612,7 @@ int skinRead( char * dname )
mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] file: %s\n",fn );
appInitStruct( &appMPlayer );
appInitStruct( skinAppMPlayer );
linenumber=0;
while ( !feof( skinFile ) )