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