annotate audacious/prefswin.c @ 1458:f12d7e208b43 trunk

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