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