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