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