annotate audacious/prefswin.c @ 162:3d02042ffdb8 trunk

[svn] autoconf fixes for lirc, still broken
author nenolod
date Sat, 12 Nov 2005 17:26:42 -0800
parents 2d3d921a44e2
children 5c457dac866a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1 /* BMP - Cross-platform multimedia player
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2 * Copyright (C) 2003-2004 BMP development team.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4 * This program is free software; you can redistribute it and/or modify
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5 * it under the terms of the GNU General Public Licensse as published by
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
7 * (at your option) any later version.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
8 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
12 * GNU General Public License for more details.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
13 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
15 * along with this program; if not, write to the Free Software
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
17 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
18
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
19 #ifdef HAVE_CONFIG_H
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
20 # include "config.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
21 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
22
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23 #include <glib.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24 #include <glib/gi18n.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
25 #include <gtk/gtk.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
26 #include <glade/glade.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
27 #include <string.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
28
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
29 #include "glade.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
30
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
31 #include "plugin.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
32 #include "pluginenum.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
33 #include "input.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
34 #include "effect.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
35 #include "general.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
36 #include "output.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
37 #include "visualization.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
38
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
39 #include "main.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
40 #include "skin.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
41 #include "urldecode.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
42 #include "util.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
43 #include "dnd.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
44 #include "libaudacious/configdb.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
45
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
46 #include "mainwin.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
47 #include "playlistwin.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
48 #include "skinwin.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
49 #include "playlist_list.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
50
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
51
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
52 enum CategoryViewCols {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
53 CATEGORY_VIEW_COL_ICON,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
54 CATEGORY_VIEW_COL_NAME,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
55 CATEGORY_VIEW_COL_ID,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
56 CATEGORY_VIEW_N_COLS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
57 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
58
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
59 enum PluginViewCols {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
60 PLUGIN_VIEW_COL_ACTIVE,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
61 PLUGIN_VIEW_COL_DESC,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
62 PLUGIN_VIEW_COL_FILENAME,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
63 PLUGIN_VIEW_COL_ID,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
64 PLUGIN_VIEW_N_COLS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
65 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
66
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
67
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
68 typedef struct {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
69 const gchar *icon_path;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
70 const gchar *name;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
71 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
72 } Category;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
73
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
74 typedef struct {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
75 const gchar *name;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
76 const gchar *tag;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
77 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
78 TitleFieldTag;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
79
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
80 static GtkWidget *prefswin = NULL;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
81
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
82 static Category categories[] = {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83 {DATA_DIR "/images/appearance.png", N_("Appearance"), 1},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84 {DATA_DIR "/images/eq.png", N_("Equalizer"), 4},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85 {DATA_DIR "/images/mouse.png", N_("Mouse"), 2},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 {DATA_DIR "/images/playlist.png", N_("Playlist"), 3},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87 {DATA_DIR "/images/plugins.png", N_("Plugins"), 0},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
88 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
89
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
90 static gint n_categories = G_N_ELEMENTS(categories);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92 static TitleFieldTag title_field_tags[] = {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93 { N_("Artist") , "%p" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
94 { N_("Album") , "%a" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
95 { N_("Title") , "%t" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
96 { N_("Tracknumber"), "%n" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
97 { N_("Genre") , "%g" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
98 { N_("Filename") , "%f" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
99 { N_("Filepath") , "%F" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
100 { N_("Date") , "%d" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
101 { N_("Year") , "%y" },
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
102 { N_("Comment") , "%c" }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
103 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
104
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
105 static const guint n_title_field_tags = G_N_ELEMENTS(title_field_tags);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
106
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
107
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
108 static GladeXML *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
109 prefswin_get_xml(void)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
110 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
111 return GLADE_XML(g_object_get_data(G_OBJECT(prefswin), "glade-xml"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
112 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
113
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
114 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
115 change_category(GtkNotebook * notebook,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
116 GtkTreeSelection * selection)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
117 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
118 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
119 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
120 gint index;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
121
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
122 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
123 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
124
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
125 gtk_tree_model_get(model, &iter, CATEGORY_VIEW_COL_ID, &index, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
126 gtk_notebook_set_current_page(notebook, index);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
127 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
128
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
129 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
130 prefswin_set_category(gint index)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
131 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
132 GladeXML *xml;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
133 GtkWidget *notebook;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
134
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
135 g_return_if_fail(index >= 0 && index < n_categories);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
136
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
137 xml = prefswin_get_xml();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
138 notebook = glade_xml_get_widget(xml, "category_view");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
139 gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), index);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
140 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
141
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
142
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
143 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
144 input_plugin_open_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
145 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
146 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
147 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
148 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
149 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
150 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
151
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
152 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
153 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
154 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
155
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
156 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
157 input_configure(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
158 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
159
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
160 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
161 input_plugin_open_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
162 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
163 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
164 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
165 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
166 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
167 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
168
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
169 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
170 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
171 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
172
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
173 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
174 input_about(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
175 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
176
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
177 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
178 output_plugin_open_prefs(GtkComboBox * cbox,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
179 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
180 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
181 output_configure(gtk_combo_box_get_active(cbox));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
182 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
183
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
184 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
185 output_plugin_open_info(GtkComboBox * cbox,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
186 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
187 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
188 output_about(gtk_combo_box_get_active(cbox));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
189 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
190
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
191 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
192 general_plugin_open_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
193 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
194 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
195 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
196 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
197 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
198 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
199
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
200 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
201 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
202 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
203
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
204 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
205 general_configure(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
206 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
207
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
208 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
209 general_plugin_open_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
210 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
211 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
212 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
213 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
214 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
215 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
216
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
217 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
218 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
219 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
220
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
221 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
222 general_about(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
223 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
224
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
225 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
226 input_plugin_toggle(GtkCellRendererToggle * cell,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
227 const gchar * path_str,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
228 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
229 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
230 GtkTreeModel *model = GTK_TREE_MODEL(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
231 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
232 GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
233 gboolean fixed;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
234 gint pluginnr;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
235 gchar *filename, *basename;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
236 /*GList *diplist, *tmplist; */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
237
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
238 /* get toggled iter */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
239 gtk_tree_model_get_iter(model, &iter, path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
240 gtk_tree_model_get(model, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
241 PLUGIN_VIEW_COL_ACTIVE, &fixed,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
242 PLUGIN_VIEW_COL_ID, &pluginnr,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
243 PLUGIN_VIEW_COL_FILENAME, &filename,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
244 -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
245
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
246 basename = g_path_get_basename(filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
247 g_free(filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
248
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
249 /* do something with the value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
250 fixed ^= 1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
251
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
252 g_hash_table_replace(plugin_matrix, basename, GINT_TO_POINTER(fixed));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
253 /* g_hash_table_foreach(pluginmatrix, (GHFunc) disp_matrix, NULL); */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
254
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
255 /* set new value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
256 gtk_list_store_set(GTK_LIST_STORE(model), &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
257 PLUGIN_VIEW_COL_ACTIVE, fixed, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
258
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
259 /* clean up */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
260 gtk_tree_path_free(path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
261 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
262
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
263
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
264 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
265 vis_plugin_toggle(GtkCellRendererToggle * cell,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
266 const gchar * path_str,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
267 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
268 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
269 GtkTreeModel *model = GTK_TREE_MODEL(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
270 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
271 GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
272 gboolean fixed;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
273 gint pluginnr;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
274
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
275 /* get toggled iter */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
276 gtk_tree_model_get_iter(model, &iter, path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
277 gtk_tree_model_get(model, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
278 PLUGIN_VIEW_COL_ACTIVE, &fixed,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
279 PLUGIN_VIEW_COL_ID, &pluginnr, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
280
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
281 /* do something with the value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
282 fixed ^= 1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
283
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
284 enable_vis_plugin(pluginnr, fixed);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
285
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
286 /* set new value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
287 gtk_list_store_set(GTK_LIST_STORE(model), &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
288 PLUGIN_VIEW_COL_ACTIVE, fixed, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
289
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
290 /* clean up */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
291 gtk_tree_path_free(path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
292 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
293
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
294 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
295 effect_plugin_toggle(GtkCellRendererToggle * cell,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
296 const gchar * path_str,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
297 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
298 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
299 GtkTreeModel *model = GTK_TREE_MODEL(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
300 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
301 GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
302 gboolean fixed;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
303 gint pluginnr;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
304
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
305 /* get toggled iter */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
306 gtk_tree_model_get_iter(model, &iter, path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
307 gtk_tree_model_get(model, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
308 PLUGIN_VIEW_COL_ACTIVE, &fixed,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
309 PLUGIN_VIEW_COL_ID, &pluginnr, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
310
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
311 /* do something with the value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
312 fixed ^= 1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
313
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
314 enable_effect_plugin(pluginnr, fixed);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
315
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
316 /* set new value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
317 gtk_list_store_set(GTK_LIST_STORE(model), &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
318 PLUGIN_VIEW_COL_ACTIVE, fixed, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
319
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
320 /* clean up */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
321 gtk_tree_path_free(path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
322 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
323 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
324 general_plugin_toggle(GtkCellRendererToggle * cell,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
325 const gchar * path_str,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
326 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
327 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
328 GtkTreeModel *model = GTK_TREE_MODEL(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
329 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
330 GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
331 gboolean fixed;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
332 gint pluginnr;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
333
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
334 /* get toggled iter */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
335 gtk_tree_model_get_iter(model, &iter, path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
336 gtk_tree_model_get(model, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
337 PLUGIN_VIEW_COL_ACTIVE, &fixed,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
338 PLUGIN_VIEW_COL_ID, &pluginnr, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
339
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
340 /* do something with the value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
341 fixed ^= 1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
342
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
343 enable_general_plugin(pluginnr, fixed);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
344
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
345 /* set new value */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
346 gtk_list_store_set(GTK_LIST_STORE(model), &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
347 PLUGIN_VIEW_COL_ACTIVE, fixed, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
348
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
349 /* clean up */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
350 gtk_tree_path_free(path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
351 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
352
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
353 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
354 on_output_plugin_cbox_changed(GtkComboBox * combobox,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
355 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
356 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
357 gint selected;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
358 selected = gtk_combo_box_get_active(combobox);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
359
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
360 /* Force playback to stop. There is NO way to change the output
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
361 plugin in the middle of a playback, and NO way to know when the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
362 user closes the output plugin settings dialog. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
363 mainwin_stop_pushed();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
364 set_current_output_plugin(selected);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
365 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
366
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
367 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
368 on_output_plugin_cbox_realize(GtkComboBox * cbox,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
369 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
370 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
371 GList *olist = get_output_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
372 OutputPlugin *op, *cp = get_current_output_plugin();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
373 gint i = 0, selected = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
374
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
375 if (!olist) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
376 gtk_widget_set_sensitive(GTK_WIDGET(cbox), FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
377 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
378 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
379
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
380 for (i = 0; olist; i++, olist = g_list_next(olist)) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
381 op = OUTPUT_PLUGIN(olist->data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
382
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
383 if (olist->data == cp)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
384 selected = i;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
385
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
386 gtk_combo_box_append_text(cbox, op->description);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
387 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
388
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
389 gtk_combo_box_set_active(cbox, selected);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
390 g_signal_connect(cbox, "changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
391 G_CALLBACK(on_output_plugin_cbox_changed), NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
392 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
393
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
394
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
395 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
396 on_input_plugin_view_realize(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
397 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
398 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
399 GtkListStore *store;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
400 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
401
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
402 GtkCellRenderer *renderer;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
403 GtkTreeViewColumn *column;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
404
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
405 GList *ilist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
406 gchar *description[2];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
407 InputPlugin *ip;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
408 gint id = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
409
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
410 gboolean enabled;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
411
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
412 store = gtk_list_store_new(PLUGIN_VIEW_N_COLS,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
413 G_TYPE_BOOLEAN, G_TYPE_STRING,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
414 G_TYPE_STRING, G_TYPE_INT);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
415
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
416 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
417 gtk_tree_view_column_set_title(column, _("Enabled"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
418 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
419 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
420 gtk_tree_view_column_set_resizable(column, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
421 gtk_tree_view_column_set_fixed_width(column, 50);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
422
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
423 renderer = gtk_cell_renderer_toggle_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
424 g_signal_connect(renderer, "toggled",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
425 G_CALLBACK(input_plugin_toggle), store);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
426 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
427 gtk_tree_view_column_set_attributes(column, renderer, "active",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
428 PLUGIN_VIEW_COL_ACTIVE, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
429
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
430 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
431
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
432 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
433 gtk_tree_view_column_set_title(column, _("Description"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
434 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
435 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
436 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
437
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
438
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
439 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
440 gtk_tree_view_column_pack_start(column, renderer, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
441 gtk_tree_view_column_set_attributes(column, renderer,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
442 "text", PLUGIN_VIEW_COL_DESC, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
443 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
444
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
445 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
446
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
447 gtk_tree_view_column_set_title(column, _("Filename"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
448 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
449 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
450 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
451
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
452 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
453 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
454 gtk_tree_view_column_set_attributes(column, renderer, "text",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
455 PLUGIN_VIEW_COL_FILENAME, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
456
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
457 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
458
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
459 for (ilist = get_input_list(); ilist; ilist = g_list_next(ilist)) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
460 ip = INPUT_PLUGIN(ilist->data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
461
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
462 description[0] = g_strdup(ip->description);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
463 description[1] = g_strdup(ip->filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
464
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
465 enabled = input_is_enabled(description[1]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
466
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
467 gtk_list_store_append(store, &iter);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
468 gtk_list_store_set(store, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
469 PLUGIN_VIEW_COL_ACTIVE, enabled,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
470 PLUGIN_VIEW_COL_DESC, description[0],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
471 PLUGIN_VIEW_COL_FILENAME, description[1],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
472 PLUGIN_VIEW_COL_ID, id++, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
473
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
474 g_free(description[1]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
475 g_free(description[0]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
476 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
477
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
478 gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(store));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
479 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
480
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
481
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
482 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
483 on_general_plugin_view_realize(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
484 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
485 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
486 GtkListStore *store;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
487 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
488
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
489 GtkCellRenderer *renderer;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
490 GtkTreeViewColumn *column;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
491
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
492 GList *ilist /*, *diplist */ ;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
493 gchar *description[2];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
494 GeneralPlugin *gp;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
495 gint id = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
496
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
497 gboolean enabled;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
498
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
499 store = gtk_list_store_new(PLUGIN_VIEW_N_COLS,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
500 G_TYPE_BOOLEAN, G_TYPE_STRING,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
501 G_TYPE_STRING, G_TYPE_INT);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
502
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
503 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
504 gtk_tree_view_column_set_title(column, _("Enabled"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
505 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
506 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
507 gtk_tree_view_column_set_resizable(column, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
508 gtk_tree_view_column_set_fixed_width(column, 50);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
509
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
510 renderer = gtk_cell_renderer_toggle_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
511 g_signal_connect(renderer, "toggled",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
512 G_CALLBACK(general_plugin_toggle), store);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
513 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
514 gtk_tree_view_column_set_attributes(column, renderer, "active",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
515 PLUGIN_VIEW_COL_ACTIVE, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
516
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
517 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
518
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
519 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
520 gtk_tree_view_column_set_title(column, _("Description"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
521 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
522 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
523 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
524
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
525
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
526 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
527 gtk_tree_view_column_pack_start(column, renderer, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
528 gtk_tree_view_column_set_attributes(column, renderer,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
529 "text", PLUGIN_VIEW_COL_DESC, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
530
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
531 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
532
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
533
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
534 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
535 gtk_tree_view_column_set_title(column, _("Filename"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
536 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
537 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
538 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
539
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
540 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
541 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
542 gtk_tree_view_column_set_attributes(column, renderer, "text",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
543 PLUGIN_VIEW_COL_FILENAME, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
544
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
545 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
546
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
547 for (ilist = get_general_list(); ilist; ilist = g_list_next(ilist)) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
548 gp = GENERAL_PLUGIN(ilist->data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
549
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
550 description[0] = g_strdup(gp->description);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
551 description[1] = g_strdup(gp->filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
552
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
553 enabled = general_enabled(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
554
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
555 gtk_list_store_append(store, &iter);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
556 gtk_list_store_set(store, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
557 PLUGIN_VIEW_COL_ACTIVE, enabled,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
558 PLUGIN_VIEW_COL_DESC, description[0],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
559 PLUGIN_VIEW_COL_FILENAME, description[1],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
560 PLUGIN_VIEW_COL_ID, id++, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
561
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
562 g_free(description[1]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
563 g_free(description[0]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
564 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
565
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
566 gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(store));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
567 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
568
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
569
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
570 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
571 on_vis_plugin_view_realize(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
572 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
573 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
574 GtkListStore *store;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
575 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
576
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
577 GtkCellRenderer *renderer;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
578 GtkTreeViewColumn *column;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
579
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
580 GList *vlist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
581 gchar *description[2];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
582 VisPlugin *vp;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
583 gint id = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
584
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
585 gboolean enabled;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
586
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
587
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
588 store = gtk_list_store_new(PLUGIN_VIEW_N_COLS,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
589 G_TYPE_BOOLEAN, G_TYPE_STRING,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
590 G_TYPE_STRING, G_TYPE_INT);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
591
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
592 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
593 gtk_tree_view_column_set_title(column, _("Enabled"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
594 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
595 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
596 gtk_tree_view_column_set_resizable(column, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
597 gtk_tree_view_column_set_fixed_width(column, 50);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
598
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
599 renderer = gtk_cell_renderer_toggle_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
600 g_signal_connect(renderer, "toggled",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
601 G_CALLBACK(vis_plugin_toggle), store);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
602 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
603 gtk_tree_view_column_set_attributes(column, renderer, "active",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
604 PLUGIN_VIEW_COL_ACTIVE, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
605
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
606 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
607
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
608 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
609 gtk_tree_view_column_set_title(column, _("Description"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
610 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
611 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
612 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
613
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
614
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
615 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
616 gtk_tree_view_column_pack_start(column, renderer, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
617 gtk_tree_view_column_set_attributes(column, renderer,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
618 "text", PLUGIN_VIEW_COL_DESC, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
619
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
620 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
621
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
622
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
623 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
624 gtk_tree_view_column_set_title(column, _("Filename"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
625 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
626 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
627 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
628
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
629 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
630 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
631 gtk_tree_view_column_set_attributes(column, renderer, "text",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
632 PLUGIN_VIEW_COL_FILENAME, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
633
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
634 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
635
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
636 for (vlist = get_vis_list(); vlist; vlist = g_list_next(vlist)) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
637 vp = VIS_PLUGIN(vlist->data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
638
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
639 description[0] = g_strdup(vp->description);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
640 description[1] = g_strdup(vp->filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
641
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
642 enabled = vis_enabled(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
643
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
644 gtk_list_store_append(store, &iter);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
645 gtk_list_store_set(store, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
646 PLUGIN_VIEW_COL_ACTIVE, enabled,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
647 PLUGIN_VIEW_COL_DESC, description[0],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
648 PLUGIN_VIEW_COL_FILENAME, description[1],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
649 PLUGIN_VIEW_COL_ID, id++, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
650
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
651 g_free(description[1]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
652 g_free(description[0]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
653 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
654
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
655 gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(store));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
656 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
657
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
658 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
659 editable_insert_text(GtkEditable * editable,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
660 const gchar * text,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
661 gint * pos)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
662 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
663 gtk_editable_insert_text(editable, text, strlen(text), pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
664 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
665
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
666
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
667 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
668 on_effect_plugin_view_realize(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
669 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
670 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
671 GtkListStore *store;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
672 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
673
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
674 GtkCellRenderer *renderer;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
675 GtkTreeViewColumn *column;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
676
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
677 GList *elist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
678 gchar *description[2];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
679 gint id = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
680
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
681 gboolean enabled;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
682
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
683
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
684 store = gtk_list_store_new(PLUGIN_VIEW_N_COLS,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
685 G_TYPE_BOOLEAN, G_TYPE_STRING,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
686 G_TYPE_STRING, G_TYPE_INT);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
687
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
688 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
689 gtk_tree_view_column_set_title(column, _("Enabled"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
690 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
691 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
692 gtk_tree_view_column_set_resizable(column, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
693 gtk_tree_view_column_set_fixed_width(column, 50);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
694
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
695 renderer = gtk_cell_renderer_toggle_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
696 g_signal_connect(renderer, "toggled",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
697 G_CALLBACK(effect_plugin_toggle), store);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
698 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
699 gtk_tree_view_column_set_attributes(column, renderer, "active",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
700 PLUGIN_VIEW_COL_ACTIVE, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
701
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
702 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
703
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
704 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
705 gtk_tree_view_column_set_title(column, _("Description"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
706 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
707 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
708 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
709
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
710
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
711 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
712 gtk_tree_view_column_pack_start(column, renderer, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
713 gtk_tree_view_column_set_attributes(column, renderer,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
714 "text", PLUGIN_VIEW_COL_DESC, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
715
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
716 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
717
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
718
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
719 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
720 gtk_tree_view_column_set_title(column, _("Filename"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
721 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
722 gtk_tree_view_column_set_spacing(column, 4);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
723 gtk_tree_view_column_set_resizable(column, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
724
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
725 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
726 gtk_tree_view_column_pack_start(column, renderer, TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
727 gtk_tree_view_column_set_attributes(column, renderer, "text",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
728 PLUGIN_VIEW_COL_FILENAME, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
729
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
730 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
731
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
732 for (elist = get_effect_list(); elist; elist = g_list_next(elist)) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
733 EffectPlugin *ep = EFFECT_PLUGIN(elist->data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
734
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
735 description[0] = g_strdup(ep->description);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
736 description[1] = g_strdup(ep->filename);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
737
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
738 enabled = effect_enabled(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
739
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
740 gtk_list_store_append(store, &iter);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
741 gtk_list_store_set(store, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
742 PLUGIN_VIEW_COL_ACTIVE, enabled,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
743 PLUGIN_VIEW_COL_DESC, description[0],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
744 PLUGIN_VIEW_COL_FILENAME, description[1],
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
745 PLUGIN_VIEW_COL_ID, id++, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
746
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
747 g_free(description[1]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
748 g_free(description[0]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
749 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
750
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
751 gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(store));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
752 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
753
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
754 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
755 titlestring_tag_menu_callback(GtkMenuItem * menuitem,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
756 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
757 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
758 const gchar *separator = " - ";
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
759 GladeXML *xml;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
760 GtkWidget *entry;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
761 gint item = GPOINTER_TO_INT(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
762 gint pos;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
763
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
764 xml = prefswin_get_xml();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
765 entry = glade_xml_get_widget(xml, "titlestring_entry");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
766
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
767 pos = gtk_editable_get_position(GTK_EDITABLE(entry));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
768
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
769 /* insert separator as needed */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
770 if (g_utf8_strlen(gtk_entry_get_text(GTK_ENTRY(entry)), -1) > 0)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
771 editable_insert_text(GTK_EDITABLE(entry), separator, &pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
772
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
773 editable_insert_text(GTK_EDITABLE(entry), _(title_field_tags[item].tag),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
774 &pos);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
775
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
776 gtk_editable_set_position(GTK_EDITABLE(entry), pos);
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 on_titlestring_help_button_clicked(GtkButton * button,
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
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
784 GtkMenu *menu;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
785 MenuPos *pos = g_new0(MenuPos, 1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
786 GdkWindow *parent;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
787
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
788 gint x_ro, y_ro;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
789 gint x_widget, y_widget;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
790 gint x_size, y_size;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
791
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
792 g_return_if_fail (button != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
793 g_return_if_fail (GTK_IS_MENU (data));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
794
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
795 parent = gtk_widget_get_parent_window(GTK_WIDGET(button));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
796
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
797 gdk_drawable_get_size(parent, &x_size, &y_size);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
798 gdk_window_get_root_origin(GTK_WIDGET(button)->window, &x_ro, &y_ro);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
799 gdk_window_get_position(GTK_WIDGET(button)->window, &x_widget, &y_widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
800
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
801 pos->x = x_size + x_ro;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
802 pos->y = y_size + y_ro - 100;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
803
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
804 menu = GTK_MENU(data);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
805 gtk_menu_popup (menu, NULL, NULL, util_menu_position, pos,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
806 0, GDK_CURRENT_TIME);
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
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
810 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
811 on_titlestring_entry_realize(GtkWidget * entry,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
812 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
813 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
814 gtk_entry_set_text(GTK_ENTRY(entry), cfg.gentitle_format);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
815 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
816
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
817 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
818 on_titlestring_entry_changed(GtkWidget * entry,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
819 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
820 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
821 g_free(cfg.gentitle_format);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
822 cfg.gentitle_format = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
823 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
824
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
825 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
826 on_titlestring_cbox_realize(GtkWidget * cbox,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
827 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
828 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
829 gtk_combo_box_set_active(GTK_COMBO_BOX(cbox), cfg.titlestring_preset);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
830 gtk_widget_set_sensitive(GTK_WIDGET(data),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
831 (cfg.titlestring_preset == n_titlestring_presets));
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 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
835 on_titlestring_cbox_changed(GtkWidget * cbox,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
836 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
837 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
838 gint position = gtk_combo_box_get_active(GTK_COMBO_BOX(cbox));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
839
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
840 cfg.titlestring_preset = position;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
841 gtk_widget_set_sensitive(GTK_WIDGET(data), (position == 4));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
842 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
843
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
844 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
845 on_mainwin_font_button_font_set(GtkFontButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
846 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
847 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
848 g_free(cfg.mainwin_font);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
849 cfg.mainwin_font = g_strdup(gtk_font_button_get_font_name(button));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
850
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
851 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
852 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
853 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
854 }
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
855
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
856 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
857 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
858 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
859 {
126
2d3d921a44e2 [svn] Fix realize function for the bitmap fonts option.
nenolod
parents: 124
diff changeset
860 gtk_toggle_button_set_active(button,
2d3d921a44e2 [svn] Fix realize function for the bitmap fonts option.
nenolod
parents: 124
diff changeset
861 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
862 }
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
863
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
864 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
865 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
866 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
867 {
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
868 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
869 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
870 textbox_set_xfont(mainwin_info, cfg.mainwin_use_xfont, cfg.mainwin_font);
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
871 mainwin_set_info_text();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
872 draw_main_window(TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
873 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
874
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
875 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
876 on_mainwin_font_button_realize(GtkFontButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
877 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
878 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
879 gtk_font_button_set_font_name(button, cfg.mainwin_font);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
880 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
881
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
882 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
883 on_playlist_font_button_font_set(GtkFontButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
884 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
885 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
886 g_free(cfg.playlist_font);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
887 cfg.playlist_font = g_strdup(gtk_font_button_get_font_name(button));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
888
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
889 playlist_list_set_font(cfg.playlist_font);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
890 playlistwin_update_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
891 draw_playlist_window(TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
892 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
893
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
894 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
895 on_playlist_font_button_realize(GtkFontButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
896 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
897 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
898 gtk_font_button_set_font_name(button, cfg.playlist_font);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
899 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
900
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
901 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
902 on_playlist_show_pl_numbers_realize(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
903 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
904 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
905 gtk_toggle_button_set_active(button, cfg.show_numbers_in_pl);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
906 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
907
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
908 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
909 on_playlist_show_pl_numbers_toggled(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
910 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
911 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
912 cfg.show_numbers_in_pl = gtk_toggle_button_get_active(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
913 playlistwin_update_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
914 draw_playlist_window(TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
915 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
916
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
917 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
918 input_plugin_enable_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
919 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
920 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
921 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
922 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
923 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
924
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
925 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
926 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
927
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
928 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
929 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
930 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
931
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
932 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
933
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
934 plist = get_input_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
935 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
936
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
937 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
938 INPUT_PLUGIN(plist->data)->configure != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
939 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
940
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
941 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
942 input_plugin_enable_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
943 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
944 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
945 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
946 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
947 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
948 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
949 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
950
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
951 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
952 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
953 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
954
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
955 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
956
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
957 plist = get_input_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
958 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
959
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
960 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
961 INPUT_PLUGIN(plist->data)->about != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
962 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
963
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
964
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
965 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
966 output_plugin_enable_info(GtkComboBox * cbox, GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
967 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
968 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
969
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
970 gint id = gtk_combo_box_get_active(cbox);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
971
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
972 plist = get_output_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
973 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
974
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
975 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
976 OUTPUT_PLUGIN(plist->data)->about != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
977 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
978
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
979 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
980 output_plugin_enable_prefs(GtkComboBox * cbox, GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
981 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
982 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
983 gint id = gtk_combo_box_get_active(cbox);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
984
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
985 plist = get_output_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
986 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
987
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
988 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
989 OUTPUT_PLUGIN(plist->data)->configure != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
990 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
991
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
992
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
993 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
994 general_plugin_enable_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
995 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
996 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
997 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
998 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
999 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1000 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1001 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1002
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1003 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1004 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1005 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1006
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1007 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1008
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1009 plist = get_general_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1010 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1011
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1012 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1013 GENERAL_PLUGIN(plist->data)->about != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1014 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1015
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1016 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1017 general_plugin_enable_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1018 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1019 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1020 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1021 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1022 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1023 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1024 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1025
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1026 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1027 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1028 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1029
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1030 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1031
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1032 plist = get_general_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1033 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1034
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1035 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1036 GENERAL_PLUGIN(plist->data)->configure != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1037 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1038
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1039
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1040
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1041 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1042 vis_plugin_enable_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1043 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1044 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1045 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1046 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1047 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1048 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1049 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1050
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1051 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1052 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1053 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1054
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1055 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1056
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1057 plist = get_vis_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1058 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1059
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1060 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1061 VIS_PLUGIN(plist->data)->configure != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1062 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1063
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1064 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1065 vis_plugin_enable_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1066 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1067 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1068 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1069 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1070 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1071 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1072 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1073
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1074 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1075 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1076 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1077
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1078 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1079
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1080 plist = get_vis_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1081 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1082
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1083 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1084 VIS_PLUGIN(plist->data)->about != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1085 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1086
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1087 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1088 vis_plugin_open_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1089 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1090 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1091 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1092 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1093 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1094 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1095
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1096 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1097 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1098 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1099
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1100 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1101 vis_configure(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1102 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1103
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1104
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1105 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1106 vis_plugin_open_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1107 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1108 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1109 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1110 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1111 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1112 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1113
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1114 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1115 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1116 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1117
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1118 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1119 vis_about(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1120 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1121
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1122
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1123
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1124
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1125
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1126
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1127 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1128 effect_plugin_enable_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1129 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1130 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1131 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1132 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1133 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1134 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1135 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1136
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1137 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1138 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1139 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1140
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1141 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1142
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1143 plist = get_effect_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1144 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1145
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1146 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1147 EFFECT_PLUGIN(plist->data)->configure != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1148 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1149
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1150 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1151 effect_plugin_enable_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1152 GtkButton * button)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1153 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1154 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1155 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1156 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1157 GList *plist;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1158 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1159
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1160 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1161 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1162 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1163
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1164 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1165
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1166 plist = get_effect_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1167 plist = g_list_nth(plist, id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1168
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1169 gtk_widget_set_sensitive(GTK_WIDGET(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1170 EFFECT_PLUGIN(plist->data)->about != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1171 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1172
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1173 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1174 effect_plugin_open_prefs(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1175 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1176 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1177 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1178 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1179 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1180 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1181
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1182 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1183 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1184 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1185
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1186 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1187 effect_configure(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1188 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1189
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1190
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1191 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1192 effect_plugin_open_info(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1193 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1194 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1195 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1196 GtkTreeModel *model;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1197 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1198 gint id;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1199
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1200 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1201 if (!gtk_tree_selection_get_selected(selection, &model, &iter))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1202 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1203
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1204 gtk_tree_model_get(model, &iter, PLUGIN_VIEW_COL_ID, &id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1205 effect_about(id);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1206 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1207
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1208
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1209
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1210
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1211
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1212 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1213 on_mouse_wheel_volume_realize(GtkSpinButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1214 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1215 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1216 gtk_spin_button_set_value(button, cfg.mouse_change);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1217 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1218
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1219 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1220 on_mouse_wheel_volume_changed(GtkSpinButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1221 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1222 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1223 cfg.mouse_change = gtk_spin_button_get_value_as_int(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1224 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1225
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1226 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1227 on_pause_between_songs_time_realize(GtkSpinButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1228 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1229 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1230 gtk_spin_button_set_value(button, cfg.pause_between_songs_time);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1231 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1232
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1233 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1234 on_pause_between_songs_time_changed(GtkSpinButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1235 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1236 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1237 cfg.pause_between_songs_time = gtk_spin_button_get_value_as_int(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1238 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1239
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1240 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1241 on_mouse_wheel_scroll_pl_realize(GtkSpinButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1242 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1243 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1244 gtk_spin_button_set_value(button, cfg.scroll_pl_by);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1245 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1246
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1247 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1248 on_mouse_wheel_scroll_pl_changed(GtkSpinButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1249 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1250 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1251 cfg.scroll_pl_by = gtk_spin_button_get_value_as_int(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1252 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1253
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1254 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1255 on_playlist_convert_underscore_realize(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1256 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1257 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1258 gtk_toggle_button_set_active(button, cfg.convert_underscore);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1259 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1260
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1261 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1262 on_playlist_convert_underscore_toggled(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1263 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1264 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1265 cfg.convert_underscore = gtk_toggle_button_get_active(button);
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 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1269 on_playlist_no_advance_realize(GtkToggleButton * button, gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1270 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1271 gtk_toggle_button_set_active(button, cfg.no_playlist_advance);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1272 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1273
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1274 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1275 on_playlist_no_advance_toggled(GtkToggleButton * button, gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1276 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1277 cfg.no_playlist_advance = gtk_toggle_button_get_active(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1278 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1279
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1280 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1281 on_playlist_convert_twenty_realize(GtkToggleButton * button, gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1282 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1283 gtk_toggle_button_set_active(button, cfg.convert_twenty);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1284 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1285
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1286 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1287 on_playlist_convert_twenty_toggled(GtkToggleButton * button, gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1288 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1289 cfg.convert_twenty = gtk_toggle_button_get_active(button);
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 #if 0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1293 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1294 on_playlist_update_clicked(GtkButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1295 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1296 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1297 playlistwin_update_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1298 draw_playlist_window(TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1299 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1300 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1301
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1302 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1303 on_use_pl_metadata_realize(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1304 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1305 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1306 gboolean state = cfg.use_pl_metadata;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1307 gtk_toggle_button_set_active(button, state);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1308 gtk_widget_set_sensitive(GTK_WIDGET(data), state);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1309 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1310
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1311 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1312 on_use_pl_metadata_toggled(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1313 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1314 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1315 gboolean state = gtk_toggle_button_get_active(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1316 cfg.use_pl_metadata = state;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1317 gtk_widget_set_sensitive(GTK_WIDGET(data), state);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1318 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1319
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1320 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1321 on_pause_between_songs_realize(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1322 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1323 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1324 gboolean state = cfg.pause_between_songs;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1325 gtk_toggle_button_set_active(button, state);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1326 gtk_widget_set_sensitive(GTK_WIDGET(data), state);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1327 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1328
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1329 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1330 on_pause_between_songs_toggled(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1331 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1332 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1333 gboolean state = gtk_toggle_button_get_active(button);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1334 cfg.pause_between_songs = state;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1335 gtk_widget_set_sensitive(GTK_WIDGET(data), state);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1336 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1337
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1338 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1339 on_pl_metadata_on_load_realize(GtkRadioButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1340 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1341 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1342 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1343 cfg.get_info_on_load);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1344 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1345
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1346 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1347 on_pl_metadata_on_display_realize(GtkRadioButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1348 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1349 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1350 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1351 cfg.get_info_on_demand);
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 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1355 on_pl_metadata_on_load_toggled(GtkRadioButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1356 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1357 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1358 cfg.get_info_on_load =
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1359 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1360 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1361
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1362 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1363 on_pl_metadata_on_display_toggled(GtkRadioButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1364 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1365 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1366 cfg.get_info_on_demand =
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1367 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1368 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1369
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1370 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1371 on_custom_cursors_realize(GtkToggleButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1372 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1373 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1374 gtk_toggle_button_set_active(button, cfg.custom_cursors);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1375 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1376
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1377 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1378 on_custom_cursors_toggled(GtkToggleButton *togglebutton,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1379 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1380 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1381 cfg.custom_cursors = gtk_toggle_button_get_active(togglebutton);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1382 skin_reload_forced();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1383 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1384
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1385 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1386 on_eq_dir_preset_entry_realize(GtkEntry * entry,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1387 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1388 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1389 gtk_entry_set_text(entry, cfg.eqpreset_default_file);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1390 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1391
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1392 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1393 on_eq_dir_preset_entry_changed(GtkEntry * entry,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1394 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1395 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1396 g_free(cfg.eqpreset_default_file);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1397 cfg.eqpreset_default_file = g_strdup(gtk_entry_get_text(entry));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1398 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1399
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1400 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1401 on_eq_file_preset_entry_realize(GtkEntry * entry,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1402 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1403 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1404 gtk_entry_set_text(entry, cfg.eqpreset_extension);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1405 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1406
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1407 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1408 on_eq_file_preset_entry_changed(GtkEntry * entry, gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1409 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1410 const gchar *text = gtk_entry_get_text(entry);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1411
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1412 while (*text == '.')
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1413 text++;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1414
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1415 g_free(cfg.eqpreset_extension);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1416 cfg.eqpreset_extension = g_strdup(text);
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
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1420 /* FIXME: implement these */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1421
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1422 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1423 on_eq_preset_view_realize(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1424 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1425 {}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1426
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1427 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1428 on_eq_preset_add_clicked(GtkButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1429 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1430 {}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1431
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1432 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1433 on_eq_preset_remove_clicked(GtkButton * button,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1434 gpointer data)
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 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1439 prefswin_set_skin_update(gboolean state)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1440 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1441 g_object_set_data(G_OBJECT(prefswin), "update-skins",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1442 GINT_TO_POINTER(state));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1443 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1444
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1445 static gboolean
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1446 prefswin_get_skin_update(void)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1447 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1448 return (gboolean) g_object_get_data(G_OBJECT(prefswin), "update-skins");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1449 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1450
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1451 static gboolean
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1452 on_skin_view_visibility_notify(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1453 GdkEvent * event,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1454 gpointer data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1455 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1456 if (event->visibility.state == GDK_VISIBILITY_FULLY_OBSCURED)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1457 return FALSE;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1458
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1459 if (!prefswin_get_skin_update())
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1460 return FALSE;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1461
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1462 prefswin_set_skin_update(FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1463 skin_view_update(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1464
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1465 return TRUE;
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_category_view_realize(GtkTreeView * treeview,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1470 GtkNotebook * notebook)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1471 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1472 GtkListStore *store;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1473 GtkCellRenderer *renderer;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1474 GtkTreeViewColumn *column;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1475 GtkTreeSelection *selection;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1476 GtkTreeIter iter;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1477 GdkPixbuf *img;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1478 gint i;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1479
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1480 column = gtk_tree_view_column_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1481 gtk_tree_view_column_set_title(column, _("Category"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1482 gtk_tree_view_append_column(treeview, column);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1483 gtk_tree_view_column_set_spacing(column, 2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1484
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1485 renderer = gtk_cell_renderer_pixbuf_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1486 gtk_tree_view_column_pack_start(column, renderer, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1487 gtk_tree_view_column_set_attributes(column, renderer, "pixbuf", 0, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1488
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1489 renderer = gtk_cell_renderer_text_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1490 gtk_tree_view_column_pack_start(column, renderer, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1491 gtk_tree_view_column_set_attributes(column, renderer, "text", 1, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1492
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1493 store = gtk_list_store_new(CATEGORY_VIEW_N_COLS,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1494 GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1495 gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(store));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1496
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1497 for (i = 0; i < n_categories; i++) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1498 img = gdk_pixbuf_new_from_file(categories[i].icon_path, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1499 gtk_list_store_append(store, &iter);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1500 gtk_list_store_set(store, &iter,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1501 CATEGORY_VIEW_COL_ICON, img,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1502 CATEGORY_VIEW_COL_NAME,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1503 gettext(categories[i].name), CATEGORY_VIEW_COL_ID,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1504 categories[i].id, -1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1505 g_object_unref(img);
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 selection = gtk_tree_view_get_selection(treeview);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1509
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1510 g_signal_connect_swapped(selection, "changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1511 G_CALLBACK(change_category), notebook);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1512 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1513
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1514 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1515 mainwin_drag_data_received1(GtkWidget * widget,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1516 GdkDragContext * context,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1517 gint x, gint y,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1518 GtkSelectionData * selection_data,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1519 guint info, guint time,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1520 gpointer user_data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1521 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1522 gchar *path, *decoded;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1523
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1524 if (!selection_data->data) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1525 g_warning("DND data string is NULL");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1526 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1527 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1528
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1529 path = (gchar *) selection_data->data;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1530
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1531 /* FIXME: use a real URL validator/parser */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1532
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1533 if (!str_has_prefix_nocase(path, "fonts:///"))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1534 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1535
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1536 path[strlen(path) - 2] = 0; /* Why the hell a CR&LF? */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1537 path += 8;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1538
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1539 /* plain, since we already stripped the first URI part */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1540 decoded = xmms_urldecode_plain(path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1541
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1542 /* Get the old font's size, and add it to the dropped
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1543 * font's name */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1544 cfg.playlist_font = g_strconcat(decoded+1,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1545 strrchr(cfg.playlist_font, ' '),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1546 NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1547 playlist_list_set_font(cfg.playlist_font);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1548 playlistwin_update_list();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1549 gtk_font_button_set_font_name(user_data, cfg.playlist_font);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1550
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1551 g_free(decoded);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1552 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1553
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1554 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1555 on_skin_view_drag_data_received(GtkWidget * widget,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1556 GdkDragContext * context,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1557 gint x, gint y,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1558 GtkSelectionData * selection_data,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1559 guint info, guint time,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1560 gpointer user_data)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1561 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1562 ConfigDb *db;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1563 gchar *path;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1564
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1565 if (!selection_data->data) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1566 g_warning("DND data string is NULL");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1567 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1568 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1569
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1570 path = (gchar *) selection_data->data;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1571
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1572 /* FIXME: use a real URL validator/parser */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1573
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1574 if (str_has_prefix_nocase(path, "file:///")) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1575 path[strlen(path) - 2] = 0; /* Why the hell a CR&LF? */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1576 path += 7;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1577 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1578 else if (str_has_prefix_nocase(path, "file:")) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1579 path += 5;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1580 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1581
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1582 if (file_is_archive(path)) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1583 bmp_active_skin_load(path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1584 skin_install_skin(path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1585 skin_view_update(GTK_TREE_VIEW(widget));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1586 /* Change skin name in the config file */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1587 db = bmp_cfg_db_open();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1588 bmp_cfg_db_set_string(db, NULL, "skin", path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1589 bmp_cfg_db_close(db);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1590 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1591
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 /* FIXME: complete the map */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1595 FUNC_MAP_BEGIN(prefswin_func_map)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1596 FUNC_MAP_ENTRY(on_input_plugin_view_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1597 FUNC_MAP_ENTRY(on_output_plugin_cbox_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1598 FUNC_MAP_ENTRY(on_general_plugin_view_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1599 FUNC_MAP_ENTRY(on_vis_plugin_view_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1600 FUNC_MAP_ENTRY(on_effect_plugin_view_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1601 FUNC_MAP_ENTRY(on_custom_cursors_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1602 FUNC_MAP_ENTRY(on_custom_cursors_toggled)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1603 FUNC_MAP_ENTRY(on_mainwin_font_button_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1604 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
1605 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
1606 FUNC_MAP_ENTRY(on_use_bitmap_fonts_toggled)
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1607 FUNC_MAP_ENTRY(on_mouse_wheel_volume_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1608 FUNC_MAP_ENTRY(on_mouse_wheel_volume_changed)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1609 FUNC_MAP_ENTRY(on_mouse_wheel_scroll_pl_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1610 FUNC_MAP_ENTRY(on_mouse_wheel_scroll_pl_changed)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1611 FUNC_MAP_ENTRY(on_pause_between_songs_time_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1612 FUNC_MAP_ENTRY(on_pause_between_songs_time_changed)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1613 FUNC_MAP_ENTRY(on_pl_metadata_on_load_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1614 FUNC_MAP_ENTRY(on_pl_metadata_on_load_toggled)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1615 FUNC_MAP_ENTRY(on_pl_metadata_on_display_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1616 FUNC_MAP_ENTRY(on_pl_metadata_on_display_toggled)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1617 FUNC_MAP_ENTRY(on_playlist_show_pl_numbers_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1618 FUNC_MAP_ENTRY(on_playlist_show_pl_numbers_toggled)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1619 FUNC_MAP_ENTRY(on_playlist_convert_twenty_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1620 FUNC_MAP_ENTRY(on_playlist_convert_twenty_toggled)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1621 FUNC_MAP_ENTRY(on_playlist_convert_underscore_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1622 FUNC_MAP_ENTRY(on_playlist_convert_underscore_toggled)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1623 FUNC_MAP_ENTRY(on_playlist_font_button_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1624 FUNC_MAP_ENTRY(on_playlist_font_button_font_set)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1625 FUNC_MAP_ENTRY(on_playlist_no_advance_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1626 FUNC_MAP_ENTRY(on_playlist_no_advance_toggled)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1627 FUNC_MAP_ENTRY(on_skin_view_visibility_notify)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1628 FUNC_MAP_ENTRY(on_titlestring_entry_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1629 FUNC_MAP_ENTRY(on_titlestring_entry_changed)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1630 FUNC_MAP_ENTRY(on_eq_dir_preset_entry_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1631 FUNC_MAP_ENTRY(on_eq_dir_preset_entry_changed)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1632 FUNC_MAP_ENTRY(on_eq_file_preset_entry_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1633 FUNC_MAP_ENTRY(on_eq_file_preset_entry_changed)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1634 FUNC_MAP_ENTRY(on_eq_preset_view_realize)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1635 FUNC_MAP_ENTRY(on_eq_preset_add_clicked)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1636 FUNC_MAP_ENTRY(on_eq_preset_remove_clicked)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1637 FUNC_MAP_END
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1638
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1639 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1640 create_prefs_window(void)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1641 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1642 const gchar *glade_file = DATA_DIR "/glade/prefswin.glade";
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1643
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1644 GladeXML *xml;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1645 GtkWidget *widget, *widget2;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1646
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1647 GtkWidget *titlestring_tag_menu, *menu_item;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1648 gint i;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1649
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1650 /* load the interface */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1651 xml = glade_xml_new_or_die(_("Preferences Window"), glade_file, NULL,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1652 NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1653
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1654
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1655 /* connect the signals in the interface */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1656 glade_xml_signal_autoconnect_map(xml, prefswin_func_map);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1657
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1658 prefswin = glade_xml_get_widget(xml, "prefswin");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1659 g_object_set_data(G_OBJECT(prefswin), "glade-xml", xml);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1660 gtk_window_set_transient_for(GTK_WINDOW(prefswin), GTK_WINDOW(mainwin));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1661
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1662 /* create category view */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1663 widget = glade_xml_get_widget(xml, "category_view");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1664 widget2 = glade_xml_get_widget(xml, "category_notebook");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1665 g_signal_connect_after(G_OBJECT(widget), "realize",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1666 G_CALLBACK(on_category_view_realize),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1667 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1668
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1669 /* plugin->input page */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1670
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1671 widget = glade_xml_get_widget(xml, "input_plugin_view");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1672 widget2 = glade_xml_get_widget(xml, "input_plugin_prefs");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1673 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1674 G_CALLBACK(input_plugin_enable_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1675 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1676
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1677 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1678 G_CALLBACK(input_plugin_open_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1679 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1680 widget2 = glade_xml_get_widget(xml, "input_plugin_info");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1681 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1682 G_CALLBACK(input_plugin_enable_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1683 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1684 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1685 G_CALLBACK(input_plugin_open_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1686 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1687
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1688 /* plugin->output page */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1689
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1690 widget = glade_xml_get_widget(xml, "output_plugin_cbox");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1691
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1692 widget2 = glade_xml_get_widget(xml, "output_plugin_prefs");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1693 g_signal_connect(G_OBJECT(widget), "changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1694 G_CALLBACK(output_plugin_enable_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1695 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1696 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1697 G_CALLBACK(output_plugin_open_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1698 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1699
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1700 widget2 = glade_xml_get_widget(xml, "output_plugin_info");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1701 g_signal_connect(G_OBJECT(widget), "changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1702 G_CALLBACK(output_plugin_enable_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1703 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1704 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1705 G_CALLBACK(output_plugin_open_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1706 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1707
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1708 /* plugin->general page */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1709
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1710 widget = glade_xml_get_widget(xml, "general_plugin_view");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1711
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1712 widget2 = glade_xml_get_widget(xml, "general_plugin_prefs");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1713 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1714 G_CALLBACK(general_plugin_enable_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1715 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1716 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1717 G_CALLBACK(general_plugin_open_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1718 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1719
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1720 widget2 = glade_xml_get_widget(xml, "general_plugin_info");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1721 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1722 G_CALLBACK(general_plugin_enable_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1723 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1724 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1725 G_CALLBACK(general_plugin_open_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1726 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1727
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1728
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1729 /* plugin->vis page */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1730
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1731 widget = glade_xml_get_widget(xml, "vis_plugin_view");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1732 widget2 = glade_xml_get_widget(xml, "vis_plugin_prefs");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1733
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1734 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1735 G_CALLBACK(vis_plugin_open_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1736 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1737 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1738 G_CALLBACK(vis_plugin_enable_prefs), widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1739
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1740
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1741 widget2 = glade_xml_get_widget(xml, "vis_plugin_info");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1742 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1743 G_CALLBACK(vis_plugin_enable_info), widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1744 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1745 G_CALLBACK(vis_plugin_open_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1746 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1747
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1748
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1749 /* plugin->effects page */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1750
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1751 widget = glade_xml_get_widget(xml, "effect_plugin_view");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1752 widget2 = glade_xml_get_widget(xml, "effect_plugin_prefs");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1753
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1754 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1755 G_CALLBACK(effect_plugin_open_prefs),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1756 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1757 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1758 G_CALLBACK(effect_plugin_enable_prefs), widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1759
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1760
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1761 widget2 = glade_xml_get_widget(xml, "effect_plugin_info");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1762 g_signal_connect(G_OBJECT(widget), "cursor-changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1763 G_CALLBACK(effect_plugin_enable_info), widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1764 g_signal_connect_swapped(G_OBJECT(widget2), "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1765 G_CALLBACK(effect_plugin_open_info),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1766 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1767
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1768 /* playlist page */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1769
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1770 widget = glade_xml_get_widget(xml, "pause_between_songs_box");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1771 widget2 = glade_xml_get_widget(xml, "pause_between_songs");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1772 g_signal_connect_after(G_OBJECT(widget2), "realize",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1773 G_CALLBACK(on_pause_between_songs_realize),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1774 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1775 g_signal_connect(G_OBJECT(widget2), "toggled",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1776 G_CALLBACK(on_pause_between_songs_toggled),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1777 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1778
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1779 widget = glade_xml_get_widget(xml, "playlist_use_metadata_box");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1780 widget2 = glade_xml_get_widget(xml, "playlist_use_metadata");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1781 g_signal_connect_after(G_OBJECT(widget2), "realize",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1782 G_CALLBACK(on_use_pl_metadata_realize),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1783 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1784 g_signal_connect(G_OBJECT(widget2), "toggled",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1785 G_CALLBACK(on_use_pl_metadata_toggled),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1786 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1787
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1788 widget = glade_xml_get_widget(xml, "skin_view");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1789 g_signal_connect(widget, "drag-data-received",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1790 G_CALLBACK(on_skin_view_drag_data_received),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1791 NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1792 bmp_drag_dest_set(widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1793
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1794 g_signal_connect(mainwin, "drag-data-received",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1795 G_CALLBACK(mainwin_drag_data_received),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1796 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1797
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1798 widget = glade_xml_get_widget(xml, "playlist_font_button");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1799 g_signal_connect(mainwin, "drag-data-received",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1800 G_CALLBACK(mainwin_drag_data_received1),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1801 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1802
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1803 widget = glade_xml_get_widget(xml, "titlestring_cbox");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1804 widget2 = glade_xml_get_widget(xml, "titlestring_entry");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1805 g_signal_connect(widget, "realize",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1806 G_CALLBACK(on_titlestring_cbox_realize),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1807 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1808 g_signal_connect(widget, "changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1809 G_CALLBACK(on_titlestring_cbox_changed),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1810 widget2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1811
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1812 /* FIXME: move this into a function */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1813 /* create tag menu */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1814 titlestring_tag_menu = gtk_menu_new();
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1815 for(i = 0; i < n_title_field_tags; i++) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1816 menu_item = gtk_menu_item_new_with_label(_(title_field_tags[i].name));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1817 gtk_menu_shell_append(GTK_MENU_SHELL(titlestring_tag_menu), menu_item);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1818 g_signal_connect(menu_item, "activate",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1819 G_CALLBACK(titlestring_tag_menu_callback),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1820 GINT_TO_POINTER(i));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1821 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1822 gtk_widget_show_all(titlestring_tag_menu);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1823
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1824 widget = glade_xml_get_widget(xml, "titlestring_help_button");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1825 widget2 = glade_xml_get_widget(xml, "titlestring_cbox");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1826
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1827 g_signal_connect(widget2, "changed",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1828 G_CALLBACK(on_titlestring_cbox_changed),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1829 widget);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1830 g_signal_connect(widget, "clicked",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1831 G_CALLBACK(on_titlestring_help_button_clicked),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1832 titlestring_tag_menu);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1833 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1834
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1835 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1836 show_prefs_window(void)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1837 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1838 prefswin_set_skin_update(TRUE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1839 gtk_widget_show(prefswin);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1840 }