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