Mercurial > mplayer.hg
annotate gui/ui/gtk/fileselect.c @ 34869:30fad98fad6e
Add Windows Media Station file (application/x-netshow-channel) support.
author | ib |
---|---|
date | Mon, 21 May 2012 22:56:37 +0000 |
parents | 1a07230149a0 |
children | 3441d7ebea3e |
rev | line source |
---|---|
33572 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 */ | |
18 | |
19 #include <stdlib.h> | |
20 #include <stdio.h> | |
21 #include <string.h> | |
22 #include <sys/stat.h> | |
23 #include <glob.h> | |
24 #include <unistd.h> | |
25 | |
26 #include "config.h" | |
27 #include "gui/ui/gmplayer.h" | |
28 | |
29 #include "gui/ui/pixmaps/up.xpm" | |
30 #include "gui/ui/pixmaps/dir.xpm" | |
31 #include "gui/ui/pixmaps/file.xpm" | |
32 | |
33 #include "gui/app.h" | |
34 #include "gui/interface.h" | |
33739 | 35 #include "gui/util/mem.h" |
33737 | 36 #include "gui/util/string.h" |
33572 | 37 #include "help_mp.h" |
38 #include "mpcommon.h" | |
39 #include "stream/stream.h" | |
33751
c28c967e40e9
Replace numeric constant fsPersistant_MaxPos for fsHistory array size.
ib
parents:
33740
diff
changeset
|
40 #include "libavutil/common.h" |
33572 | 41 |
42 #include "gui/ui/widgets.h" | |
43 #include "fileselect.h" | |
44 #include "preferences.h" | |
45 #include "tools.h" | |
46 | |
47 #ifndef __linux__ | |
48 #define get_current_dir_name() getcwd(NULL, PATH_MAX) | |
49 #else | |
50 char * get_current_dir_name( void ); | |
51 #endif | |
52 | |
53 gchar * fsSelectedFile = NULL; | |
54 gchar * fsSelectedFileUtf8 = NULL; | |
55 gchar * fsSelectedDirectory = NULL; | |
33787
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
56 gchar * fsSelectedDirectoryUtf8 = NULL; |
33572 | 57 unsigned char * fsThatDir = "."; |
58 const gchar * fsFilter = "*"; | |
59 | |
60 int fsType = 0; | |
61 | |
34364 | 62 static gint fsCurrFNameListSelected, fsLastFNameListSelected; |
63 | |
33572 | 64 char * fsVideoFilterNames[][2] = |
65 { | |
34857
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
66 { MSGTR_Filter_AVIFiles, "*.avi" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
67 { MSGTR_Filter_DivXFiles, "*.divx" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
68 { MSGTR_Filter_FlashVideo, "*.flv" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
69 { MSGTR_Filter_MP3Files, "*.mp3" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
70 { MSGTR_Filter_MP4Files, "*.aac,*.f4a,*.f4b,*.f4v,*.m4a,*.m4b,*.m4v,*.mp4" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
71 { MSGTR_Filter_MPEGFiles, "*.m1v,*.m2v,*.mp2,*.mpe,*.mpeg,*.mpg,*.mpga,*.vdr,*.vob" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
72 { MSGTR_Filter_MP2TS, "*.bdm,*.bdmv,*.clpi,*.cpi,*.m2t,*.m2ts,*.mpl,*.mpls,*.mts,*.rec,*.trp,*.ts,*.ty" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
73 { MSGTR_Filter_MatroskaMedia, "*.mka,*.mkv" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
74 { MSGTR_Filter_OGGMedia, "*.oga,*.ogg,*.ogm,*.ogv,*.ogx,*.spx" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
75 { MSGTR_Filter_QTMedia, "*.moov,*.mov,*.qt,*.qtvr" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
76 { MSGTR_Filter_RNMedia, "*.ra,*.rm,*.rmvb,*.rv" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
77 { MSGTR_Filter_VideoCDImages, "*.bin" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
78 { MSGTR_Filter_WAVFiles, "*.wav" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
79 { MSGTR_Filter_WindowsMedia, "*.asf,*.wma,*.wmv" }, |
34869
30fad98fad6e
Add Windows Media Station file (application/x-netshow-channel) support.
ib
parents:
34868
diff
changeset
|
80 { MSGTR_Filter_Playlists, "*.asx,*.m3u,*.m3u8,*.nsc,*.pls,*.ram,*.smi,*.smil,*.sml,*.vlc,*.wax,*.wmx,*.wvx" }, |
34857
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
81 { MSGTR_Filter_AllAudioFiles, "*.aac,*.ac3,*.aif,*.aifc,*.aiff,*.amr,*.ape,*.au,*.awb,*.cdg,*.f4a,*.f4b,*.flac,*.m4a,*.m4b,*.mka,*.mp+,*.mp2,*.mp3,*.mpc,*.mpga,*.mpp,*.nsa,*.oga,*.ogg,*.pcm,*.qcp,*.ra,*.snd,*.spx,*.voc,*.vqf,*.w64,*.wav,*.wma,*.wv,*.wvp" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
82 { MSGTR_Filter_AllVideoFiles, "*.264,*.3g2,*.3ga,*.3gp,*.3gp2,*.3gpp,*.3gpp2,*.asf,*.avi,*.bdm,*.bdmv,*.bin,*.clpi,*.cpi,*.divx,*.dv,*.f4v,*.flc,*.fli,*.flv,*.m1v,*.m2t,*.m2ts,*.m2v,*.m4v,*.mkv,*.moov,*.mov,*.mp2,*.mp4,*.mpe,*.mpeg,*.mpg,*.mpl,*.mpls,*.mts,*.mxf,*.nsv,*.nuv,*.ogg,*.ogm,*.ogv,*.ogx,*.pva,*.qt,*.qtvr,*.rec,*.rm,*.rmvb,*.rv,*.spl,*.str,*.swf,*.trp,*.ts,*.ty,*.vdr,*.viv,*.vivo,*.vob,*.webm,*.wmv" }, |
cceef8552b0c
Enable translation of video and audio file filter items.
ib
parents:
34856
diff
changeset
|
83 { MSGTR_Filter_AllFiles, "*" }, |
33572 | 84 { NULL,NULL } |
85 }; | |
86 int fsLastVideoFilterSelected = -1; | |
87 | |
88 char * fsSubtitleFilterNames[][2] = | |
89 { | |
34849 | 90 { "AQTitle (*.aqt)", "*.aqt" }, |
91 { "Advanced SubStation Alpha (*.ass)", "*.ass" }, | |
92 { "JACOSub (*.jss) ", "*.jss" }, | |
93 { "RealText (*.rt) ", "*.rt" }, | |
94 { "SAMI (*.smi)", "*.smi" }, | |
95 { "SubRip (*.srt)", "*.srt" }, | |
96 { "SubStation Alpha (*.ssa)", "*.ssa" }, | |
97 { "MicroDVD (*.sub)", "*.sub" }, | |
98 { "Text (*.txt)", "*.txt" }, | |
34868
1a07230149a0
Revise UTF-8 encoded subtitle file filter for file selector.
ib
parents:
34867
diff
changeset
|
99 { MSGTR_Filter_UTF8Subtitles, "*.utf,*.utf-8,*.utf8" }, |
34850 | 100 { MSGTR_Filter_AllSubtitles, "*.aqt,*.ass,*.jss,*.rt,*.smi,*.srt,*.ssa,*.sub,*.txt,*.utf" }, |
101 { MSGTR_Filter_AllFiles, "*" }, | |
33572 | 102 { NULL,NULL } |
103 }; | |
104 int fsLastSubtitleFilterSelected = -1; | |
105 | |
106 char * fsOtherFilterNames[][2] = | |
107 { | |
34854 | 108 { MSGTR_Filter_AllFiles, "*" }, |
33572 | 109 { NULL,NULL } |
110 }; | |
111 | |
112 char * fsAudioFileNames[][2] = | |
113 { | |
34853
f6f1cfdaaccf
Enable translation of external audio file filter items.
ib
parents:
34852
diff
changeset
|
114 { MSGTR_Filter_DDRawAudio, "*.ac3,*.pcm" }, |
34856 | 115 { MSGTR_Filter_MPEGAudio, "*.aac,*.f4a,*.m4a,*.mp2,*.mp3,*.mpga" }, |
34853
f6f1cfdaaccf
Enable translation of external audio file filter items.
ib
parents:
34852
diff
changeset
|
116 { MSGTR_Filter_MatroskaAudio, "*.mka" }, |
f6f1cfdaaccf
Enable translation of external audio file filter items.
ib
parents:
34852
diff
changeset
|
117 { MSGTR_Filter_OGGAudio, "*.oga,*.ogg,*.spx" }, |
f6f1cfdaaccf
Enable translation of external audio file filter items.
ib
parents:
34852
diff
changeset
|
118 { MSGTR_Filter_WAVAudio, "*.wav" }, |
f6f1cfdaaccf
Enable translation of external audio file filter items.
ib
parents:
34852
diff
changeset
|
119 { MSGTR_Filter_WMAAudio, "*.wma" }, |
34856 | 120 { MSGTR_Filter_AllAudioFiles, "*.aac,*.ac3,*.f4a,*.m4a,*.mka,*.mp2,*.mp3,*.mpga,*.oga,*.ogg,*.pcm,*.spx,*.wav,*.wma" }, |
34853
f6f1cfdaaccf
Enable translation of external audio file filter items.
ib
parents:
34852
diff
changeset
|
121 { MSGTR_Filter_AllFiles, "*" }, |
33572 | 122 { NULL, NULL } |
123 }; | |
124 int fsLastAudioFilterSelected = -1; | |
125 | |
126 char * fsFontFileNames[][2] = | |
127 { | |
128 #ifdef CONFIG_FREETYPE | |
34851 | 129 { MSGTR_Filter_TTF, "*.ttf" }, |
130 { MSGTR_Filter_Type1, "*.pfb" }, | |
34856 | 131 { MSGTR_Filter_AllFonts, "*.pfb,*.ttf" }, |
33572 | 132 #else |
34851 | 133 { MSGTR_Filter_FontFiles, "*.desc" }, |
33572 | 134 #endif |
34851 | 135 { MSGTR_Filter_AllFiles, "*" }, |
33572 | 136 { NULL,NULL } |
137 }; | |
138 int fsLastFontFilterSelected = -1; | |
139 | |
140 GtkWidget * fsFileNamesList; | |
141 GtkWidget * fsFNameList; | |
142 GtkWidget * fsFileSelect = NULL; | |
143 GdkColormap * fsColorMap; | |
144 GtkWidget * fsOk; | |
145 GtkWidget * fsUp; | |
146 GtkWidget * fsCancel; | |
147 GtkWidget * fsCombo4; | |
148 GtkWidget * fsPathCombo; | |
149 GList * fsList_items = NULL; | |
150 GList * fsTopList_items = NULL; | |
151 GtkWidget * List; | |
152 GtkWidget * fsFilterCombo; | |
153 | |
154 GtkStyle * style; | |
155 GdkPixmap * dpixmap; | |
156 GdkPixmap * fpixmap; | |
157 GdkBitmap * dmask; | |
158 GdkBitmap * fmask; | |
159 | |
160 static char * get_current_dir_name_utf8( void ) | |
161 { | |
162 char * dir, * utf8dir; | |
163 dir = get_current_dir_name(); | |
164 utf8dir = g_filename_to_utf8( dir, -1, NULL, NULL, NULL ); | |
165 if ( !utf8dir ) utf8dir = g_strdup( dir ); | |
166 free( dir ); | |
167 return utf8dir; | |
168 } | |
169 | |
170 static void clist_append_fname(GtkWidget * list, char *fname, | |
171 GdkPixmap *pixmap, GdkPixmap *mask) { | |
172 gint pos; | |
173 gchar *filename, *str[2]; | |
174 filename = g_filename_to_utf8(fname, -1, NULL, NULL, NULL); | |
175 str[0] = NULL; | |
176 str[1] = filename ? filename : fname; | |
177 pos = gtk_clist_append(GTK_CLIST(list), str); | |
178 gtk_clist_set_pixmap(GTK_CLIST(list), pos, 0, pixmap, mask); | |
179 g_free(filename); | |
180 } | |
181 | |
182 static void CheckDir( GtkWidget * list ) | |
183 { | |
184 struct stat fs; | |
34838 | 185 unsigned int i, j, fn; |
33572 | 186 glob_t gg; |
34836 | 187 gchar *filter, **fext; |
33572 | 188 |
189 if ( !fsFilter[0] ) return; | |
190 | |
191 gtk_widget_hide( list ); | |
192 gtk_clist_clear( GTK_CLIST( list ) ); | |
193 | |
194 clist_append_fname(list, ".", dpixmap, dmask); | |
195 clist_append_fname(list, "..", dpixmap, dmask); | |
196 | |
197 glob( "*",0,NULL,&gg ); | |
34838 | 198 for( i=0;i<gg.gl_pathc;i++ ) |
33572 | 199 { |
200 stat( gg.gl_pathv[i],&fs ); | |
201 if( !S_ISDIR( fs.st_mode ) ) continue; | |
202 clist_append_fname(list, gg.gl_pathv[i], dpixmap, dmask); | |
203 } | |
34836 | 204 |
205 for (fn = 1, i = 0; fsFilter[i]; i++) | |
206 if (fsFilter[i] == ',') fn++; | |
207 | |
208 filter = g_strdup(fsFilter); | |
209 fext = calloc(fn, sizeof(gchar *)); | |
33572 | 210 |
34836 | 211 if (filter && fext) |
212 { | |
213 for (j = 0, i = 0; filter[i]; i++) | |
214 { | |
215 if (filter[i] == '.') fext[j] = filter + i; | |
216 | |
217 if (filter[i] == ',') | |
218 { | |
219 filter[i] = 0; | |
220 j++; | |
221 } | |
222 } | |
33572 | 223 |
34838 | 224 for( i=0;i<gg.gl_pathc;i++ ) |
34837 | 225 { |
34836 | 226 char *ext; |
227 | |
34837 | 228 stat( gg.gl_pathv[i],&fs ); |
229 if( S_ISDIR( fs.st_mode ) ) continue; | |
34836 | 230 |
231 ext = strrchr(gg.gl_pathv[i], '.'); | |
232 | |
233 if (ext || !fext[0]) | |
234 { | |
235 for (j = 0; j < fn; j++) | |
236 { | |
237 if (fext[j] == NULL || strcasecmp(fext[j], ext) == 0) | |
238 { | |
34837 | 239 clist_append_fname(list, gg.gl_pathv[i], fpixmap, fmask); |
34836 | 240 break; |
241 } | |
242 } | |
243 } | |
34837 | 244 } |
34836 | 245 } |
246 | |
247 free(fext); | |
248 g_free(filter); | |
33572 | 249 globfree( &gg ); |
250 | |
251 gtk_clist_set_column_width( GTK_CLIST( list ),0,17 ); | |
252 gtk_widget_show( list ); | |
253 } | |
254 | |
255 void ShowFileSelect( int type,int modal ) | |
256 { | |
33787
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
257 int i, k, fsMedium; |
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
258 char * tmp = NULL, * dir = NULL; |
34366
b8a4787f363b
Add /mnt only to the file selector path list if it exists.
ib
parents:
34364
diff
changeset
|
259 struct stat f; |
33572 | 260 |
261 if ( fsFileSelect ) gtkActive( fsFileSelect ); | |
262 else fsFileSelect=create_FileSelect(); | |
263 | |
264 fsType=type; | |
265 switch ( type ) | |
266 { | |
267 case fsVideoSelector: | |
268 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect ); | |
269 fsList_items=NULL; | |
270 for( i=0;fsVideoFilterNames[i][0];i++ ) | |
271 fsList_items=g_list_append( fsList_items,fsVideoFilterNames[i][0] ); | |
272 k = fsLastVideoFilterSelected; | |
273 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items ); | |
274 g_list_free( fsList_items ); | |
275 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsVideoFilterNames[k >= 0 ? k : i-2][0] ); | |
276 tmp=guiInfo.Filename; | |
277 break; | |
278 case fsSubtitleSelector: | |
279 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_SubtitleSelect ); | |
280 fsList_items=NULL; | |
281 for( i=0;fsSubtitleFilterNames[i][0];i++ ) | |
282 fsList_items=g_list_append( fsList_items,fsSubtitleFilterNames[i][0] ); | |
283 k = fsLastSubtitleFilterSelected; | |
284 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items ); | |
285 g_list_free( fsList_items ); | |
286 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsSubtitleFilterNames[k >= 0 ? k : i-2][0] ); | |
33897 | 287 tmp=guiInfo.SubtitleFilename; |
33572 | 288 break; |
33776 | 289 /* case fsOtherSelector: |
33572 | 290 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_OtherSelect ); |
291 fsList_items=NULL; | |
292 for( i=0;fsOtherFilterNames[i][0];i++ ) | |
293 fsList_items=g_list_append( fsList_items,fsOtherFilterNames[i][0] ); | |
294 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items ); | |
295 g_list_free( fsList_items ); | |
296 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsOtherFilterNames[0][0] ); | |
297 tmp=guiInfo.Othername; | |
33776 | 298 break;*/ |
33572 | 299 case fsAudioSelector: |
300 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_AudioFileSelect ); | |
301 fsList_items=NULL; | |
302 for( i=0;fsAudioFileNames[i][0];i++ ) | |
303 fsList_items=g_list_append( fsList_items,fsAudioFileNames[i][0] ); | |
304 k = fsLastAudioFilterSelected; | |
305 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items ); | |
306 g_list_free( fsList_items ); | |
307 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsAudioFileNames[k >= 0 ? k : i-2][0] ); | |
33897 | 308 tmp=guiInfo.AudioFilename; |
33572 | 309 break; |
310 case fsFontSelector: | |
311 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FontSelect ); | |
312 fsList_items=NULL; | |
313 for( i=0;fsFontFileNames[i][0];i++ ) | |
314 fsList_items=g_list_append( fsList_items,fsFontFileNames[i][0] ); | |
315 k = fsLastFontFilterSelected; | |
316 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items ); | |
317 g_list_free( fsList_items ); | |
318 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsFontFileNames[k >= 0 ? k : i-2][0] ); | |
319 tmp=font_name; | |
320 break; | |
321 } | |
322 | |
33787
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
323 fsMedium=(fsType == fsVideoSelector || fsType == fsSubtitleSelector || fsType == fsAudioSelector); |
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
324 |
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
325 if ( !tmp && fsMedium ) tmp=guiInfo.Filename; |
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
326 |
33572 | 327 if ( tmp && tmp[0] ) |
328 { | |
33787
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
329 dir = strdup( tmp ); |
33572 | 330 |
331 do | |
332 { | |
333 char * c = strrchr( dir,'/' ); | |
334 stat( dir,&f ); | |
335 if ( S_ISDIR( f.st_mode ) ) break; | |
336 if ( c ) *c=0; | |
337 } while ( strrchr( dir,'/' ) ); | |
338 | |
33787
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
339 if ( !dir[0] ) nfree( dir ); |
33572 | 340 } |
341 | |
342 if ( fsTopList_items ) g_list_free( fsTopList_items ); fsTopList_items=NULL; | |
343 { | |
33751
c28c967e40e9
Replace numeric constant fsPersistant_MaxPos for fsHistory array size.
ib
parents:
33740
diff
changeset
|
344 unsigned int i, c = 1; |
33572 | 345 |
33787
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
346 |
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
347 if ( fsMedium ) |
33572 | 348 { |
33751
c28c967e40e9
Replace numeric constant fsPersistant_MaxPos for fsHistory array size.
ib
parents:
33740
diff
changeset
|
349 for ( i=0;i < FF_ARRAY_ELEMS(fsHistory);i++ ) |
33787
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
350 if ( fsHistory[i] ) { fsTopList_items=g_list_append( fsTopList_items,fsHistory[i] ); if ( c ) c=gstrcmp( dir,fsHistory[i] ); } |
33572 | 351 } |
33787
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
352 if ( c && dir ) |
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
353 { |
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
354 g_free( fsSelectedDirectoryUtf8 ); |
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
355 fsSelectedDirectoryUtf8=g_filename_to_utf8( dir, -1, NULL, NULL, NULL ); |
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
356 fsTopList_items=g_list_prepend( fsTopList_items,fsSelectedDirectoryUtf8 ); |
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
357 } |
33572 | 358 } |
33787
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
359 free( dir ); |
33572 | 360 if ( getenv( "HOME" ) ) fsTopList_items=g_list_append( fsTopList_items,getenv( "HOME" ) ); |
34368
dbb38c5293b0
Add /home only to the file selector path list if HOME isn't set.
ib
parents:
34367
diff
changeset
|
361 else fsTopList_items=g_list_append( fsTopList_items,"/home" ); |
34367
b370a9fd85b3
Cosmetic: Swap /mnt and /media in the file selector path list.
ib
parents:
34366
diff
changeset
|
362 if (stat( "/media",&f ) == 0) fsTopList_items=g_list_append( fsTopList_items,"/media" ); |
34366
b8a4787f363b
Add /mnt only to the file selector path list if it exists.
ib
parents:
34364
diff
changeset
|
363 if (stat( "/mnt",&f ) == 0) fsTopList_items=g_list_append( fsTopList_items,"/mnt" ); |
33572 | 364 fsTopList_items=g_list_append( fsTopList_items,"/" ); |
365 gtk_combo_set_popdown_strings( GTK_COMBO( fsCombo4 ),fsTopList_items ); | |
366 | |
34346 | 367 gtk_widget_grab_focus( fsFNameList ); |
34518 | 368 if (fsLastFNameListSelected + 1 > ((GtkCList *)fsFNameList)->rows) fsLastFNameListSelected = 0; |
34364 | 369 ((GtkCList *)fsFNameList)->focus_row = fsLastFNameListSelected; |
370 gtk_clist_select_row( GTK_CLIST( fsFNameList ),fsLastFNameListSelected,1 ); | |
371 fsLastFNameListSelected = 0; | |
34346 | 372 |
33572 | 373 gtk_window_set_modal( GTK_WINDOW( fsFileSelect ),modal ); |
374 | |
375 gtk_widget_show( fsFileSelect ); | |
376 } | |
377 | |
378 void HideFileSelect( void ) | |
379 { | |
380 if ( !fsFileSelect ) return; | |
381 gtk_widget_hide( fsFileSelect ); | |
382 gtk_widget_destroy( fsFileSelect ); | |
383 fsFileSelect=NULL; | |
34364 | 384 fsLastFNameListSelected = fsCurrFNameListSelected; |
33572 | 385 } |
386 | |
387 static void fs_PersistantHistory( char * subject ) | |
388 { | |
33751
c28c967e40e9
Replace numeric constant fsPersistant_MaxPos for fsHistory array size.
ib
parents:
33740
diff
changeset
|
389 unsigned int i; |
33572 | 390 |
391 if ( fsType != fsVideoSelector ) return; | |
392 | |
33751
c28c967e40e9
Replace numeric constant fsPersistant_MaxPos for fsHistory array size.
ib
parents:
33740
diff
changeset
|
393 for ( i=0;i < FF_ARRAY_ELEMS(fsHistory);i++ ) |
33572 | 394 if ( fsHistory[i] && !strcmp( fsHistory[i],subject ) ) |
395 { | |
396 char * tmp = fsHistory[i]; fsHistory[i]=fsHistory[0]; fsHistory[0]=tmp; | |
397 return; | |
398 } | |
33751
c28c967e40e9
Replace numeric constant fsPersistant_MaxPos for fsHistory array size.
ib
parents:
33740
diff
changeset
|
399 nfree( fsHistory[FF_ARRAY_ELEMS(fsHistory) - 1] ); |
c28c967e40e9
Replace numeric constant fsPersistant_MaxPos for fsHistory array size.
ib
parents:
33740
diff
changeset
|
400 for ( i=FF_ARRAY_ELEMS(fsHistory) - 1;i;i-- ) fsHistory[i]=fsHistory[i - 1]; |
33572 | 401 fsHistory[0]=gstrdup( subject ); |
402 } | |
34684 | 403 /* ----------------------------------------------- */ |
33572 | 404 |
34466
a650895d50a5
Use correct data types and common variable names in GTK callback functions.
ib
parents:
34368
diff
changeset
|
405 static void fs_fsFilterCombo_activate( GtkEntry * entry, |
33572 | 406 gpointer user_data ) |
407 { | |
408 fsFilter=gtk_entry_get_text( GTK_ENTRY( user_data ) ); | |
409 CheckDir( fsFNameList ); | |
410 } | |
411 | |
412 static void fs_fsFilterCombo_changed( GtkEditable * editable, | |
413 gpointer user_data ) | |
414 { | |
415 const char * str; | |
416 int i; | |
417 | |
418 str=gtk_entry_get_text( GTK_ENTRY(user_data ) ); | |
419 | |
420 switch ( fsType ) | |
421 { | |
422 case fsVideoSelector: | |
423 for( i=0;fsVideoFilterNames[i][0];i++ ) | |
424 if( !strcmp( str,fsVideoFilterNames[i][0] ) ) | |
425 { fsFilter=fsVideoFilterNames[i][1]; fsLastVideoFilterSelected = i; break; } | |
426 break; | |
427 case fsSubtitleSelector: | |
428 for( i=0;fsSubtitleFilterNames[i][0];i++ ) | |
429 if( !strcmp( str,fsSubtitleFilterNames[i][0] ) ) | |
430 { fsFilter=fsSubtitleFilterNames[i][1]; fsLastSubtitleFilterSelected = i; break; } | |
431 break; | |
33776 | 432 /* case fsOtherSelector: |
33572 | 433 for( i=0;fsOtherFilterNames[i][0];i++ ) |
434 if( !strcmp( str,fsOtherFilterNames[i][0] ) ) | |
435 { fsFilter=fsOtherFilterNames[i][1]; break; } | |
33776 | 436 break;*/ |
33572 | 437 case fsAudioSelector: |
438 for( i=0;fsAudioFileNames[i][0];i++ ) | |
439 if( !strcmp( str,fsAudioFileNames[i][0] ) ) | |
440 { fsFilter=fsAudioFileNames[i][1]; fsLastAudioFilterSelected = i; break; } | |
441 break; | |
442 case fsFontSelector: | |
443 for( i=0;fsFontFileNames[i][0];i++ ) | |
444 if( !strcmp( str,fsFontFileNames[i][0] ) ) | |
445 { fsFilter=fsFontFileNames[i][1]; fsLastFontFilterSelected = i; break; } | |
446 break; | |
447 default: return; | |
448 } | |
449 CheckDir( fsFNameList ); | |
450 } | |
451 | |
34466
a650895d50a5
Use correct data types and common variable names in GTK callback functions.
ib
parents:
34368
diff
changeset
|
452 static void fs_fsPathCombo_activate( GtkEntry * entry, |
33572 | 453 gpointer user_data ) |
454 { | |
455 const unsigned char * str; | |
456 gchar * dirname; | |
457 | |
458 str=gtk_entry_get_text( GTK_ENTRY( user_data ) ); | |
459 dirname = g_filename_from_utf8( str, -1, NULL, NULL, NULL ); | |
460 if ( chdir( dirname ? (const unsigned char *)dirname : str ) != -1 ) CheckDir( fsFNameList ); | |
461 g_free( dirname ); | |
462 } | |
463 | |
464 static void fs_fsPathCombo_changed( GtkEditable * editable, | |
465 gpointer user_data ) | |
466 { | |
467 const unsigned char * str; | |
468 gchar * dirname; | |
469 | |
470 str=gtk_entry_get_text( GTK_ENTRY( user_data ) ); | |
471 dirname = g_filename_from_utf8( str, -1, NULL, NULL, NULL ); | |
472 if ( chdir( dirname ? (const unsigned char *)dirname : str ) != -1 ) CheckDir( fsFNameList ); | |
473 g_free( dirname ); | |
474 } | |
475 | |
476 static void fs_Up_released( GtkButton * button, gpointer user_data ) | |
477 { | |
478 chdir( ".." ); | |
479 fsSelectedFile=fsThatDir; | |
480 CheckDir( fsFNameList ); | |
481 gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)get_current_dir_name_utf8() ); | |
482 return; | |
483 } | |
484 | |
485 static void fs_Ok_released( GtkButton * button, gpointer user_data ) | |
486 { | |
487 GList * item; | |
34859 | 488 int i = 1, l; |
33572 | 489 struct stat fs; |
490 | |
491 stat( fsSelectedFile,&fs ); | |
492 if( S_ISDIR(fs.st_mode ) ) | |
493 { | |
494 chdir( fsSelectedFile ); | |
495 fsSelectedFile=fsThatDir; | |
496 CheckDir( fsFNameList ); | |
497 gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)get_current_dir_name_utf8() ); | |
34364 | 498 gtk_widget_grab_focus( fsFNameList ); |
33572 | 499 return; |
500 } | |
501 | |
502 fsSelectedDirectory=(unsigned char *)get_current_dir_name(); | |
503 switch ( fsType ) | |
504 { | |
505 case fsVideoSelector: | |
34859 | 506 for (l = 0; fsVideoFilterNames[l][0]; l++) |
507 if (strcmp(fsVideoFilterNames[l][0], MSGTR_Filter_Playlists) == 0) break; | |
508 uiSetFileName( fsSelectedDirectory,fsSelectedFile, fsLastVideoFilterSelected == l ? STREAMTYPE_PLAYLIST : STREAMTYPE_FILE ); | |
33894 | 509 guiInfo.NewPlay=GUI_FILE_NEW; sub_fps=0; |
33572 | 510 fs_PersistantHistory( get_current_dir_name_utf8() ); //totem, write into history |
511 break; | |
512 case fsSubtitleSelector: | |
33897 | 513 setddup( &guiInfo.SubtitleFilename,fsSelectedDirectory,fsSelectedFile ); |
514 mplayerLoadSubtitle( guiInfo.SubtitleFilename ); | |
33572 | 515 break; |
33776 | 516 /* case fsOtherSelector: |
33740
2c02269701bd
Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents:
33739
diff
changeset
|
517 setddup( &guiInfo.Othername,fsSelectedDirectory,fsSelectedFile ); |
33776 | 518 break;*/ |
33572 | 519 case fsAudioSelector: |
33897 | 520 setddup( &guiInfo.AudioFilename,fsSelectedDirectory,fsSelectedFile ); |
33572 | 521 break; |
522 case fsFontSelector: | |
33740
2c02269701bd
Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents:
33739
diff
changeset
|
523 setddup( &font_name,fsSelectedDirectory,fsSelectedFile ); |
33763 | 524 mplayerLoadFont(); |
33572 | 525 if ( Preferences ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name ); |
526 break; | |
527 } | |
528 | |
529 HideFileSelect(); | |
530 | |
531 item=fsTopList_items; | |
532 while( item ) | |
533 { | |
534 if ( !strcmp( item->data,fsSelectedDirectory ) ) i=0; | |
535 item=item->next; | |
536 } | |
537 if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name_utf8() ); | |
538 if ( uiMainAutoPlay ) { uiMainAutoPlay=0; uiEventHandling( evPlay,0 ); } | |
33731
81f71d910333
Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents:
33725
diff
changeset
|
539 else gui( GUI_SET_STATE,(void *) GUI_STOP ); |
33572 | 540 } |
541 | |
542 static void fs_Cancel_released( GtkButton * button,gpointer user_data ) | |
543 { | |
544 HideFileSelect(); | |
545 fs_PersistantHistory( get_current_dir_name_utf8() ); //totem, write into history file | |
546 } | |
547 | |
34466
a650895d50a5
Use correct data types and common variable names in GTK callback functions.
ib
parents:
34368
diff
changeset
|
548 static void fs_fsFNameList_select_row( GtkCList * clist, gint row, gint column, |
a650895d50a5
Use correct data types and common variable names in GTK callback functions.
ib
parents:
34368
diff
changeset
|
549 GdkEvent * event, gpointer user_data) |
33572 | 550 { |
34364 | 551 fsCurrFNameListSelected = row; |
34466
a650895d50a5
Use correct data types and common variable names in GTK callback functions.
ib
parents:
34368
diff
changeset
|
552 gtk_clist_get_text( clist,row,1,&fsSelectedFile ); |
33572 | 553 g_free( fsSelectedFileUtf8 ); |
554 fsSelectedFileUtf8 = g_filename_from_utf8( fsSelectedFile, -1, NULL, NULL, NULL ); | |
555 if ( fsSelectedFileUtf8 ) fsSelectedFile = fsSelectedFileUtf8; | |
34466
a650895d50a5
Use correct data types and common variable names in GTK callback functions.
ib
parents:
34368
diff
changeset
|
556 if( event && event->type == GDK_BUTTON_PRESS ) gtk_button_released( GTK_BUTTON( fsOk ) ); |
33572 | 557 } |
558 | |
559 static gboolean on_FileSelect_key_release_event( GtkWidget * widget, | |
34466
a650895d50a5
Use correct data types and common variable names in GTK callback functions.
ib
parents:
34368
diff
changeset
|
560 GdkEvent * event, |
33572 | 561 gpointer user_data ) |
562 { | |
34344 | 563 if ( GTK_WIDGET_TYPE( widget ) == GTK_TYPE_BUTTON ) |
564 { | |
34466
a650895d50a5
Use correct data types and common variable names in GTK callback functions.
ib
parents:
34368
diff
changeset
|
565 if (event->key.keyval == GDK_Return) gtk_button_released( GTK_BUTTON( widget ) ); |
34344 | 566 } |
567 else | |
568 { | |
34466
a650895d50a5
Use correct data types and common variable names in GTK callback functions.
ib
parents:
34368
diff
changeset
|
569 switch ( event->key.keyval ) |
34345 | 570 { |
571 case GDK_Escape: | |
572 gtk_button_released( GTK_BUTTON( fsCancel ) ); | |
573 break; | |
574 case GDK_Return: | |
575 gtk_button_released( GTK_BUTTON( fsOk ) ); | |
576 break; | |
577 case GDK_BackSpace: | |
578 gtk_button_released( GTK_BUTTON( fsUp ) ); | |
34351
52a18f850c28
Leave the focus in fsFNameList after key event in file selector.
ib
parents:
34346
diff
changeset
|
579 gtk_widget_grab_focus( fsFNameList ); |
34345 | 580 break; |
581 } | |
34344 | 582 } |
33572 | 583 return FALSE; |
584 } | |
585 | |
586 static gboolean fs_fsFNameList_event( GtkWidget * widget, | |
587 GdkEvent * event, | |
588 gpointer user_data ) | |
589 { | |
590 GdkEventButton *bevent; | |
591 gint row, col; | |
592 | |
593 bevent = (GdkEventButton *) event; | |
594 | |
595 if ( event->type == GDK_BUTTON_RELEASE && bevent->button == 2 ) | |
596 { | |
597 if ( gtk_clist_get_selection_info( GTK_CLIST( widget ), bevent->x, bevent->y, &row, &col ) ) | |
598 { | |
599 gtk_clist_get_text( GTK_CLIST( widget ), row, 1, &fsSelectedFile ); | |
600 g_free( fsSelectedFileUtf8 ); | |
601 fsSelectedFileUtf8 = g_filename_from_utf8( fsSelectedFile, -1, NULL, NULL, NULL ); | |
602 if ( fsSelectedFileUtf8 ) fsSelectedFile = fsSelectedFileUtf8; | |
603 gtk_button_released( GTK_BUTTON( fsOk ) ); | |
604 return TRUE; | |
605 } | |
606 } | |
607 | |
608 return FALSE; | |
609 } | |
610 | |
611 static void fs_Destroy( void ) | |
612 { | |
613 g_free( fsSelectedFileUtf8 ); | |
614 fsSelectedFileUtf8 = NULL; | |
33787
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
615 g_free( fsSelectedDirectoryUtf8 ); |
42feff0f8a7b
Start all file dialogs always in last active directory.
ib
parents:
33776
diff
changeset
|
616 fsSelectedDirectoryUtf8 = NULL; |
33572 | 617 WidgetDestroy( fsFileSelect, &fsFileSelect ); |
618 } | |
619 | |
620 GtkWidget * create_FileSelect( void ) | |
621 { | |
622 GtkWidget * vbox4; | |
623 GtkWidget * hbox4; | |
624 GtkWidget * vseparator1; | |
625 GtkWidget * hbox6; | |
626 GtkWidget * fsFNameListWindow; | |
627 GtkWidget * hbuttonbox3; | |
628 | |
629 GtkWidget * uppixmapwid; | |
630 GdkPixmap * uppixmap; | |
631 GdkBitmap * upmask; | |
632 GtkStyle * upstyle; | |
633 | |
634 | |
635 fsFileSelect=gtk_window_new( GTK_WINDOW_TOPLEVEL ); | |
636 gtk_widget_set_name( fsFileSelect,"fsFileSelect" ); | |
637 gtk_object_set_data( GTK_OBJECT( fsFileSelect ),"fsFileSelect",fsFileSelect ); | |
638 gtk_widget_set_usize( fsFileSelect,512,300 ); | |
639 GTK_WIDGET_SET_FLAGS( fsFileSelect,GTK_CAN_DEFAULT ); | |
640 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 ); | |
641 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect ); | |
642 gtk_window_set_position( GTK_WINDOW( fsFileSelect ),GTK_WIN_POS_CENTER ); | |
643 gtk_window_set_policy( GTK_WINDOW( fsFileSelect ),TRUE,TRUE,TRUE ); | |
644 gtk_window_set_wmclass( GTK_WINDOW( fsFileSelect ),"FileSelect","MPlayer" ); | |
645 fsColorMap=gdk_colormap_get_system(); | |
646 | |
647 gtk_widget_realize( fsFileSelect ); | |
648 gtkAddIcon( fsFileSelect ); | |
649 | |
650 style=gtk_widget_get_style( fsFileSelect ); | |
651 dpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&dmask,&style->bg[GTK_STATE_NORMAL],(gchar **)dir_xpm ); | |
652 fpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&fmask,&style->bg[GTK_STATE_NORMAL],(gchar **)file_xpm ); | |
653 | |
654 vbox4=AddVBox( AddDialogFrame( fsFileSelect ),0 ); | |
655 hbox4=AddHBox( vbox4,1 ); | |
656 | |
657 fsCombo4=gtk_combo_new(); | |
658 gtk_widget_set_name( fsCombo4,"fsCombo4" ); | |
659 gtk_widget_show( fsCombo4 ); | |
660 gtk_box_pack_start( GTK_BOX( hbox4 ),fsCombo4,TRUE,TRUE,0 ); | |
661 gtk_widget_set_usize( fsCombo4,-2,20 ); | |
662 | |
663 fsPathCombo=GTK_COMBO( fsCombo4 )->entry; | |
664 gtk_widget_set_name( fsPathCombo,"fsPathCombo" ); | |
665 gtk_widget_show( fsPathCombo ); | |
666 gtk_widget_set_usize( fsPathCombo,-2,20 ); | |
667 | |
668 vseparator1=gtk_vseparator_new(); | |
669 gtk_widget_set_name( vseparator1,"vseparator1" ); | |
670 gtk_widget_show( vseparator1 ); | |
671 gtk_box_pack_start( GTK_BOX( hbox4 ),vseparator1,FALSE,TRUE,0 ); | |
672 gtk_widget_set_usize( vseparator1,7,20 ); | |
673 | |
674 upstyle=gtk_widget_get_style( fsFileSelect ); | |
675 uppixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&upmask,&upstyle->bg[GTK_STATE_NORMAL],(gchar **)up_xpm ); | |
676 uppixmapwid=gtk_pixmap_new( uppixmap,upmask ); | |
677 gtk_widget_show( uppixmapwid ); | |
678 | |
679 fsUp=gtk_button_new(); | |
680 gtk_container_add( GTK_CONTAINER(fsUp ),uppixmapwid ); | |
681 gtk_widget_show( fsUp ); | |
682 gtk_box_pack_start( GTK_BOX( hbox4 ),fsUp,FALSE,FALSE,0 ); | |
683 gtk_widget_set_usize( fsUp,65,15 ); | |
684 | |
685 AddHSeparator( vbox4 ); | |
686 | |
687 hbox6=AddHBox( NULL,0 ); | |
688 gtk_box_pack_start( GTK_BOX( vbox4 ),hbox6,TRUE,TRUE,0 ); | |
689 | |
690 fsFNameListWindow=gtk_scrolled_window_new( NULL,NULL ); | |
691 gtk_widget_set_name( fsFNameListWindow,"fsFNameListWindow" ); | |
692 gtk_widget_show( fsFNameListWindow ); | |
693 gtk_box_pack_start( GTK_BOX( hbox6 ),fsFNameListWindow,TRUE,TRUE,0 ); | |
694 gtk_widget_set_usize( fsFNameListWindow,-2,145 ); | |
695 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( fsFNameListWindow ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC ); | |
696 | |
697 fsFNameList=gtk_clist_new( 2 ); | |
698 gtk_widget_set_name( fsFNameList,"fsFNameList" ); | |
699 gtk_container_add( GTK_CONTAINER( fsFNameListWindow ),fsFNameList ); | |
700 gtk_clist_set_column_width( GTK_CLIST( fsFNameList ),0,80 ); | |
701 gtk_clist_set_selection_mode( GTK_CLIST( fsFNameList ),GTK_SELECTION_BROWSE ); | |
702 gtk_clist_column_titles_hide( GTK_CLIST( fsFNameList ) ); | |
703 gtk_clist_set_shadow_type( GTK_CLIST( fsFNameList ),GTK_SHADOW_ETCHED_OUT ); | |
704 | |
705 AddHSeparator( vbox4 ); | |
706 | |
707 List=gtk_combo_new(); | |
708 gtk_widget_set_name( List,"List" ); | |
709 gtk_widget_ref( List ); | |
710 gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"List",List,(GtkDestroyNotify)gtk_widget_unref ); | |
711 gtk_widget_show( List ); | |
712 gtk_box_pack_start( GTK_BOX( vbox4 ),List,FALSE,FALSE,0 ); | |
713 gtk_widget_set_usize( List,-2,20 ); | |
714 | |
715 fsFilterCombo=GTK_COMBO( List )->entry; | |
716 gtk_widget_set_name( fsFilterCombo,"fsFilterCombo" ); | |
717 gtk_widget_show( fsFilterCombo ); | |
718 gtk_entry_set_editable (GTK_ENTRY( fsFilterCombo ),FALSE ); | |
719 | |
720 AddHSeparator( vbox4 ); | |
721 | |
722 hbuttonbox3=AddHButtonBox( vbox4 ); | |
723 gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox3 ),GTK_BUTTONBOX_END ); | |
724 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox3 ),10 ); | |
725 | |
726 fsOk=AddButton( MSGTR_Ok,hbuttonbox3 ); | |
727 fsCancel=AddButton( MSGTR_Cancel,hbuttonbox3 ); | |
728 | |
729 gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"destroy",GTK_SIGNAL_FUNC( fs_Destroy ), NULL ); | |
730 gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL ); | |
731 | |
732 gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsFilterCombo_changed ),fsFilterCombo ); | |
733 gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsFilterCombo_activate ),fsFilterCombo ); | |
734 gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsPathCombo_changed ),fsPathCombo ); | |
735 gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsPathCombo_activate ),fsPathCombo ); | |
736 gtk_signal_connect( GTK_OBJECT( fsUp ),"released",GTK_SIGNAL_FUNC( fs_Up_released ),fsFNameList ); | |
34344 | 737 gtk_signal_connect( GTK_OBJECT( fsUp ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL ); |
33572 | 738 gtk_signal_connect( GTK_OBJECT( fsOk ),"released",GTK_SIGNAL_FUNC( fs_Ok_released ),fsCombo4 ); |
34344 | 739 gtk_signal_connect( GTK_OBJECT( fsOk ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL ); |
33572 | 740 gtk_signal_connect( GTK_OBJECT( fsCancel ),"released",GTK_SIGNAL_FUNC( fs_Cancel_released ),NULL ); |
34344 | 741 gtk_signal_connect( GTK_OBJECT( fsCancel ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL ); |
33572 | 742 gtk_signal_connect( GTK_OBJECT( fsFNameList ),"select_row",(GtkSignalFunc)fs_fsFNameList_select_row,NULL ); |
743 gtk_signal_connect( GTK_OBJECT( fsFNameList ),"event", (GtkSignalFunc)fs_fsFNameList_event,NULL ); | |
744 | |
745 return fsFileSelect; | |
746 } |