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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
1 /*
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
2 * This file is part of MPlayer.
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
3 *
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
7 * (at your option) any later version.
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
8 *
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
12 * GNU General Public License for more details.
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
13 *
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License along
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
17 */
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
18
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
19 #include <stdlib.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
20 #include <stdio.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
21 #include <string.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
22 #include <sys/stat.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
23 #include <glob.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
24 #include <unistd.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
25
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
26 #include "config.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
27 #include "gui/ui/gmplayer.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
28
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
29 #include "gui/ui/pixmaps/up.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
30 #include "gui/ui/pixmaps/dir.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
31 #include "gui/ui/pixmaps/file.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
32
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
33 #include "gui/app.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
34 #include "gui/interface.h"
33739
9f6d46d325de Remove gfree() from interface.c.
ib
parents: 33737
diff changeset
35 #include "gui/util/mem.h"
33737
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33731
diff changeset
36 #include "gui/util/string.h"
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
37 #include "help_mp.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
38 #include "mpcommon.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
41
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
42 #include "gui/ui/widgets.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
43 #include "fileselect.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
44 #include "preferences.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
45 #include "tools.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
46
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
47 #ifndef __linux__
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
48 #define get_current_dir_name() getcwd(NULL, PATH_MAX)
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
49 #else
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
50 char * get_current_dir_name( void );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
51 #endif
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
52
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
53 gchar * fsSelectedFile = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
54 gchar * fsSelectedFileUtf8 = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
57 unsigned char * fsThatDir = ".";
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
58 const gchar * fsFilter = "*";
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
59
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
60 int fsType = 0;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
61
34364
b02b6ad1b7fb Remember the lastly selected file in file selector.
ib
parents: 34351
diff changeset
62 static gint fsCurrFNameListSelected, fsLastFNameListSelected;
b02b6ad1b7fb Remember the lastly selected file in file selector.
ib
parents: 34351
diff changeset
63
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
64 char * fsVideoFilterNames[][2] =
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
84 { NULL,NULL }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
85 };
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
86 int fsLastVideoFilterSelected = -1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
87
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
88 char * fsSubtitleFilterNames[][2] =
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
89 {
34849
8e39cb975b4e Update subtitle file filter for file selector.
ib
parents: 34838
diff changeset
90 { "AQTitle (*.aqt)", "*.aqt" },
8e39cb975b4e Update subtitle file filter for file selector.
ib
parents: 34838
diff changeset
91 { "Advanced SubStation Alpha (*.ass)", "*.ass" },
8e39cb975b4e Update subtitle file filter for file selector.
ib
parents: 34838
diff changeset
92 { "JACOSub (*.jss) ", "*.jss" },
8e39cb975b4e Update subtitle file filter for file selector.
ib
parents: 34838
diff changeset
93 { "RealText (*.rt) ", "*.rt" },
8e39cb975b4e Update subtitle file filter for file selector.
ib
parents: 34838
diff changeset
94 { "SAMI (*.smi)", "*.smi" },
8e39cb975b4e Update subtitle file filter for file selector.
ib
parents: 34838
diff changeset
95 { "SubRip (*.srt)", "*.srt" },
8e39cb975b4e Update subtitle file filter for file selector.
ib
parents: 34838
diff changeset
96 { "SubStation Alpha (*.ssa)", "*.ssa" },
8e39cb975b4e Update subtitle file filter for file selector.
ib
parents: 34838
diff changeset
97 { "MicroDVD (*.sub)", "*.sub" },
8e39cb975b4e Update subtitle file filter for file selector.
ib
parents: 34838
diff changeset
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
470c696cc5cf Enable translation of subtitle file filter items.
ib
parents: 34849
diff changeset
100 { MSGTR_Filter_AllSubtitles, "*.aqt,*.ass,*.jss,*.rt,*.smi,*.srt,*.ssa,*.sub,*.txt,*.utf" },
470c696cc5cf Enable translation of subtitle file filter items.
ib
parents: 34849
diff changeset
101 { MSGTR_Filter_AllFiles, "*" },
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
102 { NULL,NULL }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
103 };
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
104 int fsLastSubtitleFilterSelected = -1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
105
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
106 char * fsOtherFilterNames[][2] =
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
107 {
34854
5f876a4fa781 Enable translation of other file filter item.
ib
parents: 34853
diff changeset
108 { MSGTR_Filter_AllFiles, "*" },
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
109 { NULL,NULL }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
110 };
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
111
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
112 char * fsAudioFileNames[][2] =
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
113 {
34853
f6f1cfdaaccf Enable translation of external audio file filter items.
ib
parents: 34852
diff changeset
114 { MSGTR_Filter_DDRawAudio, "*.ac3,*.pcm" },
34856
707029278e04 Cosmetic: Arrange all file extensions alphabetically.
ib
parents: 34855
diff changeset
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
707029278e04 Cosmetic: Arrange all file extensions alphabetically.
ib
parents: 34855
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
122 { NULL, NULL }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
123 };
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
124 int fsLastAudioFilterSelected = -1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
125
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
126 char * fsFontFileNames[][2] =
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
127 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
128 #ifdef CONFIG_FREETYPE
34851
4c5ef823ee0f Enable translation of font file filter items.
ib
parents: 34850
diff changeset
129 { MSGTR_Filter_TTF, "*.ttf" },
4c5ef823ee0f Enable translation of font file filter items.
ib
parents: 34850
diff changeset
130 { MSGTR_Filter_Type1, "*.pfb" },
34856
707029278e04 Cosmetic: Arrange all file extensions alphabetically.
ib
parents: 34855
diff changeset
131 { MSGTR_Filter_AllFonts, "*.pfb,*.ttf" },
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
132 #else
34851
4c5ef823ee0f Enable translation of font file filter items.
ib
parents: 34850
diff changeset
133 { MSGTR_Filter_FontFiles, "*.desc" },
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
134 #endif
34851
4c5ef823ee0f Enable translation of font file filter items.
ib
parents: 34850
diff changeset
135 { MSGTR_Filter_AllFiles, "*" },
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
136 { NULL,NULL }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
137 };
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
138 int fsLastFontFilterSelected = -1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
139
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
140 GtkWidget * fsFileNamesList;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
141 GtkWidget * fsFNameList;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
142 GtkWidget * fsFileSelect = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
143 GdkColormap * fsColorMap;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
144 GtkWidget * fsOk;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
145 GtkWidget * fsUp;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
146 GtkWidget * fsCancel;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
147 GtkWidget * fsCombo4;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
148 GtkWidget * fsPathCombo;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
149 GList * fsList_items = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
150 GList * fsTopList_items = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
151 GtkWidget * List;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
152 GtkWidget * fsFilterCombo;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
153
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
154 GtkStyle * style;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
155 GdkPixmap * dpixmap;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
156 GdkPixmap * fpixmap;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
157 GdkBitmap * dmask;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
158 GdkBitmap * fmask;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
159
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
160 static char * get_current_dir_name_utf8( void )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
161 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
162 char * dir, * utf8dir;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
163 dir = get_current_dir_name();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
164 utf8dir = g_filename_to_utf8( dir, -1, NULL, NULL, NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
165 if ( !utf8dir ) utf8dir = g_strdup( dir );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
166 free( dir );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
167 return utf8dir;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
168 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
169
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
170 static void clist_append_fname(GtkWidget * list, char *fname,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
171 GdkPixmap *pixmap, GdkPixmap *mask) {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
172 gint pos;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
173 gchar *filename, *str[2];
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
174 filename = g_filename_to_utf8(fname, -1, NULL, NULL, NULL);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
175 str[0] = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
176 str[1] = filename ? filename : fname;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
177 pos = gtk_clist_append(GTK_CLIST(list), str);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
178 gtk_clist_set_pixmap(GTK_CLIST(list), pos, 0, pixmap, mask);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
179 g_free(filename);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
180 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
181
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
182 static void CheckDir( GtkWidget * list )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
183 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
184 struct stat fs;
34838
716f2ddf8773 Use unsigned int instead of type casting.
ib
parents: 34837
diff changeset
185 unsigned int i, j, fn;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
186 glob_t gg;
34836
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
187 gchar *filter, **fext;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
188
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
189 if ( !fsFilter[0] ) return;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
190
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
191 gtk_widget_hide( list );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
192 gtk_clist_clear( GTK_CLIST( list ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
193
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
194 clist_append_fname(list, ".", dpixmap, dmask);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
195 clist_append_fname(list, "..", dpixmap, dmask);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
196
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
197 glob( "*",0,NULL,&gg );
34838
716f2ddf8773 Use unsigned int instead of type casting.
ib
parents: 34837
diff changeset
198 for( i=0;i<gg.gl_pathc;i++ )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
199 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
200 stat( gg.gl_pathv[i],&fs );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
201 if( !S_ISDIR( fs.st_mode ) ) continue;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
202 clist_append_fname(list, gg.gl_pathv[i], dpixmap, dmask);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
203 }
34836
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
204
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
205 for (fn = 1, i = 0; fsFilter[i]; i++)
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
206 if (fsFilter[i] == ',') fn++;
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
207
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
208 filter = g_strdup(fsFilter);
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
209 fext = calloc(fn, sizeof(gchar *));
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
210
34836
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
211 if (filter && fext)
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
212 {
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
213 for (j = 0, i = 0; filter[i]; i++)
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
214 {
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
215 if (filter[i] == '.') fext[j] = filter + i;
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
216
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
217 if (filter[i] == ',')
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
218 {
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
219 filter[i] = 0;
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
220 j++;
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
221 }
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
222 }
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
223
34838
716f2ddf8773 Use unsigned int instead of type casting.
ib
parents: 34837
diff changeset
224 for( i=0;i<gg.gl_pathc;i++ )
34837
b56cc3fd7b8a Cosmetic: Adjust indent.
ib
parents: 34836
diff changeset
225 {
34836
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
226 char *ext;
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
227
34837
b56cc3fd7b8a Cosmetic: Adjust indent.
ib
parents: 34836
diff changeset
228 stat( gg.gl_pathv[i],&fs );
b56cc3fd7b8a Cosmetic: Adjust indent.
ib
parents: 34836
diff changeset
229 if( S_ISDIR( fs.st_mode ) ) continue;
34836
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
230
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
231 ext = strrchr(gg.gl_pathv[i], '.');
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
232
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
233 if (ext || !fext[0])
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
234 {
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
235 for (j = 0; j < fn; j++)
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
236 {
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
237 if (fext[j] == NULL || strcasecmp(fext[j], ext) == 0)
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
238 {
34837
b56cc3fd7b8a Cosmetic: Adjust indent.
ib
parents: 34836
diff changeset
239 clist_append_fname(list, gg.gl_pathv[i], fpixmap, fmask);
34836
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
240 break;
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
241 }
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
242 }
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
243 }
34837
b56cc3fd7b8a Cosmetic: Adjust indent.
ib
parents: 34836
diff changeset
244 }
34836
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
245 }
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
246
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
247 free(fext);
34c835d22130 Improve filter on file selector's file list.
ib
parents: 34684
diff changeset
248 g_free(filter);
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
249 globfree( &gg );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
250
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
251 gtk_clist_set_column_width( GTK_CLIST( list ),0,17 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
252 gtk_widget_show( list );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
253 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
254
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
255 void ShowFileSelect( int type,int modal )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
260
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
261 if ( fsFileSelect ) gtkActive( fsFileSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
262 else fsFileSelect=create_FileSelect();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
263
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
264 fsType=type;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
265 switch ( type )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
266 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
267 case fsVideoSelector:
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
268 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
269 fsList_items=NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
270 for( i=0;fsVideoFilterNames[i][0];i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
271 fsList_items=g_list_append( fsList_items,fsVideoFilterNames[i][0] );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
272 k = fsLastVideoFilterSelected;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
273 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
274 g_list_free( fsList_items );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
275 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsVideoFilterNames[k >= 0 ? k : i-2][0] );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
276 tmp=guiInfo.Filename;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
277 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
278 case fsSubtitleSelector:
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
279 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_SubtitleSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
280 fsList_items=NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
281 for( i=0;fsSubtitleFilterNames[i][0];i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
282 fsList_items=g_list_append( fsList_items,fsSubtitleFilterNames[i][0] );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
283 k = fsLastSubtitleFilterSelected;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
284 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
285 g_list_free( fsList_items );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
286 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsSubtitleFilterNames[k >= 0 ? k : i-2][0] );
33897
e0d211c62cf7 Cosmetic: Rename some guiInfo members.
ib
parents: 33894
diff changeset
287 tmp=guiInfo.SubtitleFilename;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
288 break;
33776
4fae8b19fbbd Remove member Othername from struct guiInterface_t.
ib
parents: 33763
diff changeset
289 /* case fsOtherSelector:
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
290 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_OtherSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
291 fsList_items=NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
292 for( i=0;fsOtherFilterNames[i][0];i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
293 fsList_items=g_list_append( fsList_items,fsOtherFilterNames[i][0] );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
294 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
295 g_list_free( fsList_items );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
296 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsOtherFilterNames[0][0] );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
297 tmp=guiInfo.Othername;
33776
4fae8b19fbbd Remove member Othername from struct guiInterface_t.
ib
parents: 33763
diff changeset
298 break;*/
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
299 case fsAudioSelector:
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
300 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_AudioFileSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
301 fsList_items=NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
302 for( i=0;fsAudioFileNames[i][0];i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
303 fsList_items=g_list_append( fsList_items,fsAudioFileNames[i][0] );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
304 k = fsLastAudioFilterSelected;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
305 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
306 g_list_free( fsList_items );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
307 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsAudioFileNames[k >= 0 ? k : i-2][0] );
33897
e0d211c62cf7 Cosmetic: Rename some guiInfo members.
ib
parents: 33894
diff changeset
308 tmp=guiInfo.AudioFilename;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
309 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
310 case fsFontSelector:
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
311 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FontSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
312 fsList_items=NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
313 for( i=0;fsFontFileNames[i][0];i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
314 fsList_items=g_list_append( fsList_items,fsFontFileNames[i][0] );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
315 k = fsLastFontFilterSelected;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
316 gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
317 g_list_free( fsList_items );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
318 gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsFontFileNames[k >= 0 ? k : i-2][0] );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
319 tmp=font_name;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
320 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
321 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
327 if ( tmp && tmp[0] )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
328 {
33787
42feff0f8a7b Start all file dialogs always in last active directory.
ib
parents: 33776
diff changeset
329 dir = strdup( tmp );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
330
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
331 do
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
332 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
333 char * c = strrchr( dir,'/' );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
334 stat( dir,&f );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
335 if ( S_ISDIR( f.st_mode ) ) break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
336 if ( c ) *c=0;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
337 } while ( strrchr( dir,'/' ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
338
33787
42feff0f8a7b Start all file dialogs always in last active directory.
ib
parents: 33776
diff changeset
339 if ( !dir[0] ) nfree( dir );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
340 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
341
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
342 if ( fsTopList_items ) g_list_free( fsTopList_items ); fsTopList_items=NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
343 {
33751
c28c967e40e9 Replace numeric constant fsPersistant_MaxPos for fsHistory array size.
ib
parents: 33740
diff changeset
344 unsigned int i, c = 1;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
358 }
33787
42feff0f8a7b Start all file dialogs always in last active directory.
ib
parents: 33776
diff changeset
359 free( dir );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
364 fsTopList_items=g_list_append( fsTopList_items,"/" );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
365 gtk_combo_set_popdown_strings( GTK_COMBO( fsCombo4 ),fsTopList_items );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
366
34346
3d0c795524b0 Fix bug with wrong focus in file selector.
ib
parents: 34345
diff changeset
367 gtk_widget_grab_focus( fsFNameList );
34518
d476fbab0a28 Fix bug with selected file in file selector.
ib
parents: 34466
diff changeset
368 if (fsLastFNameListSelected + 1 > ((GtkCList *)fsFNameList)->rows) fsLastFNameListSelected = 0;
34364
b02b6ad1b7fb Remember the lastly selected file in file selector.
ib
parents: 34351
diff changeset
369 ((GtkCList *)fsFNameList)->focus_row = fsLastFNameListSelected;
b02b6ad1b7fb Remember the lastly selected file in file selector.
ib
parents: 34351
diff changeset
370 gtk_clist_select_row( GTK_CLIST( fsFNameList ),fsLastFNameListSelected,1 );
b02b6ad1b7fb Remember the lastly selected file in file selector.
ib
parents: 34351
diff changeset
371 fsLastFNameListSelected = 0;
34346
3d0c795524b0 Fix bug with wrong focus in file selector.
ib
parents: 34345
diff changeset
372
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
373 gtk_window_set_modal( GTK_WINDOW( fsFileSelect ),modal );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
374
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
375 gtk_widget_show( fsFileSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
376 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
377
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
378 void HideFileSelect( void )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
379 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
380 if ( !fsFileSelect ) return;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
381 gtk_widget_hide( fsFileSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
382 gtk_widget_destroy( fsFileSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
383 fsFileSelect=NULL;
34364
b02b6ad1b7fb Remember the lastly selected file in file selector.
ib
parents: 34351
diff changeset
384 fsLastFNameListSelected = fsCurrFNameListSelected;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
385 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
386
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
387 static void fs_PersistantHistory( char * subject )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
388 {
33751
c28c967e40e9 Replace numeric constant fsPersistant_MaxPos for fsHistory array size.
ib
parents: 33740
diff changeset
389 unsigned int i;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
390
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
391 if ( fsType != fsVideoSelector ) return;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
394 if ( fsHistory[i] && !strcmp( fsHistory[i],subject ) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
395 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
396 char * tmp = fsHistory[i]; fsHistory[i]=fsHistory[0]; fsHistory[0]=tmp;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
397 return;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
401 fsHistory[0]=gstrdup( subject );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
402 }
34684
b03481253518 Cosmetic: Prefer C style for single line comments.
ib
parents: 34518
diff changeset
403 /* ----------------------------------------------- */
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
406 gpointer user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
407 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
408 fsFilter=gtk_entry_get_text( GTK_ENTRY( user_data ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
409 CheckDir( fsFNameList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
410 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
411
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
412 static void fs_fsFilterCombo_changed( GtkEditable * editable,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
413 gpointer user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
414 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
415 const char * str;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
416 int i;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
417
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
418 str=gtk_entry_get_text( GTK_ENTRY(user_data ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
419
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
420 switch ( fsType )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
421 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
422 case fsVideoSelector:
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
423 for( i=0;fsVideoFilterNames[i][0];i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
424 if( !strcmp( str,fsVideoFilterNames[i][0] ) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
425 { fsFilter=fsVideoFilterNames[i][1]; fsLastVideoFilterSelected = i; break; }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
426 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
427 case fsSubtitleSelector:
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
428 for( i=0;fsSubtitleFilterNames[i][0];i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
429 if( !strcmp( str,fsSubtitleFilterNames[i][0] ) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
430 { fsFilter=fsSubtitleFilterNames[i][1]; fsLastSubtitleFilterSelected = i; break; }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
431 break;
33776
4fae8b19fbbd Remove member Othername from struct guiInterface_t.
ib
parents: 33763
diff changeset
432 /* case fsOtherSelector:
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
433 for( i=0;fsOtherFilterNames[i][0];i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
434 if( !strcmp( str,fsOtherFilterNames[i][0] ) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
435 { fsFilter=fsOtherFilterNames[i][1]; break; }
33776
4fae8b19fbbd Remove member Othername from struct guiInterface_t.
ib
parents: 33763
diff changeset
436 break;*/
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
437 case fsAudioSelector:
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
438 for( i=0;fsAudioFileNames[i][0];i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
439 if( !strcmp( str,fsAudioFileNames[i][0] ) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
440 { fsFilter=fsAudioFileNames[i][1]; fsLastAudioFilterSelected = i; break; }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
441 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
442 case fsFontSelector:
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
443 for( i=0;fsFontFileNames[i][0];i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
444 if( !strcmp( str,fsFontFileNames[i][0] ) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
445 { fsFilter=fsFontFileNames[i][1]; fsLastFontFilterSelected = i; break; }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
446 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
447 default: return;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
448 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
449 CheckDir( fsFNameList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
450 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
453 gpointer user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
454 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
455 const unsigned char * str;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
456 gchar * dirname;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
457
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
458 str=gtk_entry_get_text( GTK_ENTRY( user_data ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
459 dirname = g_filename_from_utf8( str, -1, NULL, NULL, NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
460 if ( chdir( dirname ? (const unsigned char *)dirname : str ) != -1 ) CheckDir( fsFNameList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
461 g_free( dirname );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
462 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
463
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
464 static void fs_fsPathCombo_changed( GtkEditable * editable,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
465 gpointer user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
466 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
467 const unsigned char * str;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
468 gchar * dirname;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
469
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
470 str=gtk_entry_get_text( GTK_ENTRY( user_data ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
471 dirname = g_filename_from_utf8( str, -1, NULL, NULL, NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
472 if ( chdir( dirname ? (const unsigned char *)dirname : str ) != -1 ) CheckDir( fsFNameList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
473 g_free( dirname );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
474 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
475
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
476 static void fs_Up_released( GtkButton * button, gpointer user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
477 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
478 chdir( ".." );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
479 fsSelectedFile=fsThatDir;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
480 CheckDir( fsFNameList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
481 gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)get_current_dir_name_utf8() );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
482 return;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
483 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
484
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
485 static void fs_Ok_released( GtkButton * button, gpointer user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
486 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
487 GList * item;
34859
203d0d5cac1f Add playlist support to the GUI.
ib
parents: 34857
diff changeset
488 int i = 1, l;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
489 struct stat fs;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
490
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
491 stat( fsSelectedFile,&fs );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
492 if( S_ISDIR(fs.st_mode ) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
493 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
494 chdir( fsSelectedFile );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
495 fsSelectedFile=fsThatDir;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
496 CheckDir( fsFNameList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
497 gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)get_current_dir_name_utf8() );
34364
b02b6ad1b7fb Remember the lastly selected file in file selector.
ib
parents: 34351
diff changeset
498 gtk_widget_grab_focus( fsFNameList );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
499 return;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
500 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
501
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
502 fsSelectedDirectory=(unsigned char *)get_current_dir_name();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
503 switch ( fsType )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
504 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
505 case fsVideoSelector:
34859
203d0d5cac1f Add playlist support to the GUI.
ib
parents: 34857
diff changeset
506 for (l = 0; fsVideoFilterNames[l][0]; l++)
203d0d5cac1f Add playlist support to the GUI.
ib
parents: 34857
diff changeset
507 if (strcmp(fsVideoFilterNames[l][0], MSGTR_Filter_Playlists) == 0) break;
203d0d5cac1f Add playlist support to the GUI.
ib
parents: 34857
diff changeset
508 uiSetFileName( fsSelectedDirectory,fsSelectedFile, fsLastVideoFilterSelected == l ? STREAMTYPE_PLAYLIST : STREAMTYPE_FILE );
33894
b2e63fe7fe17 Remove needless guiInfo member FilenameChanged.
ib
parents: 33787
diff changeset
509 guiInfo.NewPlay=GUI_FILE_NEW; sub_fps=0;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
510 fs_PersistantHistory( get_current_dir_name_utf8() ); //totem, write into history
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
511 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
512 case fsSubtitleSelector:
33897
e0d211c62cf7 Cosmetic: Rename some guiInfo members.
ib
parents: 33894
diff changeset
513 setddup( &guiInfo.SubtitleFilename,fsSelectedDirectory,fsSelectedFile );
e0d211c62cf7 Cosmetic: Rename some guiInfo members.
ib
parents: 33894
diff changeset
514 mplayerLoadSubtitle( guiInfo.SubtitleFilename );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
515 break;
33776
4fae8b19fbbd Remove member Othername from struct guiInterface_t.
ib
parents: 33763
diff changeset
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
4fae8b19fbbd Remove member Othername from struct guiInterface_t.
ib
parents: 33763
diff changeset
518 break;*/
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
519 case fsAudioSelector:
33897
e0d211c62cf7 Cosmetic: Rename some guiInfo members.
ib
parents: 33894
diff changeset
520 setddup( &guiInfo.AudioFilename,fsSelectedDirectory,fsSelectedFile );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
521 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
03824cf8728d Cosmetic: Rename two functions that do MPlayer calls.
ib
parents: 33755
diff changeset
524 mplayerLoadFont();
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
525 if ( Preferences ) gtk_entry_set_text( GTK_ENTRY( prEFontName ),font_name );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
526 break;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
527 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
528
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
529 HideFileSelect();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
530
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
531 item=fsTopList_items;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
532 while( item )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
533 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
534 if ( !strcmp( item->data,fsSelectedDirectory ) ) i=0;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
535 item=item->next;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
536 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
537 if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name_utf8() );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
540 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
541
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
542 static void fs_Cancel_released( GtkButton * button,gpointer user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
543 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
544 HideFileSelect();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
545 fs_PersistantHistory( get_current_dir_name_utf8() ); //totem, write into history file
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
546 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
550 {
34364
b02b6ad1b7fb Remember the lastly selected file in file selector.
ib
parents: 34351
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
553 g_free( fsSelectedFileUtf8 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
554 fsSelectedFileUtf8 = g_filename_from_utf8( fsSelectedFile, -1, NULL, NULL, NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
557 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
558
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
561 gpointer user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
562 {
34344
5a7bb8f06478 Add Return key events to file selector buttons.
ib
parents: 34065
diff changeset
563 if ( GTK_WIDGET_TYPE( widget ) == GTK_TYPE_BUTTON )
5a7bb8f06478 Add Return key events to file selector buttons.
ib
parents: 34065
diff changeset
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
5a7bb8f06478 Add Return key events to file selector buttons.
ib
parents: 34065
diff changeset
566 }
5a7bb8f06478 Add Return key events to file selector buttons.
ib
parents: 34065
diff changeset
567 else
5a7bb8f06478 Add Return key events to file selector buttons.
ib
parents: 34065
diff changeset
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
1f6e77b8cb1d Cosmetic: Adjust indent.
ib
parents: 34344
diff changeset
570 {
1f6e77b8cb1d Cosmetic: Adjust indent.
ib
parents: 34344
diff changeset
571 case GDK_Escape:
1f6e77b8cb1d Cosmetic: Adjust indent.
ib
parents: 34344
diff changeset
572 gtk_button_released( GTK_BUTTON( fsCancel ) );
1f6e77b8cb1d Cosmetic: Adjust indent.
ib
parents: 34344
diff changeset
573 break;
1f6e77b8cb1d Cosmetic: Adjust indent.
ib
parents: 34344
diff changeset
574 case GDK_Return:
1f6e77b8cb1d Cosmetic: Adjust indent.
ib
parents: 34344
diff changeset
575 gtk_button_released( GTK_BUTTON( fsOk ) );
1f6e77b8cb1d Cosmetic: Adjust indent.
ib
parents: 34344
diff changeset
576 break;
1f6e77b8cb1d Cosmetic: Adjust indent.
ib
parents: 34344
diff changeset
577 case GDK_BackSpace:
1f6e77b8cb1d Cosmetic: Adjust indent.
ib
parents: 34344
diff changeset
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
1f6e77b8cb1d Cosmetic: Adjust indent.
ib
parents: 34344
diff changeset
580 break;
1f6e77b8cb1d Cosmetic: Adjust indent.
ib
parents: 34344
diff changeset
581 }
34344
5a7bb8f06478 Add Return key events to file selector buttons.
ib
parents: 34065
diff changeset
582 }
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
583 return FALSE;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
584 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
585
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
586 static gboolean fs_fsFNameList_event( GtkWidget * widget,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
587 GdkEvent * event,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
588 gpointer user_data )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
589 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
590 GdkEventButton *bevent;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
591 gint row, col;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
592
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
593 bevent = (GdkEventButton *) event;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
594
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
595 if ( event->type == GDK_BUTTON_RELEASE && bevent->button == 2 )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
596 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
597 if ( gtk_clist_get_selection_info( GTK_CLIST( widget ), bevent->x, bevent->y, &row, &col ) )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
598 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
599 gtk_clist_get_text( GTK_CLIST( widget ), row, 1, &fsSelectedFile );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
600 g_free( fsSelectedFileUtf8 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
601 fsSelectedFileUtf8 = g_filename_from_utf8( fsSelectedFile, -1, NULL, NULL, NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
602 if ( fsSelectedFileUtf8 ) fsSelectedFile = fsSelectedFileUtf8;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
603 gtk_button_released( GTK_BUTTON( fsOk ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
604 return TRUE;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
605 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
606 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
607
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
608 return FALSE;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
609 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
610
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
611 static void fs_Destroy( void )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
612 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
613 g_free( fsSelectedFileUtf8 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
617 WidgetDestroy( fsFileSelect, &fsFileSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
618 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
619
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
620 GtkWidget * create_FileSelect( void )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
621 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
622 GtkWidget * vbox4;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
623 GtkWidget * hbox4;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
624 GtkWidget * vseparator1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
625 GtkWidget * hbox6;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
626 GtkWidget * fsFNameListWindow;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
627 GtkWidget * hbuttonbox3;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
628
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
629 GtkWidget * uppixmapwid;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
630 GdkPixmap * uppixmap;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
631 GdkBitmap * upmask;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
632 GtkStyle * upstyle;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
633
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
634
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
635 fsFileSelect=gtk_window_new( GTK_WINDOW_TOPLEVEL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
636 gtk_widget_set_name( fsFileSelect,"fsFileSelect" );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
637 gtk_object_set_data( GTK_OBJECT( fsFileSelect ),"fsFileSelect",fsFileSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
638 gtk_widget_set_usize( fsFileSelect,512,300 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
639 GTK_WIDGET_SET_FLAGS( fsFileSelect,GTK_CAN_DEFAULT );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
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 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
641 gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
642 gtk_window_set_position( GTK_WINDOW( fsFileSelect ),GTK_WIN_POS_CENTER );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
643 gtk_window_set_policy( GTK_WINDOW( fsFileSelect ),TRUE,TRUE,TRUE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
644 gtk_window_set_wmclass( GTK_WINDOW( fsFileSelect ),"FileSelect","MPlayer" );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
645 fsColorMap=gdk_colormap_get_system();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
646
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
647 gtk_widget_realize( fsFileSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
648 gtkAddIcon( fsFileSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
649
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
650 style=gtk_widget_get_style( fsFileSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
651 dpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&dmask,&style->bg[GTK_STATE_NORMAL],(gchar **)dir_xpm );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
652 fpixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&fmask,&style->bg[GTK_STATE_NORMAL],(gchar **)file_xpm );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
653
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
654 vbox4=AddVBox( AddDialogFrame( fsFileSelect ),0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
655 hbox4=AddHBox( vbox4,1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
656
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
657 fsCombo4=gtk_combo_new();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
658 gtk_widget_set_name( fsCombo4,"fsCombo4" );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
659 gtk_widget_show( fsCombo4 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
660 gtk_box_pack_start( GTK_BOX( hbox4 ),fsCombo4,TRUE,TRUE,0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
661 gtk_widget_set_usize( fsCombo4,-2,20 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
662
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
663 fsPathCombo=GTK_COMBO( fsCombo4 )->entry;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
664 gtk_widget_set_name( fsPathCombo,"fsPathCombo" );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
665 gtk_widget_show( fsPathCombo );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
666 gtk_widget_set_usize( fsPathCombo,-2,20 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
667
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
668 vseparator1=gtk_vseparator_new();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
669 gtk_widget_set_name( vseparator1,"vseparator1" );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
670 gtk_widget_show( vseparator1 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
671 gtk_box_pack_start( GTK_BOX( hbox4 ),vseparator1,FALSE,TRUE,0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
672 gtk_widget_set_usize( vseparator1,7,20 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
673
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
674 upstyle=gtk_widget_get_style( fsFileSelect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
675 uppixmap=gdk_pixmap_colormap_create_from_xpm_d( fsFileSelect->window,fsColorMap,&upmask,&upstyle->bg[GTK_STATE_NORMAL],(gchar **)up_xpm );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
676 uppixmapwid=gtk_pixmap_new( uppixmap,upmask );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
677 gtk_widget_show( uppixmapwid );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
678
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
679 fsUp=gtk_button_new();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
680 gtk_container_add( GTK_CONTAINER(fsUp ),uppixmapwid );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
681 gtk_widget_show( fsUp );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
682 gtk_box_pack_start( GTK_BOX( hbox4 ),fsUp,FALSE,FALSE,0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
683 gtk_widget_set_usize( fsUp,65,15 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
684
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
685 AddHSeparator( vbox4 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
686
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
687 hbox6=AddHBox( NULL,0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
688 gtk_box_pack_start( GTK_BOX( vbox4 ),hbox6,TRUE,TRUE,0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
689
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
690 fsFNameListWindow=gtk_scrolled_window_new( NULL,NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
691 gtk_widget_set_name( fsFNameListWindow,"fsFNameListWindow" );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
692 gtk_widget_show( fsFNameListWindow );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
693 gtk_box_pack_start( GTK_BOX( hbox6 ),fsFNameListWindow,TRUE,TRUE,0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
694 gtk_widget_set_usize( fsFNameListWindow,-2,145 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
695 gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( fsFNameListWindow ),GTK_POLICY_NEVER,GTK_POLICY_AUTOMATIC );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
696
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
697 fsFNameList=gtk_clist_new( 2 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
698 gtk_widget_set_name( fsFNameList,"fsFNameList" );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
699 gtk_container_add( GTK_CONTAINER( fsFNameListWindow ),fsFNameList );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
700 gtk_clist_set_column_width( GTK_CLIST( fsFNameList ),0,80 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
701 gtk_clist_set_selection_mode( GTK_CLIST( fsFNameList ),GTK_SELECTION_BROWSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
702 gtk_clist_column_titles_hide( GTK_CLIST( fsFNameList ) );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
703 gtk_clist_set_shadow_type( GTK_CLIST( fsFNameList ),GTK_SHADOW_ETCHED_OUT );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
704
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
705 AddHSeparator( vbox4 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
706
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
707 List=gtk_combo_new();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
708 gtk_widget_set_name( List,"List" );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
709 gtk_widget_ref( List );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
710 gtk_object_set_data_full( GTK_OBJECT( fsFileSelect ),"List",List,(GtkDestroyNotify)gtk_widget_unref );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
711 gtk_widget_show( List );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
712 gtk_box_pack_start( GTK_BOX( vbox4 ),List,FALSE,FALSE,0 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
713 gtk_widget_set_usize( List,-2,20 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
714
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
715 fsFilterCombo=GTK_COMBO( List )->entry;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
716 gtk_widget_set_name( fsFilterCombo,"fsFilterCombo" );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
717 gtk_widget_show( fsFilterCombo );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
718 gtk_entry_set_editable (GTK_ENTRY( fsFilterCombo ),FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
719
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
720 AddHSeparator( vbox4 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
721
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
722 hbuttonbox3=AddHButtonBox( vbox4 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
723 gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox3 ),GTK_BUTTONBOX_END );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
724 gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox3 ),10 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
725
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
726 fsOk=AddButton( MSGTR_Ok,hbuttonbox3 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
727 fsCancel=AddButton( MSGTR_Cancel,hbuttonbox3 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
728
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
729 gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"destroy",GTK_SIGNAL_FUNC( fs_Destroy ), NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
730 gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
731
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
732 gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsFilterCombo_changed ),fsFilterCombo );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
733 gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsFilterCombo_activate ),fsFilterCombo );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
734 gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsPathCombo_changed ),fsPathCombo );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
735 gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsPathCombo_activate ),fsPathCombo );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
736 gtk_signal_connect( GTK_OBJECT( fsUp ),"released",GTK_SIGNAL_FUNC( fs_Up_released ),fsFNameList );
34344
5a7bb8f06478 Add Return key events to file selector buttons.
ib
parents: 34065
diff changeset
737 gtk_signal_connect( GTK_OBJECT( fsUp ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
738 gtk_signal_connect( GTK_OBJECT( fsOk ),"released",GTK_SIGNAL_FUNC( fs_Ok_released ),fsCombo4 );
34344
5a7bb8f06478 Add Return key events to file selector buttons.
ib
parents: 34065
diff changeset
739 gtk_signal_connect( GTK_OBJECT( fsOk ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
740 gtk_signal_connect( GTK_OBJECT( fsCancel ),"released",GTK_SIGNAL_FUNC( fs_Cancel_released ),NULL );
34344
5a7bb8f06478 Add Return key events to file selector buttons.
ib
parents: 34065
diff changeset
741 gtk_signal_connect( GTK_OBJECT( fsCancel ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
742 gtk_signal_connect( GTK_OBJECT( fsFNameList ),"select_row",(GtkSignalFunc)fs_fsFNameList_select_row,NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
743 gtk_signal_connect( GTK_OBJECT( fsFNameList ),"event", (GtkSignalFunc)fs_fsFNameList_event,NULL );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
744
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
745 return fsFileSelect;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
746 }