~ubuntu-branches/ubuntu/karmic/aqualung/karmic

« back to all changes in this revision

Viewing changes to src/options.c

  • Committer: Bazaar Package Importer
  • Author(s): Adam Cécile (Le_Vert)
  • Date: 2007-10-04 14:03:26 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071004140326-h00cr9l1jibc74j0
Tags: 0.9~beta8-2
* Improve debian/menu (Closes: #445126).
* Improve .desktop to fit current FreeDesktop specifications.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
    along with this program; if not, write to the Free Software
16
16
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
17
 
18
 
    $Id: options.c 583 2007-02-10 16:36:41Z peterszilagyi $
 
18
    $Id: options.c 674 2007-06-17 22:42:48Z peterszilagyi $
19
19
*/
20
20
 
21
21
#include <config.h>
67
67
 
68
68
extern GtkWidget * main_window;
69
69
extern GtkWidget * playlist_window;
70
 
extern GtkWidget * play_button;
 
70
extern GtkWidget * playlist_color_indicator;
71
71
extern GtkTooltips * aqualung_tooltips;
72
72
 
73
73
extern PangoFontDescription *fd_playlist;
78
78
extern PangoFontDescription *fd_songinfo;
79
79
extern PangoFontDescription *fd_statusbar;
80
80
 
81
 
extern GtkWidget * bigtimer_label;
82
 
extern GtkWidget * smalltimer_label_1;
83
 
extern GtkWidget * smalltimer_label_2;
84
 
 
85
 
extern GtkWidget * label_title;
86
 
extern GtkWidget * label_format;
87
 
extern GtkWidget * label_samplerate;
88
 
extern GtkWidget * label_bps;
89
 
extern GtkWidget * label_mono;
90
 
extern GtkWidget * label_output;
91
 
extern GtkWidget * label_src_type;
92
 
 
93
 
extern GtkWidget * statusbar_total;
94
 
extern GtkWidget * statusbar_total_label;
95
 
extern GtkWidget * statusbar_selected;
96
 
extern GtkWidget * statusbar_selected_label;
97
 
 
98
 
extern GtkWidget * statusbar_ms;
99
 
 
100
81
extern int music_store_changed;
101
82
 
102
83
extern GtkWidget * music_tree;
103
84
extern GtkTreeStore * music_store;
104
85
 
105
 
extern GtkWidget * play_list;
106
 
extern GtkTreeViewColumn * track_column;
107
 
extern GtkTreeViewColumn * rva_column;
108
 
extern GtkTreeViewColumn * length_column;
109
 
 
110
 
extern GtkListStore * play_store;
111
 
 
112
86
extern GtkWidget* gui_stock_label_button(gchar *blabel, const gchar *bstock);
113
 
extern void disable_bold_font_in_playlist(void);
114
 
extern void playlist_selection_changed(GtkTreeSelection * sel, gpointer data);
115
87
extern void set_buttons_relief(void);
116
 
extern void show_active_position_in_playlist(void);
117
88
 
118
89
int rva_is_enabled_shadow;
119
90
int rva_env_shadow;
123
94
int rva_use_linear_thresh_shadow;
124
95
float rva_avg_linear_thresh_shadow;
125
96
float rva_avg_stddev_thresh_shadow;
 
97
float rva_no_rva_voladj_shadow;
126
98
 
127
99
int appearance_changed;
128
100
int reskin_flag;
134
106
GtkWidget * notebook;
135
107
 
136
108
GtkWidget * entry_title;
 
109
GtkWidget * entry_title_no_album;
137
110
GtkWidget * entry_param;
138
111
GtkWidget * check_enable_tooltips;
139
112
GtkWidget * check_buttons_at_the_bottom;
148
121
GtkWidget * check_playlist_is_embedded;
149
122
GtkWidget * check_autoplsave;
150
123
GtkWidget * check_playlist_is_tree;
 
124
GtkWidget * check_playlist_always_show_tabs;
 
125
GtkWidget * check_show_close_button_in_tab;
151
126
GtkWidget * check_album_shuffle_mode;
152
127
GtkWidget * check_enable_playlist_statusbar;
153
128
GtkWidget * check_pl_statusbar_show_size;
189
164
GtkWidget * combo_threshold;
190
165
GtkWidget * spin_linthresh;
191
166
GtkWidget * spin_stdthresh;
 
167
GtkWidget * spin_defvol;
192
168
GtkObject * adj_refvol;
193
169
GtkObject * adj_steepness;
194
170
GtkObject * adj_linthresh;
195
171
GtkObject * adj_stdthresh;
 
172
GtkObject * adj_defvol;
196
173
GtkWidget * label_listening_env;
197
174
GtkWidget * label_refvol;
198
175
GtkWidget * label_steepness;
199
176
GtkWidget * label_threshold;
200
177
GtkWidget * label_linthresh;
201
178
GtkWidget * label_stdthresh;
 
179
GtkWidget * label_defvol;
202
180
 
203
181
GtkWidget * check_auto_use_meta_artist;
204
182
GtkWidget * check_auto_use_meta_record;
226
204
GtkWidget * cddb_email_entry;
227
205
GtkWidget * cddb_local_entry;
228
206
GtkWidget * cddb_local_check;
229
 
GtkWidget * cddb_radio_direct;
230
 
GtkWidget * cddb_radio_proxy;
231
207
GtkWidget * cddb_proto_combo;
232
 
GtkWidget * cddb_proxy_entry;
233
 
GtkWidget * cddb_proxy_port_spinner;
234
208
GtkWidget * cddb_label_proto;
235
 
GtkWidget * cddb_label_proxy;
236
 
GtkWidget * cddb_label_proxy_port;
237
209
#endif /* HAVE_CDDB */
238
210
 
 
211
GtkWidget * inet_radio_direct;
 
212
GtkWidget * inet_radio_proxy;
 
213
GtkWidget * inet_frame;
 
214
GtkWidget * inet_label_proxy;
 
215
GtkWidget * inet_entry_proxy;
 
216
GtkWidget * inet_label_proxy_port;
 
217
GtkWidget * inet_spinner_proxy_port;
 
218
GtkWidget * inet_label_noproxy_domains;
 
219
GtkWidget * inet_entry_noproxy_domains;
 
220
GtkWidget * inet_help_noproxy_domains;
 
221
GtkWidget * inet_spinner_timeout;
 
222
 
 
223
 
239
224
GtkWidget * check_override_skin;
240
225
 
241
226
#define DEFAULT_FONT_NAME "Sans 11"
267
252
void
268
253
open_font_desc(void) {
269
254
 
270
 
        if (fd_playlist) pango_font_description_free(fd_playlist);
 
255
        if (fd_playlist) {
 
256
                pango_font_description_free(fd_playlist);
 
257
        }
 
258
 
 
259
        if (fd_browser) {
 
260
                pango_font_description_free(fd_browser);
 
261
        }
 
262
 
 
263
        if (fd_bigtimer) {
 
264
                pango_font_description_free(fd_bigtimer);
 
265
        }
 
266
 
 
267
        if (fd_smalltimer) {
 
268
                pango_font_description_free(fd_smalltimer);
 
269
        }
 
270
 
 
271
        if (fd_songtitle) {
 
272
                pango_font_description_free(fd_songtitle);
 
273
        }
 
274
 
 
275
        if (fd_songinfo) {
 
276
                pango_font_description_free(fd_songinfo);
 
277
        }
 
278
 
 
279
        if (fd_statusbar) {
 
280
                pango_font_description_free(fd_statusbar);
 
281
        }
 
282
 
271
283
        fd_playlist = pango_font_description_from_string(options.playlist_font);
272
 
        if (fd_browser) pango_font_description_free(fd_browser);
273
284
        fd_browser = pango_font_description_from_string(options.browser_font);
274
 
        if (fd_bigtimer) pango_font_description_free(fd_bigtimer);
275
285
        fd_bigtimer = pango_font_description_from_string(options.bigtimer_font);
276
 
        if (fd_smalltimer) pango_font_description_free(fd_smalltimer);
277
286
        fd_smalltimer = pango_font_description_from_string(options.smalltimer_font);
278
 
        if (fd_songtitle) pango_font_description_free(fd_songtitle);
279
287
        fd_songtitle = pango_font_description_from_string(options.songtitle_font);
280
 
        if (fd_songinfo) pango_font_description_free(fd_songinfo);
281
288
        fd_songinfo = pango_font_description_from_string(options.songinfo_font);
282
 
        if (fd_statusbar) pango_font_description_free(fd_statusbar);
283
289
        fd_statusbar = pango_font_description_from_string(options.statusbar_font);
284
290
}
285
291
 
306
312
}
307
313
 
308
314
void
309
 
set_option_from_entry(GtkWidget * widget, char * opt) {
 
315
set_option_from_entry(GtkWidget * widget, char * opt, int n) {
310
316
 
311
 
        strncpy(opt, gtk_entry_get_text(GTK_ENTRY(widget)), MAXLEN-1);
 
317
        strncpy(opt, gtk_entry_get_text(GTK_ENTRY(widget)), n-1);
312
318
}
 
319
 
313
320
void
314
321
options_window_accept(void) {
315
322
 
316
323
        int i;
317
 
        int n;
318
 
        int n_prev = 3;
319
324
        GtkTreeIter iter;
320
325
        GtkTreeIter iter2;
321
326
 
328
333
        /* General */
329
334
 
330
335
        strncpy(options.title_format, gtk_entry_get_text(GTK_ENTRY(entry_title)), MAXLEN - 1);
 
336
        strncpy(options.title_format_no_album, gtk_entry_get_text(GTK_ENTRY(entry_title_no_album)), MAXLEN - 1);
331
337
        strncpy(options.default_param, gtk_entry_get_text(GTK_ENTRY(entry_param)), MAXLEN - 1);
332
338
 
333
339
        set_option_from_toggle(check_enable_tooltips, &options.enable_tooltips);
351
357
 
352
358
 
353
359
        /* Playlist */
354
 
 
355
360
        set_option_from_toggle(check_autoplsave, &options.auto_save_playlist);
356
361
        set_option_from_toggle(check_playlist_is_embedded, &options.playlist_is_embedded_shadow);
357
362
        set_option_from_toggle(check_playlist_is_tree, &options.playlist_is_tree);
358
 
        set_option_from_toggle(check_album_shuffle_mode, &options.album_shuffle_mode);
 
363
        set_option_from_toggle(check_playlist_always_show_tabs, &options.playlist_always_show_tabs);
 
364
 
 
365
        set_option_from_toggle(check_show_close_button_in_tab, &options.playlist_show_close_button_in_tab);
 
366
        playlist_show_hide_close_buttons(options.playlist_show_close_button_in_tab);
 
367
 
 
368
        set_option_from_toggle(check_album_shuffle_mode, &options.album_shuffle_mode);
359
369
        set_option_from_toggle(check_enable_playlist_statusbar, &options.enable_playlist_statusbar_shadow);
360
370
        set_option_from_toggle(check_pl_statusbar_show_size, &options.pl_statusbar_show_size);
361
371
        set_option_from_toggle(check_show_rva_in_playlist, &options.show_rva_in_playlist);
362
 
        gtk_tree_view_column_set_visible(GTK_TREE_VIEW_COLUMN(rva_column),
363
 
                                         options.show_rva_in_playlist);
364
372
        set_option_from_toggle(check_show_length_in_playlist, &options.show_length_in_playlist);
365
 
        gtk_tree_view_column_set_visible(GTK_TREE_VIEW_COLUMN(length_column),
366
 
                                         options.show_length_in_playlist);
367
373
        set_option_from_toggle(check_show_active_track_name_in_bold, &options.show_active_track_name_in_bold);
368
374
        if (!options.show_active_track_name_in_bold) {
369
 
                disable_bold_font_in_playlist();
 
375
                playlist_disable_bold_font();
370
376
        }
371
377
 
372
378
        set_option_from_toggle(check_enable_pl_rules_hint, &options.enable_pl_rules_hint);
373
 
        gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(play_list), options.enable_pl_rules_hint);
374
 
 
375
379
 
376
380
        /* Music Store */
377
381
 
402
406
        options.rva_use_linear_thresh = rva_use_linear_thresh_shadow;
403
407
        options.rva_avg_linear_thresh = rva_avg_linear_thresh_shadow;
404
408
        options.rva_avg_stddev_thresh = rva_avg_stddev_thresh_shadow;
 
409
        options.rva_no_rva_voladj = rva_no_rva_voladj_shadow;
405
410
 
406
411
 
407
412
        /* Metadata */
434
439
 
435
440
        /* CDDB */
436
441
#ifdef HAVE_CDDB
437
 
        set_option_from_entry(cddb_server_entry, options.cddb_server);
 
442
        set_option_from_entry(cddb_server_entry, options.cddb_server, MAXLEN);
438
443
        set_option_from_spin(cddb_tout_spinner, &options.cddb_timeout);
439
 
        set_option_from_entry(cddb_email_entry, options.cddb_email);
440
 
        set_option_from_entry(cddb_local_entry, options.cddb_local);
 
444
        set_option_from_entry(cddb_email_entry, options.cddb_email, MAXLEN);
 
445
        set_option_from_entry(cddb_local_entry, options.cddb_local, MAXLEN);
441
446
        set_option_from_toggle(cddb_local_check, &options.cddb_cache_only);
442
 
        set_option_from_toggle(cddb_radio_proxy, &options.cddb_use_proxy);
443
447
        set_option_from_combo(cddb_proto_combo, &options.cddb_use_http);
444
 
        set_option_from_entry(cddb_proxy_entry, options.cddb_proxy);
445
 
        set_option_from_spin(cddb_proxy_port_spinner, &options.cddb_proxy_port);
446
448
#endif /* HAVE_CDDB */
447
449
 
448
450
 
 
451
        /* Internet */
 
452
 
 
453
        set_option_from_toggle(inet_radio_proxy, &options.inet_use_proxy);
 
454
        set_option_from_entry(inet_entry_proxy, options.inet_proxy, MAXLEN);
 
455
        set_option_from_spin(inet_spinner_proxy_port, &options.inet_proxy_port);
 
456
        set_option_from_entry(inet_entry_noproxy_domains, options.inet_noproxy_domains, MAXLEN);
 
457
        set_option_from_spin(inet_spinner_timeout, &options.inet_timeout);
 
458
 
 
459
 
449
460
        /* Appearance */
450
461
 
451
462
        set_option_from_toggle(check_override_skin, &options.override_skin_settings);
452
 
 
 
463
        set_option_from_entry(entry_pl_font, options.playlist_font, MAX_FONTNAME_LEN);
 
464
        set_option_from_entry(entry_ms_font, options.browser_font, MAX_FONTNAME_LEN);
 
465
        set_option_from_entry(entry_bt_font, options.bigtimer_font, MAX_FONTNAME_LEN);
 
466
        set_option_from_entry(entry_st_font, options.smalltimer_font, MAX_FONTNAME_LEN);
 
467
        set_option_from_entry(entry_songt_font, options.songtitle_font, MAX_FONTNAME_LEN);
 
468
        set_option_from_entry(entry_si_font, options.songinfo_font, MAX_FONTNAME_LEN);
 
469
        set_option_from_entry(entry_sb_font, options.statusbar_font, MAX_FONTNAME_LEN);
453
470
 
454
471
        /* refresh GUI */
455
 
 
456
 
        for (i = 0; i < 3; i++) {
457
 
 
 
472
        {
 
473
                int i;
458
474
                GtkTreeIter iter;
459
 
                GtkTreeViewColumn * cols[4];
460
 
                char * pnumstr;
461
 
 
462
 
                cols[0] = track_column;
463
 
                cols[1] = rva_column;
464
 
                cols[2] = length_column;
465
 
                cols[3] = NULL;
466
 
 
467
 
                gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(plistcol_store), &iter, NULL, i);
468
 
                
469
 
                gtk_tree_model_get(GTK_TREE_MODEL(plistcol_store), &iter, 1, &pnumstr, -1);
470
 
                n = atoi(pnumstr);
471
 
                g_free(pnumstr);
472
 
 
473
 
                gtk_tree_view_move_column_after(GTK_TREE_VIEW(play_list),
474
 
                                                cols[n], cols[n_prev]);
475
 
 
476
 
                options.plcol_idx[i] = n;
477
 
                n_prev = n;
478
 
        }       
 
475
 
 
476
                for (i = 0; i < 3; i++) {
 
477
                        gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(plistcol_store),
 
478
                                                      &iter, NULL, i);
 
479
                        gtk_tree_model_get(GTK_TREE_MODEL(plistcol_store), &iter,
 
480
                                           1, options.plcol_idx + i, -1);
 
481
                }
 
482
                playlist_reorder_columns_all(options.plcol_idx);
 
483
        }
479
484
 
480
485
        if (!track_name_in_bold_shadow && options.show_active_track_name_in_bold == 1) {
481
486
                reskin_flag = 1;
485
490
        if (options.override_skin_settings) {
486
491
 
487
492
                /* apply fonts */
488
 
 
489
493
                open_font_desc();
490
 
 
491
 
                gtk_widget_modify_font (music_tree, fd_browser);
492
 
                gtk_widget_modify_font (play_list, fd_playlist);
493
 
 
494
 
                gtk_widget_modify_font (bigtimer_label, fd_bigtimer);
495
 
                gtk_widget_modify_font (smalltimer_label_1, fd_smalltimer);
496
 
                gtk_widget_modify_font (smalltimer_label_2, fd_smalltimer);
497
 
                gtk_widget_modify_font (label_title, fd_songtitle);
498
 
 
499
 
                gtk_widget_modify_font (label_format, fd_songinfo);
500
 
                gtk_widget_modify_font (label_samplerate, fd_songinfo);
501
 
                gtk_widget_modify_font (label_bps, fd_songinfo);
502
 
                gtk_widget_modify_font (label_mono, fd_songinfo);
503
 
                gtk_widget_modify_font (label_output, fd_songinfo);
504
 
                gtk_widget_modify_font (label_src_type, fd_songinfo);
505
 
 
506
 
                if (options.enable_playlist_statusbar) {
507
 
                        gtk_widget_modify_font (statusbar_total, fd_statusbar);
508
 
                        gtk_widget_modify_font (statusbar_total_label, fd_statusbar);
509
 
                        gtk_widget_modify_font (statusbar_selected, fd_statusbar);
510
 
                        gtk_widget_modify_font (statusbar_selected_label, fd_statusbar);
511
 
                }
512
 
                if (options.enable_mstore_statusbar) {
513
 
                        gtk_widget_modify_font (statusbar_ms, fd_statusbar);
514
 
                }
515
 
 
516
 
                set_playlist_color();
517
 
 
518
494
                if (appearance_changed) {
519
495
                        reskin_flag = 1;
520
496
                }
522
498
        } else if (override_shadow) {
523
499
                reskin_flag = 1;
524
500
                override_shadow = 0;
525
 
        } 
526
 
     
 
501
        }
527
502
 
528
503
 
529
504
#ifdef HAVE_CDDA
648
623
        refresh_displays();
649
624
        gtk_window_set_keep_above(GTK_WINDOW(main_window), options.main_window_always_on_top);
650
625
 
651
 
        playlist_content_changed();
652
 
        playlist_selection_changed(NULL, NULL);
653
626
        music_store_set_status_bar_info();
654
627
 
655
 
        current_notebook_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook));
656
 
 
657
 
        playlist_size_allocate(NULL, NULL);
658
 
        show_active_position_in_playlist();
659
 
 
660
 
        gtk_widget_destroy(options_window);
 
628
        playlist_size_allocate_all();
661
629
 
662
630
        save_config();
663
631
}
698
666
 
699
667
                gtk_widget_set_sensitive(check_rva_use_averaging, TRUE);
700
668
 
 
669
                gtk_widget_set_sensitive(spin_defvol, TRUE);
 
670
                gtk_widget_set_sensitive(label_defvol, TRUE);
 
671
 
701
672
                if (rva_use_averaging_shadow) {
702
673
                        gtk_widget_set_sensitive(combo_threshold, TRUE);
703
674
                        gtk_widget_set_sensitive(label_threshold, TRUE);
722
693
                gtk_widget_set_sensitive(label_linthresh, FALSE);
723
694
                gtk_widget_set_sensitive(spin_stdthresh, FALSE);
724
695
                gtk_widget_set_sensitive(label_stdthresh, FALSE);
 
696
                gtk_widget_set_sensitive(spin_defvol, FALSE);
 
697
                gtk_widget_set_sensitive(label_defvol, FALSE);
725
698
        }
726
699
 
727
700
        draw_rva_diagram();
784
757
void
785
758
draw_rva_diagram(void) {
786
759
 
787
 
        GdkGC * gc;
788
 
        GdkColor fg_color;
789
760
        int i;
790
761
        int width = rva_viewport->allocation.width - 4;
791
762
        int height = rva_viewport->allocation.height - 4;
796
767
        float volx, voly;
797
768
        int px1, py1, px2, py2;
798
769
 
 
770
#if (GTK_CHECK_VERSION(2,8,0))
 
771
 
 
772
        cairo_t *rva_cr = NULL;
 
773
 
 
774
 
 
775
        rva_cr = gdk_cairo_create (rva_drawing_area->window);
 
776
 
 
777
        if (rva_cr != NULL) {
 
778
 
 
779
                cairo_set_source_rgb (rva_cr, 0.0, 0.0, 0.0);
 
780
                cairo_paint (rva_cr);
 
781
 
 
782
                cairo_set_line_width (rva_cr, 1.0);
 
783
 
 
784
                if (rva_is_enabled_shadow) {
 
785
                        cairo_set_source_rgb (rva_cr, 10000 / 65536.0, 10000 / 65536.0, 10000 / 65536.0);
 
786
                } else {
 
787
                        cairo_set_source_rgb (rva_cr, 5000 / 65536.0, 5000 / 65536.0, 5000 / 65536.0);
 
788
                }
 
789
 
 
790
                cairo_set_antialias (rva_cr, CAIRO_ANTIALIAS_NONE);
 
791
 
 
792
                for (i = 0; i <= 24; i++) {
 
793
                        cairo_move_to (rva_cr, xoffs + i * dw, yoffs);
 
794
                        cairo_line_to (rva_cr, xoffs + i * dw, yoffs + 24 * dh);
 
795
                        cairo_move_to (rva_cr, xoffs, yoffs + i * dh);
 
796
                        cairo_line_to (rva_cr, xoffs + 24 * dw, yoffs + i * dh);
 
797
                }
 
798
                cairo_stroke (rva_cr);
 
799
 
 
800
                cairo_set_antialias (rva_cr, CAIRO_ANTIALIAS_DEFAULT);
 
801
 
 
802
                if (rva_is_enabled_shadow) {
 
803
                        cairo_set_source_rgb (rva_cr, 0.0, 0.0, 1.0);
 
804
                } else {
 
805
                        cairo_set_source_rgb (rva_cr, 0.0, 0.0, 30000 / 65536.0);
 
806
                }
 
807
 
 
808
                cairo_move_to (rva_cr, xoffs, yoffs + 24 * dh);
 
809
                cairo_line_to (rva_cr, xoffs + 24 * dw, yoffs);
 
810
                cairo_stroke (rva_cr);
 
811
 
 
812
                if (rva_is_enabled_shadow) {
 
813
                        cairo_set_source_rgb (rva_cr, 1.0, 0.0, 0.0);
 
814
                } else {
 
815
                        cairo_set_source_rgb (rva_cr, 30000 / 65536.0, 0.0, 0.0);
 
816
                }
 
817
 
 
818
                volx = -24.0f;
 
819
                voly = volx + (volx - rva_refvol_shadow) * (rva_steepness_shadow - 1.0f);
 
820
                px1 = xoffs;
 
821
                py1 = yoffs - (voly * dh);
 
822
 
 
823
                volx = 0.0f;
 
824
                voly = volx + (volx - rva_refvol_shadow) * (rva_steepness_shadow - 1.0f);
 
825
                px2 = xoffs + 24*dw;
 
826
                py2 = yoffs - (voly * dh);
 
827
 
 
828
                cairo_move_to (rva_cr, px1, py1);
 
829
                cairo_line_to (rva_cr, px2, py2);
 
830
                cairo_stroke (rva_cr);
 
831
 
 
832
                cairo_destroy (rva_cr);
 
833
        }
 
834
#else
 
835
 
 
836
        GdkGC * gc;
 
837
        GdkColor fg_color;
 
838
 
799
839
 
800
840
        gdk_draw_rectangle(rva_pixmap,
801
841
                           rva_drawing_area->style->black_gc,
820
860
                gdk_draw_line(rva_pixmap, gc,
821
861
                              xoffs + i * dw, yoffs,
822
862
                              xoffs + i * dw, yoffs + 24 * dh);
823
 
        }
824
 
 
825
 
        for (i = 0; i <= 24; i++) {
826
 
                gdk_draw_line(rva_pixmap, gc,
 
863
                gdk_draw_line(rva_pixmap, gc,
827
864
                              xoffs, yoffs + i * dh,
828
865
                              xoffs + 24 * dw, yoffs + i * dh);
829
866
        }
871
908
                        width, height);
872
909
 
873
910
        g_object_unref(gc);
 
911
 
 
912
#endif /* GTK_CHECK_VERSION */
874
913
}
875
914
 
876
915
 
893
932
static gint
894
933
rva_configure_event(GtkWidget * widget, GdkEventConfigure * event) {
895
934
 
896
 
        if (rva_pixmap)
 
935
#if (!GTK_CHECK_VERSION(2,8,0))
 
936
 
 
937
        if (rva_pixmap)
897
938
                g_object_unref(rva_pixmap);
898
939
 
899
940
        rva_pixmap = gdk_pixmap_new(widget->window,
906
947
                           0, 0,
907
948
                           widget->allocation.width,
908
949
                           widget->allocation.height);
909
 
        draw_rva_diagram();
 
950
 
 
951
#endif /* GTK_CHECK_VERSION */
 
952
 
 
953
        draw_rva_diagram();
910
954
        return TRUE;
911
955
}
912
956
 
914
958
static gint
915
959
rva_expose_event(GtkWidget * widget, GdkEventExpose * event) {
916
960
 
 
961
#if (GTK_CHECK_VERSION(2,8,0))
 
962
 
 
963
        draw_rva_diagram();
 
964
 
 
965
#else
 
966
 
917
967
        gdk_draw_drawable(widget->window,
918
968
                        widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
919
969
                        rva_pixmap,
920
970
                        event->area.x, event->area.y,
921
971
                        event->area.x, event->area.y,
922
972
                        event->area.width, event->area.height);
 
973
 
 
974
#endif /* GTK_CHECK_VERSION */
 
975
 
923
976
        return FALSE;
924
977
}
925
978
 
946
999
}
947
1000
 
948
1001
void
 
1002
defvol_changed(GtkWidget * widget, gpointer * data) {
 
1003
 
 
1004
        rva_no_rva_voladj_shadow = gtk_adjustment_get_value(GTK_ADJUSTMENT(widget));
 
1005
}
 
1006
 
 
1007
void
949
1008
show_restart_info(void) {
950
1009
 
951
1010
        GtkWidget * info_dialog;
981
1040
}
982
1041
 
983
1042
void
984
 
playlist_font_select(GtkWidget *widget) {
 
1043
appearance_font_select(GtkWidget * widget, gpointer data) {
985
1044
 
986
1045
        gchar *s;
987
1046
        GtkWidget *font_selector;
997
1056
        if (response == GTK_RESPONSE_OK) {
998
1057
 
999
1058
                s = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(font_selector));
1000
 
                strncpy(options.playlist_font, s, MAX_FONTNAME_LEN);
1001
 
                gtk_entry_set_text(GTK_ENTRY(entry_pl_font), s);
1002
 
                g_free (s);
1003
 
 
1004
 
        }
1005
 
 
1006
 
        appearance_changed = 1;
1007
 
        gtk_widget_destroy (font_selector);
1008
 
}
1009
 
 
1010
 
void
1011
 
browser_font_select(GtkWidget *widget) {
1012
 
 
1013
 
        gchar *s;
1014
 
        GtkWidget *font_selector;
1015
 
        gint response;
1016
 
 
1017
 
        font_selector = gtk_font_selection_dialog_new ("Select a font...");
1018
 
        gtk_window_set_modal(GTK_WINDOW(font_selector), TRUE);
1019
 
        gtk_window_set_transient_for(GTK_WINDOW(font_selector), GTK_WINDOW(options_window));
1020
 
        gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG(font_selector), options.browser_font);
1021
 
        gtk_widget_show (font_selector);
1022
 
        response = aqualung_dialog_run (GTK_DIALOG (font_selector));
1023
 
 
1024
 
        if (response == GTK_RESPONSE_OK) {
1025
 
 
1026
 
                s = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(font_selector));
1027
 
                strncpy(options.browser_font, s, MAX_FONTNAME_LEN);
1028
 
                gtk_entry_set_text(GTK_ENTRY(entry_ms_font), s);
1029
 
                g_free (s);
1030
 
 
1031
 
        }
1032
 
 
1033
 
        appearance_changed = 1;
1034
 
        gtk_widget_destroy (font_selector);
1035
 
}
1036
 
 
1037
 
void
1038
 
bigtimer_font_select(GtkWidget *widget) {
1039
 
 
1040
 
        gchar *s;
1041
 
        GtkWidget *font_selector;
1042
 
        gint response;
1043
 
 
1044
 
        font_selector = gtk_font_selection_dialog_new ("Select a font...");
1045
 
        gtk_window_set_modal(GTK_WINDOW(font_selector), TRUE);
1046
 
        gtk_window_set_transient_for(GTK_WINDOW(font_selector), GTK_WINDOW(options_window));
1047
 
        gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG(font_selector), options.bigtimer_font);
1048
 
        gtk_widget_show (font_selector);
1049
 
        response = aqualung_dialog_run (GTK_DIALOG (font_selector));
1050
 
 
1051
 
        if (response == GTK_RESPONSE_OK) {
1052
 
 
1053
 
                s = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(font_selector));
1054
 
                strncpy(options.bigtimer_font, s, MAX_FONTNAME_LEN);
1055
 
                gtk_entry_set_text(GTK_ENTRY(entry_bt_font), s);
1056
 
                g_free (s);
1057
 
 
1058
 
        }
1059
 
 
1060
 
        appearance_changed = 1;
1061
 
        gtk_widget_destroy (font_selector);
1062
 
}
1063
 
 
1064
 
void
1065
 
smalltimer_font_select(GtkWidget *widget) {
1066
 
 
1067
 
        gchar *s;
1068
 
        GtkWidget *font_selector;
1069
 
        gint response;
1070
 
 
1071
 
        font_selector = gtk_font_selection_dialog_new ("Select a font...");
1072
 
        gtk_window_set_modal(GTK_WINDOW(font_selector), TRUE);
1073
 
        gtk_window_set_transient_for(GTK_WINDOW(font_selector), GTK_WINDOW(options_window));
1074
 
        gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG(font_selector), options.smalltimer_font);
1075
 
        gtk_widget_show (font_selector);
1076
 
        response = aqualung_dialog_run (GTK_DIALOG (font_selector));
1077
 
 
1078
 
        if (response == GTK_RESPONSE_OK) {
1079
 
 
1080
 
                s = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(font_selector));
1081
 
                strncpy(options.smalltimer_font, s, MAX_FONTNAME_LEN);
1082
 
                gtk_entry_set_text(GTK_ENTRY(entry_st_font), s);
1083
 
                g_free (s);
1084
 
 
1085
 
        }
1086
 
 
1087
 
        appearance_changed = 1;
1088
 
        gtk_widget_destroy (font_selector);
1089
 
}
1090
 
 
1091
 
void
1092
 
songtitle_font_select(GtkWidget *widget) {
1093
 
 
1094
 
        gchar *s;
1095
 
        GtkWidget *font_selector;
1096
 
        gint response;
1097
 
 
1098
 
        font_selector = gtk_font_selection_dialog_new ("Select a font...");
1099
 
        gtk_window_set_modal(GTK_WINDOW(font_selector), TRUE);
1100
 
        gtk_window_set_transient_for(GTK_WINDOW(font_selector), GTK_WINDOW(options_window));
1101
 
        gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG(font_selector), options.songtitle_font);
1102
 
        gtk_widget_show (font_selector);
1103
 
        response = aqualung_dialog_run (GTK_DIALOG (font_selector));
1104
 
 
1105
 
        if (response == GTK_RESPONSE_OK) {
1106
 
 
1107
 
                s = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(font_selector));
1108
 
                strncpy(options.songtitle_font, s, MAX_FONTNAME_LEN);
1109
 
                gtk_entry_set_text(GTK_ENTRY(entry_songt_font), s);
1110
 
                g_free (s);
1111
 
 
1112
 
        }
1113
 
 
1114
 
        appearance_changed = 1;
1115
 
        gtk_widget_destroy (font_selector);
1116
 
}
1117
 
 
1118
 
void
1119
 
songinfo_font_select(GtkWidget *widget) {
1120
 
 
1121
 
        gchar *s;
1122
 
        GtkWidget *font_selector;
1123
 
        gint response;
1124
 
 
1125
 
        font_selector = gtk_font_selection_dialog_new ("Select a font...");
1126
 
        gtk_window_set_modal(GTK_WINDOW(font_selector), TRUE);
1127
 
        gtk_window_set_transient_for(GTK_WINDOW(font_selector), GTK_WINDOW(options_window));
1128
 
        gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG(font_selector), options.songinfo_font);
1129
 
        gtk_widget_show (font_selector);
1130
 
        response = aqualung_dialog_run (GTK_DIALOG (font_selector));
1131
 
 
1132
 
        if (response == GTK_RESPONSE_OK) {
1133
 
 
1134
 
                s = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(font_selector));
1135
 
                strncpy(options.songinfo_font, s, MAX_FONTNAME_LEN);
1136
 
                gtk_entry_set_text(GTK_ENTRY(entry_si_font), s);
1137
 
                g_free (s);
1138
 
 
1139
 
        }
1140
 
 
1141
 
        appearance_changed = 1;
1142
 
        gtk_widget_destroy (font_selector);
1143
 
}
1144
 
 
1145
 
void
1146
 
statusbar_font_select(GtkWidget *widget) {
1147
 
 
1148
 
        gchar *s;
1149
 
        GtkWidget *font_selector;
1150
 
        gint response;
1151
 
 
1152
 
        font_selector = gtk_font_selection_dialog_new ("Select a font...");
1153
 
        gtk_window_set_modal(GTK_WINDOW(font_selector), TRUE);
1154
 
        gtk_window_set_transient_for(GTK_WINDOW(font_selector), GTK_WINDOW(options_window));
1155
 
        gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG(font_selector), options.statusbar_font);
1156
 
        gtk_widget_show (font_selector);
1157
 
        response = aqualung_dialog_run (GTK_DIALOG (font_selector));
1158
 
 
1159
 
        if (response == GTK_RESPONSE_OK) {
1160
 
 
1161
 
                s = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG(font_selector));
1162
 
                strncpy(options.statusbar_font, s, MAX_FONTNAME_LEN);
1163
 
                gtk_entry_set_text(GTK_ENTRY(entry_sb_font), s);
 
1059
                gtk_entry_set_text(GTK_ENTRY((GtkWidget *)data), s);
1164
1060
                g_free (s);
1165
1061
 
1166
1062
        }
1209
1105
        gboolean state;
1210
1106
        gint items, n;
1211
1107
        
1212
 
        if (options.override_skin_settings) {
1213
 
                state = TRUE;
1214
 
        } else {
1215
 
                state = FALSE;
1216
 
        }
 
1108
        state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_override_skin));
1217
1109
 
1218
1110
        items = sizeof(sensitive_table) / sizeof(GtkWidget*);
1219
1111
 
1225
1117
void
1226
1118
cb_toggle_override_skin(GtkToggleButton *togglebutton, gpointer user_data) {
1227
1119
 
1228
 
        options.override_skin_settings = options.override_skin_settings ? 0 : 1;
1229
1120
        appearance_changed = 1;
1230
1121
        set_sensitive_part();
1231
1122
}
1299
1190
 
1300
1191
 
1301
1192
void
 
1193
browse_ms_pathlist_clicked(GtkWidget * widget, gpointer data) {
 
1194
 
 
1195
        GtkWidget * dialog;
 
1196
        const gchar * selected_filename = gtk_entry_get_text(GTK_ENTRY(data));
 
1197
 
 
1198
 
 
1199
        dialog = gtk_file_chooser_dialog_new(_("Please select a Music Store database."),
 
1200
                                             GTK_WINDOW(options_window),
 
1201
                                             GTK_FILE_CHOOSER_ACTION_OPEN,
 
1202
                                             GTK_STOCK_APPLY, GTK_RESPONSE_ACCEPT,
 
1203
                                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 
1204
                                             NULL);
 
1205
 
 
1206
        gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT);
 
1207
        gtk_window_set_default_size(GTK_WINDOW(dialog), 580, 390);
 
1208
        gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
 
1209
 
 
1210
        if (strlen(selected_filename)) {
 
1211
                char * locale = g_locale_from_utf8(selected_filename, -1, NULL, NULL, NULL);
 
1212
                char tmp[MAXLEN];
 
1213
                tmp[0] = '\0';
 
1214
 
 
1215
                if (locale == NULL) {
 
1216
                        gtk_widget_destroy(dialog);
 
1217
                        return;
 
1218
                }
 
1219
 
 
1220
                normalize_filename(locale, tmp);
 
1221
                gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), tmp);
 
1222
                g_free(locale);
 
1223
        } else {
 
1224
                gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), options.currdir);
 
1225
        }
 
1226
 
 
1227
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_show_hidden))) {
 
1228
                gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
 
1229
        }
 
1230
 
 
1231
        if (aqualung_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
 
1232
 
 
1233
                char * utf8;
 
1234
 
 
1235
                selected_filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
 
1236
                utf8 = g_locale_to_utf8(selected_filename, -1, NULL, NULL, NULL);
 
1237
 
 
1238
                if (utf8 == NULL) {
 
1239
                        gtk_widget_destroy(dialog);
 
1240
                        return;
 
1241
                }
 
1242
 
 
1243
                gtk_entry_set_text(GTK_ENTRY(entry_ms_pathlist), utf8);
 
1244
 
 
1245
                strncpy(options.currdir, selected_filename, MAXLEN-1);
 
1246
                g_free(utf8);
 
1247
        }
 
1248
 
 
1249
        gtk_widget_destroy(dialog);
 
1250
}
 
1251
 
 
1252
 
 
1253
void
1302
1254
append_ms_pathlist(char * path, char * name) {
1303
1255
 
1304
1256
        GtkTreeIter iter;
1322
1274
 
1323
1275
        pname = gtk_entry_get_text(GTK_ENTRY(entry_ms_pathlist));
1324
1276
 
1325
 
        if (pname[0] == '\0') return;
 
1277
        if (pname[0] == '\0') {
 
1278
                browse_ms_pathlist_clicked(widget, entry_ms_pathlist);
 
1279
                return;
 
1280
        }
1326
1281
 
1327
1282
        if (pname[0] == '~') {
1328
1283
                snprintf(name, MAXLEN - 1, "%s%s", options.home, pname + 1);
1412
1367
 
1413
1368
 
1414
1369
void
1415
 
browse_ms_pathlist_clicked(GtkWidget * widget, gpointer data) {
1416
 
 
1417
 
        GtkWidget * dialog;
1418
 
        const gchar * selected_filename = gtk_entry_get_text(GTK_ENTRY(data));
1419
 
 
1420
 
 
1421
 
        dialog = gtk_file_chooser_dialog_new(_("Please select a Music Store database."),
1422
 
                                             GTK_WINDOW(options_window),
1423
 
                                             GTK_FILE_CHOOSER_ACTION_OPEN,
1424
 
                                             GTK_STOCK_APPLY, GTK_RESPONSE_ACCEPT,
1425
 
                                             GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
1426
 
                                             NULL);
1427
 
 
1428
 
        gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT);
1429
 
        gtk_window_set_default_size(GTK_WINDOW(dialog), 580, 390);
1430
 
        gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
1431
 
 
1432
 
        if (strlen(selected_filename)) {
1433
 
                char * locale = g_locale_from_utf8(selected_filename, -1, NULL, NULL, NULL);
1434
 
                char tmp[MAXLEN];
1435
 
                tmp[0] = '\0';
1436
 
 
1437
 
                if (locale == NULL) {
1438
 
                        gtk_widget_destroy(dialog);
1439
 
                        return;
1440
 
                }
1441
 
 
1442
 
                normalize_filename(locale, tmp);
1443
 
                gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), tmp);
1444
 
                g_free(locale);
1445
 
        } else {
1446
 
                gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), options.currdir);
1447
 
        }
1448
 
 
1449
 
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_show_hidden))) {
1450
 
                gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
1451
 
        }
1452
 
 
1453
 
        if (aqualung_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
1454
 
 
1455
 
                char * utf8;
1456
 
 
1457
 
                selected_filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
1458
 
                utf8 = g_locale_to_utf8(selected_filename, -1, NULL, NULL, NULL);
1459
 
 
1460
 
                if (utf8 == NULL) {
1461
 
                        gtk_widget_destroy(dialog);
1462
 
                        return;
1463
 
                }
1464
 
 
1465
 
                gtk_entry_set_text(GTK_ENTRY(entry_ms_pathlist), utf8);
1466
 
 
1467
 
                strncpy(options.currdir, selected_filename, MAXLEN-1);
1468
 
                g_free(utf8);
1469
 
        }
1470
 
 
1471
 
        gtk_widget_destroy(dialog);
1472
 
}
1473
 
 
1474
 
 
1475
 
void
1476
1370
display_title_format_help(void) {
1477
1371
 
1478
1372
        GtkWidget *help_dialog;
1494
1388
 
1495
1389
 
1496
1390
void
 
1391
display_title_format_no_album_help(void) {
 
1392
 
 
1393
        GtkWidget *help_dialog;
 
1394
 
 
1395
        help_dialog = gtk_message_dialog_new (GTK_WINDOW(options_window), 
 
1396
                                              GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
 
1397
                                              GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, 
 
1398
                                              _("\nThe template string you enter here will be used to\n"
 
1399
                                              "construct a single title line from an Artist and a Track\n"
 
1400
                                              "name. These are denoted by %%a and %%t, respectively.\n"
 
1401
                                              "Everything else you enter here will be literally\n"
 
1402
                                              "copied into the resulting string.\n"));
 
1403
 
 
1404
        gtk_window_set_title(GTK_WINDOW(help_dialog), _("Help"));
 
1405
        gtk_widget_show (help_dialog);
 
1406
        aqualung_dialog_run(GTK_DIALOG(help_dialog));
 
1407
        gtk_widget_destroy(help_dialog);
 
1408
}
 
1409
 
 
1410
 
 
1411
void
1497
1412
display_implict_command_line_help(void) {
1498
1413
 
1499
1414
        GtkWidget *help_dialog;
1591
1506
#endif /* HAVE_CDDA */
1592
1507
 
1593
1508
 
1594
 
#ifdef HAVE_CDDB
1595
 
void
1596
 
cddb_radio_direct_toggled(GtkWidget * widget, gpointer * data) {
1597
 
 
1598
 
        gboolean state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cddb_radio_direct));
1599
 
 
1600
 
        gtk_widget_set_sensitive(cddb_proto_combo, state);
1601
 
        gtk_widget_set_sensitive(cddb_label_proto, state);
1602
 
        gtk_widget_set_sensitive(cddb_proxy_entry, !state);
1603
 
        gtk_widget_set_sensitive(cddb_proxy_port_spinner, !state);
1604
 
        gtk_widget_set_sensitive(cddb_label_proxy, !state);
1605
 
        gtk_widget_set_sensitive(cddb_label_proxy_port, !state);
1606
 
}
1607
 
#endif /* HAVE_CDDB */
 
1509
void
 
1510
inet_radio_direct_toggled(GtkWidget * widget, gpointer * data) {
 
1511
 
 
1512
        gboolean state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(inet_radio_direct));
 
1513
 
 
1514
        gtk_widget_set_sensitive(inet_frame, !state);
 
1515
}
 
1516
 
 
1517
void
 
1518
display_inet_help_noproxy_domains(void) {
 
1519
 
 
1520
        GtkWidget *help_dialog;
 
1521
 
 
1522
        help_dialog = gtk_message_dialog_new (GTK_WINDOW(options_window), 
 
1523
                                              GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
 
1524
                                              GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
 
1525
                                              _("\nHere you should enter a comma-separated list of domains\n"
 
1526
                                                "that should be accessed without using the proxy set above.\n"
 
1527
                                                "Example: localhost, .localdomain, .my.domain.com"));
 
1528
 
 
1529
        gtk_window_set_title(GTK_WINDOW(help_dialog), _("Help"));
 
1530
        gtk_widget_show (help_dialog);
 
1531
        aqualung_dialog_run(GTK_DIALOG(help_dialog));
 
1532
        gtk_widget_destroy(help_dialog);
 
1533
}
1608
1534
 
1609
1535
void
1610
1536
create_options_window(void) {
1611
1537
 
 
1538
        int ret;
 
1539
 
1612
1540
        GtkWidget * vbox_general;
1613
1541
        GtkWidget * frame_title;
1614
1542
        GtkWidget * frame_param;
1615
1543
        GtkWidget * frame_misc;
1616
1544
        GtkWidget * frame_cart;
1617
 
        GtkWidget * hbox_title;
 
1545
        GtkWidget * table_title;
 
1546
        GtkWidget * label_title;
1618
1547
        GtkWidget * hbox_param;
1619
1548
        GtkWidget * vbox_misc;
1620
1549
        GtkWidget * vbox_cart;
1672
1601
        GtkWidget * table_cddb;
1673
1602
#endif /* HAVE_CDDB */
1674
1603
 
 
1604
        GtkWidget * vbox_inet;
 
1605
        GtkWidget * table_inet;
 
1606
        GtkWidget * inet_hbox_timeout;
 
1607
        GtkWidget * inet_label_timeout;
 
1608
 
1675
1609
        GtkSizeGroup * label_size;
1676
1610
 
1677
1611
        GtkWidget * hbox;
1723
1657
        frame_title = gtk_frame_new(_("Title format"));
1724
1658
        gtk_box_pack_start(GTK_BOX(vbox_general), frame_title, FALSE, TRUE, 0);
1725
1659
 
1726
 
        hbox_title = gtk_hbox_new(FALSE, 3);
1727
 
        gtk_container_set_border_width(GTK_CONTAINER(hbox_title), 5);
1728
 
        gtk_container_add(GTK_CONTAINER(frame_title), hbox_title);
 
1660
        table_title = gtk_table_new(8, 3, FALSE);
 
1661
        gtk_container_set_border_width(GTK_CONTAINER(table_title), 5);
 
1662
        gtk_container_add(GTK_CONTAINER(frame_title), table_title);
 
1663
 
 
1664
 
 
1665
        hbox = gtk_hbox_new(FALSE, 0);
 
1666
        label_title = gtk_label_new(_("Full:"));
 
1667
        gtk_box_pack_start(GTK_BOX(hbox), label_title, FALSE, FALSE, 0);
 
1668
        gtk_table_attach(GTK_TABLE(table_title), hbox, 0, 1, 0, 1,
 
1669
                         GTK_FILL, GTK_FILL, 5, 2);
1729
1670
 
1730
1671
        entry_title = gtk_entry_new();
1731
1672
        gtk_entry_set_max_length(GTK_ENTRY(entry_title), MAXLEN - 1);
1732
1673
        gtk_entry_set_text(GTK_ENTRY(entry_title), options.title_format);
1733
 
        gtk_box_pack_start(GTK_BOX(hbox_title), entry_title, TRUE, TRUE, 0);
 
1674
        gtk_table_attach(GTK_TABLE(table_title), entry_title, 1, 2, 0, 1,
 
1675
                         GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 5, 2);
1734
1676
 
1735
1677
        help_btn_title = gtk_button_new_from_stock (GTK_STOCK_HELP); 
1736
1678
        g_signal_connect(help_btn_title, "clicked", G_CALLBACK(display_title_format_help), NULL);
1737
 
        gtk_box_pack_start(GTK_BOX(hbox_title), help_btn_title, FALSE, FALSE, 0);
 
1679
        gtk_table_attach(GTK_TABLE(table_title), help_btn_title, 2, 3, 0, 1,
 
1680
                         GTK_FILL, GTK_FILL, 5, 2);
 
1681
 
 
1682
 
 
1683
        hbox = gtk_hbox_new(FALSE, 0);
 
1684
        label_title = gtk_label_new(_("No album:"));
 
1685
        gtk_box_pack_start(GTK_BOX(hbox), label_title, FALSE, FALSE, 0);
 
1686
        gtk_table_attach(GTK_TABLE(table_title), hbox, 0, 1, 1, 2,
 
1687
                         GTK_FILL, GTK_FILL, 5, 2);
 
1688
 
 
1689
        entry_title_no_album = gtk_entry_new();
 
1690
        gtk_entry_set_max_length(GTK_ENTRY(entry_title_no_album), MAXLEN - 1);
 
1691
        gtk_entry_set_text(GTK_ENTRY(entry_title_no_album), options.title_format_no_album);
 
1692
        gtk_table_attach(GTK_TABLE(table_title), entry_title_no_album, 1, 2, 1, 2,
 
1693
                         GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 5, 2);
 
1694
 
 
1695
        help_btn_title = gtk_button_new_from_stock (GTK_STOCK_HELP); 
 
1696
        g_signal_connect(help_btn_title, "clicked", G_CALLBACK(display_title_format_no_album_help), NULL);
 
1697
        gtk_table_attach(GTK_TABLE(table_title), help_btn_title, 2, 3, 1, 2,
 
1698
                         GTK_FILL, GTK_FILL, 5, 2);
 
1699
 
1738
1700
 
1739
1701
        frame_param = gtk_frame_new(_("Implicit command line"));
1740
1702
        gtk_box_pack_start(GTK_BOX(vbox_general), frame_param, FALSE, TRUE, 5);
1870
1832
        }
1871
1833
        gtk_box_pack_start(GTK_BOX(vbox_pl), check_playlist_is_tree, FALSE, TRUE, 0);
1872
1834
 
 
1835
        check_playlist_always_show_tabs =
 
1836
                gtk_check_button_new_with_label(_("Always show the tab bar"));
 
1837
        gtk_widget_set_name(check_playlist_always_show_tabs, "check_on_notebook");
 
1838
        if (options.playlist_always_show_tabs) {
 
1839
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_playlist_always_show_tabs), TRUE);
 
1840
        }
 
1841
        gtk_box_pack_start(GTK_BOX(vbox_pl), check_playlist_always_show_tabs, FALSE, TRUE, 0);
 
1842
 
 
1843
        check_show_close_button_in_tab =
 
1844
                gtk_check_button_new_with_label(_("Show close button in tab"));
 
1845
        gtk_widget_set_name(check_show_close_button_in_tab, "check_on_notebook");
 
1846
        if (options.playlist_show_close_button_in_tab) {
 
1847
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_show_close_button_in_tab), TRUE);
 
1848
        }
 
1849
        gtk_box_pack_start(GTK_BOX(vbox_pl), check_show_close_button_in_tab, FALSE, TRUE, 0);
 
1850
 
1873
1851
        check_album_shuffle_mode =
1874
1852
                gtk_check_button_new_with_label(_("When shuffling, records added in Album mode "
1875
1853
                                                  "are played in order"));
1944
1922
 
1945
1923
        plistcol_store = gtk_list_store_new(2,
1946
1924
                                            G_TYPE_STRING,   /* Column name */
1947
 
                                            G_TYPE_STRING);  /* Column index */
 
1925
                                            G_TYPE_INT);     /* Column index */
1948
1926
 
1949
1927
        plistcol_list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(plistcol_store));
1950
1928
        gtk_tree_view_set_enable_search(GTK_TREE_VIEW(plistcol_list), FALSE);
1966
1944
                case 0:
1967
1945
                        gtk_list_store_append(plistcol_store, &iter);
1968
1946
                        gtk_list_store_set(plistcol_store, &iter,
1969
 
                                           0, _("Track titles"), 1, "0", -1);
 
1947
                                           0, _("Track titles"), 1, 0, -1);
1970
1948
                        break;
1971
1949
                case 1:
1972
1950
                        gtk_list_store_append(plistcol_store, &iter);
1973
1951
                        gtk_list_store_set(plistcol_store, &iter,
1974
 
                                           0, _("RVA values"), 1, "1", -1);
 
1952
                                           0, _("RVA values"), 1, 1, -1);
1975
1953
                        break;
1976
1954
                case 2:
1977
1955
                        gtk_list_store_append(plistcol_store, &iter);
1978
1956
                        gtk_list_store_set(plistcol_store, &iter,
1979
 
                                           0, _("Track lengths"), 1, "2", -1);
 
1957
                                           0, _("Track lengths"), 1, 2, -1);
1980
1958
                        break;
1981
1959
                }
1982
1960
        }
2233
2211
        /* "Playback RVA" notebook page */
2234
2212
 
2235
2213
        vbox_rva = gtk_vbox_new(FALSE, 3);
2236
 
        gtk_container_set_border_width(GTK_CONTAINER(vbox_rva), 8);
 
2214
        gtk_container_set_border_width(GTK_CONTAINER(vbox_rva), 10);
2237
2215
        gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_rva, create_notebook_tab(_("Playback RVA"), "rva.png"));
2238
2216
 
2239
2217
        check_rva_is_enabled = gtk_check_button_new_with_label(_("Enable playback RVA"));
2318
2296
 
2319
2297
 
2320
2298
 
 
2299
        hbox = gtk_hbox_new(FALSE, 0);
 
2300
        label_defvol = gtk_label_new(_("RVA for Unmeasured Files [dB] :"));
 
2301
        gtk_box_pack_start(GTK_BOX(hbox), label_defvol, FALSE, FALSE, 0);
 
2302
        gtk_table_attach(GTK_TABLE(table_rva), hbox, 0, 1, 4, 5,
 
2303
                         GTK_FILL, GTK_FILL, 5, 2);
 
2304
 
 
2305
        rva_no_rva_voladj_shadow = options.rva_no_rva_voladj;
 
2306
        adj_defvol = gtk_adjustment_new(options.rva_no_rva_voladj, -10.0f, 10.0f, 0.1f, 1.0f, 0.0f);
 
2307
        spin_defvol = gtk_spin_button_new(GTK_ADJUSTMENT(adj_defvol), 0.1, 1);
 
2308
        gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spin_defvol), TRUE);
 
2309
        gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(spin_defvol), FALSE);
 
2310
        g_signal_connect(G_OBJECT(adj_defvol), "value_changed",
 
2311
                         G_CALLBACK(defvol_changed), NULL);
 
2312
        gtk_table_attach(GTK_TABLE(table_rva), spin_defvol, 1, 2, 4, 5,
 
2313
                         GTK_FILL, GTK_FILL, 5, 2);
 
2314
 
 
2315
 
 
2316
 
2321
2317
        check_rva_use_averaging =
2322
2318
            gtk_check_button_new_with_label(_("Apply averaged RVA to tracks of the same record"));
2323
2319
        gtk_widget_set_name(check_rva_use_averaging, "check_on_notebook");
2327
2323
        rva_use_averaging_shadow = options.rva_use_averaging;
2328
2324
        g_signal_connect(G_OBJECT(check_rva_use_averaging), "toggled",
2329
2325
                         G_CALLBACK(check_rva_use_averaging_toggled), NULL);
2330
 
        gtk_table_attach(GTK_TABLE(table_rva), check_rva_use_averaging, 0, 2, 4, 5,
 
2326
        gtk_table_attach(GTK_TABLE(table_rva), check_rva_use_averaging, 0, 2, 5, 6,
2331
2327
                         GTK_FILL, GTK_FILL, 5, 2);
2332
2328
 
2333
2329
        hbox = gtk_hbox_new(FALSE, 0);
2334
2330
        label_threshold = gtk_label_new(_("Drop statistical aberrations based on"));
2335
2331
        gtk_box_pack_start(GTK_BOX(hbox), label_threshold, FALSE, FALSE, 0);
2336
 
        gtk_table_attach(GTK_TABLE(table_rva), hbox, 0, 1, 5, 6,
 
2332
        gtk_table_attach(GTK_TABLE(table_rva), hbox, 0, 1, 6, 7,
2337
2333
                         GTK_FILL, GTK_FILL, 5, 2);
2338
2334
 
2339
2335
        combo_threshold = gtk_combo_box_new_text ();
2340
 
        gtk_table_attach(GTK_TABLE(table_rva), combo_threshold, 1, 2, 5, 6,
 
2336
        gtk_table_attach(GTK_TABLE(table_rva), combo_threshold, 1, 2, 6, 7,
2341
2337
                         GTK_FILL | GTK_EXPAND, GTK_FILL, 5, 2);
2342
2338
 
2343
2339
 
2351
2347
        hbox = gtk_hbox_new(FALSE, 0);
2352
2348
        label_linthresh = gtk_label_new(_("Linear threshold [dB] :"));
2353
2349
        gtk_box_pack_start(GTK_BOX(hbox), label_linthresh, FALSE, FALSE, 0);
2354
 
        gtk_table_attach(GTK_TABLE(table_rva), hbox, 0, 1, 6, 7,
 
2350
        gtk_table_attach(GTK_TABLE(table_rva), hbox, 0, 1, 7, 8,
2355
2351
                         GTK_FILL, GTK_FILL, 5, 2);
2356
2352
 
2357
2353
        rva_avg_linear_thresh_shadow = options.rva_avg_linear_thresh;
2361
2357
        gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(spin_linthresh), FALSE);
2362
2358
        g_signal_connect(G_OBJECT(adj_linthresh), "value_changed",
2363
2359
                         G_CALLBACK(linthresh_changed), NULL);
2364
 
        gtk_table_attach(GTK_TABLE(table_rva), spin_linthresh, 1, 2, 6, 7,
 
2360
        gtk_table_attach(GTK_TABLE(table_rva), spin_linthresh, 1, 2, 7, 8,
2365
2361
                         GTK_FILL, GTK_FILL, 5, 2);
2366
2362
 
2367
2363
        hbox = gtk_hbox_new(FALSE, 0);
2368
2364
        label_stdthresh = gtk_label_new(_("% of standard deviation :"));
2369
2365
        gtk_box_pack_start(GTK_BOX(hbox), label_stdthresh, FALSE, FALSE, 0);
2370
 
        gtk_table_attach(GTK_TABLE(table_rva), hbox, 0, 1, 7, 8,
 
2366
        gtk_table_attach(GTK_TABLE(table_rva), hbox, 0, 1, 8, 9,
2371
2367
                         GTK_FILL, GTK_FILL, 5, 2);
2372
2368
 
2373
2369
        rva_avg_stddev_thresh_shadow = options.rva_avg_stddev_thresh;
2378
2374
        gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(spin_stdthresh), FALSE);
2379
2375
        g_signal_connect(G_OBJECT(adj_stdthresh), "value_changed",
2380
2376
                         G_CALLBACK(stdthresh_changed), NULL);
2381
 
        gtk_table_attach(GTK_TABLE(table_rva), spin_stdthresh, 1, 2, 7, 8,
 
2377
        gtk_table_attach(GTK_TABLE(table_rva), spin_stdthresh, 1, 2, 8, 9,
2382
2378
                         GTK_FILL, GTK_FILL, 5, 2);
2383
2379
 
2384
 
 
2385
2380
        if (!rva_use_averaging_shadow) {
2386
2381
                gtk_widget_set_sensitive(combo_threshold, FALSE);
2387
2382
                gtk_widget_set_sensitive(label_threshold, FALSE);
2405
2400
                gtk_widget_set_sensitive(label_linthresh, FALSE);
2406
2401
                gtk_widget_set_sensitive(spin_stdthresh, FALSE);
2407
2402
                gtk_widget_set_sensitive(label_stdthresh, FALSE);
 
2403
                gtk_widget_set_sensitive(spin_defvol, FALSE);
 
2404
                gtk_widget_set_sensitive(label_defvol, FALSE);
2408
2405
        }
2409
2406
 
2410
2407
        /* "Metadata" notebook page */
2672
2669
        }
2673
2670
 
2674
2671
 
2675
 
        cddb_radio_direct = gtk_radio_button_new_with_label(NULL, _("Direct connection to CDDB server"));
2676
 
        gtk_widget_set_name(cddb_radio_direct, "check_on_notebook");
2677
 
        g_signal_connect(G_OBJECT(cddb_radio_direct), "toggled",
2678
 
                         G_CALLBACK(cddb_radio_direct_toggled), NULL);
2679
 
        gtk_table_attach(GTK_TABLE(table_cddb), cddb_radio_direct, 0, 2, 5, 6,
2680
 
                         GTK_FILL | GTK_EXPAND, GTK_FILL, 5, 3);
2681
 
 
2682
 
        cddb_label_proto = gtk_label_new(_("Protocol for querying:"));
 
2672
        cddb_label_proto = gtk_label_new(_("Protocol for querying (direct connection only):"));
2683
2673
        hbox = gtk_hbox_new(FALSE, 0);
2684
2674
        gtk_box_pack_start(GTK_BOX(hbox), cddb_label_proto, FALSE, FALSE, 0);
2685
 
        gtk_table_attach(GTK_TABLE(table_cddb), hbox, 0, 1, 6, 7,
2686
 
                         GTK_FILL, GTK_FILL, 35, 3);
 
2675
        gtk_table_attach(GTK_TABLE(table_cddb), hbox, 0, 1, 5, 6,
 
2676
                         GTK_FILL, GTK_FILL, 5, 3);
2687
2677
 
2688
2678
        cddb_proto_combo = gtk_combo_box_new_text();
2689
2679
        gtk_combo_box_append_text(GTK_COMBO_BOX(cddb_proto_combo), _("CDDBP (port 888)"));
2693
2683
        } else {
2694
2684
                gtk_combo_box_set_active(GTK_COMBO_BOX(cddb_proto_combo), 0);
2695
2685
        }
2696
 
        gtk_table_attach(GTK_TABLE(table_cddb), cddb_proto_combo, 1, 2, 6, 7,
2697
 
                         GTK_FILL | GTK_EXPAND, GTK_FILL, 5, 3);
2698
 
 
2699
 
        cddb_radio_proxy = gtk_radio_button_new_with_label_from_widget(
2700
 
                       GTK_RADIO_BUTTON(cddb_radio_direct), _("HTTP tunneling through proxy"));
2701
 
        gtk_widget_set_name(cddb_radio_proxy, "check_on_notebook");
2702
 
        gtk_table_attach(GTK_TABLE(table_cddb), cddb_radio_proxy, 0, 2, 7, 8,
2703
 
                         GTK_FILL | GTK_EXPAND, GTK_FILL, 5, 3);
2704
 
 
2705
 
        cddb_label_proxy = gtk_label_new(_("HTTP proxy:"));
2706
 
        hbox = gtk_hbox_new(FALSE, 0);
2707
 
        gtk_box_pack_start(GTK_BOX(hbox), cddb_label_proxy, FALSE, FALSE, 0);
2708
 
        gtk_table_attach(GTK_TABLE(table_cddb), hbox, 0, 1, 8, 9,
2709
 
                         GTK_FILL, GTK_FILL, 35, 3);
2710
 
 
2711
 
        cddb_proxy_entry = gtk_entry_new();
2712
 
        gtk_entry_set_text(GTK_ENTRY(cddb_proxy_entry), options.cddb_proxy);
2713
 
        gtk_table_attach(GTK_TABLE(table_cddb), cddb_proxy_entry, 1, 2, 8, 9,
2714
 
                         GTK_FILL | GTK_EXPAND, GTK_FILL, 5, 3);
2715
 
 
2716
 
        cddb_label_proxy_port = gtk_label_new(_("Port:"));
2717
 
        hbox = gtk_hbox_new(FALSE, 0);
2718
 
        gtk_box_pack_start(GTK_BOX(hbox), cddb_label_proxy_port, FALSE, FALSE, 0);
2719
 
        gtk_table_attach(GTK_TABLE(table_cddb), hbox, 0, 1, 9, 10,
2720
 
                         GTK_FILL, GTK_FILL, 35, 3);
2721
 
 
2722
 
        cddb_proxy_port_spinner = gtk_spin_button_new_with_range(0, 65535, 1);
2723
 
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(cddb_proxy_port_spinner), options.cddb_proxy_port);
2724
 
        gtk_table_attach(GTK_TABLE(table_cddb), cddb_proxy_port_spinner, 1, 2, 9, 10,
2725
 
                         GTK_FILL | GTK_EXPAND, GTK_FILL, 5, 3);
2726
 
 
2727
 
        if (options.cddb_use_proxy) {
2728
 
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cddb_radio_direct), TRUE);
2729
 
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cddb_radio_proxy), TRUE);
 
2686
        gtk_table_attach(GTK_TABLE(table_cddb), cddb_proto_combo, 1, 2, 5, 6,
 
2687
                         GTK_FILL | GTK_EXPAND, GTK_FILL, 5, 3);
 
2688
 
 
2689
#endif /* HAVE_CDDB */
 
2690
 
 
2691
        /* Internet notebook page */
 
2692
 
 
2693
        vbox_inet = gtk_vbox_new(FALSE, 3);
 
2694
        gtk_container_set_border_width(GTK_CONTAINER(vbox_inet), 8);
 
2695
        gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_inet, create_notebook_tab(_("Internet"), "inet.png"));
 
2696
 
 
2697
        inet_radio_direct = gtk_radio_button_new_with_label(NULL, _("Direct connection to the Internet"));
 
2698
        gtk_widget_set_name(inet_radio_direct, "check_on_notebook");
 
2699
        gtk_box_pack_start(GTK_BOX(vbox_inet), inet_radio_direct, FALSE, FALSE, 0);
 
2700
        g_signal_connect(G_OBJECT(inet_radio_direct), "toggled",
 
2701
                         G_CALLBACK(inet_radio_direct_toggled), NULL);
 
2702
 
 
2703
        inet_radio_proxy = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(inet_radio_direct),
 
2704
                                                                       _("Connect via HTTP proxy"));
 
2705
        gtk_widget_set_name(inet_radio_proxy, "check_on_notebook");
 
2706
        gtk_box_pack_start(GTK_BOX(vbox_inet), inet_radio_proxy, FALSE, FALSE, 0);
 
2707
 
 
2708
        inet_frame = gtk_frame_new(_("Proxy settings"));
 
2709
        gtk_box_pack_start(GTK_BOX(vbox_inet), inet_frame, FALSE, FALSE, 0);
 
2710
 
 
2711
        table_inet = gtk_table_new(2/*row*/, 4, FALSE);
 
2712
        gtk_container_set_border_width(GTK_CONTAINER(table_inet), 8);
 
2713
        gtk_container_add(GTK_CONTAINER(inet_frame), table_inet);
 
2714
 
 
2715
 
 
2716
        inet_label_proxy = gtk_label_new(_("Proxy host:"));
 
2717
        hbox = gtk_hbox_new(FALSE, 0);
 
2718
        gtk_box_pack_start(GTK_BOX(hbox), inet_label_proxy, FALSE, FALSE, 0);
 
2719
        gtk_table_attach(GTK_TABLE(table_inet), hbox, 0, 1, 0, 1,
 
2720
                         GTK_FILL, GTK_FILL, 5, 3);
 
2721
 
 
2722
        inet_entry_proxy = gtk_entry_new();
 
2723
        gtk_entry_set_text(GTK_ENTRY(inet_entry_proxy), options.inet_proxy);
 
2724
        gtk_table_attach(GTK_TABLE(table_inet), inet_entry_proxy, 1, 2, 0, 1,
 
2725
                         GTK_FILL | GTK_EXPAND, GTK_FILL, 5, 3);
 
2726
 
 
2727
        inet_label_proxy_port = gtk_label_new(_("Port:"));
 
2728
        hbox = gtk_hbox_new(FALSE, 0);
 
2729
        gtk_box_pack_start(GTK_BOX(hbox), inet_label_proxy_port, FALSE, FALSE, 0);
 
2730
        gtk_table_attach(GTK_TABLE(table_inet), hbox, 2, 3, 0, 1,
 
2731
                         GTK_FILL, GTK_FILL, 5, 3);
 
2732
 
 
2733
        inet_spinner_proxy_port = gtk_spin_button_new_with_range(0, 65535, 1);
 
2734
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(inet_spinner_proxy_port), options.inet_proxy_port);
 
2735
        gtk_table_attach(GTK_TABLE(table_inet), inet_spinner_proxy_port, 3, 4, 0, 1,
 
2736
                         GTK_FILL, GTK_FILL, 5, 3);
 
2737
 
 
2738
        inet_label_noproxy_domains = gtk_label_new(_("No proxy for:"));
 
2739
        hbox = gtk_hbox_new(FALSE, 0);
 
2740
        gtk_box_pack_start(GTK_BOX(hbox), inet_label_noproxy_domains, FALSE, FALSE, 0);
 
2741
        gtk_table_attach(GTK_TABLE(table_inet), hbox, 0, 1, 1, 2,
 
2742
                         GTK_FILL, GTK_FILL, 5, 3);
 
2743
 
 
2744
        inet_entry_noproxy_domains = gtk_entry_new();
 
2745
        gtk_entry_set_text(GTK_ENTRY(inet_entry_noproxy_domains), options.inet_noproxy_domains);
 
2746
        gtk_table_attach(GTK_TABLE(table_inet), inet_entry_noproxy_domains, 1, 3, 1, 2,
 
2747
                         GTK_FILL | GTK_EXPAND, GTK_FILL, 5, 3);
 
2748
 
 
2749
        inet_help_noproxy_domains = gtk_button_new_from_stock(GTK_STOCK_HELP); 
 
2750
        g_signal_connect(inet_help_noproxy_domains, "clicked", G_CALLBACK(display_inet_help_noproxy_domains), NULL);
 
2751
        gtk_table_attach(GTK_TABLE(table_inet), inet_help_noproxy_domains, 3, 4, 1, 2, GTK_FILL, GTK_FILL, 5, 3);
 
2752
 
 
2753
 
 
2754
        inet_hbox_timeout = gtk_hbox_new(FALSE, 0);
 
2755
        gtk_box_pack_start(GTK_BOX(vbox_inet), inet_hbox_timeout, FALSE, FALSE, 5);
 
2756
 
 
2757
        inet_label_timeout = gtk_label_new(_("Timeout for socket I/O:"));
 
2758
        hbox = gtk_hbox_new(FALSE, 0);
 
2759
        gtk_box_pack_start(GTK_BOX(hbox), inet_label_timeout, FALSE, FALSE, 0);
 
2760
        gtk_box_pack_start(GTK_BOX(inet_hbox_timeout), hbox, FALSE, FALSE, 5);
 
2761
 
 
2762
        inet_spinner_timeout = gtk_spin_button_new_with_range(1, 300, 1);
 
2763
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(inet_spinner_timeout), options.inet_timeout);
 
2764
        gtk_box_pack_start(GTK_BOX(inet_hbox_timeout), inet_spinner_timeout, FALSE, FALSE, 5);
 
2765
 
 
2766
        inet_label_timeout = gtk_label_new(_("seconds"));
 
2767
        hbox = gtk_hbox_new(FALSE, 0);
 
2768
        gtk_box_pack_start(GTK_BOX(hbox), inet_label_timeout, FALSE, FALSE, 0);
 
2769
        gtk_box_pack_start(GTK_BOX(inet_hbox_timeout), hbox, FALSE, FALSE, 5);
 
2770
 
 
2771
        if (options.inet_use_proxy) {
 
2772
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(inet_radio_direct), FALSE);
 
2773
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(inet_radio_proxy), TRUE);
2730
2774
        } else {
2731
 
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cddb_radio_proxy), TRUE);
2732
 
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cddb_radio_direct), TRUE);
 
2775
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(inet_radio_direct), TRUE);
 
2776
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(inet_radio_proxy), FALSE);
 
2777
                gtk_widget_set_sensitive(inet_frame, FALSE);
2733
2778
        }
2734
2779
 
2735
 
#endif /* HAVE_CDDB */
2736
2780
 
2737
2781
        /* Appearance notebook page */
2738
2782
 
2785
2829
        button_pl_font =  gui_stock_label_button(_("Select"), GTK_STOCK_SELECT_FONT);
2786
2830
        gtk_box_pack_start(GTK_BOX(hbox), button_pl_font, FALSE, FALSE, 0);
2787
2831
        g_signal_connect (G_OBJECT (button_pl_font), "clicked",
2788
 
                                                G_CALLBACK (playlist_font_select), NULL);
 
2832
                          G_CALLBACK (appearance_font_select), entry_pl_font);
2789
2833
 
2790
2834
        /* music store font */
2791
2835
 
2816
2860
        button_ms_font = gui_stock_label_button(_("Select"), GTK_STOCK_SELECT_FONT);
2817
2861
        gtk_box_pack_start(GTK_BOX(hbox), button_ms_font, FALSE, FALSE, 0);
2818
2862
        g_signal_connect (G_OBJECT (button_ms_font), "clicked",
2819
 
                                                G_CALLBACK (browser_font_select), NULL);
 
2863
                          G_CALLBACK (appearance_font_select), entry_ms_font);
2820
2864
 
2821
2865
 
2822
2866
        /* big timer font */
2848
2892
        button_bt_font = gui_stock_label_button(_("Select"), GTK_STOCK_SELECT_FONT);
2849
2893
        gtk_box_pack_start(GTK_BOX(hbox), button_bt_font, FALSE, FALSE, 0);
2850
2894
        g_signal_connect (G_OBJECT (button_bt_font), "clicked",
2851
 
                                                G_CALLBACK (bigtimer_font_select), NULL);
 
2895
                          G_CALLBACK (appearance_font_select), entry_bt_font);
2852
2896
 
2853
2897
        /* small timer font */
2854
2898
 
2879
2923
        button_st_font = gui_stock_label_button(_("Select"), GTK_STOCK_SELECT_FONT);
2880
2924
        gtk_box_pack_start(GTK_BOX(hbox), button_st_font, FALSE, FALSE, 0);
2881
2925
        g_signal_connect (G_OBJECT (button_st_font), "clicked",
2882
 
                                                G_CALLBACK (smalltimer_font_select), NULL);
 
2926
                          G_CALLBACK (appearance_font_select), entry_st_font);
2883
2927
 
2884
2928
        /* song title font */
2885
2929
 
2910
2954
        button_songt_font = gui_stock_label_button(_("Select"), GTK_STOCK_SELECT_FONT);
2911
2955
        gtk_box_pack_start(GTK_BOX(hbox), button_songt_font, FALSE, FALSE, 0);
2912
2956
        g_signal_connect (G_OBJECT (button_songt_font), "clicked",
2913
 
                                                G_CALLBACK (songtitle_font_select), NULL);
 
2957
                          G_CALLBACK (appearance_font_select), entry_songt_font);
2914
2958
 
2915
2959
        /* song info font */
2916
2960
 
2941
2985
        button_si_font = gui_stock_label_button(_("Select"), GTK_STOCK_SELECT_FONT);
2942
2986
        gtk_box_pack_start(GTK_BOX(hbox), button_si_font, FALSE, FALSE, 0);
2943
2987
        g_signal_connect (G_OBJECT (button_si_font), "clicked",
2944
 
                                                G_CALLBACK (songinfo_font_select), NULL);
 
2988
                          G_CALLBACK (appearance_font_select), entry_si_font);
2945
2989
 
2946
2990
        /* statusbar font */
2947
2991
 
2972
3016
        button_sb_font = gui_stock_label_button(_("Select"), GTK_STOCK_SELECT_FONT);
2973
3017
        gtk_box_pack_start(GTK_BOX(hbox), button_sb_font, FALSE, FALSE, 0);
2974
3018
        g_signal_connect (G_OBJECT (button_sb_font), "clicked",
2975
 
                                                G_CALLBACK (statusbar_font_select), NULL);
 
3019
                          G_CALLBACK (appearance_font_select), entry_sb_font);
2976
3020
 
2977
3021
        /* colors */
2978
3022
 
2997
3041
        gtk_box_pack_start(GTK_BOX(hbox), hbox_s, TRUE, TRUE, 0);
2998
3042
 
2999
3043
        if (gdk_color_parse(options.activesong_color, &color) == FALSE) {
3000
 
 
3001
 
                color.red = play_list->style->fg[SELECTED].red; 
3002
 
                color.green = play_list->style->fg[SELECTED].green; 
3003
 
                color.blue = play_list->style->fg[SELECTED].blue; 
3004
 
                color.pixel = (gulong)((color.red & 0xff00)*256 + (color.green & 0xff00) + (color.blue & 0xff00)/256); 
 
3044
                color.red = playlist_color_indicator->style->fg[SELECTED].red; 
 
3045
                color.green = playlist_color_indicator->style->fg[SELECTED].green; 
 
3046
                color.blue = playlist_color_indicator->style->fg[SELECTED].blue; 
 
3047
                color.pixel = (gulong)((color.red & 0xff00)*256 + (color.green & 0xff00) + (color.blue & 0xff00)/256);
3005
3048
        }
3006
3049
 
3007
3050
        color_picker = gtk_color_button_new_with_color (&color);
3018
3061
        gtk_widget_show_all(options_window);
3019
3062
        gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), current_notebook_page);
3020
3063
 
3021
 
        if (aqualung_dialog_run(GTK_DIALOG(options_window)) == GTK_RESPONSE_ACCEPT) {
 
3064
        ret = aqualung_dialog_run(GTK_DIALOG(options_window));
 
3065
 
 
3066
        current_notebook_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook));
 
3067
 
 
3068
        if (ret == GTK_RESPONSE_ACCEPT) {
3022
3069
                options_window_accept();
 
3070
                gtk_widget_destroy(options_window);
3023
3071
 
3024
3072
                if (reskin_flag) {
3025
3073
                        change_skin(options.skin);
3084
3132
        SAVE_STR(currdir);
3085
3133
        SAVE_STR(default_param);
3086
3134
        SAVE_STR(title_format);
 
3135
        SAVE_STR(title_format_no_album);
3087
3136
        SAVE_STR(skin);
3088
3137
        SAVE_INT(src_type);
3089
3138
        SAVE_INT(ladspa_is_postfader);
3129
3178
        SAVE_INT(rva_use_linear_thresh);
3130
3179
        SAVE_FLOAT(rva_avg_linear_thresh);
3131
3180
        SAVE_FLOAT(rva_avg_stddev_thresh);
 
3181
        SAVE_FLOAT(rva_no_rva_voladj);
3132
3182
        SAVE_INT(main_pos_x);
3133
3183
        SAVE_INT(main_pos_y);
3134
3184
        SAVE_INT(main_size_x);
3153
3203
        SAVE_INT(playlist_on);
3154
3204
        SAVE_INT_SH(playlist_is_embedded);
3155
3205
        SAVE_INT(playlist_is_tree);
 
3206
        SAVE_INT(playlist_always_show_tabs);
 
3207
        SAVE_INT(playlist_show_close_button_in_tab);
3156
3208
        SAVE_INT(album_shuffle_mode);
3157
3209
        SAVE_INT_SH(enable_playlist_statusbar);
3158
3210
        SAVE_FONT(browser_font);
3186
3238
        SAVE_STR(cddb_local);
3187
3239
        SAVE_INT(cddb_cache_only);
3188
3240
        SAVE_INT(cddb_use_http);
3189
 
        SAVE_INT(cddb_use_proxy);
3190
 
        SAVE_STR(cddb_proxy);
3191
 
        SAVE_INT(cddb_proxy_port);
 
3241
        SAVE_INT(inet_use_proxy);
 
3242
        SAVE_STR(inet_proxy);
 
3243
        SAVE_INT(inet_proxy_port);
 
3244
        SAVE_STR(inet_noproxy_domains);
 
3245
        SAVE_INT(inet_timeout);
3192
3246
        SAVE_FLOAT(loop_range_start);
3193
3247
        SAVE_FLOAT(loop_range_end);
3194
3248
 
3357
3411
        options.skin[0] = '\0';
3358
3412
 
3359
3413
        options.default_param[0] = '\0';
3360
 
        options.title_format[0] = '\0';
 
3414
        strcpy(options.title_format, "%a: %t [%r]");
 
3415
        strcpy(options.title_format_no_album, "%a: %t");
3361
3416
        options.enable_tooltips = 1;
3362
3417
        options.show_sn_title = 1;
3363
3418
        options.united_minimization = 1;
3364
3419
        options.buttons_at_the_bottom = options.buttons_at_the_bottom_shadow = 0;
3365
3420
        options.playlist_is_embedded = options.playlist_is_embedded_shadow = 1;
3366
3421
        options.playlist_is_tree = 1;
 
3422
        options.playlist_show_close_button_in_tab = 1;
3367
3423
 
3368
3424
        options.enable_mstore_statusbar = options.enable_mstore_statusbar_shadow = 1;
3369
3425
        options.enable_mstore_toolbar = options.enable_mstore_toolbar_shadow = 1;
3398
3454
        options.cddb_server[0] = '\0';
3399
3455
        options.cddb_email[0] = '\0';
3400
3456
        options.cddb_local[0] = '\0';
3401
 
        options.cddb_proxy[0] = '\0';
3402
3457
        options.cddb_timeout = 10;
3403
3458
 
 
3459
        options.inet_use_proxy = 0;
 
3460
        options.inet_proxy[0] = '\0';
 
3461
        options.inet_proxy_port = 8080;
 
3462
        options.inet_noproxy_domains[0] = '\0';
 
3463
        options.inet_timeout = 5;
 
3464
 
3404
3465
        options.time_idx[0] = 0;
3405
3466
        options.time_idx[1] = 1;
3406
3467
        options.time_idx[2] = 2;
3419
3480
                LOAD_STR(currdir);
3420
3481
                LOAD_STR(default_param);
3421
3482
                LOAD_STR(title_format);
 
3483
                LOAD_STR(title_format_no_album);
3422
3484
                LOAD_STR(skin);
3423
3485
 
3424
3486
                if (!src_type_parsed) {
3468
3530
                LOAD_INT(rva_use_linear_thresh);
3469
3531
                LOAD_FLOAT(rva_avg_linear_thresh);
3470
3532
                LOAD_FLOAT(rva_avg_stddev_thresh);
 
3533
                LOAD_FLOAT(rva_no_rva_voladj);
3471
3534
                LOAD_INT(main_pos_x);
3472
3535
                LOAD_INT(main_pos_y);
3473
3536
                LOAD_INT(main_size_x);
3485
3548
                LOAD_INT(playlist_on);
3486
3549
                LOAD_INT_SH(playlist_is_embedded);
3487
3550
                LOAD_INT(playlist_is_tree);
 
3551
                LOAD_INT(playlist_always_show_tabs);
 
3552
                LOAD_INT(playlist_show_close_button_in_tab);
3488
3553
                LOAD_INT(album_shuffle_mode);
3489
3554
                LOAD_INT_SH(enable_playlist_statusbar);
3490
3555
                LOAD_FONT(browser_font);
3518
3583
                LOAD_STR(cddb_local);
3519
3584
                LOAD_INT(cddb_cache_only);
3520
3585
                LOAD_INT(cddb_use_http);
3521
 
                LOAD_STR(cddb_proxy);
3522
 
                LOAD_INT(cddb_proxy_port);
3523
 
                LOAD_INT(cddb_use_proxy);
 
3586
                LOAD_INT(inet_use_proxy);
 
3587
                LOAD_STR(inet_proxy);
 
3588
                LOAD_INT(inet_proxy_port);
 
3589
                LOAD_STR(inet_noproxy_domains);
 
3590
                LOAD_INT(inet_timeout);
3524
3591
                LOAD_FLOAT(loop_range_start);
3525
3592
                LOAD_FLOAT(loop_range_end);
3526
3593