[Mplayer-cvslog] CVS: main/Gui/mplayer/gtk sb.c,1.4,1.5

Zoltan Ponekker pontscho at mplayerhq.hu
Thu Apr 18 23:24:44 CEST 2002


Update of /cvsroot/mplayer/main/Gui/mplayer/gtk
In directory mail:/var/tmp.root/cvs-serv30196/Gui/mplayer/gtk

Modified Files:
	sb.c 
Log Message:
fix skin loading bug

Index: sb.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/sb.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- sb.c	23 Feb 2002 15:12:54 -0000	1.4
+++ sb.c	18 Apr 2002 21:24:41 -0000	1.5
@@ -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 )




More information about the MPlayer-cvslog mailing list