annotate audacious/prefswin.c @ 1389:c19443be579d trunk

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