annotate audacious/prefswin.c @ 1120:8e6b7ed7dd88 trunk

[svn] - more bandwidth expansion
author nenolod
date Tue, 30 May 2006 23:10:32 -0700
parents 95365899992e
children 6dd4db5212ae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1073
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1 /* Audacious - Cross-platform multimedia player
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
2 * Copyright (C) 2005-2006 Audacious development team.
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
3 *
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
4 * BMP - Cross-platform multimedia player
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5 * Copyright (C) 2003-2004 BMP development team.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
8 * it under the terms of the GNU General Public Licensse as published by
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
10 * (at your option) any later version.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
11 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
15 * GNU General Public License for more details.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
16 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
20 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
21
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
22 #ifdef HAVE_CONFIG_H
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23 # include "config.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
25
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
26 #include <glib.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
27 #include <glib/gi18n.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
28 #include <gtk/gtk.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
29 #include <glade/glade.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
30 #include <string.h>
887
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
31 #include <stddef.h>
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
32 #include <stdio.h>
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
33 #include <sys/types.h>
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
34 #include <dirent.h>
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
35 #include <unistd.h>
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
36 #include <errno.h>
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
37 #include <sys/types.h>
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
38 #include <sys/stat.h>
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
39
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
40 #include "glade.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
41
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
42 #include "plugin.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
43 #include "pluginenum.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
44 #include "input.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
45 #include "effect.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
46 #include "general.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
47 #include "output.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
48 #include "visualization.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
49
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
50 #include "main.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
51 #include "skin.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
52 #include "urldecode.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
53 #include "util.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
54 #include "dnd.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
55 #include "libaudacious/configdb.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
56
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
57 #include "mainwin.h"
383
5c457dac866a [svn] - Rename playlistwin stuff to ui_playlist.*
nenolod
parents: 126
diff changeset
58 #include "ui_playlist.h"
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
59 #include "skinwin.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
60 #include "playlist_list.h"
816
8073d8300502 [svn] display audacious version and revision in the prefs window
giacomo
parents: 625
diff changeset
61 #include "build_stamp.h"
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
62
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
63
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
64 enum CategoryViewCols {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
65 CATEGORY_VIEW_COL_ICON,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
66 CATEGORY_VIEW_COL_NAME,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
67 CATEGORY_VIEW_COL_ID,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
68 CATEGORY_VIEW_N_COLS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
69 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
70
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
71 enum PluginViewCols {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
72 PLUGIN_VIEW_COL_ACTIVE,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
73 PLUGIN_VIEW_COL_DESC,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
74 PLUGIN_VIEW_COL_FILENAME,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
75 PLUGIN_VIEW_COL_ID,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
76 PLUGIN_VIEW_N_COLS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
77 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
78
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
79
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
80 typedef struct {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
81 const gchar *icon_path;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
82 const gchar *name;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84 } Category;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 typedef struct {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87 const gchar *name;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
88 const gchar *tag;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
89 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
90 TitleFieldTag;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92 static GtkWidget *prefswin = NULL;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
94 static Category categories[] = {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
95 {DATA_DIR "/images/appearance.png", N_("Appearance"), 1},
1074
ac0da4976e09 [svn] - artwork
nenolod
parents: 1073
diff changeset
96 {DATA_DIR "/images/connectivity.png", N_("Connectivity"), 5},
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
97 {DATA_DIR "/images/eq.png", N_("Equalizer"), 4},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
98 {DATA_DIR "/images/mouse.png", N_("Mouse"), 2},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
99 {DATA_DIR "/images/playlist.png", N_("Playlist"), 3},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
100 {DATA_DIR "/images/plugins.png", N_("Plugins"), 0},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
101 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
102
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
103 static gint n_categories = G_N_ELEMENTS(categories);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
104
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
105 static TitleFieldTag title_field_tags[] = {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
106 { N_("Artist") , "%p" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
107 { N_("Album") , "%a" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
108 { N_("Title") , "%t" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
109 { N_("Tracknumber"), "%n" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
110 { N_("Genre") , "%g" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
111 { N_("Filename") , "%f" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
112 { N_("Filepath") , "%F" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
113 { N_("Date") , "%d" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
114 { N_("Year") , "%y" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
115 { N_("Comment") , "%c" }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
116 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
117
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
118 static const guint n_title_field_tags = G_N_ELEMENTS(title_field_tags);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
119
963
e42ce60c308f [svn] - GLib 2.6 compatibility wrapper, per bug #469
nenolod
parents: 962
diff changeset
120 /* GLib 2.6 compatibility */
e42ce60c308f [svn] - GLib 2.6 compatibility wrapper, per bug #469
nenolod
parents: 962
diff changeset
121 #if (! ((GLIB_MAJOR_VERSION > 2) || ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION >= 8))))
e42ce60c308f [svn] - GLib 2.6 compatibility wrapper, per bug #469
nenolod
parents: 962
diff changeset
122 static const char *
e42ce60c308f [svn] - GLib 2.6 compatibility wrapper, per bug #469
nenolod
parents: 962
diff changeset
123 g_get_host_name (void)
e42ce60c308f [svn] - GLib 2.6 compatibility wrapper, per bug #469
nenolod
parents: 962
diff changeset
124 {
e42ce60c308f [svn] - GLib 2.6 compatibility wrapper, per bug #469
nenolod
parents: 962
diff changeset
125 static char hostname [HOST_NAME_MAX + 1];
e42ce60c308f [svn] - GLib 2.6 compatibility wrapper, per bug #469
nenolod
parents: 962
diff changeset
126 if (gethostname (hostname, HOST_NAME_MAX) == -1) {
e42ce60c308f [svn] - GLib 2.6 compatibility wrapper, per bug #469
nenolod
parents: 962
diff changeset
127 return _("localhost");
e42ce60c308f [svn] - GLib 2.6 compatibility wrapper, per bug #469
nenolod
parents: 962
diff changeset
128 }
e42ce60c308f [svn] - GLib 2.6 compatibility wrapper, per bug #469
nenolod
parents: 962
diff changeset
129 return hostname;
e42ce60c308f [svn] - GLib 2.6 compatibility wrapper, per bug #469
nenolod
parents: 962
diff changeset
130 }
e42ce60c308f [svn] - GLib 2.6 compatibility wrapper, per bug #469
nenolod
parents: 962
diff changeset
131 #endif
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
132
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
133 static GladeXML *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
134 prefswin_get_xml(void)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
135 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
136 return GLADE_XML(g_object_get_data(G_OBJECT(prefswin), "glade-xml"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
137 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
138
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
139 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
140 change_category(GtkNotebook * notebook,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
141 GtkTreeSelection * selection)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
142 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
143 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
144 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
145 gint index;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
146
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
147 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
148 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
149
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
150 gtk_tree_model_get(model, &iter, CATEGORY_VIEW_COL_ID, &index, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
151 gtk_notebook_set_current_page(notebook, index);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
152 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
153
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
154 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
155 prefswin_set_category(gint index)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
156 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
157 GladeXML *xml;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
158 GtkWidget *notebook;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
159
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
160 g_return_if_fail(index >= 0 && index < n_categories);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
161
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
162 xml = prefswin_get_xml();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
163 notebook = glade_xml_get_widget(xml, "category_view");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
164 gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), index);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
165 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
166
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
167
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
168 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
169 input_plugin_open_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
170 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
171 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
172 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
173 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
174 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
175 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
176
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
177 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
178 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
179 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
180
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
181 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
182 input_configure(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
183 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
184
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
185 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
186 input_plugin_open_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
187 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
188 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
189 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
190 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
191 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
192 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
193
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
194 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
195 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
196 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
197
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
198 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
199 input_about(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
200 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
201
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
202 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
203 output_plugin_open_prefs(GtkComboBox * cbox,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
204 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
205 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
206 output_configure(gtk_combo_box_get_active(cbox));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
207 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
208
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
209 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
210 output_plugin_open_info(GtkComboBox * cbox,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
211 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
212 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
213 output_about(gtk_combo_box_get_active(cbox));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
214 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
215
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
216 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
217 general_plugin_open_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
218 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
219 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
220 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
221 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
222 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
223 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
224
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
225 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
226 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
227 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
228
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
229 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
230 general_configure(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
231 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
232
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
233 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
234 general_plugin_open_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
235 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
236 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
237 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
238 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
239 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
240 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
241
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
242 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
243 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
244 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
245
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
246 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
247 general_about(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
248 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
249
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
250 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
251 input_plugin_toggle(GtkCellRendererToggle * cell,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
252 const gchar * path_str,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
253 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
254 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
255 GtkTreeModel *model = GTK_TREE_MODEL(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
256 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
257 GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
258 gboolean fixed;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
259 gint pluginnr;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
260 gchar *filename, *basename;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
261 /*GList *diplist, *tmplist; */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
262
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
263 /* get toggled iter */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
264 gtk_tree_model_get_iter(model, &iter, path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
265 gtk_tree_model_get(model, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
266 PLUGIN_VIEW_COL_ACTIVE, &fixed,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
267 PLUGIN_VIEW_COL_ID, &pluginnr,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
268 PLUGIN_VIEW_COL_FILENAME, &filename,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
269 -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
270
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
271 basename = g_path_get_basename(filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
272 g_free(filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
273
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
274 /* do something with the value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
275 fixed ^= 1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
276
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
277 g_hash_table_replace(plugin_matrix, basename, GINT_TO_POINTER(fixed));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
278 /* g_hash_table_foreach(pluginmatrix, (GHFunc) disp_matrix, NULL); */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
279
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
280 /* set new value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
281 gtk_list_store_set(GTK_LIST_STORE(model), &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
282 PLUGIN_VIEW_COL_ACTIVE, fixed, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
283
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
284 /* clean up */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
285 gtk_tree_path_free(path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
286 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
287
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
288
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
289 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
290 vis_plugin_toggle(GtkCellRendererToggle * cell,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
291 const gchar * path_str,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
292 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
293 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
294 GtkTreeModel *model = GTK_TREE_MODEL(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
295 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
296 GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
297 gboolean fixed;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
298 gint pluginnr;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
299
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
300 /* get toggled iter */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
301 gtk_tree_model_get_iter(model, &iter, path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
302 gtk_tree_model_get(model, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
303 PLUGIN_VIEW_COL_ACTIVE, &fixed,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
304 PLUGIN_VIEW_COL_ID, &pluginnr, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
305
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
306 /* do something with the value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
307 fixed ^= 1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
308
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
309 enable_vis_plugin(pluginnr, fixed);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
310
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
311 /* set new value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
312 gtk_list_store_set(GTK_LIST_STORE(model), &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
313 PLUGIN_VIEW_COL_ACTIVE, fixed, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
314
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
315 /* clean up */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
316 gtk_tree_path_free(path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
317 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
318
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
319 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
320 effect_plugin_toggle(GtkCellRendererToggle * cell,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
321 const gchar * path_str,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
322 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
323 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
324 GtkTreeModel *model = GTK_TREE_MODEL(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
325 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
326 GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
327 gboolean fixed;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
328 gint pluginnr;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
329
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
330 /* get toggled iter */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
331 gtk_tree_model_get_iter(model, &iter, path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
332 gtk_tree_model_get(model, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
333 PLUGIN_VIEW_COL_ACTIVE, &fixed,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
334 PLUGIN_VIEW_COL_ID, &pluginnr, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
335
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
336 /* do something with the value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
337 fixed ^= 1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
338
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
339 enable_effect_plugin(pluginnr, fixed);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
340
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
341 /* set new value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
342 gtk_list_store_set(GTK_LIST_STORE(model), &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
343 PLUGIN_VIEW_COL_ACTIVE, fixed, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
344
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
345 /* clean up */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
346 gtk_tree_path_free(path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
347 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
348 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
349 general_plugin_toggle(GtkCellRendererToggle * cell,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
350 const gchar * path_str,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
351 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
352 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
353 GtkTreeModel *model = GTK_TREE_MODEL(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
354 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
355 GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
356 gboolean fixed;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
357 gint pluginnr;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
358
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
359 /* get toggled iter */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
360 gtk_tree_model_get_iter(model, &iter, path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
361 gtk_tree_model_get(model, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
362 PLUGIN_VIEW_COL_ACTIVE, &fixed,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
363 PLUGIN_VIEW_COL_ID, &pluginnr, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
364
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
365 /* do something with the value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
366 fixed ^= 1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
367
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
368 enable_general_plugin(pluginnr, fixed);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
369
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
370 /* set new value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
371 gtk_list_store_set(GTK_LIST_STORE(model), &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
372 PLUGIN_VIEW_COL_ACTIVE, fixed, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
373
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
374 /* clean up */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
375 gtk_tree_path_free(path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
376 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
377
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
378 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
379 on_output_plugin_cbox_changed(GtkComboBox * combobox,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
380 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
381 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
382 gint selected;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
383 selected = gtk_combo_box_get_active(combobox);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
384
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
385 /* Force playback to stop. There is NO way to change the output
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
386 plugin in the middle of a playback, and NO way to know when the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
387 user closes the output plugin settings dialog. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
388 mainwin_stop_pushed();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
389 set_current_output_plugin(selected);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
390 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
391
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
392 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
393 on_output_plugin_cbox_realize(GtkComboBox * cbox,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
394 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
395 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
396 GList *olist = get_output_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
397 OutputPlugin *op, *cp = get_current_output_plugin();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
398 gint i = 0, selected = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
399
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
400 if (!olist) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
401 gtk_widget_set_sensitive(GTK_WIDGET(cbox), FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
402 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
403 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
404
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
405 for (i = 0; olist; i++, olist = g_list_next(olist)) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
406 op = OUTPUT_PLUGIN(olist->data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
407
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
408 if (olist->data == cp)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
409 selected = i;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
410
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
411 gtk_combo_box_append_text(cbox, op->description);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
412 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
413
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
414 gtk_combo_box_set_active(cbox, selected);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
415 g_signal_connect(cbox, "changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
416 G_CALLBACK(on_output_plugin_cbox_changed), NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
417 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
418
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
419
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
420 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
421 on_input_plugin_view_realize(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
422 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
423 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
424 GtkListStore *store;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
425 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
426
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
427 GtkCellRenderer *renderer;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
428 GtkTreeViewColumn *column;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
429
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
430 GList *ilist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
431 gchar *description[2];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
432 InputPlugin *ip;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
433 gint id = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
434
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
435 gboolean enabled;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
436
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
437 store = gtk_list_store_new(PLUGIN_VIEW_N_COLS,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
438 G_TYPE_BOOLEAN, G_TYPE_STRING,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
439 G_TYPE_STRING, G_TYPE_INT);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
440
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
441 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
442 gtk_tree_view_column_set_title(column, _("Enabled"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
443 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
444 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
445 gtk_tree_view_column_set_resizable(column, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
446 gtk_tree_view_column_set_fixed_width(column, 50);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
447
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
448 renderer = gtk_cell_renderer_toggle_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
449 g_signal_connect(renderer, "toggled",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
450 G_CALLBACK(input_plugin_toggle), store);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
451 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
452 gtk_tree_view_column_set_attributes(column, renderer, "active",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
453 PLUGIN_VIEW_COL_ACTIVE, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
454
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
455 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
456
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
457 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
458 gtk_tree_view_column_set_title(column, _("Description"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
459 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
460 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
461 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
462
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
463
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
464 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
465 gtk_tree_view_column_pack_start(column, renderer, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
466 gtk_tree_view_column_set_attributes(column, renderer,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
467 "text", PLUGIN_VIEW_COL_DESC, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
468 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
469
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
470 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
471
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
472 gtk_tree_view_column_set_title(column, _("Filename"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
473 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
474 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
475 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
476
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
477 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
478 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
479 gtk_tree_view_column_set_attributes(column, renderer, "text",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
480 PLUGIN_VIEW_COL_FILENAME, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
481
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
482 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
483
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
484 for (ilist = get_input_list(); ilist; ilist = g_list_next(ilist)) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
485 ip = INPUT_PLUGIN(ilist->data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
486
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
487 description[0] = g_strdup(ip->description);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
488 description[1] = g_strdup(ip->filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
489
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
490 enabled = input_is_enabled(description[1]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
491
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
492 gtk_list_store_append(store, &iter);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
493 gtk_list_store_set(store, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
494 PLUGIN_VIEW_COL_ACTIVE, enabled,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
495 PLUGIN_VIEW_COL_DESC, description[0],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
496 PLUGIN_VIEW_COL_FILENAME, description[1],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
497 PLUGIN_VIEW_COL_ID, id++, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
498
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
499 g_free(description[1]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
500 g_free(description[0]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
501 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
502
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
503 gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(store));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
504 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
505
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
506
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
507 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
508 on_general_plugin_view_realize(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
509 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
510 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
511 GtkListStore *store;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
512 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
513
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
514 GtkCellRenderer *renderer;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
515 GtkTreeViewColumn *column;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
516
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
517 GList *ilist /*, *diplist */ ;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
518 gchar *description[2];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
519 GeneralPlugin *gp;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
520 gint id = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
521
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
522 gboolean enabled;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
523
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
524 store = gtk_list_store_new(PLUGIN_VIEW_N_COLS,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
525 G_TYPE_BOOLEAN, G_TYPE_STRING,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
526 G_TYPE_STRING, G_TYPE_INT);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
527
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
528 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
529 gtk_tree_view_column_set_title(column, _("Enabled"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
530 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
531 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
532 gtk_tree_view_column_set_resizable(column, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
533 gtk_tree_view_column_set_fixed_width(column, 50);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
534
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
535 renderer = gtk_cell_renderer_toggle_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
536 g_signal_connect(renderer, "toggled",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
537 G_CALLBACK(general_plugin_toggle), store);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
538 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
539 gtk_tree_view_column_set_attributes(column, renderer, "active",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
540 PLUGIN_VIEW_COL_ACTIVE, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
541
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
542 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
543
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
544 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
545 gtk_tree_view_column_set_title(column, _("Description"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
546 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
547 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
548 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
549
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
550
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
551 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
552 gtk_tree_view_column_pack_start(column, renderer, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
553 gtk_tree_view_column_set_attributes(column, renderer,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
554 "text", PLUGIN_VIEW_COL_DESC, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
555
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
556 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
557
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
558
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
559 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
560 gtk_tree_view_column_set_title(column, _("Filename"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
561 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
562 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
563 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
564
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
565 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
566 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
567 gtk_tree_view_column_set_attributes(column, renderer, "text",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
568 PLUGIN_VIEW_COL_FILENAME, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
569
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
570 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
571
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
572 for (ilist = get_general_list(); ilist; ilist = g_list_next(ilist)) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
573 gp = GENERAL_PLUGIN(ilist->data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
574
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
575 description[0] = g_strdup(gp->description);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
576 description[1] = g_strdup(gp->filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
577
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
578 enabled = general_enabled(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
579
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
580 gtk_list_store_append(store, &iter);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
581 gtk_list_store_set(store, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
582 PLUGIN_VIEW_COL_ACTIVE, enabled,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
583 PLUGIN_VIEW_COL_DESC, description[0],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
584 PLUGIN_VIEW_COL_FILENAME, description[1],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
585 PLUGIN_VIEW_COL_ID, id++, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
586
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
587 g_free(description[1]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
588 g_free(description[0]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
589 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
590
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
591 gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(store));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
592 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
593
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
594
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
595 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
596 on_vis_plugin_view_realize(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
597 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
598 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
599 GtkListStore *store;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
600 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
601
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
602 GtkCellRenderer *renderer;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
603 GtkTreeViewColumn *column;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
604
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
605 GList *vlist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
606 gchar *description[2];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
607 VisPlugin *vp;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
608 gint id = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
609
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
610 gboolean enabled;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
611
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
612
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
613 store = gtk_list_store_new(PLUGIN_VIEW_N_COLS,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
614 G_TYPE_BOOLEAN, G_TYPE_STRING,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
615 G_TYPE_STRING, G_TYPE_INT);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
616
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
617 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
618 gtk_tree_view_column_set_title(column, _("Enabled"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
619 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
620 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
621 gtk_tree_view_column_set_resizable(column, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
622 gtk_tree_view_column_set_fixed_width(column, 50);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
623
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
624 renderer = gtk_cell_renderer_toggle_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
625 g_signal_connect(renderer, "toggled",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
626 G_CALLBACK(vis_plugin_toggle), store);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
627 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
628 gtk_tree_view_column_set_attributes(column, renderer, "active",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
629 PLUGIN_VIEW_COL_ACTIVE, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
630
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
631 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
632
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
633 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
634 gtk_tree_view_column_set_title(column, _("Description"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
635 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
636 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
637 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
638
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
639
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
640 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
641 gtk_tree_view_column_pack_start(column, renderer, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
642 gtk_tree_view_column_set_attributes(column, renderer,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
643 "text", PLUGIN_VIEW_COL_DESC, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
644
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
645 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
646
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
647
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
648 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
649 gtk_tree_view_column_set_title(column, _("Filename"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
650 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
651 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
652 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
653
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
654 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
655 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
656 gtk_tree_view_column_set_attributes(column, renderer, "text",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
657 PLUGIN_VIEW_COL_FILENAME, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
658
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
659 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
660
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
661 for (vlist = get_vis_list(); vlist; vlist = g_list_next(vlist)) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
662 vp = VIS_PLUGIN(vlist->data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
663
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
664 description[0] = g_strdup(vp->description);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
665 description[1] = g_strdup(vp->filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
666
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
667 enabled = vis_enabled(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
668
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
669 gtk_list_store_append(store, &iter);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
670 gtk_list_store_set(store, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
671 PLUGIN_VIEW_COL_ACTIVE, enabled,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
672 PLUGIN_VIEW_COL_DESC, description[0],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
673 PLUGIN_VIEW_COL_FILENAME, description[1],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
674 PLUGIN_VIEW_COL_ID, id++, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
675
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
676 g_free(description[1]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
677 g_free(description[0]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
678 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
679
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
680 gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(store));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
681 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
682
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
683 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
684 editable_insert_text(GtkEditable * editable,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
685 const gchar * text,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
686 gint * pos)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
687 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
688 gtk_editable_insert_text(editable, text, strlen(text), pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
689 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
690
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
691
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
692 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
693 on_effect_plugin_view_realize(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
694 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
695 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
696 GtkListStore *store;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
697 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
698
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
699 GtkCellRenderer *renderer;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
700 GtkTreeViewColumn *column;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
701
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
702 GList *elist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
703 gchar *description[2];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
704 gint id = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
705
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
706 gboolean enabled;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
707
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
708
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
709 store = gtk_list_store_new(PLUGIN_VIEW_N_COLS,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
710 G_TYPE_BOOLEAN, G_TYPE_STRING,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
711 G_TYPE_STRING, G_TYPE_INT);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
712
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
713 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
714 gtk_tree_view_column_set_title(column, _("Enabled"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
715 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
716 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
717 gtk_tree_view_column_set_resizable(column, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
718 gtk_tree_view_column_set_fixed_width(column, 50);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
719
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
720 renderer = gtk_cell_renderer_toggle_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
721 g_signal_connect(renderer, "toggled",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
722 G_CALLBACK(effect_plugin_toggle), store);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
723 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
724 gtk_tree_view_column_set_attributes(column, renderer, "active",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
725 PLUGIN_VIEW_COL_ACTIVE, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
726
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
727 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
728
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
729 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
730 gtk_tree_view_column_set_title(column, _("Description"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
731 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
732 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
733 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
734
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
735
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
736 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
737 gtk_tree_view_column_pack_start(column, renderer, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
738 gtk_tree_view_column_set_attributes(column, renderer,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
739 "text", PLUGIN_VIEW_COL_DESC, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
740
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
741 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
742
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
743
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
744 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
745 gtk_tree_view_column_set_title(column, _("Filename"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
746 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
747 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
748 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
749
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
750 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
751 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
752 gtk_tree_view_column_set_attributes(column, renderer, "text",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
753 PLUGIN_VIEW_COL_FILENAME, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
754
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
755 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
756
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
757 for (elist = get_effect_list(); elist; elist = g_list_next(elist)) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
758 EffectPlugin *ep = EFFECT_PLUGIN(elist->data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
759
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
760 description[0] = g_strdup(ep->description);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
761 description[1] = g_strdup(ep->filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
762
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
763 enabled = effect_enabled(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
764
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
765 gtk_list_store_append(store, &iter);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
766 gtk_list_store_set(store, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
767 PLUGIN_VIEW_COL_ACTIVE, enabled,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
768 PLUGIN_VIEW_COL_DESC, description[0],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
769 PLUGIN_VIEW_COL_FILENAME, description[1],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
770 PLUGIN_VIEW_COL_ID, id++, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
771
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
772 g_free(description[1]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
773 g_free(description[0]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
774 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
775
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
776 gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(store));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
777 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
778
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
779 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
780 titlestring_tag_menu_callback(GtkMenuItem * menuitem,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
781 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
782 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
783 const gchar *separator = " - ";
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
784 GladeXML *xml;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
785 GtkWidget *entry;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
786 gint item = GPOINTER_TO_INT(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
787 gint pos;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
788
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
789 xml = prefswin_get_xml();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
790 entry = glade_xml_get_widget(xml, "titlestring_entry");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
791
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
792 pos = gtk_editable_get_position(GTK_EDITABLE(entry));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
793
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
794 /* insert separator as needed */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
795 if (g_utf8_strlen(gtk_entry_get_text(GTK_ENTRY(entry)), -1) > 0)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
796 editable_insert_text(GTK_EDITABLE(entry), separator, &pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
797
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
798 editable_insert_text(GTK_EDITABLE(entry), _(title_field_tags[item].tag),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
799 &pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
800
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
801 gtk_editable_set_position(GTK_EDITABLE(entry), pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
802 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
803
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
804 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
805 on_titlestring_help_button_clicked(GtkButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
806 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
807 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
808
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
809 GtkMenu *menu;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
810 MenuPos *pos = g_new0(MenuPos, 1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
811 GdkWindow *parent;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
812
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
813 gint x_ro, y_ro;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
814 gint x_widget, y_widget;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
815 gint x_size, y_size;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
816
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
817 g_return_if_fail (button != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
818 g_return_if_fail (GTK_IS_MENU (data));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
819
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
820 parent = gtk_widget_get_parent_window(GTK_WIDGET(button));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
821
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
822 gdk_drawable_get_size(parent, &x_size, &y_size);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
823 gdk_window_get_root_origin(GTK_WIDGET(button)->window, &x_ro, &y_ro);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
824 gdk_window_get_position(GTK_WIDGET(button)->window, &x_widget, &y_widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
825
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
826 pos->x = x_size + x_ro;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
827 pos->y = y_size + y_ro - 100;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
828
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
829 menu = GTK_MENU(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
830 gtk_menu_popup (menu, NULL, NULL, util_menu_position, pos,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
831 0, GDK_CURRENT_TIME);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
832 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
833
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
834
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
835 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
836 on_titlestring_entry_realize(GtkWidget * entry,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
837 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
838 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
839 gtk_entry_set_text(GTK_ENTRY(entry), cfg.gentitle_format);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
840 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
841
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
842 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
843 on_titlestring_entry_changed(GtkWidget * entry,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
844 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
845 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
846 g_free(cfg.gentitle_format);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
847 cfg.gentitle_format = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
848 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
849
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
850 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
851 on_titlestring_cbox_realize(GtkWidget * cbox,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
852 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
853 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
854 gtk_combo_box_set_active(GTK_COMBO_BOX(cbox), cfg.titlestring_preset);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
855 gtk_widget_set_sensitive(GTK_WIDGET(data),
625
0a73d1faeb4e [svn] GCC 4.1 warning fixes by Diego 'Flameeyes' Petteno from Gentoo.
chainsaw
parents: 383
diff changeset
856 (cfg.titlestring_preset == (gint)n_titlestring_presets));
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
857 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
858
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
859 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
860 on_titlestring_cbox_changed(GtkWidget * cbox,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
861 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
862 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
863 gint position = gtk_combo_box_get_active(GTK_COMBO_BOX(cbox));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
864
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
865 cfg.titlestring_preset = position;
946
8cfe13fcd0c7 [svn] - Forgot a few things regarding titlestrings!
nhjm449
parents: 893
diff changeset
866 gtk_widget_set_sensitive(GTK_WIDGET(data), (position == 6));
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
867 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
868
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
869 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
870 on_mainwin_font_button_font_set(GtkFontButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
871 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
872 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
873 g_free(cfg.mainwin_font);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
874 cfg.mainwin_font = g_strdup(gtk_font_button_get_font_name(button));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
875
124
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
876 textbox_set_xfont(mainwin_info, cfg.mainwin_use_xfont, cfg.mainwin_font);
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
877 mainwin_set_info_text();
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
878 draw_main_window(TRUE);
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
879 }
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
880
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
881 static void
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
882 on_use_bitmap_fonts_realize(GtkToggleButton * button,
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
883 gpointer data)
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
884 {
126
2d3d921a44e2 [svn] Fix realize function for the bitmap fonts option.
nenolod
parents: 124
diff changeset
885 gtk_toggle_button_set_active(button,
2d3d921a44e2 [svn] Fix realize function for the bitmap fonts option.
nenolod
parents: 124
diff changeset
886 cfg.mainwin_use_xfont != FALSE ? FALSE : TRUE);
124
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
887 }
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
888
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
889 static void
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
890 on_use_bitmap_fonts_toggled(GtkToggleButton * button,
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
891 gpointer data)
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
892 {
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
893 gboolean useit = gtk_toggle_button_get_active(button);
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
894 cfg.mainwin_use_xfont = useit != FALSE ? FALSE : TRUE;
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
895 textbox_set_xfont(mainwin_info, cfg.mainwin_use_xfont, cfg.mainwin_font);
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
896 mainwin_set_info_text();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
897 draw_main_window(TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
898 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
899
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
900 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
901 on_mainwin_font_button_realize(GtkFontButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
902 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
903 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
904 gtk_font_button_set_font_name(button, cfg.mainwin_font);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
905 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
906
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
907 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
908 on_playlist_font_button_font_set(GtkFontButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
909 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
910 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
911 g_free(cfg.playlist_font);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
912 cfg.playlist_font = g_strdup(gtk_font_button_get_font_name(button));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
913
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
914 playlist_list_set_font(cfg.playlist_font);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
915 playlistwin_update_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
916 draw_playlist_window(TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
917 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
918
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
919 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
920 on_playlist_font_button_realize(GtkFontButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
921 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
922 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
923 gtk_font_button_set_font_name(button, cfg.playlist_font);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
924 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
925
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
926 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
927 on_playlist_show_pl_numbers_realize(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
928 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
929 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
930 gtk_toggle_button_set_active(button, cfg.show_numbers_in_pl);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
931 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
932
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
933 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
934 on_playlist_show_pl_numbers_toggled(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
935 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
936 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
937 cfg.show_numbers_in_pl = gtk_toggle_button_get_active(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
938 playlistwin_update_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
939 draw_playlist_window(TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
940 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
941
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
942 static void
1081
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
943 on_playlist_transparent_realize(GtkToggleButton * button,
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
944 gpointer data)
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
945 {
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
946 gtk_toggle_button_set_active(button, cfg.playlist_transparent);
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
947 }
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
948
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
949 static void
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
950 on_playlist_transparent_toggled(GtkToggleButton * button,
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
951 gpointer data)
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
952 {
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
953 cfg.playlist_transparent = gtk_toggle_button_get_active(button);
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
954 playlistwin_update_list();
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
955 draw_playlist_window(TRUE);
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
956 }
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
957
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
958 static void
1056
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
959 on_playlist_show_pl_separator_realize(GtkToggleButton * button,
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
960 gpointer data)
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
961 {
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
962 gtk_toggle_button_set_active(button, cfg.show_separator_in_pl);
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
963 }
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
964
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
965 static void
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
966 on_playlist_show_pl_separator_toggled(GtkToggleButton * button,
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
967 gpointer data)
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
968 {
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
969 cfg.show_separator_in_pl = gtk_toggle_button_get_active(button);
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
970 playlistwin_update_list();
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
971 draw_playlist_window(TRUE);
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
972 }
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
973
1070
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
974 /* proxy */
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
975 static void
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
976 on_proxy_use_realize(GtkToggleButton * button,
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
977 gpointer data)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
978 {
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
979 ConfigDb *db;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
980 gboolean ret;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
981
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
982 db = bmp_cfg_db_open();
1073
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
983
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
984 if (bmp_cfg_db_get_bool(db, NULL, "use_proxy", &ret) != FALSE)
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
985 gtk_toggle_button_set_active(button, ret);
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
986
1070
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
987 bmp_cfg_db_close(db);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
988 }
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
989
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
990 static void
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
991 on_proxy_use_toggled(GtkToggleButton * button,
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
992 gpointer data)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
993 {
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
994 ConfigDb *db;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
995 gboolean ret = gtk_toggle_button_get_active(button);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
996
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
997 db = bmp_cfg_db_open();
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
998 bmp_cfg_db_set_bool(db, NULL, "use_proxy", ret);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
999 bmp_cfg_db_close(db);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1000 }
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1001
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1002 static void
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1003 on_proxy_auth_realize(GtkToggleButton * button,
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1004 gpointer data)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1005 {
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1006 ConfigDb *db;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1007 gboolean ret;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1008
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1009 db = bmp_cfg_db_open();
1073
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1010
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1011 if (bmp_cfg_db_get_bool(db, NULL, "proxy_use_auth", &ret) != FALSE)
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1012 gtk_toggle_button_set_active(button, ret);
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1013
1070
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1014 bmp_cfg_db_close(db);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1015 }
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1016
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1017 static void
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1018 on_proxy_auth_toggled(GtkToggleButton * button,
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1019 gpointer data)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1020 {
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1021 ConfigDb *db;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1022 gboolean ret = gtk_toggle_button_get_active(button);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1023
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1024 db = bmp_cfg_db_open();
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1025 bmp_cfg_db_set_bool(db, NULL, "proxy_use_auth", ret);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1026 bmp_cfg_db_close(db);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1027 }
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1028
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1029 static void
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1030 on_proxy_host_realize(GtkEntry * entry,
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1031 gpointer data)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1032 {
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1033 ConfigDb *db;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1034 gchar *ret;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1035
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1036 db = bmp_cfg_db_open();
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1037
1073
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1038 if (bmp_cfg_db_get_string(db, NULL, "proxy_host", &ret) != FALSE)
1070
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1039 gtk_entry_set_text(entry, ret);
1073
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1040
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1041 bmp_cfg_db_close(db);
1070
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1042 }
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1043
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1044 static void
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1045 on_proxy_host_changed(GtkEntry * entry,
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1046 gpointer data)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1047 {
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1048 ConfigDb *db;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1049 gchar *ret = g_strdup(gtk_entry_get_text(entry));
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1050
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1051 db = bmp_cfg_db_open();
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1052 bmp_cfg_db_set_string(db, NULL, "proxy_host", ret);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1053 bmp_cfg_db_close(db);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1054
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1055 g_free(ret);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1056 }
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1057
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1058 static void
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1059 on_proxy_port_realize(GtkEntry * entry,
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1060 gpointer data)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1061 {
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1062 ConfigDb *db;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1063 gchar *ret;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1064
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1065 db = bmp_cfg_db_open();
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1066
1073
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1067 if (bmp_cfg_db_get_string(db, NULL, "proxy_port", &ret) != FALSE)
1070
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1068 gtk_entry_set_text(entry, ret);
1073
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1069
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1070 bmp_cfg_db_close(db);
1070
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1071 }
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1072
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1073 static void
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1074 on_proxy_port_changed(GtkEntry * entry,
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1075 gpointer data)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1076 {
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1077 ConfigDb *db;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1078 gchar *ret = g_strdup(gtk_entry_get_text(entry));
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1079
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1080 db = bmp_cfg_db_open();
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1081 bmp_cfg_db_set_string(db, NULL, "proxy_port", ret);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1082 bmp_cfg_db_close(db);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1083
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1084 g_free(ret);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1085 }
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1086
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1087 static void
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1088 on_proxy_user_realize(GtkEntry * entry,
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1089 gpointer data)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1090 {
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1091 ConfigDb *db;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1092 gchar *ret;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1093
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1094 db = bmp_cfg_db_open();
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1095
1073
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1096 if (bmp_cfg_db_get_string(db, NULL, "proxy_user", &ret) != FALSE)
1070
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1097 gtk_entry_set_text(entry, ret);
1073
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1098
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1099 bmp_cfg_db_close(db);
1070
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1100 }
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1101
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1102 static void
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1103 on_proxy_user_changed(GtkEntry * entry,
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1104 gpointer data)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1105 {
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1106 ConfigDb *db;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1107 gchar *ret = g_strdup(gtk_entry_get_text(entry));
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1108
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1109 db = bmp_cfg_db_open();
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1110 bmp_cfg_db_set_string(db, NULL, "proxy_user", ret);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1111 bmp_cfg_db_close(db);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1112
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1113 g_free(ret);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1114 }
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1115
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1116 static void
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1117 on_proxy_pass_realize(GtkEntry * entry,
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1118 gpointer data)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1119 {
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1120 ConfigDb *db;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1121 gchar *ret;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1122
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1123 db = bmp_cfg_db_open();
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1124
1073
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1125 if (bmp_cfg_db_get_string(db, NULL, "proxy_pass", &ret) != FALSE)
1070
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1126 gtk_entry_set_text(entry, ret);
1073
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1127
28949899e412 [svn] - fix
nenolod
parents: 1070
diff changeset
1128 bmp_cfg_db_close(db);
1070
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1129 }
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1130
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1131 static void
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1132 on_proxy_pass_changed(GtkEntry * entry,
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1133 gpointer data)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1134 {
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1135 ConfigDb *db;
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1136 gchar *ret = g_strdup(gtk_entry_get_text(entry));
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1137
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1138 db = bmp_cfg_db_open();
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1139 bmp_cfg_db_set_string(db, NULL, "proxy_pass", ret);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1140 bmp_cfg_db_close(db);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1141
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1142 g_free(ret);
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1143 }
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1144
1056
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
1145 static void
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1146 input_plugin_enable_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1147 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1148 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1149 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1150 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1151 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1152
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1153 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1154 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1155
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1156 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1157 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1158 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1159
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1160 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1161
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1162 plist = get_input_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1163 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1164
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1165 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1166 INPUT_PLUGIN(plist->data)->configure != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1167 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1168
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1169 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1170 input_plugin_enable_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1171 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1172 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1173 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1174 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1175 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1176 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1177 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1178
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1179 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1180 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1181 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1182
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1183 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1184
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1185 plist = get_input_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1186 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1187
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1188 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1189 INPUT_PLUGIN(plist->data)->about != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1190 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1191
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1192
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1193 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1194 output_plugin_enable_info(GtkComboBox * cbox, GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1195 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1196 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1197
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1198 gint id = gtk_combo_box_get_active(cbox);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1199
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1200 plist = get_output_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1201 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1202
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1203 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1204 OUTPUT_PLUGIN(plist->data)->about != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1205 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1206
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1207 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1208 output_plugin_enable_prefs(GtkComboBox * cbox, GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1209 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1210 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1211 gint id = gtk_combo_box_get_active(cbox);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1212
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1213 plist = get_output_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1214 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1215
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1216 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1217 OUTPUT_PLUGIN(plist->data)->configure != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1218 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1219
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1220
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1221 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1222 general_plugin_enable_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1223 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1224 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1225 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1226 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1227 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1228 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1229 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1230
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1231 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1232 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1233 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1234
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1235 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1236
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1237 plist = get_general_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1238 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1239
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1240 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1241 GENERAL_PLUGIN(plist->data)->about != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1242 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1243
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1244 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1245 general_plugin_enable_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1246 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1247 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1248 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1249 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1250 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1251 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1252 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1253
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1254 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1255 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1256 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1257
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1258 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1259
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1260 plist = get_general_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1261 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1262
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1263 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1264 GENERAL_PLUGIN(plist->data)->configure != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1265 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1266
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1267
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1268
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1269 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1270 vis_plugin_enable_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1271 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1272 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1273 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1274 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1275 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1276 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1277 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1278
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1279 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1280 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1281 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1282
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1283 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1284
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1285 plist = get_vis_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1286 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1287
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1288 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1289 VIS_PLUGIN(plist->data)->configure != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1290 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1291
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1292 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1293 vis_plugin_enable_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1294 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1295 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1296 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1297 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1298 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1299 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1300 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1301
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1302 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1303 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1304 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1305
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1306 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1307
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1308 plist = get_vis_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1309 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1310
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1311 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1312 VIS_PLUGIN(plist->data)->about != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1313 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1314
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1315 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1316 vis_plugin_open_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1317 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1318 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1319 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1320 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1321 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1322 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1323
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1324 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1325 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1326 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1327
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1328 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1329 vis_configure(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1330 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1331
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1332
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1333 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1334 vis_plugin_open_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1335 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1336 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1337 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1338 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1339 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1340 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1341
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1342 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1343 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1344 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1345
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1346 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1347 vis_about(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1348 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1349
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1350
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1351
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1352
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1353
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1354
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1355 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1356 effect_plugin_enable_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1357 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1358 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1359 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1360 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1361 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1362 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1363 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1364
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1365 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1366 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1367 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1368
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1369 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1370
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1371 plist = get_effect_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1372 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1373
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1374 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1375 EFFECT_PLUGIN(plist->data)->configure != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1376 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1377
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1378 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1379 effect_plugin_enable_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1380 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1381 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1382 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1383 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1384 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1385 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1386 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1387
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1388 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1389 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1390 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1391
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1392 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1393
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1394 plist = get_effect_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1395 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1396
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1397 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1398 EFFECT_PLUGIN(plist->data)->about != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1399 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1400
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1401 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1402 effect_plugin_open_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1403 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1404 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1405 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1406 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1407 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1408 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1409
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1410 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1411 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1412 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1413
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1414 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1415 effect_configure(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1416 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1417
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1418
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1419 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1420 effect_plugin_open_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1421 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1422 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1423 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1424 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1425 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1426 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1427
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1428 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1429 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1430 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1431
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1432 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1433 effect_about(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1434 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1435
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1436
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1437
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1438
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1439
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1440 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1441 on_mouse_wheel_volume_realize(GtkSpinButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1442 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1443 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1444 gtk_spin_button_set_value(button, cfg.mouse_change);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1445 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1446
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1447 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1448 on_mouse_wheel_volume_changed(GtkSpinButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1449 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1450 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1451 cfg.mouse_change = gtk_spin_button_get_value_as_int(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1452 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1453
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1454 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1455 on_pause_between_songs_time_realize(GtkSpinButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1456 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1457 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1458 gtk_spin_button_set_value(button, cfg.pause_between_songs_time);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1459 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1460
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1461 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1462 on_pause_between_songs_time_changed(GtkSpinButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1463 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1464 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1465 cfg.pause_between_songs_time = gtk_spin_button_get_value_as_int(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1466 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1467
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1468 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1469 on_mouse_wheel_scroll_pl_realize(GtkSpinButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1470 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1471 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1472 gtk_spin_button_set_value(button, cfg.scroll_pl_by);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1473 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1474
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1475 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1476 on_mouse_wheel_scroll_pl_changed(GtkSpinButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1477 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1478 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1479 cfg.scroll_pl_by = gtk_spin_button_get_value_as_int(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1480 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1481
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1482 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1483 on_playlist_convert_underscore_realize(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1484 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1485 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1486 gtk_toggle_button_set_active(button, cfg.convert_underscore);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1487 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1488
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1489 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1490 on_playlist_convert_underscore_toggled(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1491 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1492 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1493 cfg.convert_underscore = gtk_toggle_button_get_active(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1494 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1495
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1496 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1497 on_playlist_no_advance_realize(GtkToggleButton * button, gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1498 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1499 gtk_toggle_button_set_active(button, cfg.no_playlist_advance);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1500 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1501
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1502 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1503 on_playlist_no_advance_toggled(GtkToggleButton * button, gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1504 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1505 cfg.no_playlist_advance = gtk_toggle_button_get_active(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1506 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1507
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1508 static void
893
6afdd0d7e1e1 [svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents: 887
diff changeset
1509 on_refresh_file_list_realize(GtkToggleButton * button, gpointer data)
6afdd0d7e1e1 [svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents: 887
diff changeset
1510 {
6afdd0d7e1e1 [svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents: 887
diff changeset
1511 gtk_toggle_button_set_active(button, cfg.refresh_file_list);
6afdd0d7e1e1 [svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents: 887
diff changeset
1512 }
6afdd0d7e1e1 [svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents: 887
diff changeset
1513
6afdd0d7e1e1 [svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents: 887
diff changeset
1514 static void
6afdd0d7e1e1 [svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents: 887
diff changeset
1515 on_refresh_file_list_toggled(GtkToggleButton * button, gpointer data)
6afdd0d7e1e1 [svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents: 887
diff changeset
1516 {
6afdd0d7e1e1 [svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents: 887
diff changeset
1517 cfg.refresh_file_list = gtk_toggle_button_get_active(button);
6afdd0d7e1e1 [svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents: 887
diff changeset
1518 }
6afdd0d7e1e1 [svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents: 887
diff changeset
1519
6afdd0d7e1e1 [svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents: 887
diff changeset
1520 static void
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1521 on_playlist_convert_twenty_realize(GtkToggleButton * button, gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1522 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1523 gtk_toggle_button_set_active(button, cfg.convert_twenty);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1524 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1525
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1526 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1527 on_playlist_convert_twenty_toggled(GtkToggleButton * button, gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1528 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1529 cfg.convert_twenty = gtk_toggle_button_get_active(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1530 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1531
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1532 #if 0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1533 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1534 on_playlist_update_clicked(GtkButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1535 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1536 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1537 playlistwin_update_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1538 draw_playlist_window(TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1539 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1540 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1541
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1542 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1543 on_use_pl_metadata_realize(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1544 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1545 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1546 gboolean state = cfg.use_pl_metadata;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1547 gtk_toggle_button_set_active(button, state);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1548 gtk_widget_set_sensitive(GTK_WIDGET(data), state);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1549 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1550
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1551 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1552 on_use_pl_metadata_toggled(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1553 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1554 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1555 gboolean state = gtk_toggle_button_get_active(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1556 cfg.use_pl_metadata = state;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1557 gtk_widget_set_sensitive(GTK_WIDGET(data), state);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1558 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1559
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1560 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1561 on_pause_between_songs_realize(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1562 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1563 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1564 gboolean state = cfg.pause_between_songs;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1565 gtk_toggle_button_set_active(button, state);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1566 gtk_widget_set_sensitive(GTK_WIDGET(data), state);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1567 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1568
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1569 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1570 on_pause_between_songs_toggled(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1571 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1572 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1573 gboolean state = gtk_toggle_button_get_active(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1574 cfg.pause_between_songs = state;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1575 gtk_widget_set_sensitive(GTK_WIDGET(data), state);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1576 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1577
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1578 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1579 on_pl_metadata_on_load_realize(GtkRadioButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1580 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1581 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1582 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1583 cfg.get_info_on_load);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1584 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1585
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1586 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1587 on_pl_metadata_on_display_realize(GtkRadioButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1588 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1589 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1590 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1591 cfg.get_info_on_demand);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1592 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1593
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1594 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1595 on_pl_metadata_on_load_toggled(GtkRadioButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1596 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1597 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1598 cfg.get_info_on_load =
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1599 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1600 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1601
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1602 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1603 on_pl_metadata_on_display_toggled(GtkRadioButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1604 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1605 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1606 cfg.get_info_on_demand =
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1607 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1608 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1609
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1610 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1611 on_custom_cursors_realize(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1612 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1613 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1614 gtk_toggle_button_set_active(button, cfg.custom_cursors);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1615 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1616
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1617 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1618 on_custom_cursors_toggled(GtkToggleButton *togglebutton,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1619 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1620 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1621 cfg.custom_cursors = gtk_toggle_button_get_active(togglebutton);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1622 skin_reload_forced();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1623 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1624
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1625 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1626 on_eq_dir_preset_entry_realize(GtkEntry * entry,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1627 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1628 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1629 gtk_entry_set_text(entry, cfg.eqpreset_default_file);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1630 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1631
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1632 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1633 on_eq_dir_preset_entry_changed(GtkEntry * entry,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1634 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1635 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1636 g_free(cfg.eqpreset_default_file);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1637 cfg.eqpreset_default_file = g_strdup(gtk_entry_get_text(entry));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1638 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1639
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1640 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1641 on_eq_file_preset_entry_realize(GtkEntry * entry,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1642 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1643 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1644 gtk_entry_set_text(entry, cfg.eqpreset_extension);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1645 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1646
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1647 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1648 on_eq_file_preset_entry_changed(GtkEntry * entry, gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1649 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1650 const gchar *text = gtk_entry_get_text(entry);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1651
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1652 while (*text == '.')
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1653 text++;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1654
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1655 g_free(cfg.eqpreset_extension);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1656 cfg.eqpreset_extension = g_strdup(text);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1657 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1658
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1659
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1660 /* FIXME: implement these */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1661
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1662 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1663 on_eq_preset_view_realize(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1664 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1665 {}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1666
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1667 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1668 on_eq_preset_add_clicked(GtkButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1669 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1670 {}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1671
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1672 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1673 on_eq_preset_remove_clicked(GtkButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1674 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1675 {}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1676
887
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1677 static void
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1678 on_skin_refresh_button_clicked(GtkButton * button,
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1679 gpointer data)
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1680 {
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1681 GladeXML *xml;
962
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1682 GtkWidget *widget, *widget2;
887
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1683
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1684 const mode_t mode755 = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1685
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1686 del_directory(bmp_paths[BMP_PATH_SKIN_THUMB_DIR]);
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1687 make_directory(bmp_paths[BMP_PATH_SKIN_THUMB_DIR], mode755);
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1688
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1689 xml = prefswin_get_xml();
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1690
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1691 widget = glade_xml_get_widget(xml, "skin_view");
962
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1692 widget2 = glade_xml_get_widget(xml, "skin_refresh_button");
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1693 skin_view_update(GTK_TREE_VIEW(widget), GTK_WIDGET(widget2));
887
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
1694 }
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1695
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1696 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1697 prefswin_set_skin_update(gboolean state)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1698 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1699 g_object_set_data(G_OBJECT(prefswin), "update-skins",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1700 GINT_TO_POINTER(state));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1701 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1702
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1703 static gboolean
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1704 prefswin_get_skin_update(void)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1705 {
625
0a73d1faeb4e [svn] GCC 4.1 warning fixes by Diego 'Flameeyes' Petteno from Gentoo.
chainsaw
parents: 383
diff changeset
1706 return g_object_get_data(G_OBJECT(prefswin), "update-skins") != 0;
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1707 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1708
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1709 static gboolean
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1710 on_skin_view_visibility_notify(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1711 GdkEvent * event,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1712 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1713 {
962
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1714 GladeXML *xml;
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1715 GtkWidget *widget;
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1716
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1717 if (event->visibility.state == GDK_VISIBILITY_FULLY_OBSCURED)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1718 return FALSE;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1719
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1720 if (!prefswin_get_skin_update())
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1721 return FALSE;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1722
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1723 prefswin_set_skin_update(FALSE);
962
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1724
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1725 xml = prefswin_get_xml();
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1726 widget = glade_xml_get_widget(xml, "skin_refresh_button");
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1727 skin_view_update(treeview, GTK_WIDGET(widget));
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1728
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1729 return TRUE;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1730 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1731
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1732 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1733 on_category_view_realize(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1734 GtkNotebook * notebook)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1735 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1736 GtkListStore *store;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1737 GtkCellRenderer *renderer;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1738 GtkTreeViewColumn *column;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1739 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1740 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1741 GdkPixbuf *img;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1742 gint i;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1743
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1744 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1745 gtk_tree_view_column_set_title(column, _("Category"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1746 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1747 gtk_tree_view_column_set_spacing(column, 2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1748
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1749 renderer = gtk_cell_renderer_pixbuf_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1750 gtk_tree_view_column_pack_start(column, renderer, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1751 gtk_tree_view_column_set_attributes(column, renderer, "pixbuf", 0, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1752
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1753 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1754 gtk_tree_view_column_pack_start(column, renderer, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1755 gtk_tree_view_column_set_attributes(column, renderer, "text", 1, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1756
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1757 store = gtk_list_store_new(CATEGORY_VIEW_N_COLS,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1758 GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1759 gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(store));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1760
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1761 for (i = 0; i < n_categories; i++) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1762 img = gdk_pixbuf_new_from_file(categories[i].icon_path, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1763 gtk_list_store_append(store, &iter);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1764 gtk_list_store_set(store, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1765 CATEGORY_VIEW_COL_ICON, img,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1766 CATEGORY_VIEW_COL_NAME,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1767 gettext(categories[i].name), CATEGORY_VIEW_COL_ID,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1768 categories[i].id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1769 g_object_unref(img);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1770 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1771
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1772 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1773
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1774 g_signal_connect_swapped(selection, "changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1775 G_CALLBACK(change_category), notebook);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1776 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1777
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1778 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1779 mainwin_drag_data_received1(GtkWidget * widget,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1780 GdkDragContext * context,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1781 gint x, gint y,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1782 GtkSelectionData * selection_data,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1783 guint info, guint time,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1784 gpointer user_data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1785 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1786 gchar *path, *decoded;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1787
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1788 if (!selection_data->data) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1789 g_warning("DND data string is NULL");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1790 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1791 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1792
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1793 path = (gchar *) selection_data->data;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1794
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1795 /* FIXME: use a real URL validator/parser */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1796
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1797 if (!str_has_prefix_nocase(path, "fonts:///"))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1798 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1799
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1800 path[strlen(path) - 2] = 0; /* Why the hell a CR&LF? */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1801 path += 8;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1802
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1803 /* plain, since we already stripped the first URI part */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1804 decoded = xmms_urldecode_plain(path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1805
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1806 /* Get the old font's size, and add it to the dropped
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1807 * font's name */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1808 cfg.playlist_font = g_strconcat(decoded+1,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1809 strrchr(cfg.playlist_font, ' '),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1810 NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1811 playlist_list_set_font(cfg.playlist_font);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1812 playlistwin_update_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1813 gtk_font_button_set_font_name(user_data, cfg.playlist_font);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1814
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1815 g_free(decoded);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1816 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1817
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1818 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1819 on_skin_view_drag_data_received(GtkWidget * widget,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1820 GdkDragContext * context,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1821 gint x, gint y,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1822 GtkSelectionData * selection_data,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1823 guint info, guint time,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1824 gpointer user_data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1825 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1826 ConfigDb *db;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1827 gchar *path;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1828
962
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1829 GladeXML *xml;
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1830 GtkWidget *widget2;
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1831
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1832 if (!selection_data->data) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1833 g_warning("DND data string is NULL");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1834 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1835 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1836
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1837 path = (gchar *) selection_data->data;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1838
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1839 /* FIXME: use a real URL validator/parser */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1840
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1841 if (str_has_prefix_nocase(path, "file:///")) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1842 path[strlen(path) - 2] = 0; /* Why the hell a CR&LF? */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1843 path += 7;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1844 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1845 else if (str_has_prefix_nocase(path, "file:")) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1846 path += 5;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1847 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1848
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1849 if (file_is_archive(path)) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1850 bmp_active_skin_load(path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1851 skin_install_skin(path);
962
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1852 xml = prefswin_get_xml();
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1853 widget2 = glade_xml_get_widget(xml, "skin_refresh_button");
a341792533a6 [svn] - Let's not let the user press the skin refresh button while already refreshing ;)
nhjm449
parents: 954
diff changeset
1854 skin_view_update(GTK_TREE_VIEW(widget), GTK_WIDGET(widget2));
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1855 /* Change skin name in the config file */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1856 db = bmp_cfg_db_open();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1857 bmp_cfg_db_set_string(db, NULL, "skin", path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1858 bmp_cfg_db_close(db);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1859 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1860
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1861 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1862
1105
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1863 static void
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1864 on_chardet_detector_cbox_changed(GtkComboBox * combobox, gpointer data)
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1865 {
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1866 ConfigDb *db;
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1867 gint position;
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1868
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1869 position = gtk_combo_box_get_active(GTK_COMBO_BOX(combobox));
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1870 cfg.chardet_detector = (char *)chardet_detector_presets[position];
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1871
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1872 db = bmp_cfg_db_open();
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1873 bmp_cfg_db_set_string(db, NULL, "chardet_detector", cfg.chardet_detector);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1874 bmp_cfg_db_close(db);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1875 gtk_widget_set_sensitive(GTK_WIDGET(data), 1);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1876 }
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1877
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1878 static void
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1879 on_chardet_detector_cbox_realize(GtkComboBox *combobox, gpointer data)
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1880 {
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1881 ConfigDb *db;
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1882 gchar *ret=NULL;
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1883 guint i=0,index=0;
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1884
1109
95365899992e [svn] - audacious should pick runtime library up from ${libdir}.
yaz
parents: 1105
diff changeset
1885 for(i=0; i<n_chardet_detector_presets; i++) {
95365899992e [svn] - audacious should pick runtime library up from ${libdir}.
yaz
parents: 1105
diff changeset
1886 gtk_combo_box_append_text(combobox, chardet_detector_presets[i]);
95365899992e [svn] - audacious should pick runtime library up from ${libdir}.
yaz
parents: 1105
diff changeset
1887 }
95365899992e [svn] - audacious should pick runtime library up from ${libdir}.
yaz
parents: 1105
diff changeset
1888
1105
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1889 db = bmp_cfg_db_open();
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1890 if(bmp_cfg_db_get_string(db, NULL, "chardet_detector", &ret) != FALSE) {
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1891 for(i=0; i<n_chardet_detector_presets; i++) {
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1892 if(!strcmp(chardet_detector_presets[i], ret)) {
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1893 cfg.chardet_detector = (char *)chardet_detector_presets[i];
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1894 index = i;
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1895 }
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1896 }
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1897 }
1109
95365899992e [svn] - audacious should pick runtime library up from ${libdir}.
yaz
parents: 1105
diff changeset
1898 bmp_cfg_db_close(db);
95365899992e [svn] - audacious should pick runtime library up from ${libdir}.
yaz
parents: 1105
diff changeset
1899
1105
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1900 #ifdef USE_CHARDET
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1901 gtk_combo_box_set_active(GTK_COMBO_BOX(combobox), index);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1902 gtk_widget_set_sensitive(GTK_WIDGET(data), 1);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1903 g_signal_connect(combobox, "changed",
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1904 G_CALLBACK(on_chardet_detector_cbox_changed), NULL);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1905 #else
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1906 gtk_combo_box_set_active(GTK_COMBO_BOX(combobox), -1);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1907 gtk_widget_set_sensitive(GTK_WIDGET(combobox), 0);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1908 #endif
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1909 if(ret)
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1910 g_free(ret);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1911 }
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1912
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1913 static void
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1914 on_chardet_fallback_realize(GtkEntry *entry, gpointer data)
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1915 {
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1916 ConfigDb *db;
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1917 gchar *ret;
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1918
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1919 db = bmp_cfg_db_open();
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1920
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1921 if (bmp_cfg_db_get_string(db, NULL, "chardet_fallback", &ret) != FALSE) {
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1922 if(cfg.chardet_fallback)
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1923 g_free(cfg.chardet_fallback);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1924 cfg.chardet_fallback = ret;
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1925 gtk_entry_set_text(entry, cfg.chardet_fallback);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1926 }
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1927 bmp_cfg_db_close(db);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1928 }
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1929
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1930 static void
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1931 on_chardet_fallback_changed(GtkEntry *entry, gpointer data)
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1932 {
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1933 ConfigDb *db;
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1934 gchar *ret;
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1935
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1936 ret = g_strdup(gtk_entry_get_text(entry));
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1937
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1938 if(cfg.chardet_fallback)
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1939 g_free(cfg.chardet_fallback);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1940 cfg.chardet_fallback = ret;
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1941
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1942 db = bmp_cfg_db_open();
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1943 bmp_cfg_db_set_string(db, NULL, "chardet_fallback", cfg.chardet_fallback);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1944 bmp_cfg_db_close(db);
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1945 }
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
1946
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1947 /* FIXME: complete the map */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1948 FUNC_MAP_BEGIN(prefswin_func_map)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1949 FUNC_MAP_ENTRY(on_input_plugin_view_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1950 FUNC_MAP_ENTRY(on_output_plugin_cbox_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1951 FUNC_MAP_ENTRY(on_general_plugin_view_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1952 FUNC_MAP_ENTRY(on_vis_plugin_view_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1953 FUNC_MAP_ENTRY(on_effect_plugin_view_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1954 FUNC_MAP_ENTRY(on_custom_cursors_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1955 FUNC_MAP_ENTRY(on_custom_cursors_toggled)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1956 FUNC_MAP_ENTRY(on_mainwin_font_button_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1957 FUNC_MAP_ENTRY(on_mainwin_font_button_font_set)
124
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
1958 FUNC_MAP_ENTRY(on_use_bitmap_fonts_realize)
428d3865de3c [svn] More bitmap-font related stuff, working on a scrolling implementation too. (You can now enable or disable bitmap font support in Preferences.)
nenolod
parents: 0
diff changeset
1959 FUNC_MAP_ENTRY(on_use_bitmap_fonts_toggled)
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1960 FUNC_MAP_ENTRY(on_mouse_wheel_volume_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1961 FUNC_MAP_ENTRY(on_mouse_wheel_volume_changed)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1962 FUNC_MAP_ENTRY(on_mouse_wheel_scroll_pl_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1963 FUNC_MAP_ENTRY(on_mouse_wheel_scroll_pl_changed)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1964 FUNC_MAP_ENTRY(on_pause_between_songs_time_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1965 FUNC_MAP_ENTRY(on_pause_between_songs_time_changed)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1966 FUNC_MAP_ENTRY(on_pl_metadata_on_load_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1967 FUNC_MAP_ENTRY(on_pl_metadata_on_load_toggled)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1968 FUNC_MAP_ENTRY(on_pl_metadata_on_display_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1969 FUNC_MAP_ENTRY(on_pl_metadata_on_display_toggled)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1970 FUNC_MAP_ENTRY(on_playlist_show_pl_numbers_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1971 FUNC_MAP_ENTRY(on_playlist_show_pl_numbers_toggled)
1056
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
1972 FUNC_MAP_ENTRY(on_playlist_show_pl_separator_realize)
21628529c615 [svn] add the config option to enable/disable separator line in the playlist
yaz
parents: 963
diff changeset
1973 FUNC_MAP_ENTRY(on_playlist_show_pl_separator_toggled)
1081
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
1974 FUNC_MAP_ENTRY(on_playlist_transparent_realize)
00442fab8cc3 [svn] - playlist transparency toggle
nenolod
parents: 1074
diff changeset
1975 FUNC_MAP_ENTRY(on_playlist_transparent_toggled)
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1976 FUNC_MAP_ENTRY(on_playlist_convert_twenty_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1977 FUNC_MAP_ENTRY(on_playlist_convert_twenty_toggled)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1978 FUNC_MAP_ENTRY(on_playlist_convert_underscore_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1979 FUNC_MAP_ENTRY(on_playlist_convert_underscore_toggled)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1980 FUNC_MAP_ENTRY(on_playlist_font_button_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1981 FUNC_MAP_ENTRY(on_playlist_font_button_font_set)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1982 FUNC_MAP_ENTRY(on_playlist_no_advance_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1983 FUNC_MAP_ENTRY(on_playlist_no_advance_toggled)
893
6afdd0d7e1e1 [svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents: 887
diff changeset
1984 FUNC_MAP_ENTRY(on_refresh_file_list_realize)
6afdd0d7e1e1 [svn] Make refreshing optional, default to disabled if Gnome VFS available.
nemo
parents: 887
diff changeset
1985 FUNC_MAP_ENTRY(on_refresh_file_list_toggled)
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1986 FUNC_MAP_ENTRY(on_skin_view_visibility_notify)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1987 FUNC_MAP_ENTRY(on_titlestring_entry_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1988 FUNC_MAP_ENTRY(on_titlestring_entry_changed)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1989 FUNC_MAP_ENTRY(on_eq_dir_preset_entry_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1990 FUNC_MAP_ENTRY(on_eq_dir_preset_entry_changed)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1991 FUNC_MAP_ENTRY(on_eq_file_preset_entry_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1992 FUNC_MAP_ENTRY(on_eq_file_preset_entry_changed)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1993 FUNC_MAP_ENTRY(on_eq_preset_view_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1994 FUNC_MAP_ENTRY(on_eq_preset_add_clicked)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1995 FUNC_MAP_ENTRY(on_eq_preset_remove_clicked)
954
53df4e214988 [svn] - fix signal handler error
nhjm449
parents: 946
diff changeset
1996 FUNC_MAP_ENTRY(on_skin_refresh_button_clicked)
1070
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1997 FUNC_MAP_ENTRY(on_proxy_use_toggled)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1998 FUNC_MAP_ENTRY(on_proxy_use_realize)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
1999 FUNC_MAP_ENTRY(on_proxy_auth_toggled)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
2000 FUNC_MAP_ENTRY(on_proxy_auth_realize)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
2001 FUNC_MAP_ENTRY(on_proxy_host_realize)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
2002 FUNC_MAP_ENTRY(on_proxy_host_changed)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
2003 FUNC_MAP_ENTRY(on_proxy_port_realize)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
2004 FUNC_MAP_ENTRY(on_proxy_port_changed)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
2005 FUNC_MAP_ENTRY(on_proxy_user_realize)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
2006 FUNC_MAP_ENTRY(on_proxy_user_changed)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
2007 FUNC_MAP_ENTRY(on_proxy_pass_realize)
6e7d0b545473 [svn] - proxy auth options
nenolod
parents: 1056
diff changeset
2008 FUNC_MAP_ENTRY(on_proxy_pass_changed)
1105
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
2009 FUNC_MAP_ENTRY(on_chardet_detector_cbox_realize)
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
2010 FUNC_MAP_ENTRY(on_chardet_detector_cbox_changed)
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
2011 FUNC_MAP_ENTRY(on_chardet_fallback_realize)
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
2012 FUNC_MAP_ENTRY(on_chardet_fallback_changed)
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2013 FUNC_MAP_END
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2014
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2015 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2016 create_prefs_window(void)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2017 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2018 const gchar *glade_file = DATA_DIR "/glade/prefswin.glade";
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2019
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2020 GladeXML *xml;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2021 GtkWidget *widget, *widget2;
816
8073d8300502 [svn] display audacious version and revision in the prefs window
giacomo
parents: 625
diff changeset
2022 GString *aud_version_string;
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2023
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2024 GtkWidget *titlestring_tag_menu, *menu_item;
625
0a73d1faeb4e [svn] GCC 4.1 warning fixes by Diego 'Flameeyes' Petteno from Gentoo.
chainsaw
parents: 383
diff changeset
2025 guint i;
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2026
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2027 /* load the interface */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2028 xml = glade_xml_new_or_die(_("Preferences Window"), glade_file, NULL,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2029 NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2030
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2031
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2032 /* connect the signals in the interface */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2033 glade_xml_signal_autoconnect_map(xml, prefswin_func_map);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2034
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2035 prefswin = glade_xml_get_widget(xml, "prefswin");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2036 g_object_set_data(G_OBJECT(prefswin), "glade-xml", xml);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2037 gtk_window_set_transient_for(GTK_WINDOW(prefswin), GTK_WINDOW(mainwin));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2038
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2039 /* create category view */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2040 widget = glade_xml_get_widget(xml, "category_view");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2041 widget2 = glade_xml_get_widget(xml, "category_notebook");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2042 g_signal_connect_after(G_OBJECT(widget), "realize",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2043 G_CALLBACK(on_category_view_realize),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2044 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2045
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2046 /* plugin->input page */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2047
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2048 widget = glade_xml_get_widget(xml, "input_plugin_view");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2049 widget2 = glade_xml_get_widget(xml, "input_plugin_prefs");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2050 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2051 G_CALLBACK(input_plugin_enable_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2052 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2053
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2054 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2055 G_CALLBACK(input_plugin_open_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2056 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2057 widget2 = glade_xml_get_widget(xml, "input_plugin_info");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2058 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2059 G_CALLBACK(input_plugin_enable_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2060 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2061 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2062 G_CALLBACK(input_plugin_open_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2063 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2064
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2065 /* plugin->output page */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2066
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2067 widget = glade_xml_get_widget(xml, "output_plugin_cbox");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2068
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2069 widget2 = glade_xml_get_widget(xml, "output_plugin_prefs");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2070 g_signal_connect(G_OBJECT(widget), "changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2071 G_CALLBACK(output_plugin_enable_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2072 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2073 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2074 G_CALLBACK(output_plugin_open_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2075 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2076
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2077 widget2 = glade_xml_get_widget(xml, "output_plugin_info");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2078 g_signal_connect(G_OBJECT(widget), "changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2079 G_CALLBACK(output_plugin_enable_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2080 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2081 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2082 G_CALLBACK(output_plugin_open_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2083 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2084
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2085 /* plugin->general page */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2086
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2087 widget = glade_xml_get_widget(xml, "general_plugin_view");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2088
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2089 widget2 = glade_xml_get_widget(xml, "general_plugin_prefs");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2090 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2091 G_CALLBACK(general_plugin_enable_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2092 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2093 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2094 G_CALLBACK(general_plugin_open_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2095 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2096
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2097 widget2 = glade_xml_get_widget(xml, "general_plugin_info");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2098 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2099 G_CALLBACK(general_plugin_enable_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2100 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2101 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2102 G_CALLBACK(general_plugin_open_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2103 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2104
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2105
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2106 /* plugin->vis page */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2107
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2108 widget = glade_xml_get_widget(xml, "vis_plugin_view");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2109 widget2 = glade_xml_get_widget(xml, "vis_plugin_prefs");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2110
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2111 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2112 G_CALLBACK(vis_plugin_open_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2113 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2114 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2115 G_CALLBACK(vis_plugin_enable_prefs), widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2116
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2117
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2118 widget2 = glade_xml_get_widget(xml, "vis_plugin_info");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2119 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2120 G_CALLBACK(vis_plugin_enable_info), widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2121 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2122 G_CALLBACK(vis_plugin_open_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2123 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2124
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2125
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2126 /* plugin->effects page */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2127
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2128 widget = glade_xml_get_widget(xml, "effect_plugin_view");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2129 widget2 = glade_xml_get_widget(xml, "effect_plugin_prefs");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2130
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2131 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2132 G_CALLBACK(effect_plugin_open_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2133 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2134 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2135 G_CALLBACK(effect_plugin_enable_prefs), widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2136
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2137
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2138 widget2 = glade_xml_get_widget(xml, "effect_plugin_info");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2139 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2140 G_CALLBACK(effect_plugin_enable_info), widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2141 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2142 G_CALLBACK(effect_plugin_open_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2143 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2144
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2145 /* playlist page */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2146
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2147 widget = glade_xml_get_widget(xml, "pause_between_songs_box");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2148 widget2 = glade_xml_get_widget(xml, "pause_between_songs");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2149 g_signal_connect_after(G_OBJECT(widget2), "realize",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2150 G_CALLBACK(on_pause_between_songs_realize),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2151 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2152 g_signal_connect(G_OBJECT(widget2), "toggled",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2153 G_CALLBACK(on_pause_between_songs_toggled),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2154 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2155
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2156 widget = glade_xml_get_widget(xml, "playlist_use_metadata_box");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2157 widget2 = glade_xml_get_widget(xml, "playlist_use_metadata");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2158 g_signal_connect_after(G_OBJECT(widget2), "realize",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2159 G_CALLBACK(on_use_pl_metadata_realize),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2160 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2161 g_signal_connect(G_OBJECT(widget2), "toggled",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2162 G_CALLBACK(on_use_pl_metadata_toggled),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2163 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2164
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2165 widget = glade_xml_get_widget(xml, "skin_view");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2166 g_signal_connect(widget, "drag-data-received",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2167 G_CALLBACK(on_skin_view_drag_data_received),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2168 NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2169 bmp_drag_dest_set(widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2170
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2171 g_signal_connect(mainwin, "drag-data-received",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2172 G_CALLBACK(mainwin_drag_data_received),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2173 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2174
887
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
2175 widget = glade_xml_get_widget(xml, "skin_refresh_button");
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
2176 g_signal_connect(widget, "clicked",
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
2177 G_CALLBACK(on_skin_refresh_button_clicked),
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
2178 NULL);
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
2179
a8fb5974c3a9 [svn] * Skin thumbnails are refreshable!
nhjm449
parents: 824
diff changeset
2180 widget = glade_xml_get_widget(xml, "playlist_font_button");
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2181 g_signal_connect(mainwin, "drag-data-received",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2182 G_CALLBACK(mainwin_drag_data_received1),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2183 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2184
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2185 widget = glade_xml_get_widget(xml, "titlestring_cbox");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2186 widget2 = glade_xml_get_widget(xml, "titlestring_entry");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2187 g_signal_connect(widget, "realize",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2188 G_CALLBACK(on_titlestring_cbox_realize),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2189 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2190 g_signal_connect(widget, "changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2191 G_CALLBACK(on_titlestring_cbox_changed),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2192 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2193
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2194 /* FIXME: move this into a function */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2195 /* create tag menu */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2196 titlestring_tag_menu = gtk_menu_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2197 for(i = 0; i < n_title_field_tags; i++) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2198 menu_item = gtk_menu_item_new_with_label(_(title_field_tags[i].name));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2199 gtk_menu_shell_append(GTK_MENU_SHELL(titlestring_tag_menu), menu_item);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2200 g_signal_connect(menu_item, "activate",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2201 G_CALLBACK(titlestring_tag_menu_callback),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2202 GINT_TO_POINTER(i));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2203 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2204 gtk_widget_show_all(titlestring_tag_menu);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2205
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2206 widget = glade_xml_get_widget(xml, "titlestring_help_button");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2207 widget2 = glade_xml_get_widget(xml, "titlestring_cbox");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2208
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2209 g_signal_connect(widget2, "changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2210 G_CALLBACK(on_titlestring_cbox_changed),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2211 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2212 g_signal_connect(widget, "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2213 G_CALLBACK(on_titlestring_help_button_clicked),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2214 titlestring_tag_menu);
816
8073d8300502 [svn] display audacious version and revision in the prefs window
giacomo
parents: 625
diff changeset
2215
8073d8300502 [svn] display audacious version and revision in the prefs window
giacomo
parents: 625
diff changeset
2216 /* audacious version label */
8073d8300502 [svn] display audacious version and revision in the prefs window
giacomo
parents: 625
diff changeset
2217 widget = glade_xml_get_widget(xml, "audversionlabel");
8073d8300502 [svn] display audacious version and revision in the prefs window
giacomo
parents: 625
diff changeset
2218 aud_version_string = g_string_new( "" );
822
c5eb4b762977 [svn] - only show the SVN revision if we know what it is
nenolod
parents: 818
diff changeset
2219
824
dfce5683ef45 [svn] that should have been strcasecmp
nenolod
parents: 822
diff changeset
2220 if (strcasecmp(svn_stamp, "exported"))
822
c5eb4b762977 [svn] - only show the SVN revision if we know what it is
nenolod
parents: 818
diff changeset
2221 {
c5eb4b762977 [svn] - only show the SVN revision if we know what it is
nenolod
parents: 818
diff changeset
2222 g_string_printf( aud_version_string , "%s (r%s) (%s@%s)" , "Audacious " PACKAGE_VERSION ,
c5eb4b762977 [svn] - only show the SVN revision if we know what it is
nenolod
parents: 818
diff changeset
2223 svn_stamp , g_get_user_name() , g_get_host_name() );
c5eb4b762977 [svn] - only show the SVN revision if we know what it is
nenolod
parents: 818
diff changeset
2224 }
c5eb4b762977 [svn] - only show the SVN revision if we know what it is
nenolod
parents: 818
diff changeset
2225 else
c5eb4b762977 [svn] - only show the SVN revision if we know what it is
nenolod
parents: 818
diff changeset
2226 {
c5eb4b762977 [svn] - only show the SVN revision if we know what it is
nenolod
parents: 818
diff changeset
2227 g_string_printf( aud_version_string , "%s (%s@%s)" , "Audacious " PACKAGE_VERSION ,
c5eb4b762977 [svn] - only show the SVN revision if we know what it is
nenolod
parents: 818
diff changeset
2228 g_get_user_name() , g_get_host_name() );
c5eb4b762977 [svn] - only show the SVN revision if we know what it is
nenolod
parents: 818
diff changeset
2229 }
c5eb4b762977 [svn] - only show the SVN revision if we know what it is
nenolod
parents: 818
diff changeset
2230
816
8073d8300502 [svn] display audacious version and revision in the prefs window
giacomo
parents: 625
diff changeset
2231 gtk_label_set_text( GTK_LABEL(widget) , aud_version_string->str );
8073d8300502 [svn] display audacious version and revision in the prefs window
giacomo
parents: 625
diff changeset
2232 g_string_free( aud_version_string , TRUE );
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2233 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2234
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2235 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2236 show_prefs_window(void)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2237 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2238 prefswin_set_skin_update(TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2239 gtk_widget_show(prefswin);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2240 }
1105
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
2241
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
2242
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
2243
4be4d74db123 [svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
yaz
parents: 1081
diff changeset
2244