annotate audacious/prefswin.c @ 1358:0c41255487ee trunk

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