changeset 1799:b26a936b24e4

fix cancel
author pontscho
date Fri, 31 Aug 2001 12:58:43 +0000
parents ddeafb1dbc73
children f5ffb03ebdb5
files Gui/mplayer/gtk/sb.h
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/gtk/sb.h	Fri Aug 31 11:27:21 2001 +0000
+++ b/Gui/mplayer/gtk/sb.h	Fri Aug 31 12:58:43 2001 +0000
@@ -27,8 +27,11 @@
  gtkVisibleSkinBrowser=0;
  gtkShMem->vs.window=evSkinBrowser;
  gtkSendMessage( evHideWindow );
+ gtkSendMessage( evSkinBrowser );
 }
 
+char gtkOldSkin[128];
+
 int gtkFillSkinList( gchar * mdir )
 {
  gchar         * str[2];
@@ -37,6 +40,7 @@
  glob_t          gg;
  struct stat     fs;
 
+ strcpy( gtkOldSkin,gtkShMem->sb.name );
  if ( ( str[0]=(char *)calloc( 1,7 ) ) == NULL )
   {
    gtkMessageBox( sbNotEnoughMemory );
@@ -69,6 +73,12 @@
 void on_SkinBrowser_destroy( GtkObject * object,gpointer user_data )
 { HideSkinBrowser(); }
 
+void on_SkinBrowser_Cancel( GtkObject * object,gpointer user_data )
+{ 
+ strcpy( gtkShMem->sb.name,gtkOldSkin );
+ HideSkinBrowser(); 
+}
+
 void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data )
 {
  gtk_clist_get_text( clist,row,0,&sbSelectedSkin );
@@ -85,6 +95,8 @@
  switch ( event->keyval )
   {
    case GDK_Escape:
+        if ( !sbShift ) on_SkinBrowser_Cancel( NULL,0 );
+        break;
    case GDK_Return:
         if ( !sbShift ) HideSkinBrowser();
         break;
@@ -293,7 +305,7 @@
                      GTK_SIGNAL_FUNC( on_SkinBrowser_destroy ),
                      NULL );
  gtk_signal_connect( GTK_OBJECT( Cancel ),"released",
-                     GTK_SIGNAL_FUNC( on_SkinBrowser_destroy ),
+                     GTK_SIGNAL_FUNC( on_SkinBrowser_Cancel ),
                      NULL );
 
  if ( ( sbMPlayerDirInHome=(char *)calloc( 1,strlen( skinDirInHome ) + 4 ) ) != NULL )
@@ -310,4 +322,4 @@
  return SkinBrowser;
 }
 
-#endif
\ No newline at end of file
+#endif