Mercurial > audlegacy
annotate src/audacious/ui_fileopener.c @ 2987:7f17c37db82b trunk
Log a warning if an adequate transport was not found.
author | William Pitcock <nenolod@atheme-project.org> |
---|---|
date | Thu, 05 Jul 2007 01:25:56 -0500 |
parents | 4fb16b502a06 |
children | 3b6d316f8b09 |
rev | line source |
---|---|
2417 | 1 /* Audacious - Cross-platform multimedia player |
2 * Copyright (C) 2005-2007 Audacious development team | |
3 * | |
4 * This program 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; under version 2 of the License. | |
7 * | |
8 * This program is distributed in the hope that it will be useful, | |
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 * GNU General Public License for more details. | |
12 * | |
13 * You should have received a copy of the GNU General Public License | |
14 * along with this program; if not, write to the Free Software | |
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
16 */ | |
17 | |
18 #include "ui_fileopener.h" | |
19 | |
20 #include <glib/gi18n.h> | |
21 #include <string.h> | |
2432
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
22 #include <gdk/gdkkeysyms.h> |
2417 | 23 |
24 #include "input.h" | |
25 #include "main.h" | |
26 #include "playback.h" | |
27 #include "strings.h" | |
28 #include "ui_playlist.h" | |
29 | |
30 static void | |
31 filebrowser_add_files(GtkFileChooser * browser, | |
32 GSList * files) | |
33 { | |
34 GSList *cur; | |
35 gchar *ptr; | |
36 guint ctr = 0; | |
37 Playlist *playlist = playlist_get_active(); | |
38 | |
39 for (cur = files; cur; cur = g_slist_next(cur)) { | |
40 | |
2984
df71b1cef70a
Use vfs_file_test() instead of g_file_test() where appropriate.
William Pitcock <nenolod@atheme-project.org>
parents:
2658
diff
changeset
|
41 if (vfs_file_test(cur->data, G_FILE_TEST_IS_DIR)) { |
2417 | 42 playlist_add_dir(playlist, (const gchar *) cur->data); |
43 } else { | |
44 playlist_add(playlist, (const gchar *) cur->data); | |
45 } | |
46 | |
47 if (++ctr == 20) { | |
48 playlistwin_update_list(playlist); | |
49 ctr = 0; | |
50 while (gtk_events_pending() ) gtk_main_iteration(); | |
51 } | |
52 } | |
53 | |
54 playlistwin_update_list(playlist); | |
55 | |
56 ptr = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(browser)); | |
57 | |
58 g_free(cfg.filesel_path); | |
59 cfg.filesel_path = ptr; | |
60 } | |
61 | |
62 static void | |
63 action_button_cb(GtkWidget *widget, gpointer data) | |
64 { | |
65 GtkWidget *window = g_object_get_data(data, "window"); | |
66 GtkWidget *chooser = g_object_get_data(data, "chooser"); | |
67 GtkWidget *toggle = g_object_get_data(data, "toggle-button"); | |
2658
4b8db8c0521d
[svn] - fixed c++ish declaration in a c file (part 5)
giacomo
parents:
2500
diff
changeset
|
68 gboolean play_button; |
4b8db8c0521d
[svn] - fixed c++ish declaration in a c file (part 5)
giacomo
parents:
2500
diff
changeset
|
69 GSList *files; |
2417 | 70 cfg.close_dialog_open = |
71 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle)); | |
72 | |
2658
4b8db8c0521d
[svn] - fixed c++ish declaration in a c file (part 5)
giacomo
parents:
2500
diff
changeset
|
73 play_button = |
2417 | 74 GPOINTER_TO_INT(g_object_get_data(data, "play-button")); |
75 | |
2986
4fb16b502a06
Use gtk_file_chooser_get_uris() to enforce proper VFS URIs being passed around.
William Pitcock <nenolod@atheme-project.org>
parents:
2984
diff
changeset
|
76 files = gtk_file_chooser_get_uris(GTK_FILE_CHOOSER(chooser)); |
2417 | 77 if (!files) return; |
78 | |
79 if (play_button) | |
80 playlist_clear(playlist_get_active()); | |
81 | |
82 filebrowser_add_files(GTK_FILE_CHOOSER(chooser), files); | |
83 g_slist_foreach(files, (GFunc) g_free, NULL); | |
84 g_slist_free(files); | |
85 | |
86 if (play_button) | |
87 playback_initiate(); | |
88 | |
89 if (cfg.close_dialog_open) | |
90 gtk_widget_destroy(window); | |
91 } | |
92 | |
93 | |
94 static void | |
95 close_button_cb(GtkWidget *widget, gpointer data) | |
96 { | |
97 gtk_widget_destroy(GTK_WIDGET(data)); | |
98 } | |
99 | |
2432
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
100 static gboolean |
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
101 filebrowser_on_keypress(GtkWidget * browser, |
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
102 GdkEventKey * event, |
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
103 gpointer data) |
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
104 { |
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
105 if (event->keyval == GDK_Escape) { |
2449 | 106 gtk_widget_destroy(browser); |
2432
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
107 return TRUE; |
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
108 } |
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
109 |
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
110 return FALSE; |
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
111 } |
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
112 |
2417 | 113 void |
114 util_run_filebrowser_gtk2style(gboolean play_button) | |
115 { | |
2449 | 116 static GtkWidget *window = NULL; |
2417 | 117 GtkWidget *vbox, *hbox, *bbox; |
118 GtkWidget *chooser; | |
119 GtkWidget *action_button, *close_button; | |
120 GtkWidget *toggle; | |
2658
4b8db8c0521d
[svn] - fixed c++ish declaration in a c file (part 5)
giacomo
parents:
2500
diff
changeset
|
121 gchar *window_title, *toggle_text; |
4b8db8c0521d
[svn] - fixed c++ish declaration in a c file (part 5)
giacomo
parents:
2500
diff
changeset
|
122 gpointer action_stock, storage; |
2417 | 123 |
2490
49e27e4d8426
[svn] - trying to open filebrowser when it is already open will raise the filebrowser.
yaz
parents:
2449
diff
changeset
|
124 if(window) { |
49e27e4d8426
[svn] - trying to open filebrowser when it is already open will raise the filebrowser.
yaz
parents:
2449
diff
changeset
|
125 gtk_window_present(GTK_WINDOW(window)); /* raise filebrowser */ |
2449 | 126 return; |
2490
49e27e4d8426
[svn] - trying to open filebrowser when it is already open will raise the filebrowser.
yaz
parents:
2449
diff
changeset
|
127 } |
2449 | 128 |
2658
4b8db8c0521d
[svn] - fixed c++ish declaration in a c file (part 5)
giacomo
parents:
2500
diff
changeset
|
129 window_title = play_button ? _("Open Files") : _("Add Files"); |
4b8db8c0521d
[svn] - fixed c++ish declaration in a c file (part 5)
giacomo
parents:
2500
diff
changeset
|
130 toggle_text = play_button ? |
2417 | 131 _("Close dialog on Open") : _("Close dialog on Add"); |
2658
4b8db8c0521d
[svn] - fixed c++ish declaration in a c file (part 5)
giacomo
parents:
2500
diff
changeset
|
132 action_stock = play_button ? GTK_STOCK_OPEN : GTK_STOCK_ADD; |
2417 | 133 |
134 window = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
135 gtk_window_set_title(GTK_WINDOW(window), window_title); | |
136 gtk_window_set_default_size(GTK_WINDOW(window), 700, 450); | |
2440
7f0318090690
[svn] - set the gtk2 fileopener position to the center of the screen
giacomo
parents:
2432
diff
changeset
|
137 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); |
2417 | 138 gtk_container_set_border_width(GTK_CONTAINER(window), 10); |
139 | |
140 vbox = gtk_vbox_new(FALSE, 0); | |
141 gtk_container_add(GTK_CONTAINER(window), vbox); | |
142 | |
143 chooser = gtk_file_chooser_widget_new(GTK_FILE_CHOOSER_ACTION_OPEN); | |
144 gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(chooser), TRUE); | |
145 if (cfg.filesel_path) | |
146 gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(chooser), | |
147 cfg.filesel_path); | |
2422 | 148 gtk_box_pack_start(GTK_BOX(vbox), chooser, TRUE, TRUE, 3); |
2417 | 149 |
150 hbox = gtk_hbox_new(TRUE, 0); | |
2422 | 151 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 3); |
2417 | 152 |
153 toggle = gtk_check_button_new_with_label(toggle_text); | |
154 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), | |
155 cfg.close_dialog_open ? TRUE : FALSE); | |
2422 | 156 gtk_box_pack_start(GTK_BOX(hbox), toggle, TRUE, TRUE, 3); |
2417 | 157 |
158 bbox = gtk_hbutton_box_new(); | |
159 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); | |
2422 | 160 gtk_box_set_spacing(GTK_BOX(bbox), 6); |
161 gtk_box_pack_end(GTK_BOX(hbox), bbox, TRUE, TRUE, 3); | |
2417 | 162 |
163 close_button = gtk_button_new_from_stock(GTK_STOCK_CANCEL); | |
164 action_button = gtk_button_new_from_stock(action_stock); | |
165 gtk_container_add(GTK_CONTAINER(bbox), close_button); | |
166 gtk_container_add(GTK_CONTAINER(bbox), action_button); | |
167 | |
2420 | 168 /* this storage object holds several other objects which are used in the |
169 * callback functions | |
170 */ | |
2658
4b8db8c0521d
[svn] - fixed c++ish declaration in a c file (part 5)
giacomo
parents:
2500
diff
changeset
|
171 storage = g_object_new(G_TYPE_OBJECT, NULL); |
2417 | 172 g_object_set_data(storage, "window", window); |
173 g_object_set_data(storage, "chooser", chooser); | |
174 g_object_set_data(storage, "toggle-button", toggle); | |
175 g_object_set_data(storage, "play-button", GINT_TO_POINTER(play_button)); | |
176 | |
177 g_signal_connect(chooser, "file-activated", | |
178 G_CALLBACK(action_button_cb), storage); | |
179 g_signal_connect(action_button, "clicked", | |
180 G_CALLBACK(action_button_cb), storage); | |
181 g_signal_connect(close_button, "clicked", | |
182 G_CALLBACK(close_button_cb), window); | |
183 g_signal_connect(window, "destroy", | |
184 G_CALLBACK(gtk_widget_destroyed), &window); | |
185 | |
2432
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
186 g_signal_connect(window, "key_press_event", |
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
187 G_CALLBACK(filebrowser_on_keypress), |
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
188 NULL); |
4a1d1c324685
[svn] - restore shortcut key (esc) to close gtk2 fileopener.
yaz
parents:
2422
diff
changeset
|
189 |
2417 | 190 gtk_widget_show_all(window); |
191 } | |
192 | |
193 /* | |
194 * Derived from Beep Media Player 0.9.6.1. | |
195 * Which is (C) 2003 - 2006 Milosz Derezynski &c | |
196 * | |
197 * Although I changed it quite a bit. -nenolod | |
198 */ | |
199 static void filebrowser_changed_classic(GtkFileSelection * filesel) | |
200 { | |
201 GList *list; | |
202 GList *node; | |
203 char *filename = (char *) | |
204 gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel)); | |
205 GtkListStore *store; | |
206 GtkTreeIter iter; | |
207 | |
208 if ((list = input_scan_dir(filename)) != NULL) | |
209 { | |
210 /* | |
211 * We enter a directory that has been "hijacked" by an | |
212 * input-plugin. This is used by the CDDA plugin | |
213 */ | |
214 store = | |
215 GTK_LIST_STORE(gtk_tree_view_get_model | |
216 (GTK_TREE_VIEW(filesel->file_list))); | |
217 gtk_list_store_clear(store); | |
218 | |
219 node = list; | |
220 while (node) { | |
221 gtk_list_store_append(store, &iter); | |
222 gtk_list_store_set(store, &iter, 0, node->data, -1); | |
223 g_free(node->data); | |
224 node = g_list_next(node); | |
225 } | |
226 | |
227 g_list_free(list); | |
228 } | |
229 } | |
230 | |
231 static void filebrowser_entry_changed_classic(GtkEditable * entry, gpointer data) | |
232 { | |
233 filebrowser_changed_classic(GTK_FILE_SELECTION(data)); | |
234 } | |
235 | |
236 | |
237 static gboolean | |
238 util_filebrowser_is_dir_classic(GtkFileSelection * filesel) | |
239 { | |
240 char *text; | |
241 struct stat buf; | |
242 gboolean retv = FALSE; | |
243 | |
244 text = g_strdup(gtk_file_selection_get_filename(filesel)); | |
245 | |
246 if (stat(text, &buf) == 0 && S_ISDIR(buf.st_mode)) { | |
247 /* Selected directory */ | |
248 int len = strlen(text); | |
249 if (len > 3 && !strcmp(text + len - 4, "/../")) { | |
250 if (len == 4) | |
251 /* At the root already */ | |
252 *(text + len - 3) = '\0'; | |
253 else { | |
254 char *ptr; | |
255 *(text + len - 4) = '\0'; | |
256 ptr = strrchr(text, '/'); | |
257 *(ptr + 1) = '\0'; | |
258 } | |
259 } else if (len > 2 && !strcmp(text + len - 3, "/./")) | |
260 *(text + len - 2) = '\0'; | |
261 gtk_file_selection_set_filename(filesel, text); | |
262 retv = TRUE; | |
263 } | |
264 g_free(text); | |
265 return retv; | |
266 } | |
267 | |
268 static void filebrowser_add_files_classic(gchar ** files, | |
269 GtkFileSelection * filesel) | |
270 { | |
271 int ctr = 0; | |
272 char *ptr; | |
273 Playlist *playlist = playlist_get_active(); | |
274 | |
275 | |
276 while (files[ctr] != NULL) { | |
2500 | 277 playlist_add(playlist, files[ctr++]); |
2417 | 278 } |
279 playlistwin_update_list(playlist); | |
280 | |
281 gtk_label_get(GTK_LABEL(GTK_BIN(filesel->history_pulldown)->child), | |
282 &ptr); | |
283 | |
284 /* This will give an extra slash if the current dir is the root. */ | |
285 cfg.filesel_path = g_strconcat(ptr, "/", NULL); | |
286 } | |
287 | |
288 static void filebrowser_ok_classic(GtkWidget * w, GtkWidget * filesel) | |
289 { | |
290 gchar **files; | |
291 | |
292 if (util_filebrowser_is_dir_classic(GTK_FILE_SELECTION(filesel))) | |
293 return; | |
294 files = gtk_file_selection_get_selections(GTK_FILE_SELECTION(filesel)); | |
295 filebrowser_add_files_classic(files, GTK_FILE_SELECTION(filesel)); | |
296 gtk_widget_destroy(filesel); | |
297 } | |
298 | |
299 static void filebrowser_play_classic(GtkWidget * w, GtkWidget * filesel) | |
300 { | |
301 gchar **files; | |
302 | |
303 if (util_filebrowser_is_dir_classic | |
304 (GTK_FILE_SELECTION(GTK_FILE_SELECTION(filesel)))) | |
305 return; | |
306 playlist_clear(playlist_get_active()); | |
307 files = gtk_file_selection_get_selections(GTK_FILE_SELECTION(filesel)); | |
308 filebrowser_add_files_classic(files, GTK_FILE_SELECTION(filesel)); | |
309 gtk_widget_destroy(filesel); | |
310 playback_initiate(); | |
311 } | |
312 | |
313 static void filebrowser_add_selected_files_classic(GtkWidget * w, gpointer data) | |
314 { | |
315 gchar **files; | |
316 | |
317 GtkFileSelection *filesel = GTK_FILE_SELECTION(data); | |
318 files = gtk_file_selection_get_selections(filesel); | |
319 | |
320 filebrowser_add_files_classic(files, filesel); | |
321 gtk_tree_selection_unselect_all(gtk_tree_view_get_selection | |
322 (GTK_TREE_VIEW(filesel->file_list))); | |
323 | |
324 gtk_entry_set_text(GTK_ENTRY(filesel->selection_entry), ""); | |
325 } | |
326 | |
327 static void filebrowser_add_all_files_classic(GtkWidget * w, gpointer data) | |
328 { | |
329 gchar **files; | |
330 GtkFileSelection *filesel; | |
331 | |
332 filesel = data; | |
333 gtk_tree_selection_select_all(gtk_tree_view_get_selection | |
334 (GTK_TREE_VIEW(filesel->file_list))); | |
335 files = gtk_file_selection_get_selections(filesel); | |
336 filebrowser_add_files_classic(files, filesel); | |
337 gtk_tree_selection_unselect_all(gtk_tree_view_get_selection | |
338 (GTK_TREE_VIEW(filesel->file_list))); | |
339 gtk_entry_set_text(GTK_ENTRY(filesel->selection_entry), ""); | |
340 } | |
341 | |
342 void | |
343 util_run_filebrowser_classic(gboolean play_button) | |
344 { | |
345 static GtkWidget *dialog; | |
346 GtkWidget *button_add_selected, *button_add_all, *button_close, | |
347 *button_add; | |
348 char *title; | |
349 | |
350 if (dialog != NULL) { | |
351 gtk_window_present(GTK_WINDOW(dialog)); | |
352 return; | |
353 } | |
354 | |
355 if (play_button) | |
356 title = _("Play files"); | |
357 else | |
358 title = _("Load files"); | |
359 | |
360 dialog = gtk_file_selection_new(title); | |
361 | |
362 gtk_file_selection_set_select_multiple | |
363 (GTK_FILE_SELECTION(dialog), TRUE); | |
364 | |
365 if (cfg.filesel_path) | |
366 gtk_file_selection_set_filename(GTK_FILE_SELECTION(dialog), | |
367 cfg.filesel_path); | |
368 | |
369 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(dialog)); | |
370 gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); | |
371 | |
372 gtk_widget_hide(GTK_FILE_SELECTION(dialog)->ok_button); | |
373 gtk_widget_destroy(GTK_FILE_SELECTION(dialog)->cancel_button); | |
374 | |
375 /* | |
376 * The mnemonics are quite unorthodox, but that should guarantee they're unique in any locale | |
377 * plus kinda easy to use | |
378 */ | |
379 button_add_selected = | |
380 gtk_dialog_add_button(GTK_DIALOG(dialog), "Add selected", | |
381 GTK_RESPONSE_NONE); | |
382 gtk_button_set_use_underline(GTK_BUTTON(button_add_selected), TRUE); | |
383 g_signal_connect(G_OBJECT(button_add_selected), "clicked", | |
384 G_CALLBACK(filebrowser_add_selected_files_classic), dialog); | |
385 | |
386 button_add_all = | |
387 gtk_dialog_add_button(GTK_DIALOG(dialog), "Add all", | |
388 GTK_RESPONSE_NONE); | |
389 gtk_button_set_use_underline(GTK_BUTTON(button_add_all), TRUE); | |
390 g_signal_connect(G_OBJECT(button_add_all), "clicked", | |
391 G_CALLBACK(filebrowser_add_all_files_classic), dialog); | |
392 | |
393 if (play_button) { | |
394 button_add = | |
395 gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_MEDIA_PLAY, | |
396 GTK_RESPONSE_NONE); | |
397 gtk_button_set_use_stock(GTK_BUTTON(button_add), TRUE); | |
398 g_signal_connect(G_OBJECT(button_add), "clicked", | |
399 G_CALLBACK(filebrowser_play_classic), dialog); | |
400 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(dialog)->ok_button), | |
401 "clicked", G_CALLBACK(filebrowser_play_classic), dialog); | |
402 } else { | |
403 button_add = | |
404 gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_ADD, | |
405 GTK_RESPONSE_NONE); | |
406 gtk_button_set_use_stock(GTK_BUTTON(button_add), TRUE); | |
407 g_signal_connect(G_OBJECT(button_add), "clicked", | |
408 G_CALLBACK(filebrowser_ok_classic), dialog); | |
409 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(dialog)->ok_button), | |
410 "clicked", G_CALLBACK(filebrowser_ok_classic), dialog); | |
411 } | |
412 | |
413 button_close = | |
414 gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CLOSE, | |
415 GTK_RESPONSE_NONE); | |
416 gtk_button_set_use_stock(GTK_BUTTON(button_close), TRUE); | |
417 g_signal_connect_swapped(G_OBJECT(button_close), "clicked", | |
418 G_CALLBACK(gtk_widget_destroy), | |
419 G_OBJECT(dialog)); | |
420 | |
421 gtk_widget_set_size_request(dialog, 600, 450); | |
422 gtk_widget_realize(dialog); | |
423 | |
424 g_signal_connect(G_OBJECT | |
425 (GTK_FILE_SELECTION(dialog)->history_pulldown), | |
426 "changed", G_CALLBACK(filebrowser_entry_changed_classic), | |
427 dialog); | |
428 | |
429 g_signal_connect(G_OBJECT(dialog), "destroy", | |
430 G_CALLBACK(gtk_widget_destroyed), &dialog); | |
431 | |
432 filebrowser_changed_classic(GTK_FILE_SELECTION(dialog)); | |
433 | |
434 gtk_widget_show(dialog); | |
435 } | |
436 | |
437 /* | |
438 * util_run_filebrowser(gboolean play_button) | |
439 * | |
440 * Inputs: | |
441 * - whether or not a play button should be used | |
442 * | |
443 * Outputs: | |
444 * - none | |
445 * | |
446 * Side Effects: | |
447 * - either a GTK1 or a GTK2 fileselector is launched | |
448 */ | |
449 void | |
450 run_filebrowser(gboolean play_button) | |
451 { | |
452 if (!cfg.use_xmms_style_fileselector) | |
453 util_run_filebrowser_gtk2style(play_button); | |
454 else | |
455 util_run_filebrowser_classic(play_button); | |
456 } |