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