annotate audacious/prefswin.c @ 921:2d7a46b743cb trunk

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