2001-11-14 16:04:25 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <glob.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2002-07-03 08:55:26 +00:00
|
|
|
#include "../mplayer.h"
|
2001-11-14 16:04:25 +00:00
|
|
|
|
2002-07-03 08:55:26 +00:00
|
|
|
#include "mplayer/pixmaps/up.xpm"
|
|
|
|
#include "mplayer/pixmaps/dir.xpm"
|
|
|
|
#include "mplayer/pixmaps/file.xpm"
|
2001-11-14 16:04:25 +00:00
|
|
|
|
2002-11-02 16:09:05 +00:00
|
|
|
#include "../../app.h"
|
2002-02-23 15:12:55 +00:00
|
|
|
#include "../../interface.h"
|
2001-11-14 16:04:25 +00:00
|
|
|
#include "../../../config.h"
|
|
|
|
#include "../../../help_mp.h"
|
2002-02-24 17:45:24 +00:00
|
|
|
#include "../../../libmpdemux/stream.h"
|
2001-11-14 16:04:25 +00:00
|
|
|
|
|
|
|
#include "../widgets.h"
|
|
|
|
#include "fs.h"
|
2002-07-25 20:26:38 +00:00
|
|
|
#include "opts.h"
|
2002-11-27 22:48:56 +00:00
|
|
|
#include "common.h"
|
2001-11-14 16:04:25 +00:00
|
|
|
|
|
|
|
#ifndef __linux__
|
|
|
|
#define get_current_dir_name() getcwd(NULL, PATH_MAX)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef get_current_dir_name
|
|
|
|
extern char * get_current_dir_name( void );
|
|
|
|
#endif
|
|
|
|
|
|
|
|
gchar * fsSelectedFile = NULL;
|
|
|
|
gchar * fsSelectedDirectory = NULL;
|
|
|
|
unsigned char * fsThatDir = ".";
|
2002-09-28 20:33:56 +00:00
|
|
|
gchar * fsFilter = "*";
|
2001-11-14 16:04:25 +00:00
|
|
|
|
|
|
|
int fsPressed = 0;
|
2002-02-23 15:12:55 +00:00
|
|
|
int fsType = 0;
|
2001-12-15 15:36:07 +00:00
|
|
|
|
2002-08-31 15:55:03 +00:00
|
|
|
char * fsVideoFilterNames[][2] =
|
2002-09-28 18:49:07 +00:00
|
|
|
{ { "MPEG files (*.mpg,*.mpeg,*.m1v)", "*.mpg,*.mpeg,*.m1v" },
|
2002-04-22 15:39:45 +00:00
|
|
|
{ "VOB files (*.vob)", "*.vob" },
|
|
|
|
{ "AVI files (*.avi)", "*.avi" },
|
2002-08-31 15:55:03 +00:00
|
|
|
{ "DiVX files (*.divx)", "*.divx" },
|
2002-09-28 18:49:07 +00:00
|
|
|
{ "QuickTime files (*.mov,*.qt)", "*.mov,*.qt" },
|
2002-04-22 15:39:45 +00:00
|
|
|
{ "ASF files (*.asf)", "*.asf" },
|
|
|
|
{ "VIVO files (*.viv)", "*.viv" },
|
2002-09-01 11:28:18 +00:00
|
|
|
{ "RealVideo files (*.rm)", "*.rm" },
|
2002-04-22 15:39:45 +00:00
|
|
|
{ "Windows Media Video (*.wmv)", "*.wmv" },
|
2002-09-28 18:49:07 +00:00
|
|
|
{ "OGG Media files (*.ogm)", "*.ogm" },
|
|
|
|
{ "Autodesk animations (*.fli,*.flc)", "*.fli,*.flc" },
|
|
|
|
{ "NuppelVideo files (*.nuv)", "*.nuv" },
|
2002-08-31 15:55:03 +00:00
|
|
|
{ "MP3 files (*.mp3,mp2)", "*.mp3,*.mp2" },
|
|
|
|
{ "Wave files (*.wav)", "*.wav" },
|
|
|
|
{ "WMA files (*.wma)", "*.wma" },
|
2002-11-27 22:48:56 +00:00
|
|
|
{ "Audio files", "*.wav,*.ogg,*.mp2,*.mp3,*.wma" },
|
|
|
|
{ "Video files", "*.asf,*.avi,*.divx,*.fli,*.flc,*.ogm,*.mpg,*.mpeg,*.m1v,*.mov,*.nuv,*.qt,*.rm,*.vob,*.viv,*.wmv" },
|
|
|
|
{ "All files", "*" },
|
2002-08-31 15:55:03 +00:00
|
|
|
{ NULL,NULL }
|
|
|
|
};
|
2002-04-22 15:39:45 +00:00
|
|
|
|
2002-08-31 15:55:03 +00:00
|
|
|
char * fsSubtitleFilterNames[][2] =
|
2002-04-22 15:39:45 +00:00
|
|
|
{ { "UTF (*.utf)", "*.utf" },
|
|
|
|
{ "SUB (*.sub)", "*.sub" },
|
|
|
|
{ "SRT (*.srt)", "*.str" },
|
|
|
|
{ "SMI (*.smi)", "*.smi" },
|
|
|
|
{ "RT (*.rt) ", "*.rt" },
|
|
|
|
{ "TXT (*.txt)", "*.txt" },
|
|
|
|
{ "SSA (*.ssa)", "*.ssa" },
|
|
|
|
{ "AQT (*.aqt)", "*.aqt" },
|
2002-11-27 22:48:56 +00:00
|
|
|
{ "Subtitles", "*.utf,*.sub,*.srt,*.smi,*.rt,*.txt,*.ssa,*.aqt" },
|
|
|
|
{ "All files", "*" },
|
2002-08-31 15:55:03 +00:00
|
|
|
{ NULL,NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
char * fsOtherFilterNames[][2] =
|
|
|
|
{
|
2002-11-27 22:48:56 +00:00
|
|
|
{ "All files", "*" },
|
2002-08-31 15:55:03 +00:00
|
|
|
{ NULL,NULL }
|
|
|
|
};
|
2002-07-02 22:31:50 +00:00
|
|
|
|
2002-08-31 15:55:03 +00:00
|
|
|
char * fsAudioFileNames[][2] =
|
|
|
|
{
|
|
|
|
{ "WAV files (*.wav)", "*.wav" },
|
2002-07-02 22:31:50 +00:00
|
|
|
{ "MP3 files (*.mp2, *.mp3)", "*.mp2,*.mp3" },
|
2002-09-28 18:49:07 +00:00
|
|
|
{ "OGG Vorbis files (*.ogg)", "*.ogg" },
|
2002-11-27 22:48:56 +00:00
|
|
|
{ "Audio files", "*.ogg,*.mp2,*.mp3,*.wav" },
|
|
|
|
{ "All files", "*" },
|
2002-08-31 15:55:03 +00:00
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
2001-11-14 16:04:25 +00:00
|
|
|
|
2002-08-31 15:55:03 +00:00
|
|
|
char * fsFontFileNames[][2] =
|
|
|
|
{
|
2002-08-29 17:16:34 +00:00
|
|
|
#ifdef HAVE_FREETYPE
|
2002-08-31 15:55:03 +00:00
|
|
|
{ "font files (*.ttf)", "*.ttf" },
|
2002-08-29 17:16:34 +00:00
|
|
|
#else
|
2002-08-31 15:55:03 +00:00
|
|
|
{ "font files (*.desc)", "*.desc" },
|
2002-08-29 17:16:34 +00:00
|
|
|
#endif
|
2002-11-27 22:48:56 +00:00
|
|
|
{ "All files", "*" },
|
2002-08-31 15:55:03 +00:00
|
|
|
{ NULL,NULL }
|
|
|
|
};
|
2002-07-25 20:26:38 +00:00
|
|
|
|
2001-11-14 16:04:25 +00:00
|
|
|
GtkWidget * fsFileNamesList;
|
|
|
|
GtkWidget * fsFNameList;
|
2002-11-27 22:48:56 +00:00
|
|
|
GtkWidget * fsFileSelect = NULL;
|
2001-11-14 16:04:25 +00:00
|
|
|
GdkColormap * fsColorMap;
|
|
|
|
GtkWidget * fsOk;
|
|
|
|
GtkWidget * fsUp;
|
|
|
|
GtkWidget * fsCancel;
|
|
|
|
GtkWidget * fsCombo4;
|
2001-12-15 15:36:07 +00:00
|
|
|
GtkWidget * fsPathCombo;
|
2001-11-14 16:04:25 +00:00
|
|
|
GList * fsList_items = NULL;
|
|
|
|
GList * fsTopList_items = NULL;
|
2001-12-15 15:36:07 +00:00
|
|
|
GtkWidget * List;
|
|
|
|
GtkWidget * fsFilterCombo;
|
2001-11-14 16:04:25 +00:00
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
GtkStyle * style;
|
|
|
|
GdkPixmap * dpixmap;
|
|
|
|
GdkPixmap * fpixmap;
|
|
|
|
GdkBitmap * dmask;
|
|
|
|
GdkBitmap * fmask;
|
|
|
|
|
2002-08-31 15:55:03 +00:00
|
|
|
static char * Filter( char * name )
|
|
|
|
{
|
2002-09-13 20:00:20 +00:00
|
|
|
static char tmp[32];
|
2002-08-31 15:55:03 +00:00
|
|
|
int i,c;
|
|
|
|
for ( i=0,c=0;i < strlen( name );i++ )
|
|
|
|
{
|
|
|
|
if ( ( name[i] >='a' )&&( name[i] <= 'z' ) ) { tmp[c++]='['; tmp[c++]=name[i]; tmp[c++]=name[i] - 32; tmp[c++]=']'; }
|
|
|
|
else tmp[c++]=name[i];
|
|
|
|
}
|
|
|
|
tmp[c]=0;
|
|
|
|
return tmp;
|
|
|
|
}
|
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
void CheckDir( GtkWidget * list,char * directory )
|
2001-11-14 16:04:25 +00:00
|
|
|
{
|
|
|
|
struct stat fs;
|
|
|
|
int i,c=2;
|
|
|
|
gchar * str[1][2];
|
2001-12-15 15:36:07 +00:00
|
|
|
GdkPixmap * pixmap;
|
|
|
|
GdkBitmap * mask;
|
2001-11-14 16:04:25 +00:00
|
|
|
glob_t gg;
|
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
if ( !fsFilter[0] ) return;
|
|
|
|
|
2001-11-14 16:04:25 +00:00
|
|
|
gtk_widget_hide( list );
|
2001-12-15 15:36:07 +00:00
|
|
|
gtk_clist_clear( GTK_CLIST( list ) );
|
2001-11-14 16:04:25 +00:00
|
|
|
str[0][0]=NULL;
|
2002-02-23 15:12:55 +00:00
|
|
|
|
2001-11-14 16:04:25 +00:00
|
|
|
pixmap=dpixmap; mask=dmask;
|
|
|
|
str[0][0]=NULL; str[0][1]=(gchar *)malloc( 3 );
|
2001-12-15 15:36:07 +00:00
|
|
|
strcpy( str[0][1],"." ); gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),0,0,pixmap,mask );
|
|
|
|
strcpy( str[0][1],".." ); gtk_clist_append( GTK_CLIST( list ),str[0] ); gtk_clist_set_pixmap( GTK_CLIST( list ),1,0,pixmap,mask );
|
2001-11-14 16:04:25 +00:00
|
|
|
free( str[0][0] );
|
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
glob( "*",0,NULL,&gg );
|
2001-11-14 16:04:25 +00:00
|
|
|
// glob( ".*",GLOB_NOSORT | GLOB_APPEND,NULL,&gg );
|
2002-07-25 20:26:38 +00:00
|
|
|
for( i=0;(unsigned)i<gg.gl_pathc;i++ )
|
2001-11-14 16:04:25 +00:00
|
|
|
{
|
|
|
|
stat( gg.gl_pathv[i],&fs );
|
2001-12-15 15:36:07 +00:00
|
|
|
if( !S_ISDIR( fs.st_mode ) ) continue;
|
|
|
|
|
|
|
|
str[0][1]=(gchar *)malloc( strlen( gg.gl_pathv[i] ) + 1 );
|
|
|
|
strcpy( str[0][1],gg.gl_pathv[i] );
|
|
|
|
pixmap=dpixmap; mask=dmask;
|
|
|
|
gtk_clist_append( GTK_CLIST( list ),str[0] );
|
|
|
|
gtk_clist_set_pixmap( GTK_CLIST( list ),c++,0,pixmap,mask );
|
|
|
|
free( str[0][1] );
|
2001-11-14 16:04:25 +00:00
|
|
|
}
|
|
|
|
globfree( &gg );
|
2002-02-23 15:12:55 +00:00
|
|
|
|
2002-04-22 15:39:45 +00:00
|
|
|
if ( strchr( fsFilter,',' ) )
|
|
|
|
{
|
|
|
|
char tmp[8];
|
|
|
|
int i,c,glob_param = 0;
|
|
|
|
//printf( "sub item detected.\n" );
|
|
|
|
for ( i=0,c=0;i<(int)strlen( fsFilter ) + 1;i++,c++ )
|
|
|
|
{
|
|
|
|
tmp[c]=fsFilter[i];
|
|
|
|
if ( ( tmp[c] == ',' )||( tmp[c] == '\0' ) )
|
|
|
|
{
|
|
|
|
tmp[c]=0; c=-1;
|
|
|
|
// printf( "substr: %s\n",tmp );
|
2002-08-31 15:55:03 +00:00
|
|
|
glob( Filter( tmp ),glob_param,NULL,&gg );
|
2002-04-22 15:39:45 +00:00
|
|
|
glob_param=GLOB_APPEND;
|
|
|
|
}
|
|
|
|
}
|
2002-08-31 15:55:03 +00:00
|
|
|
} else glob( Filter( fsFilter ),0,NULL,&gg );
|
2002-02-23 15:12:55 +00:00
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
#if 0
|
|
|
|
if ( !strcmp( fsFilter,"*" ) )
|
|
|
|
{
|
|
|
|
char * f = strdup( fsFilter );
|
|
|
|
int i;
|
|
|
|
for( i=0;i<strlen( f );i++ )
|
|
|
|
if ( ( f[i] >= 'A' )&&( f[i] <= 'Z' ) ) f[i]+=32;
|
|
|
|
glob( f,GLOB_APPEND,NULL,&gg );
|
2002-02-23 15:12:55 +00:00
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
for( i=0;i<strlen( f );i++ )
|
|
|
|
if ( ( f[i] >= 'a' )&&( f[i] <= 'z' ) ) f[i]-=32;
|
|
|
|
glob( f,GLOB_APPEND,NULL,&gg );
|
|
|
|
free( f );
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2001-11-14 16:04:25 +00:00
|
|
|
// glob( ".*",GLOB_NOSORT | GLOB_APPEND,NULL,&gg );
|
|
|
|
pixmap=fpixmap; mask=fmask;
|
2002-07-25 20:26:38 +00:00
|
|
|
for( i=0;(unsigned)i<gg.gl_pathc;i++ )
|
2001-11-14 16:04:25 +00:00
|
|
|
{
|
|
|
|
stat( gg.gl_pathv[i],&fs );
|
|
|
|
if( S_ISDIR( fs.st_mode ) ) continue;
|
2001-12-15 15:36:07 +00:00
|
|
|
|
|
|
|
str[0][1]=(gchar *)malloc( strlen( gg.gl_pathv[i] ) + 1 );
|
|
|
|
strcpy( str[0][1],gg.gl_pathv[i] );
|
2001-11-14 16:04:25 +00:00
|
|
|
gtk_clist_append( GTK_CLIST( list ),str[0] );
|
2001-12-15 15:36:07 +00:00
|
|
|
gtk_clist_set_pixmap( GTK_CLIST( list ),c++,0,pixmap,mask );
|
2001-11-14 16:04:25 +00:00
|
|
|
free( str[0][1] );
|
|
|
|
}
|
|
|
|
globfree( &gg );
|
|
|
|
|
|
|
|
gtk_clist_set_column_width( GTK_CLIST( list ),0,17 );
|
|
|
|
gtk_clist_select_row( GTK_CLIST( list ),0,1 );
|
|
|
|
gtk_widget_show( list );
|
|
|
|
}
|
|
|
|
|
2002-07-02 21:10:42 +00:00
|
|
|
void ShowFileSelect( int type,int modal )
|
2001-12-15 15:36:07 +00:00
|
|
|
{
|
|
|
|
int i;
|
2002-07-25 20:26:38 +00:00
|
|
|
char * tmp = NULL;
|
2002-05-20 13:56:16 +00:00
|
|
|
|
2002-11-27 22:48:56 +00:00
|
|
|
if ( fsFileSelect ) gtkActive( fsFileSelect );
|
2002-05-20 13:56:16 +00:00
|
|
|
else fsFileSelect=create_FileSelect();
|
2002-05-11 16:37:58 +00:00
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
fsType=type;
|
|
|
|
switch ( type )
|
|
|
|
{
|
|
|
|
case fsVideoSelector:
|
2002-02-23 15:12:55 +00:00
|
|
|
gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect );
|
2001-12-15 15:36:07 +00:00
|
|
|
fsList_items=NULL;
|
2002-08-31 15:55:03 +00:00
|
|
|
for( i=0;fsVideoFilterNames[i][0];i++ )
|
2001-12-15 15:36:07 +00:00
|
|
|
fsList_items=g_list_append( fsList_items,fsVideoFilterNames[i][0] );
|
|
|
|
gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
|
|
|
|
g_list_free( fsList_items );
|
2002-08-31 15:55:03 +00:00
|
|
|
gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsVideoFilterNames[i-2][0] );
|
2002-07-25 20:26:38 +00:00
|
|
|
tmp=guiIntfStruct.Filename;
|
2001-12-15 15:36:07 +00:00
|
|
|
break;
|
|
|
|
case fsSubtitleSelector:
|
2002-02-23 15:12:55 +00:00
|
|
|
gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_SubtitleSelect );
|
2001-12-15 15:36:07 +00:00
|
|
|
fsList_items=NULL;
|
2002-08-31 15:55:03 +00:00
|
|
|
for( i=0;fsSubtitleFilterNames[i][0];i++ )
|
2001-12-15 15:36:07 +00:00
|
|
|
fsList_items=g_list_append( fsList_items,fsSubtitleFilterNames[i][0] );
|
|
|
|
gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
|
|
|
|
g_list_free( fsList_items );
|
2002-08-31 15:55:03 +00:00
|
|
|
gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsSubtitleFilterNames[i-2][0] );
|
2002-07-25 20:26:38 +00:00
|
|
|
tmp=guiIntfStruct.Subtitlename;
|
2001-12-15 15:36:07 +00:00
|
|
|
break;
|
|
|
|
case fsOtherSelector:
|
2002-02-23 15:12:55 +00:00
|
|
|
gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_OtherSelect );
|
2001-12-15 15:36:07 +00:00
|
|
|
fsList_items=NULL;
|
2002-08-31 15:55:03 +00:00
|
|
|
for( i=0;fsOtherFilterNames[i][0];i++ )
|
2001-12-15 15:36:07 +00:00
|
|
|
fsList_items=g_list_append( fsList_items,fsOtherFilterNames[i][0] );
|
|
|
|
gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
|
|
|
|
g_list_free( fsList_items );
|
2002-08-31 15:55:03 +00:00
|
|
|
gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsOtherFilterNames[0][0] );
|
2002-07-25 20:26:38 +00:00
|
|
|
tmp=guiIntfStruct.Othername;
|
2001-12-15 15:36:07 +00:00
|
|
|
break;
|
2002-07-02 22:31:50 +00:00
|
|
|
case fsAudioSelector:
|
|
|
|
gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_AudioFileSelect );
|
|
|
|
fsList_items=NULL;
|
2002-08-31 15:55:03 +00:00
|
|
|
for( i=0;fsAudioFileNames[i][0];i++ )
|
2002-07-02 22:31:50 +00:00
|
|
|
fsList_items=g_list_append( fsList_items,fsAudioFileNames[i][0] );
|
|
|
|
gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
|
|
|
|
g_list_free( fsList_items );
|
2002-08-31 15:55:03 +00:00
|
|
|
gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsAudioFileNames[i-2][0] );
|
2002-07-25 20:26:38 +00:00
|
|
|
tmp=guiIntfStruct.AudioFile;
|
|
|
|
break;
|
|
|
|
case fsFontSelector:
|
|
|
|
gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FontSelect );
|
|
|
|
fsList_items=NULL;
|
2002-08-31 15:55:03 +00:00
|
|
|
for( i=0;fsFontFileNames[i][0];i++ )
|
2002-07-25 20:26:38 +00:00
|
|
|
fsList_items=g_list_append( fsList_items,fsFontFileNames[i][0] );
|
|
|
|
gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
|
|
|
|
g_list_free( fsList_items );
|
2002-08-31 15:55:03 +00:00
|
|
|
gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsFontFileNames[i-2][0] );
|
2002-08-15 22:52:52 +00:00
|
|
|
tmp=font_name;
|
2002-07-02 22:31:50 +00:00
|
|
|
break;
|
2001-12-15 15:36:07 +00:00
|
|
|
}
|
2002-07-25 20:26:38 +00:00
|
|
|
|
|
|
|
if ( tmp && tmp[0] )
|
|
|
|
{
|
|
|
|
struct stat f;
|
|
|
|
char * dir = strdup( tmp );
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
char * c = strrchr( dir,'/' );
|
|
|
|
stat( dir,&f );
|
|
|
|
if ( S_ISDIR( f.st_mode ) ) break;
|
|
|
|
if ( c ) *c=0;
|
|
|
|
} while ( strrchr( dir,'/' ) );
|
|
|
|
|
|
|
|
if ( dir[0] ) chdir( dir );
|
|
|
|
|
|
|
|
free( dir );
|
|
|
|
}
|
2002-07-02 21:10:42 +00:00
|
|
|
|
2002-07-25 20:26:38 +00:00
|
|
|
if ( fsTopList_items ) g_list_free( fsTopList_items ); fsTopList_items=NULL;
|
2003-01-02 12:33:06 +00:00
|
|
|
{
|
|
|
|
char hist[fsPersistant_MaxPath + 1];
|
|
|
|
|
|
|
|
bzero( hist,fsPersistant_MaxPath + 1 );
|
|
|
|
if ( fs_PersistantHistory( 0,hist,0 ) == 0 )
|
|
|
|
{
|
|
|
|
fsTopList_items=g_list_append( fsTopList_items,hist );
|
|
|
|
chdir( hist );
|
|
|
|
} else fsTopList_items=g_list_append( fsTopList_items,(gchar *)get_current_dir_name() );
|
|
|
|
}
|
2002-07-25 20:26:38 +00:00
|
|
|
if ( getenv( "HOME" ) ) fsTopList_items=g_list_append( fsTopList_items,getenv( "HOME" ) );
|
|
|
|
fsTopList_items=g_list_append( fsTopList_items,"/home" );
|
|
|
|
fsTopList_items=g_list_append( fsTopList_items,"/mnt" );
|
|
|
|
fsTopList_items=g_list_append( fsTopList_items,"/" );
|
|
|
|
gtk_combo_set_popdown_strings( GTK_COMBO( fsCombo4 ),fsTopList_items );
|
|
|
|
|
2002-07-02 21:10:42 +00:00
|
|
|
gtk_window_set_modal( GTK_WINDOW( fsFileSelect ),modal );
|
|
|
|
|
2002-08-04 19:23:58 +00:00
|
|
|
gtk_widget_show( fsFileSelect );
|
2001-12-15 15:36:07 +00:00
|
|
|
}
|
|
|
|
|
2001-11-14 16:04:25 +00:00
|
|
|
void HideFileSelect( void )
|
2002-05-20 13:56:16 +00:00
|
|
|
{
|
2002-11-27 22:48:56 +00:00
|
|
|
if ( !fsFileSelect ) return;
|
2002-05-20 13:56:16 +00:00
|
|
|
gtk_widget_hide( fsFileSelect );
|
|
|
|
gtk_widget_destroy( fsFileSelect );
|
2002-11-27 22:48:56 +00:00
|
|
|
fsFileSelect=NULL;
|
2002-05-20 13:56:16 +00:00
|
|
|
}
|
2001-11-14 16:04:25 +00:00
|
|
|
|
2003-01-02 12:33:06 +00:00
|
|
|
//----------------------------------------------------
|
|
|
|
|
|
|
|
/*
|
|
|
|
* int fs_PersistantHistory(int rw_command, char *subject)
|
|
|
|
*
|
|
|
|
* is used to read/write in the $HOME/.mplayer/persistant_history file
|
|
|
|
* parameters: rw_command = (0,1) <=> (read,write)
|
|
|
|
* subject - for i/o
|
|
|
|
* pos - position in history file (line)
|
|
|
|
* return: 0 = ok
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
int fs_PersistantHistory(int rw_command, char *subject, int pos)
|
|
|
|
{
|
|
|
|
FILE *pfile;
|
|
|
|
|
|
|
|
char path[fsPersistant_MaxPath+1];
|
|
|
|
int fdata,fpos = 0;
|
|
|
|
char *subpath = NULL;
|
|
|
|
const char *ph_filename = fsPersistant_FilePath;
|
|
|
|
|
|
|
|
if (!subject) return -1;
|
|
|
|
if (pos < 0 || pos > fsPersistant_MaxPos) return -2;
|
|
|
|
bzero(path,fsPersistant_MaxPath+1);
|
|
|
|
|
|
|
|
subpath = getenv("HOME");
|
|
|
|
if (!subpath) return -3;
|
|
|
|
if (strlen(subpath)+strlen(fsPersistant_FilePath) > fsPersistant_MaxPath) return -4;
|
|
|
|
memcpy(path, subpath, strlen(subpath));
|
|
|
|
memcpy(path+strlen(subpath), ph_filename, strlen(ph_filename));
|
|
|
|
|
|
|
|
if (rw_command == 0)
|
|
|
|
{
|
|
|
|
pfile = fopen(path,"r");
|
|
|
|
if (!pfile) return -5;
|
|
|
|
while ((fdata = fgetc(pfile)) != EOF)
|
|
|
|
{
|
|
|
|
if (fpos > fsPersistant_MaxPath) { fclose(pfile);return -6; }
|
|
|
|
subject[fpos++] = fdata;
|
|
|
|
}
|
|
|
|
fclose(pfile);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rw_command == 1)
|
|
|
|
{
|
|
|
|
pfile = fopen(path,"w+");
|
|
|
|
if (!pfile) return -6;
|
|
|
|
fprintf(pfile,"%s",subject);
|
|
|
|
fclose(pfile);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
else return -10;
|
|
|
|
}
|
|
|
|
//-----------------------------------------------
|
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
void fs_fsFilterCombo_activate( GtkEditable * editable,gpointer user_data )
|
2001-11-14 16:04:25 +00:00
|
|
|
{
|
2002-09-28 20:33:56 +00:00
|
|
|
fsFilter=gtk_entry_get_text( GTK_ENTRY( user_data ) );
|
2001-12-15 15:36:07 +00:00
|
|
|
CheckDir( fsFNameList,get_current_dir_name() );
|
2001-11-14 16:04:25 +00:00
|
|
|
}
|
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
void fs_fsFilterCombo_changed( GtkEditable * editable,gpointer user_data )
|
2001-11-14 16:04:25 +00:00
|
|
|
{
|
2001-12-15 15:36:07 +00:00
|
|
|
char * str;
|
|
|
|
int i;
|
2001-11-14 16:04:25 +00:00
|
|
|
|
|
|
|
str=gtk_entry_get_text( GTK_ENTRY(user_data ) );
|
2002-02-23 15:12:55 +00:00
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
switch ( fsType )
|
2001-11-14 16:04:25 +00:00
|
|
|
{
|
2001-12-15 15:36:07 +00:00
|
|
|
case fsVideoSelector:
|
2002-08-31 15:55:03 +00:00
|
|
|
for( i=0;fsVideoFilterNames[i][0];i++ )
|
2002-02-23 15:12:55 +00:00
|
|
|
if( !strcmp( str,fsVideoFilterNames[i][0] ) )
|
2002-09-28 20:33:56 +00:00
|
|
|
{ fsFilter=fsVideoFilterNames[i][1]; break; }
|
2002-02-23 15:12:55 +00:00
|
|
|
break;
|
2001-12-15 15:36:07 +00:00
|
|
|
case fsSubtitleSelector:
|
2002-08-31 15:55:03 +00:00
|
|
|
for( i=0;fsSubtitleFilterNames[i][0];i++ )
|
2002-02-23 15:12:55 +00:00
|
|
|
if( !strcmp( str,fsSubtitleFilterNames[i][0] ) )
|
2002-09-28 20:33:56 +00:00
|
|
|
{ fsFilter=fsSubtitleFilterNames[i][1]; break; }
|
2001-12-15 15:36:07 +00:00
|
|
|
break;
|
|
|
|
case fsOtherSelector:
|
2002-08-31 15:55:03 +00:00
|
|
|
for( i=0;fsOtherFilterNames[i][0];i++ )
|
2002-02-23 15:12:55 +00:00
|
|
|
if( !strcmp( str,fsOtherFilterNames[i][0] ) )
|
2002-09-28 20:33:56 +00:00
|
|
|
{ fsFilter=fsOtherFilterNames[i][1]; break; }
|
2001-12-15 15:36:07 +00:00
|
|
|
break;
|
2002-07-02 22:31:50 +00:00
|
|
|
case fsAudioSelector:
|
2002-08-31 15:55:03 +00:00
|
|
|
for( i=0;fsAudioFileNames[i][0];i++ )
|
2002-07-02 22:31:50 +00:00
|
|
|
if( !strcmp( str,fsAudioFileNames[i][0] ) )
|
2002-09-28 20:33:56 +00:00
|
|
|
{ fsFilter=fsAudioFileNames[i][1]; break; }
|
2002-07-02 22:31:50 +00:00
|
|
|
break;
|
2002-07-25 20:26:38 +00:00
|
|
|
case fsFontSelector:
|
2002-08-31 15:55:03 +00:00
|
|
|
for( i=0;fsFontFileNames[i][0];i++ )
|
2002-07-25 20:26:38 +00:00
|
|
|
if( !strcmp( str,fsFontFileNames[i][0] ) )
|
2002-09-29 19:00:43 +00:00
|
|
|
{ fsFilter=fsFontFileNames[i][1]; break; }
|
2002-07-25 20:26:38 +00:00
|
|
|
break;
|
2002-07-02 22:31:50 +00:00
|
|
|
default: return;
|
2001-11-14 16:04:25 +00:00
|
|
|
}
|
2002-07-02 22:31:50 +00:00
|
|
|
CheckDir( fsFNameList,get_current_dir_name() );
|
2001-11-14 16:04:25 +00:00
|
|
|
}
|
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
void fs_fsPathCombo_activate( GtkEditable * editable,gpointer user_data )
|
2001-11-14 16:04:25 +00:00
|
|
|
{
|
|
|
|
unsigned char * str;
|
|
|
|
|
|
|
|
str=gtk_entry_get_text( GTK_ENTRY( user_data ) );
|
2001-12-15 15:36:07 +00:00
|
|
|
if ( chdir( str ) != -1 ) CheckDir( fsFNameList,get_current_dir_name() );
|
2001-11-14 16:04:25 +00:00
|
|
|
}
|
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
void fs_fsPathCombo_changed( GtkEditable * editable,gpointer user_data )
|
2001-11-14 16:04:25 +00:00
|
|
|
{
|
|
|
|
unsigned char * str;
|
|
|
|
|
|
|
|
str=gtk_entry_get_text( GTK_ENTRY( user_data ) );
|
|
|
|
fsPressed=2;
|
2001-12-15 15:36:07 +00:00
|
|
|
if ( chdir( str ) != -1 ) CheckDir( fsFNameList,get_current_dir_name() );
|
2001-11-14 16:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void fs_Up_released( GtkButton * button,gpointer user_data )
|
|
|
|
{
|
|
|
|
chdir( ".." );
|
|
|
|
fsSelectedFile=fsThatDir;
|
2001-12-15 15:36:07 +00:00
|
|
|
CheckDir( fsFNameList,get_current_dir_name() );
|
|
|
|
gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)get_current_dir_name() );
|
2001-11-14 16:04:25 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
int fsFileExist( unsigned char * fname )
|
|
|
|
{
|
|
|
|
FILE * f = fopen( fname,"r" );
|
|
|
|
if ( f == NULL ) return 0;
|
|
|
|
fclose( f );
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void fs_Ok_released( GtkButton * button,gpointer user_data )
|
|
|
|
{
|
|
|
|
unsigned char * str;
|
|
|
|
GList * item;
|
|
|
|
int size,j,i = 1;
|
|
|
|
struct stat fs;
|
|
|
|
|
|
|
|
stat( fsSelectedFile,&fs );
|
|
|
|
if( S_ISDIR(fs.st_mode ) )
|
|
|
|
{
|
|
|
|
chdir( fsSelectedFile );
|
|
|
|
fsSelectedFile=fsThatDir;
|
2001-12-15 15:36:07 +00:00
|
|
|
CheckDir( fsFNameList,get_current_dir_name() );
|
|
|
|
gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)get_current_dir_name() );
|
2003-01-02 12:33:06 +00:00
|
|
|
fs_PersistantHistory(1,get_current_dir_name(),0); //totem, write into history
|
2001-11-14 16:04:25 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch( fsPressed )
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
fsSelectedDirectory=(unsigned char *)get_current_dir_name();
|
|
|
|
break;
|
|
|
|
case 2:
|
2001-12-15 15:36:07 +00:00
|
|
|
str=gtk_entry_get_text( GTK_ENTRY( fsPathCombo ) );
|
2001-11-14 16:04:25 +00:00
|
|
|
fsSelectedFile=str;
|
2002-05-20 13:56:16 +00:00
|
|
|
if ( !fsFileExist( fsSelectedFile ) ) { HideFileSelect(); return; }
|
2001-11-14 16:04:25 +00:00
|
|
|
fsSelectedDirectory=fsSelectedFile;
|
|
|
|
size=strlen( fsSelectedDirectory );
|
|
|
|
for ( j=0;j<size;j++ )
|
|
|
|
{
|
|
|
|
if ( fsSelectedDirectory[ size - j ] == '/' )
|
|
|
|
{
|
|
|
|
fsSelectedFile+=size - j + 1;
|
|
|
|
fsSelectedDirectory[ size - j ]=0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2001-12-15 15:36:07 +00:00
|
|
|
switch ( fsType )
|
|
|
|
{
|
|
|
|
case fsVideoSelector:
|
2002-02-23 15:12:55 +00:00
|
|
|
guiSetDF( guiIntfStruct.Filename,fsSelectedDirectory,fsSelectedFile );
|
|
|
|
guiIntfStruct.StreamType=STREAMTYPE_FILE;
|
|
|
|
guiIntfStruct.FilenameChanged=1;
|
2002-07-30 11:50:20 +00:00
|
|
|
gfree( (void **)&guiIntfStruct.AudioFile );
|
|
|
|
gfree( (void **)&guiIntfStruct.Subtitlename );
|
2002-02-23 15:12:55 +00:00
|
|
|
break;
|
2002-08-29 22:24:49 +00:00
|
|
|
#ifdef USE_SUB
|
2001-12-15 15:36:07 +00:00
|
|
|
case fsSubtitleSelector:
|
2002-02-23 15:12:55 +00:00
|
|
|
guiSetDF( guiIntfStruct.Subtitlename,fsSelectedDirectory,fsSelectedFile );
|
2002-08-29 22:24:49 +00:00
|
|
|
guiLoadSubtitle( guiIntfStruct.Subtitlename );
|
2001-12-15 15:36:07 +00:00
|
|
|
break;
|
2002-08-29 22:24:49 +00:00
|
|
|
#endif
|
2001-12-15 15:36:07 +00:00
|
|
|
case fsOtherSelector:
|
2002-02-23 15:12:55 +00:00
|
|
|
guiSetDF( guiIntfStruct.Othername,fsSelectedDirectory,fsSelectedFile );
|
2001-12-15 15:36:07 +00:00
|
|
|
break;
|
2002-07-02 22:31:50 +00:00
|
|
|
case fsAudioSelector:
|
|
|
|
guiSetDF( guiIntfStruct.AudioFile,fsSelectedDirectory,fsSelectedFile );
|
|
|
|
break;
|
2002-07-25 20:26:38 +00:00
|
|
|
case fsFontSelector:
|
2002-08-15 22:52:52 +00:00
|
|
|
guiSetDF( font_name,fsSelectedDirectory,fsSelectedFile );
|
2002-07-25 20:26:38 +00:00
|
|
|
#if defined( USE_OSD ) || defined( USE_SUB )
|
|
|
|
guiLoadFont();
|
|
|
|
#endif
|
2002-11-27 22:48:56 +00:00
|
|
|
if ( Preferences ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name );
|
2002-07-25 20:26:38 +00:00
|
|
|
break;
|
2001-12-15 15:36:07 +00:00
|
|
|
}
|
2002-05-20 13:56:16 +00:00
|
|
|
|
|
|
|
HideFileSelect();
|
|
|
|
|
2001-11-14 16:04:25 +00:00
|
|
|
item=fsTopList_items;
|
|
|
|
while( item )
|
|
|
|
{
|
|
|
|
if ( !strcmp( item->data,fsSelectedDirectory ) ) i=0;
|
|
|
|
item=item->next;
|
|
|
|
}
|
2002-05-11 16:37:58 +00:00
|
|
|
if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name() );
|
2002-08-05 01:14:14 +00:00
|
|
|
if ( mplMainAutoPlay ) { mplMainAutoPlay=0; mplEventHandling( evPlay,0 ); }
|
2001-11-14 16:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void fs_Cancel_released( GtkButton * button,gpointer user_data )
|
2003-01-02 12:33:06 +00:00
|
|
|
{
|
|
|
|
HideFileSelect();
|
|
|
|
fs_PersistantHistory(1,get_current_dir_name(),0); //totem, write into history file
|
|
|
|
}
|
2001-11-14 16:04:25 +00:00
|
|
|
|
|
|
|
void fs_fsFNameList_select_row( GtkWidget * widget,gint row,gint column,GdkEventButton *bevent,gpointer user_data )
|
|
|
|
{
|
2002-02-23 15:12:55 +00:00
|
|
|
gtk_clist_get_text( GTK_CLIST(widget ),row,1,&fsSelectedFile );
|
2001-11-14 16:04:25 +00:00
|
|
|
fsPressed=1;
|
2002-11-27 22:48:56 +00:00
|
|
|
if( bevent && bevent->type == GDK_BUTTON_PRESS ) gtk_button_released( GTK_BUTTON( fsOk ) );
|
2001-11-14 16:04:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gboolean on_FileSelect_key_release_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data )
|
|
|
|
{
|
|
|
|
switch ( event->keyval )
|
|
|
|
{
|
|
|
|
case GDK_Escape:
|
|
|
|
gtk_button_released( GTK_BUTTON( fsCancel ) );
|
|
|
|
break;
|
|
|
|
case GDK_Return:
|
|
|
|
gtk_button_released( GTK_BUTTON( fsOk ) );
|
|
|
|
break;
|
|
|
|
case GDK_BackSpace:
|
|
|
|
gtk_button_released( GTK_BUTTON( fsUp ) );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget * create_FileSelect( void )
|
|
|
|
{
|
|
|
|
GtkWidget * FSFrame;
|
|
|
|
GtkWidget * frame2;
|
|
|
|
GtkWidget * frame3;
|
|
|
|
GtkWidget * frame4;
|
|
|
|
GtkWidget * vbox4;
|
|
|
|
GtkWidget * hbox4;
|
|
|
|
GtkWidget * vseparator1;
|
|
|
|
GtkWidget * hseparator1;
|
|
|
|
GtkWidget * hbox6;
|
|
|
|
GtkWidget * fsFNameListWindow;
|
|
|
|
GtkWidget * label1;
|
|
|
|
GtkWidget * hseparator2;
|
|
|
|
GtkWidget * hseparator3;
|
|
|
|
GtkWidget * hbuttonbox3;
|
|
|
|
|
|
|
|
GtkWidget * uppixmapwid;
|
|
|
|
GdkPixmap * uppixmap;
|
|
|
|
GdkBitmap * upmask;
|
|
|
|
GtkStyle * upstyle;
|
|
|
|
|
2003-01-02 12:33:06 +00:00
|
|
|
|
2002-02-21 10:35:37 +00:00
|
|
|
fsFileSelect=gtk_window_new( GTK_WINDOW_TOPLEVEL );
|
2001-11-14 16:04:25 +00:00
|
|
|
gtk_widget_set_name( fsFileSelect,"fsFileSelect" );
|
|
|
|
gtk_object_set_data( GTK_OBJECT( fsFileSelect ),"fsFileSelect",fsFileSelect );
|
2002-02-21 10:35:37 +00:00
|
|
|
gtk_widget_set_usize( fsFileSelect,512,300 );
|
2001-11-14 16:04:25 +00:00
|
|
|
GTK_WIDGET_SET_FLAGS( fsFileSelect,GTK_CAN_DEFAULT );
|
|
|
|
gtk_widget_set_events( fsFileSelect,GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK );
|
|
|
|
gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect );
|
|
|
|
gtk_window_set_position( GTK_WINDOW( fsFileSelect ),GTK_WIN_POS_CENTER );
|
2002-02-21 10:35:37 +00:00
|
|
|
gtk_window_set_policy( GTK_WINDOW( fsFileSelect ),TRUE,TRUE,TRUE );
|
2002-11-27 22:48:56 +00:00
|
|
|
gtk_window_set_wmclass( GTK_WINDOW( fsFileSelect ),"FileSelect","MPlayer" );
|
2001-11-14 16:04:25 +00:00
|
|
|
fsColorMap=gdk_colormap_get_system();
|
2002-07-05 23:47:00 +00:00
|
|
|
|
|
|
|
gtk_widget_realize( fsFileSelect );
|
|
|
|
gtkAddIcon( fsFileSelect );
|
2001-11-14 16:04:25 +00:00
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
style=gtk_widget_get_style( fsFileSelect );
|
|
|
|
dpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&dmask,&style->bg[GTK_STATE_NORMAL],(gchar **)dir_xpm );
|
|
|
|
fpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&fmask,&style->bg[GTK_STATE_NORMAL],(gchar **)file_xpm );
|
|
|
|
|
2002-11-27 22:48:56 +00:00
|
|
|
vbox4=AddVBox( AddDialogFrame( fsFileSelect ),0 );
|
|
|
|
hbox4=AddHBox( vbox4,1 );
|
2001-11-14 16:04:25 +00:00
|
|
|
|
|
|
|
fsCombo4=gtk_combo_new();
|
|
|
|
gtk_widget_set_name( fsCombo4,"fsCombo4" );
|
|
|
|
gtk_widget_show( fsCombo4 );
|
|
|
|
gtk_box_pack_start( GTK_BOX( hbox4 ),fsCombo4,TRUE,TRUE,0 );
|
|
|
|
gtk_widget_set_usize( fsCombo4,-2,20 );
|
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
fsPathCombo=GTK_COMBO( fsCombo4 )->entry;
|
|
|
|
gtk_widget_set_name( fsPathCombo,"fsPathCombo" );
|
|
|
|
gtk_widget_show( fsPathCombo );
|
|
|
|
gtk_widget_set_usize( fsPathCombo,-2,20 );
|
2001-11-14 16:04:25 +00:00
|
|
|
|
|
|
|
vseparator1=gtk_vseparator_new();
|
|
|
|
gtk_widget_set_name( vseparator1,"vseparator1" );
|
|
|
|
gtk_widget_show( vseparator1 );
|
|
|
|
gtk_box_pack_start( GTK_BOX( hbox4 ),vseparator1,FALSE,TRUE,0 );
|
|
|
|
gtk_widget_set_usize( vseparator1,7,20 );
|
|
|
|
|
|
|
|
upstyle=gtk_widget_get_style( fsFileSelect );
|
|
|
|
uppixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&upmask,&upstyle->bg[GTK_STATE_NORMAL],(gchar **)up_xpm );
|
|
|
|
uppixmapwid=gtk_pixmap_new( uppixmap,upmask );
|
|
|
|
gtk_widget_show( uppixmapwid );
|
|
|
|
|
|
|
|
fsUp=gtk_button_new();
|
|
|
|
gtk_container_add( GTK_CONTAINER(fsUp ),uppixmapwid );
|
|
|
|
gtk_widget_show( fsUp );
|
|
|
|
gtk_box_pack_start( GTK_BOX( hbox4 ),fsUp,FALSE,FALSE,0 );
|
|
|
|
gtk_widget_set_usize( fsUp,65,15 );
|
|
|
|
|
2002-11-27 22:48:56 +00:00
|
|
|
AddHSeparator( vbox4 );
|
|
|
|
|
|
|
|
hbox6=AddHBox( NULL,0 );
|
|
|
|
gtk_box_pack_start( GTK_BOX( vbox4 ),hbox6,TRUE,TRUE,0 );
|
2001-11-14 16:04:25 +00:00
|
|
|
|
|
|
|
fsFNameListWindow=gtk_scrolled_window_new( NULL,NULL );
|
|
|
|
gtk_widget_set_name( fsFNameListWindow,"fsFNameListWindow" );
|
|
|
|
gtk_widget_show( fsFNameListWindow );
|
|
|
|
gtk_box_pack_start( GTK_BOX( hbox6 ),fsFNameListWindow,TRUE,TRUE,0 );
|
|
|
|
gtk_widget_set_usize( fsFNameListWindow,-2,145 );
|
|
|
|
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( fsFNameListWindow ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC );
|
|
|
|
|
|
|
|
fsFNameList=gtk_clist_new( 2 );
|
|
|
|
gtk_widget_set_name( fsFNameList,"fsFNameList" );
|
|
|
|
gtk_container_add( GTK_CONTAINER( fsFNameListWindow ),fsFNameList );
|
|
|
|
gtk_clist_set_column_width( GTK_CLIST( fsFNameList ),0,80 );
|
|
|
|
gtk_clist_set_selection_mode( GTK_CLIST( fsFNameList ),GTK_SELECTION_BROWSE );
|
|
|
|
gtk_clist_column_titles_hide( GTK_CLIST( fsFNameList ) );
|
|
|
|
gtk_clist_set_shadow_type( GTK_CLIST( fsFNameList ),GTK_SHADOW_ETCHED_OUT );
|
|
|
|
|
2002-11-27 22:48:56 +00:00
|
|
|
AddHSeparator( vbox4 );
|
2001-11-14 16:04:25 +00:00
|
|
|
|
|
|
|
List=gtk_combo_new();
|
|
|
|
gtk_widget_set_name( List,"List" );
|
|
|
|
gtk_widget_ref( List );
|
2002-05-11 16:37:58 +00:00
|
|
|
gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"List",List,(GtkDestroyNotify)gtk_widget_unref );
|
2001-11-14 16:04:25 +00:00
|
|
|
gtk_widget_show( List );
|
|
|
|
gtk_box_pack_start( GTK_BOX( vbox4 ),List,FALSE,FALSE,0 );
|
|
|
|
gtk_widget_set_usize( List,-2,20 );
|
|
|
|
|
2001-12-15 15:36:07 +00:00
|
|
|
fsFilterCombo=GTK_COMBO( List )->entry;
|
|
|
|
gtk_widget_set_name( fsFilterCombo,"fsFilterCombo" );
|
|
|
|
gtk_widget_show( fsFilterCombo );
|
|
|
|
gtk_entry_set_editable (GTK_ENTRY( fsFilterCombo ),FALSE );
|
2001-11-14 16:04:25 +00:00
|
|
|
|
2002-11-27 22:48:56 +00:00
|
|
|
AddHSeparator( vbox4 );
|
|
|
|
|
|
|
|
hbuttonbox3=AddHButtonBox( vbox4 );
|
|
|
|
gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox3 ),GTK_BUTTONBOX_END );
|
|
|
|
gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox3 ),10 );
|
2002-05-20 13:56:16 +00:00
|
|
|
|
2002-11-27 22:48:56 +00:00
|
|
|
fsOk=AddButton( MSGTR_Ok,hbuttonbox3 );
|
|
|
|
fsCancel=AddButton( MSGTR_Cancel,hbuttonbox3 );
|
|
|
|
|
|
|
|
gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&fsFileSelect );
|
|
|
|
gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );
|
2002-05-20 13:56:16 +00:00
|
|
|
|
2002-05-11 16:37:58 +00:00
|
|
|
gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsFilterCombo_changed ),fsFilterCombo );
|
|
|
|
gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsFilterCombo_activate ),fsFilterCombo );
|
|
|
|
gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsPathCombo_changed ),fsPathCombo );
|
|
|
|
gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsPathCombo_activate ),fsPathCombo );
|
|
|
|
gtk_signal_connect( GTK_OBJECT( fsUp ),"released",GTK_SIGNAL_FUNC( fs_Up_released ),fsFNameList );
|
|
|
|
gtk_signal_connect( GTK_OBJECT( fsOk ),"released",GTK_SIGNAL_FUNC( fs_Ok_released ),fsCombo4 );
|
|
|
|
gtk_signal_connect( GTK_OBJECT( fsCancel ),"released",GTK_SIGNAL_FUNC( fs_Cancel_released ),NULL );
|
|
|
|
gtk_signal_connect( GTK_OBJECT( fsFNameList ),"select_row",(GtkSignalFunc)fs_fsFNameList_select_row,NULL );
|
2001-11-14 16:04:25 +00:00
|
|
|
|
|
|
|
gtk_widget_grab_focus( fsFNameList );
|
|
|
|
|
|
|
|
return fsFileSelect;
|
|
|
|
}
|
|
|
|
|