annotate src/audacious/ui_fileopener.c @ 3917:b5ee3a4a8e3b

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