changeset 5690:436cf6ef67fd

fix skin loading bug
author pontscho
date Thu, 18 Apr 2002 21:24:42 +0000
parents 2077782d0ca9
children 61fd0f9e4344
files Gui/mplayer/gtk/sb.c Gui/mplayer/play.c Gui/skin/skin.c
diffstat 3 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/gtk/sb.c	Thu Apr 18 18:24:08 2002 +0000
+++ b/Gui/mplayer/gtk/sb.c	Thu Apr 18 21:24:42 2002 +0000
@@ -20,6 +20,7 @@
 char      * sbMPlayerPrefixDir=NULL;
 
 char * gtkOldSkin;
+static char * prev;
 
 int gtkFillSkinList( gchar * mdir )
 {
@@ -30,6 +31,7 @@
  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_Cancel( GtkObject * object,gpointer user_data )
 {
- ChangeSkin( skinName );
+ if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) ChangeSkin( gtkOldSkin );
  gtk_widget_hide( SkinBrowser );
 }
 
@@ -79,9 +81,18 @@
 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 )
--- a/Gui/mplayer/play.c	Thu Apr 18 18:24:08 2002 +0000
+++ b/Gui/mplayer/play.c	Thu Apr 18 21:24:42 2002 +0000
@@ -141,7 +141,7 @@
 void ChangeSkin( char * name )
 {
  int ret;
-// if ( !strcmp( skinName,name ) ) return;
+
  mainVisible=0;
 
  appInitStruct( &tmpList );
--- a/Gui/skin/skin.c	Thu Apr 18 18:24:08 2002 +0000
+++ b/Gui/skin/skin.c	Thu Apr 18 21:24:42 2002 +0000
@@ -612,7 +612,7 @@
 
  mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[skin] file: %s\n",fn );
 
- appInitStruct( &appMPlayer );
+ appInitStruct( skinAppMPlayer );
 
  linenumber=0;
  while ( !feof( skinFile ) )