annotate audacious/prefswin.c @ 863:25f42f39c44c trunk

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