340
361
vbox_general = gtk.VBox(False, 2)
341
362
vbox_general.set_border_width(12)
343
365
vbox_general.pack_start(self.get_title_label(_("General")), False, False)
366
vbox_general.pack_start(self.make_check_box(_("Show current playing media in window title"), "setting", "update_title"), False, False)
368
vbox_general.pack_start(self.get_title_label(_("Systray")), False, False)
369
vbox_general.pack_start(self.make_check_box(_("Enable trayicon"), "setting", "use_trayicon"), False, False)
344
370
vbox_general.pack_start(self.make_check_box(_("Minimized on startup"), "setting", "start_trayicon"), False, False)
345
vbox_general.pack_start(self.make_check_box(_("Play lastest played song on startup"), "player", "play_on_startup"), False, False)
346
vbox_general.pack_start(self.make_check_box(_("Enable trayicon"), "setting", "use_trayicon"), False, False)
347
371
vbox_general.pack_start(self.make_check_box(_("Close to systray"), "setting", "fermer_trayicon"), False, False)
348
vbox_general.pack_start(self.make_check_box(_("Show current playing media in window title"), "setting", "update_title"), False, False)
350
vbox_general.pack_start(self.get_title_label(_("Now playing")), False, False)
351
vbox_general.pack_start(self.make_check_box(_("Playlist on the right (need restart)"), "window", "right_layout"), False, False)
352
vbox_general.pack_start(self.make_check_box(_("Enqueue as default action"), "player", "click_enqueue"), False, False)
353
vbox_general.pack_start(self.make_check_box(_("Play/Enqueue whole album as default action"), "player", "queuewholealbum"), False, False)
354
vbox_general.pack_start(self.make_check_box(_("Compact mode"), "setting", "compact_playlist"), False, False)
355
vbox_general.pack_start(self.make_check_box(_("Color by album"), "setting", "dynamic_playlist_color"), False, False)
356
vbox_general.pack_start(self.make_check_box(_("Don't clear when play a new song"), "player", "enqueue"), False, False)
357
vbox_general.pack_start(self.make_check_box(_("Play a random file when it is empty"), "setting", "empty_random"), False, False)
358
#vbox_general.pack_start(self.make_gst_select_output(), False, False)
360
vbox_general.pack_start(self.get_title_label(_("Crossfade")), False, False)
361
vbox_general.pack_start(self.make_check_box(_("Enable crossfade"), "player", "crossfade"), False, False)
362
vbox_general.pack_start(self.make_check_box(_("Gapless instead of crossfade between track of same album"), "player", "crossfade_gapless_album"), False, False)
364
crossfade = float(config.get("player", "crossfade_time"))
368
if crossfade > 50: config.set("player", "crossfade_time", "3.5")
370
vbox_general.pack_start(self.make_bar("player", "crossfade_time", 0, 10, 1.0), False, False)
373
#vbox_general.pack_start(self.get_title_label(_("Wikipedia & lyrics fonts and colors")),False,False)
372
vbox_general.pack_start(self.get_title_label(_("Browser view")), False, False)
375
(_('Artist and album'), 0),
376
(_('Genre and artist'), 1),
377
(_('Genre, artist and album'), 2),
379
vbox_general.pack_start(self.make_radio_list("browser","view", listradio), False, False)
374
380
vbox_general.pack_start(self.get_title_label(_("Lyrics fonts and colors")), False, False)
375
382
font = gtk.FontButton(config.get("setting", "web_font"))
376
383
font.connect('font-set', self.font_set)
377
384
vbox_general.pack_start(font, False, False)
392
399
vbox_general.pack_start(box_color, False, False)
401
vbox_playback = gtk.VBox(False, 2)
402
vbox_playback.set_border_width(12)
403
vbox_playback.pack_start(self.get_title_label(_("Playback")), False, False)
404
vbox_playback.pack_start(self.make_check_box(_("Play lastest played song on startup"), "player", "play_on_startup"), False, False)
405
vbox_playback.pack_start(self.make_check_box(_("Enable crossfade"), "player", "crossfade"), False, False)
406
vbox_playback.pack_start(self.make_check_box(_("Gapless instead of crossfade between track of same album"), "player", "crossfade_gapless_album"), False, False)
408
crossfade = float(config.get("player", "crossfade_time"))
412
if crossfade > 50: config.set("player", "crossfade_time", "3.5")
414
vbox_playback.pack_start(self.make_bar("player", "crossfade_time", 0, 10, 1.0), False, False)
416
vbox_playback.pack_start(self.get_title_label(_("Now playing")), False, False)
417
vbox_playback.pack_start(self.make_check_box(_("Playlist on the right (need restart)"), "window", "right_layout"), False, False)
418
vbox_playback.pack_start(self.make_check_box(_("Enqueue as default action"), "player", "click_enqueue"), False, False)
419
vbox_playback.pack_start(self.make_check_box(_("Play/Enqueue whole album as default action"), "player", "queuewholealbum"), False, False)
420
vbox_playback.pack_start(self.make_check_box(_("Compact mode"), "setting", "compact_playlist"), False, False)
421
vbox_playback.pack_start(self.make_check_box(_("Color by album"), "setting", "dynamic_playlist_color"), False, False)
422
vbox_playback.pack_start(self.make_check_box(_("Don't clear when play a new song"), "player", "enqueue"), False, False)
423
vbox_playback.pack_start(self.make_check_box(_("Play a random file when it is empty"), "setting", "empty_random"), False, False)
395
426
vbox_audioscrobller = gtk.VBox(False, 6)
396
427
vbox_audioscrobller.set_border_width(12)
436
467
vbox_library.pack_start(self.make_check_box(_("Check my library for deleted files on startup"), "library", "startup_deleted"), False, False)
437
468
vbox_library.pack_start(self.make_check_box(_("Check my library for added/changed files on startup"), "library", "startup_added"), False, False)
439
vbox_podcast = gtk.VBox(False, 2)
440
vbox_podcast.set_border_width(12)
441
vbox_podcast.pack_start(self.get_title_label(_("Podcast behavior")), False, False)
442
vbox_podcast.pack_start(self.make_check_box(_("Refresh on startup"), "podcast", "startup"), False, False)
443
vbox_podcast.pack_start(self.make_number(_("Refresh every"), _("minute") + " " + _("( <= 1 to disable )"), "podcast", "time_refresh", 10), False, False)
444
vbox_podcast.pack_start(self.make_number(_("Download only"), _("lastest podcast"), "podcast", "nb_download", 1), False, False)
445
vbox_podcast.pack_start(self.get_title_label(_("Podcast directory")), False, False)
446
vbox_podcast.pack_start(self.make_file("podcast", "folder", "~/Podcasts"), False, False)
470
vbox_library.pack_start(self.get_title_label(_("Podcast behavior")), False, False)
471
vbox_library.pack_start(self.make_check_box(_("Refresh on startup"), "podcast", "startup"), False, False)
472
vbox_library.pack_start(self.make_number(_("Refresh every"), _("minute") + " " + _("( <= 1 to disable )"), "podcast", "time_refresh", 10), False, False)
473
vbox_library.pack_start(self.make_number(_("Download only"), _("lastest podcast"), "podcast", "nb_download", 1), False, False)
474
vbox_library.pack_start(self.get_title_label(_("Podcast directory")), False, False)
475
vbox_library.pack_start(self.make_file("podcast", "folder", "~/Podcasts"), False, False)
448
477
vbox_webservice = gtk.VBox(False, 2)
449
478
vbox_webservice.set_border_width(12)
450
479
vbox_webservice.pack_start(self.get_title_label(_("Web service filter")), False, False)
451
vbox_webservice.pack_start(self.get_label(_("Skipped words for the web service queries")), False, False)
452
vbox_webservice.pack_start(self.make_list_edit("webservice", "filter", _("New filter"), _("Filter")), True, True)
480
#vbox_webservice.pack_start(self.get_label(_("Skipped words for the web queries")), False, False)
481
vbox_webservice.pack_start(self.make_list_edit("webservice", "filter", _("New filter"), _("Filter"), small=True), True, True)
455
484
vbox_wikipedia = gtk.VBox(False, 2)
456
485
vbox_wikipedia.set_border_width(12)
457
486
vbox_wikipedia.pack_start(self.get_title_label(_("Wikipedia language")), False, False)
458
vbox_wikipedia.pack_start(self.make_list_edit("wikipedia", "lang", _("language name"), _("Language")), True, True)
487
vbox_wikipedia.pack_start(self.make_list_edit("wikipedia", "lang", _("language name"), _("Language"), small=True), True, True)
489
hbox_web = gtk.HBox()
490
hbox_web.pack_start(vbox_webservice)
491
hbox_web.pack_start(vbox_wikipedia)
493
vbox_web = gtk.VBox()
494
vbox_web.pack_start(hbox_web)
495
vbox_web.pack_start(vbox_audioscrobller)
460
497
notebook = gtk.Notebook()
461
notebook.append_page(vbox_general, self.get_tab(_("General"), gtk.STOCK_PREFERENCES))
498
notebook.append_page(vbox_general, self.get_tab(_("View"), gtk.STOCK_PREFERENCES))
499
notebook.append_page(vbox_playback, self.get_tab(_("Playback"), gtk.STOCK_MEDIA_PLAY))
462
500
notebook.append_page(vbox_library, self.get_tab(_("Library"), gtk.STOCK_PREFERENCES))
463
notebook.append_page(vbox_podcast, self.get_tab(_("Podcast"), stock.PREF_PODCAST))
464
notebook.append_page(vbox_audioscrobller, self.get_tab(_("Audioscrobbler"), stock.PREF_LASTFM))
501
notebook.append_page(vbox_web, self.get_tab(_("Web service"), gtk.STOCK_NETWORK))
465
502
notebook.append_page(self.osd.PluginPreferences(), self.get_tab(_("OSD"), stock.PREF_OSD))
466
notebook.append_page(vbox_webservice, self.get_tab(_("Web service"), gtk.STOCK_NETWORK))
467
notebook.append_page(vbox_wikipedia, self.get_tab(_("Wikipedia"), stock.PREF_WIKIPEDIA))
470
505
notebook.set_current_page(0)
492
527
def on_switch_page(self, notebook, page, page_num):
494
529
self.osd.pref_show_panel()
496
531
self.osd.pref_hide_panel()
498
def make_gst_select_output(self):
499
sink_plugins = odict()
500
plugs = gst.registry_get_default().get_plugin_list()
502
for elem_factory in gst.registry_get_default().get_feature_list_by_plugin(p.get_name()):
503
if isinstance(elem_factory, gst.ElementFactory):
504
if elem_factory.get_klass().rfind("Sink/Audio") != -1:
505
sink_plugins[elem_factory.get_name()] = elem_factory.get_longname()
507
return self.make_lmenu(_("Gstreamer output"), "setting", "player_output", sink_plugins, "gconfaudiosink")
509
533
def make_check_box(self, label, section, attribut):
510
534
check = gtk.CheckButton(label)
511
535
if config.get(section, attribut) == "true":