Esempio n. 1
0
def InitUsageConfig():
	config.usage = ConfigSubsection();
	config.usage.showdish = ConfigYesNo(default = True)
	config.usage.multibouquet = ConfigYesNo(default = True)
	config.usage.multiepg_ask_bouquet = ConfigYesNo(default = False)

	config.usage.quickzap_bouquet_change = ConfigYesNo(default = True)
	config.usage.e1like_radio_mode = ConfigYesNo(default = True)
	config.usage.infobar_timeout = ConfigSelection(default = "5", choices = [
		("0", _("no timeout")), ("1", "1 " + _("second")), ("2", "2 " + _("seconds")), ("3", "3 " + _("seconds")),
		("4", "4 " + _("seconds")), ("5", "5 " + _("seconds")), ("6", "6 " + _("seconds")), ("7", "7 " + _("seconds")),
		("8", "8 " + _("seconds")), ("9", "9 " + _("seconds")), ("10", "10 " + _("seconds"))])
	config.usage.show_infobar_on_zap = ConfigYesNo(default = True)
	config.usage.show_infobar_on_skip = ConfigYesNo(default = True)
	config.usage.show_infobar_on_event_change = ConfigYesNo(default = True)
	config.usage.hdd_standby = ConfigSelection(default = "1200", choices = [
		("0", _("no standby")), ("10", "10 " + _("seconds")), ("30", "30 " + _("seconds")),
		("60", "1 " + _("minute")), ("120", "2 " + _("minutes")),
		("300", "5 " + _("minutes")), ("600", "10 " + _("minutes")), ("1200", "20 " + _("minutes")),
		("1800", "30 " + _("minutes")), ("3600", "1 " + _("hour")), ("7200", "2 " + _("hours")),
		("14400", "4 " + _("hours")) ])
	config.usage.output_12V = ConfigSelection(default = "do not change", choices = [
		("do not change", _("do not change")), ("off", _("off")), ("on", _("on")) ])

	zero_button_choices = [ ("standard", _("standard")),
				("swap", _("swap PiP and main picture")),
				("swapstop", _("move PiP to main picture")),
				("stop", _("stop PiP")),
				("zap_focus", _("toggle zap focus")) ]
	config.usage.pip_zero_button = ConfigSelection(default = "swap", choices = zero_button_choices)
	config.usage.pip_zero_button_doubleclick = ConfigSelection(default = "zap_focus", choices = zero_button_choices)

	config.usage.default_path = ConfigText(default = resolveFilename(SCOPE_HDD))
	config.usage.timer_path = ConfigText(default = "<default>")
	config.usage.instantrec_path = ConfigText(default = "<default>")
	config.usage.timeshift_path = ConfigText(default = "/media/hdd/")
	config.usage.allowed_timeshift_paths = ConfigLocations(default = ["/media/hdd/"])
	config.usage.vdir_info_path = ConfigText(default = "<default>")
	config.usage.days_mark_as_new = ConfigInteger(default = 3, limits = (0, 31))
	config.usage.only_unseen_mark_as_new = ConfigYesNo(default = False)

	config.usage.on_movie_start = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("resume", _("Resume from last position")), ("beginning", _("Start from the beginning")) ])
	config.usage.on_movie_stop = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")) ])
	config.usage.on_movie_eof = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")), ("pause", _("Pause movie at end")), ("restart", _("Start from the beginning")), ("playnext", _("Start next media file")) ])

	config.usage.setup_level = ConfigSelection(default = "expert", choices = [
		("simple", _("Simple")),
		("intermediate", _("Intermediate")),
		("expert", _("Expert")) ])

	config.usage.on_long_powerpress = ConfigSelection(default = "show_menu", choices = [
		("show_menu", _("show shutdown menu")),
		("shutdown", _("immediate shutdown")),
		("standby", _("Standby")),
		("restart", _("Restart")),
		("restart_gui", _("Restart GUI")),
		("nothing", _("do nothing")) ] )
	
	config.usage.on_short_powerpress = ConfigSelection(default = "standby", choices = [
		("show_menu", _("show shutdown menu")),
		("shutdown", _("immediate shutdown")),
		("standby", _("Standby")),
		("restart", _("Restart")),
		("restart_gui", _("Restart GUI")),
		("nothing", _("do nothing")) ] )


	config.usage.alternatives_priority = ConfigSelection(default = "0", choices = [
		("0", "DVB-S/-C/-T"),
		("1", "DVB-S/-T/-C"),
		("2", "DVB-C/-S/-T"),
		("3", "DVB-C/-T/-S"),
		("4", "DVB-T/-C/-S"),
		("5", "DVB-T/-S/-C") ])

	nims = [ ("-1", _("auto")) ]
	for x in nimmanager.nim_slots:
		nims.append( (str(x.slot), x.getSlotName()) )
	config.usage.tuner_priority = ConfigSelection(default = "-1", choices = nims)

	config.usage.show_event_progress_in_servicelist = ConfigYesNo(default = False)

	config.usage.blinking_display_clock_during_recording = ConfigYesNo(default = False)

	config.usage.show_message_when_recording_starts = ConfigYesNo(default = True)

	config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(default = True)
	
	def TunerTypePriorityOrderChanged(configElement):
		setTunerTypePriorityOrder(int(configElement.value))
	config.usage.alternatives_priority.addNotifier(TunerTypePriorityOrderChanged, immediate_feedback=False)

	def PreferredTunerChanged(configElement):
		setPreferredTuner(int(configElement.value))
	config.usage.tuner_priority.addNotifier(PreferredTunerChanged)

	def setHDDStandby(configElement):
		for hdd in harddiskmanager.HDDList():
			hdd[1].setIdleTime(int(configElement.value))
	config.usage.hdd_standby.addNotifier(setHDDStandby, immediate_feedback=False)

	def set12VOutput(configElement):
		if configElement.value == "on":
			Misc_Options.getInstance().set_12V_output(1)
		elif configElement.value == "off":
			Misc_Options.getInstance().set_12V_output(0)
	config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

	SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()

	config.usage.keymap = ConfigText(default = eEnv.resolve("${datadir}/enigma2/keymap.xml"))

	config.seek = ConfigSubsection()
	config.seek.selfdefined_13 = ConfigNumber(default=15)
	config.seek.selfdefined_46 = ConfigNumber(default=60)
	config.seek.selfdefined_79 = ConfigNumber(default=300)

	config.seek.speeds_forward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
	config.seek.speeds_backward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
	config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8], choices=[2, 4, 6, 8, 12, 16, 25])

	config.seek.enter_forward = ConfigSelection(default = "2", choices = ["2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])
	config.seek.enter_backward = ConfigSelection(default = "1", choices = ["1", "2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])

	config.seek.on_pause = ConfigSelection(default = "play", choices = [
		("play", _("Play")),
		("step", _("Singlestep (GOP)")),
		("last", _("Last speed")) ])

	config.usage.timerlist_finished_timer_position = ConfigSelection(default = "beginning", choices = [("beginning", _("at beginning")), ("end", _("at end"))])
	config.usage.timer_avoid_simultaneous_start = ConfigYesNo(default = False)

	config.seek.smartseek_enable = ConfigYesNo(default = True)
	config.seek.smartseek_marker = ConfigYesNo(default = False)
	config.seek.smartseek_time = ConfigInteger(default = 300, limits = (60, 999))
	config.seek.smartseek_constant_time = ConfigInteger(default = 15, limits = (5, 600))
	config.seek.smartseek_remap_skip_fw_rw = ConfigYesNo(default = False)
	config.seek.smartseek_timeout = ConfigInteger(default = 8, limits = (5, 30))
	config.seek.smartseek_min_time = ConfigInteger(default = 10, limits = (2, 120))

	def updateEnterForward(configElement):
		if not configElement.value:
			configElement.value = [2]
		updateChoices(config.seek.enter_forward, configElement.value)

	config.seek.speeds_forward.addNotifier(updateEnterForward, immediate_feedback = False)

	def updateEnterBackward(configElement):
		if not configElement.value:
			configElement.value = [2]
		updateChoices(config.seek.enter_backward, configElement.value)

	config.seek.speeds_backward.addNotifier(updateEnterBackward, immediate_feedback = False)


# VTI Settings start
	config.usage.show_bsod = ConfigYesNo(default = False)
	config.misc.placeholder = NoSave(ConfigSelection(default = "1", choices = [("1", " ")]))
	config.misc.use_ci_assignment = ConfigYesNo(default = True)
	config.misc.disable_auto_channel_list = ConfigYesNo(default = False)
	config.misc.allow_service_delete = ConfigYesNo(default = False)
	config.misc.ecm_info = ConfigYesNo(default = True)
	config.misc.enable_custom_mainmenu = ConfigYesNo(default = False)
	config.usage.ts_min_duration = ConfigSelection(default = "0", choices = [
		("0", _("off")),
		("1", _("1 minute")),
		("2", _("2 minutes")),
		("5", _("5 minutes")),
		("10", _("10 minutes")),])
	config.usage.ts_show_old_ts = ConfigYesNo(default = False)
	config.usage.ts_use_history_keys = ConfigYesNo(default = False)
	config.usage.ts_clean_intervall = ConfigSelection(default = "0", choices = ["0", "1", "2", "3", "4", "5", "6", "12", "24"])
	config.usage.ts_clean_ts_older_than = ConfigSelection(default = "1", choices = [("0.25", "1/4"), ("0.5", "1/2"), ("1.0", "1"), ("2.0", "2"), ("3.0", "3"), ("4.0", "4"), ("5.0", "5")])
	config.usage.ts_ask_before_service_changed = ConfigSelection(default = "delete", choices = [
		("ask", _("Ask user")),
		("delete", _("delete timeshift file")),
		("keep_ts", _("keep timeshift file")),])
	config.usage.ts_auto_start = ConfigSelection(default = "0", choices = [
		("0", _("off")),
		("1", _("1 second")),
		("2", _("2 seconds")),
		("3", _("3 seconds")),
		("4", _("4 seconds")),
		("5", _("5 seconds")),
		("10", _("10 seconds")),
		("20", _("20 seconds")),
		("30", _("30 seconds")),
		("60", _("1 minute")),
		("120", _("2 minutes")),
		("300", _("5 minutes")),])
	config.usage.ts_event_change = ConfigSelection(default = "split_and_keep", choices = [
		("ask", _("Ask user")),
		("continue", _("continue timeshift")),
		("split_and_keep", _("split & keep")),
		("split_and_delete", _("split & delete")),
		("stop_and_keep", _("stop & keep")),
		("stop_and_delete", _("stop & delete")),])
	config.usage.infobar_dimm = ConfigSelection(default = "off", choices = [
		("fade_in", _("fade in")),
		("fade_in_out", _("fade in/out")),
		("fade_out", _("fade out")),
		("off", _("off")),])
	config.usage.infobar_dimm_speed = ConfigSelection(default = "30", choices = [
		("15", _("fast")),
		("30", _("default")),
		("50", _("slow")),])

	config.usage.enable_zaphistory = ConfigYesNo(default = True)
	config.usage.show_epg_progress_percent = ConfigYesNo(default = False)
	config.usage.servicelist_show_picon = ConfigSelection(default = "0", choices = [
		("0", _("off")),
		("100", "100x60 px"),
		("50", "50x30 px"),
		("1", _("user defined")),])
	config.usage.servicelist_picon_dir = ConfigDirectory(default = "/usr/share/enigma2/picon")
	config.usage.servicelist_two_lines = ConfigYesNo(default = False)
	config.usage.servicelist_show_event_time = ConfigYesNo(default = False)
	config.usage.servicelist_mark_rec_service = ConfigYesNo(default = True)
	config.usage.servicelist_show_rec_service_symbol = ConfigYesNo(default = True)
	config.usage.servicelist_show_servicenumber = ConfigYesNo(default = True)
	config.usage.servicelist_name_width = ConfigInteger(default = 200, limits = (1, 1920))
	config.usage.servicelist_use_matrix = ConfigYesNo(default = False)
	config.usage.servicelist_show_next_event = ConfigYesNo(default = False)
	config.usage.servicelist_show_service_type_icon = ConfigYesNo(default = False)
	config.usage.servicelist_preview_mode = ConfigYesNo(default = False)
	config.usage.servicelist_hide_service_name = ConfigYesNo(default = False)
	
	rec_button_choices = \
		[
			("record_menu", _("show record menu")),
			("running_record", _("show running records")),
			("timer_list", _("show timer list")),
			("event_record", _("add recording (stop after current event)")),
			("indefinitely_record", _("add recording (indefinitely)")),
			("manualduration_record", _("add recording (enter recording duration)")),
			("manualendtime_record", _("add recording (enter recording endtime)")),
			("timeshift_to_record", _("Transform Timeshift into recording"))
		]
	
	config.usage.rec_button = ConfigSelection(default = "record_menu", choices = rec_button_choices)
	config.usage.rec_button_long = ConfigSelection(default = "running_record", choices = rec_button_choices)
	
	
	config.usage.remove_finished_timers = ConfigYesNo(default = True)
	config.usage.enable_eit_epg = ConfigYesNo(default = True)
	def setEITepg(configElement):
			from enigma import eEPGCache
			eEPGCache.getInstance().setEITenabled(int(config.usage.enable_eit_epg.getValue()))
	config.usage.enable_eit_epg.addNotifier(setEITepg)
	config.usage.show_nownext_eit = ConfigYesNo(default = True)
	config.usage.show_old_epg = ConfigSelection(default = "21600", choices = [
		("0", _("off")),
		("3600", "1 h"),
		("21600", "6 h"),
		("43200", "12 h"),
		("86400", "24 h"),])
	def setOldEPGBuffer(configElement):
			from enigma import eEPGCache
			eEPGCache.getInstance().setOldEPG(int(config.usage.show_old_epg.getValue()))
	config.usage.show_old_epg.addNotifier(setOldEPGBuffer)

	config.usage.epg_buffer = ConfigInteger(default = 14, limits = (1, 28))
	def setEPGBufferDays(configElement):
			from enigma import eEPGCache
			eEPGCache.getInstance().setEPGBuffer(config.usage.epg_buffer.getValue())
	config.usage.epg_buffer.addNotifier(setEPGBufferDays)
	epg_choices = [
		("eventview", _("Event Description")),
		("singleepg", _("Single Service EPG")),
		("multiepg", _("Multi EPG")),
		("epgbar", _("Service EPGBar"))]
	if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/GraphMultiEPG/plugin.py'):
		epg_choices.append(("graphicalmultiepg", _("Graphical Multi EPG")))
	config.usage.epg_default_view = ConfigSelection(default = "eventview", choices = epg_choices)

	config.usage.enable_tt_caching = ConfigYesNo(default = True)
	def EnableTtCachingChanged(configElement):
		setEnableTtCachingOnOff(int(configElement.value))
	config.usage.enable_tt_caching.addNotifier(EnableTtCachingChanged)

	config.usage.stop_seek_eof = ConfigSelection(default = "20", choices = [
		("0", _("off")),
		("10", "10 " + _("seconds")),
		("20", "20 " + _("seconds")),
		("30", "30 " + _("seconds")),
		("60", "60 " + _("seconds"))])

	def updateVideoDirChoice(configElement):
		tmp = configElement.value
		tmp.append(("off", _("off")))
		tmp.append(("last_video", _("last video")))
		tmp.append(("latest_movies", _("latest movies")))
		tmp.append(("all_movies", _("All movies")))
		if (config.movielist.start_videodir.value, config.movielist.start_videodir.value) in tmp:
			default = config.movielist.start_videodir.value
		else:
			default = "last_video"
		config.movielist.start_videodir.setChoices(tmp, default)
	tmp = []
	for x in config.movielist.videodirs.value:
		tmp.append((x,x))
	tmp.append(("off", _("off")))
	tmp.append(("last_video", _("last video")))
	tmp.append(("latest_movies", _("latest movies")))
	tmp.append(("all_movies", _("All movies")))
	config.movielist.start_videodir = ConfigSelection(default = "last_video", choices = tmp)
	config.movielist.videodirs.addNotifier(updateVideoDirChoice)
	config.usage.movielist_folder_based_config = ConfigYesNo(default = True)
	config.usage.movielist_support_pig = ConfigYesNo(default = True)
	config.usage.movielist_last_played_movie = ConfigText(default = "")
	config.usage.movielist_select_last_movie = ConfigYesNo(default = True)
	config.usage.movielist_resume_at_eof = ConfigYesNo(default = True)
	config.usage.movielist_show_cover = ConfigYesNo(default = True)
	config.usage.movielist_show_dir = ConfigYesNo(default = True)
	config.usage.movielist_show_trash_dir = ConfigYesNo(default = False)
	config.usage.movielist_use_trash_dir = ConfigYesNo(default = False)
	config.usage.movielist_show_icon = ConfigYesNo(default = True)
	config.usage.movielist_show_color = ConfigYesNo(default = True)
	config.usage.movielist_show_picon = ConfigYesNo(default = False)
	config.usage.movielist_show_channel_info = ConfigYesNo(default = True)
	config.usage.movielist_show_recording_date = ConfigYesNo(default = True)
	config.usage.movielist_show_file_size = ConfigYesNo(default = True)
	config.usage.movielist_show_folder_info = ConfigYesNo(default = True)
	config.usage.movielist_show_folder_info_new = ConfigYesNo(default = True)
	config.usage.movielist_show_folder_info_only_new = ConfigYesNo(default = True)
	config.usage.movielist_show_folder_info_sort_by_new = ConfigYesNo(default = True)
	config.usage.movielist_show_folder_info_dirs = ConfigYesNo(default = False)
	config.usage.movielist_show_folder_info_left = ConfigYesNo(default = False)
	config.usage.movielist_hide_timeshift_files = ConfigYesNo(default = False)
	config.usage.movielist_only_day = ConfigYesNo(default = True)
	config.usage.movielist_show_last_stop_time = ConfigYesNo(default = False)
	config.usage.movielist_show_duration = ConfigYesNo(default = True)
	config.usage.movielist_duration_in_min = ConfigYesNo(default = True)
	config.usage.movielist_progress_seen = ConfigInteger(default = 80, limits = (40, 99))
	config.usage.movielist_leave_exit = ConfigYesNo(default = True)
	config.usage.movielist_ask_movie_del = ConfigYesNo(default = False)
	config.usage.movielist_show_progress = ConfigSelection(default = "progress_bar", choices = [
		("progress_bar", _("progress bar")),
		("progress_percent", _("percent")),
		("progress_calculate", _("only calculate")),
		("progress_off", _("off"))])
	config.usage.timerlist_show_icon = ConfigYesNo(default = True)
	config.usage.timerlist_show_epg = ConfigYesNo(default = True)
	config.usage.timerlist_style = ConfigSelection(default = "0", choices = [
		("0", _("Default")),
		("1", _("Style") + " 1"),
		("2", _("Style") + " 2"),
		("3", _("Style") + " 3"),
		("4", _("Style") + " 4"),
		("5", _("Style") + " 5"),])
	config.usage.channelzap_w_bouquet = ConfigYesNo(default = False)
	config.usage.show_favourites_w_bouquet = ConfigSelection(default = "down", choices = [("down", _("Channel -")), ("up", _("Channel +")), ("off", _("off"))])
	config.usage.show_servicelist_at_modeswitch = ConfigYesNo(default = False)
	config.usage.use_pig = ConfigYesNo(default = False)
	config.usage.use_extended_pig = ConfigYesNo(default = False)
	config.usage.use_extended_pig_channelselection = ConfigYesNo(default = False)
	config.usage.show_infobar_on_splitscreen = ConfigYesNo(default = False)
	pip_modes = [("splitscreen", _("Split Screen")), ("audiozap", _("Audio Zap")), ("pip", _("Picture in Picture"))]
	config.usage.default_pip_mode = ConfigSelection(default = "splitscreen", choices = pip_modes)
	config.usage.default_zero_double_click_mode = ConfigSelection(default = "pip", choices = pip_modes)
	default_timeout = SystemInfo["CanPiP"] and 500 or 50
	config.usage.zero_doubleclick_timeout = ConfigInteger(default = default_timeout, limits = (50, 5000))
	config.usage.zap_pip = ConfigYesNo(default = True)
	config.usage.zap_before_record = ConfigYesNo(default = False)
	config.usage.zap_notification_record = ConfigYesNo(default = True)
	if SystemInfo["CanPiP"]:
		config.usage.pip_in_EPGBar = ConfigYesNo(default = True)
	else:
		config.usage.pip_in_EPGBar = ConfigYesNo(default = False)
	config.usage.picon_dir = ConfigDirectory(default = "/usr/share/enigma2/picon")
	config.usage.picon_scale = ConfigYesNo(default = True)
	config.usage.sort_menu_byname = ConfigYesNo(default = False)
	config.usage.sort_plugins_byname = ConfigYesNo(default = True)
	config.usage.plugins_sort_mode = ConfigSelection(default = "user", choices = [
		("a_z", _("alphabetical")),
		("default", _("Default")),
		("user", _("user defined")),])
	config.usage.plugin_sort_weight = ConfigDictionarySet()
	config.usage.menu_sort_mode = ConfigSelection(default = "user", choices = [
		("a_z", _("alphabetical")),
		("default", _("Default")),
		("user", _("user defined")),])
	config.usage.menu_sort_weight = ConfigDictionarySet(default = { "mainmenu" : {"submenu" : {} }})
	config.usage.numberzap_timeout = ConfigInteger(default = 3000, limits = (100, 20000))
	config.usage.numberzap_show_servicename = ConfigYesNo(default = True)
	config.usage.numberzap_show_picon = ConfigYesNo(default = True)
	config.usage.startup_service_leavestandby = ConfigYesNo(default = False)
	config.usage.overzap_notplayable = ConfigYesNo(default = True)
	config.usage.disable_tuner_error_popup = ConfigYesNo(default = False)
	config.usage.disable_infobar_timeout_okbutton = ConfigYesNo(default = False)
	config.usage.ask_timer_file_del = ConfigYesNo(default = True)
	config.usage.record_file_name_date_at_end = ConfigYesNo(default = False)
	config.usage.silent_rec_mode = ConfigYesNo(default = True)
	config.usage.vfd_scroll_delay = ConfigSelection(default = "10000", choices = [
		("10000", "10 " + _("seconds")),
		("20000", "20 " + _("seconds")),
		("30000", "30 " + _("seconds")),
		("60000", "1 " + _("minute")),
		("300000", "5 " + _("minutes")),
		("noscrolling", _("off"))])
	config.usage.vfd_scroll_speed = ConfigSelection(default = "300", choices = [
		("500", _("slow")),
		("300", _("normal")),
		("100", _("fast"))])

	def get_default_RC():
		device = HardwareInfoVu().get_device_name()
		if device =="duo2":
			return "2"
		elif device == "ultimo":
			return "1"
		return "0"

	config.usage.rc_style = ConfigSelection(default = get_default_RC(), choices = [
		("0", "Vu+ 1 (Duo, Solo, Uno, Solo2)"),
		("1", "Vu+ 2 (Ultimo)"),
		("2", "Vu+ 3 (Duo2)")])
	config.usage.use_force_overwrite = ConfigYesNo(default = True)
	config.usage.use_package_conffile = ConfigYesNo(default = True)
	config.usage.use_rm_force_depends = ConfigYesNo(default = False)
	config.usage.use_rm_autoremove = ConfigYesNo(default = True)
	config.usage.check_for_updates = ConfigInteger(default = 0, limits = (0, 24))
	config.usage.show_notification_for_updates = ConfigYesNo(default = True)
	config.usage.update_available = NoSave(ConfigYesNo(default = False))
	config.usage.blinking_rec_symbol_during_recording = ConfigYesNo(default = True)
	config.usage.enable_hbbtv_autostart = ConfigYesNo(default = True)
	config.subtitles = ConfigSubsection()
	config.subtitles.subtitle_fontcolor = ConfigSelection(default = "0", choices = [
		("0", _("default")),
		("1", _("white")),
		("2", _("yellow")),
		("3", _("green")),
		("4", _("cyan")),
		("5", _("blue")),
		("6", _("magneta")),
		("7", _("red")),
		("8", _("black")) ])
	config.subtitles.subtitle_fontsize  = ConfigSelection(choices = ["%d" % x for x in range(16,101) if not x % 2], default = "20")
	config.subtitles.subtitle_padding_y  = ConfigSelection(choices = ["%d" % x for x in range(2,301) if not x % 2], default = "10")
	config.subtitles.subtitle_bgcolor = ConfigSelection(default = "0", choices = [
		("0", _("black")),
		("1", _("red")),
		("2", _("magneta")),
		("3", _("blue")),
		("4", _("cyan")),
		("5", _("green")),
		("6", _("yellow")),
		("7", _("white"))])
	config.subtitles.subtitle_bgopacity = ConfigSelection(default = "225", choices = [
		("0", _("No transparency")),
		("25", "10%"),
		("50", "20%"),
		("75", "30%"),
		("100", "40%"),
		("125", "50%"),
		("150", "60%"),
		("175", "70%"),
		("200", "80%"),
		("225", "90%"),
		("255", _("Full transparency"))])
	config.subtitles.subtitle_edgestyle = ConfigSelection(default = "2", choices = [
		("0", _("None")),
		("1", _("Raised")),
		("2", _("Depressed")),
		("3", _("Uniform"))])
	config.subtitles.subtitle_edgestyle_level = ConfigSelection(choices = ["0", "1", "2", "3", "4", "5"], default = "3")
	config.subtitles.subtitle_opacity = ConfigSelection(default = "0", choices = [
		("0", _("No transparency")),
		("75", "25%"),
		("150", "50%")])
	config.subtitles.subtitle_original_position = ConfigYesNo(default = True)
	config.subtitles.subtitle_alignment = ConfigSelection(choices = [("left", _("left")), ("center", _("center")), ("right", _("right"))], default = "center")
	config.subtitles.subtitle_position = ConfigSelection( choices = ["0", "50", "100", "150", "200", "250", "300", "350", "400", "450", "500", "550", "600"], default = "100")

	config.subtitles.dvb_subtitles_centered = ConfigYesNo(default = False)

	subtitle_delay_choicelist = []
	for i in range(-900000, 1845000, 45000):
		if i == 0:
			subtitle_delay_choicelist.append(("0", _("No delay")))
		else:
			subtitle_delay_choicelist.append((str(i), "%2.1f sec" % (i / 90000.)))
	config.subtitles.subtitle_noPTSrecordingdelay = ConfigSelection(default = "315000", choices = subtitle_delay_choicelist)
	config.subtitles.subtitle_bad_timing_delay = ConfigSelection(default = "0", choices = subtitle_delay_choicelist)
	config.subtitles.subtitle_rewrap = ConfigYesNo(default = False)
	config.subtitles.colourise_dialogs = ConfigYesNo(default = False)
	config.subtitles.pango_subtitle_fontswitch = ConfigYesNo(default = True)
	config.subtitles.pango_subtitles_delay = ConfigSelection(default = "0", choices = subtitle_delay_choicelist)
	config.subtitles.pango_subtitles_fps = ConfigSelection(default = "1", choices = [
		("1", _("Original")),
		("23976", _("23.976")),
		("24000", _("24")),
		("25000", _("25")),
		("29970", _("29.97")),
		("30000", _("30"))])
	config.subtitles.pango_autoturnon = ConfigYesNo(default = True)

	debug_choices = [("off", _("off")),
		("console", _("Console")),
		("file", _("File")),
		("fileloop", _("File (loop)")),
		("console|file", _("Console & File")),
		("console|fileloop", _("Console & File (loop)")),]
	config.usage.debug_config = ConfigSelection(default = "off_", choices = debug_choices)
	debug_file = "/etc/enigma2/dvbapp2debug.conf"
	val = "off"
	if os.path.exists(debug_file):
		f = open(debug_file, "r")
		lines = f.readlines()
		f.close()
		if lines and len(lines):
			val = lines[0].strip()
			is_valid = False
			for x in debug_choices:
				if x[0] == val:
					is_valid = True
					config.usage.debug_config.value = val
					break
	config.usage.debug_config.value = val
Esempio n. 2
0
 def set12VOutput(configElement):
     if configElement.value == "on":
         Misc_Options.getInstance().set_12V_output(1)
     elif configElement.value == "off":
         Misc_Options.getInstance().set_12V_output(0)
Esempio n. 3
0
	def set12VOutput(configElement):
		if configElement.value == "on":
			Misc_Options.getInstance().set_12V_output(1)
		elif configElement.value == "off":
			Misc_Options.getInstance().set_12V_output(0)
Esempio n. 4
0
def InitUsageConfig():
	config.usage = ConfigSubsection();
	config.usage.showdish = ConfigYesNo(default = True)
	config.usage.multibouquet = ConfigYesNo(default = True)
	config.usage.multiepg_ask_bouquet = ConfigYesNo(default = False)

	config.usage.alternative_number_mode = ConfigYesNo(default = False)
	def alternativeNumberModeChange(configElement):
    		eDVBDB.getInstance().setNumberingMode(configElement.value)
    		refreshServiceList()
	config.usage.alternative_number_mode.addNotifier(alternativeNumberModeChange)

        choicelist = [("-1", _("Disable"))]
	for i in range(0,1300,100):
		choicelist.append((str(i), ngettext("%d pixel wide", "%d pixels wide", i) % i))
	config.usage.servicelist_column = ConfigSelection(default="-1", choices=choicelist)
	config.usage.servicelist_column.addNotifier(refreshServiceList)

	config.usage.hide_number_markers = ConfigYesNo(default = False)
	config.usage.hide_number_markers.addNotifier(refreshServiceList)

        config.usage.servicetype_icon_mode = ConfigSelection(default = "0", choices = [("0", _("None")), ("1", _("Left from servicename")), ("2", _("Right from servicename"))])
	config.usage.servicetype_icon_mode.addNotifier(refreshServiceList)
	config.usage.crypto_icon_mode = ConfigSelection(default = "0", choices = [("0", _("None")), ("1", _("Left from servicename")), ("2", _("Right from servicename"))])
	config.usage.crypto_icon_mode.addNotifier(refreshServiceList)
        config.usage.record_indicator_mode = ConfigSelection(default = "0", choices = [("0", _("None")), ("1", _("Left from servicename")), ("2", _("Right from servicename")), ("3", _("Red colored"))])
	config.usage.record_indicator_mode.addNotifier(refreshServiceList)

	config.usage.quickzap_bouquet_change = ConfigYesNo(default = False)
	config.usage.e1like_radio_mode = ConfigYesNo(default = False)
	config.usage.infobar_timeout = ConfigSelection(default = "5", choices = [
		("0", _("no timeout")), ("1", "1 " + _("second")), ("2", "2 " + _("seconds")), ("3", "3 " + _("seconds")),
		("4", "4 " + _("seconds")), ("5", "5 " + _("seconds")), ("6", "6 " + _("seconds")), ("7", "7 " + _("seconds")),
		("8", "8 " + _("seconds")), ("9", "9 " + _("seconds")), ("10", "10 " + _("seconds"))])
	config.usage.show_infobar_on_zap = ConfigYesNo(default = True)
	config.usage.show_infobar_on_skip = ConfigYesNo(default = True)
	config.usage.show_infobar_on_event_change = ConfigYesNo(default = True)
        config.usage.show_second_infobar = ConfigSelection(default = None, choices = [(None, _("None"))] + choicelist + [("EPG",_("EPG")), ("Event",_("Event view"))])
	config.usage.show_eit_nownext = ConfigYesNo(default = True)
	config.usage.hide_zap_errors = ConfigYesNo(default = False)
	config.usage.hide_ci_messages = ConfigYesNo(default = False)
        config.usage.show_cryptoinfo = ConfigYesNo(default = True)
        config.usage.pic_resolution = ConfigSelection(default = None, choices = [(None, _("Same resolution as skin")), ("(720, 576)","720x576"), ("(1280, 720)", "1280x720"), ("(1920, 1080)", "1920x1080")])
	config.usage.hdd_standby = ConfigSelection(default = "600", choices = [
		("0", _("no standby")), ("10", "10 " + _("seconds")), ("30", "30 " + _("seconds")),
		("60", "1 " + _("minute")), ("120", "2 " + _("minutes")),
		("300", "5 " + _("minutes")), ("600", "10 " + _("minutes")), ("1200", "20 " + _("minutes")),
		("1800", "30 " + _("minutes")), ("3600", "1 " + _("hour")), ("7200", "2 " + _("hours")),
		("14400", "4 " + _("hours")) ])
	config.usage.output_12V = ConfigSelection(default = "do not change", choices = [
		("do not change", _("do not change")), ("off", _("off")), ("on", _("on")) ])

	config.usage.pip_zero_button = ConfigSelection(default = "standard", choices = [
		("standard", _("standard")), ("swap", _("swap PiP and main picture")),
		("swapstop", _("move PiP to main picture")), ("stop", _("stop PiP")) ])

	config.usage.default_path = ConfigText(default = resolveFilename(SCOPE_HDD))
	config.usage.timer_path = ConfigText(default = "<default>")
	config.usage.instantrec_path = ConfigText(default = "<default>")
	config.usage.timeshift_path = ConfigText(default = "/media/hdd/")
	config.usage.allowed_timeshift_paths = ConfigLocations(default = ["/media/hdd/"])

	config.usage.on_movie_start = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("resume", _("Resume from last position")), ("beginning", _("Start from the beginning")) ])
	config.usage.on_movie_stop = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")) ])
	config.usage.on_movie_eof = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")), ("pause", _("Pause movie at end")) ])

	config.usage.setup_level = ConfigSelection(default = "intermediate", choices = [
		("simple", _("Simple")),
		("intermediate", _("Intermediate")),
		("expert", _("Expert")) ])

	config.usage.on_long_powerpress = ConfigSelection(default = "show_menu", choices = [
		("show_menu", _("show shutdown menu")),
		("shutdown", _("immediate shutdown")),
		("standby", _("Standby")) ] )
	
	config.usage.on_short_powerpress = ConfigSelection(default = "standby", choices = [
		("show_menu", _("show shutdown menu")),
		("shutdown", _("immediate shutdown")),
		("standby", _("Standby")) ] )


	config.usage.alternatives_priority = ConfigSelection(default = "0", choices = [
		("0", "DVB-S/-C/-T"),
		("1", "DVB-S/-T/-C"),
		("2", "DVB-C/-S/-T"),
		("3", "DVB-C/-T/-S"),
		("4", "DVB-T/-C/-S"),
		("5", "DVB-T/-S/-C") ])

	config.usage.service_icon_enable = ConfigYesNo(default = False)
	config.usage.service_icon_enable.addNotifier(refreshServiceList)
       
	config.usage.show_event_progress_in_servicelist = ConfigYesNo(default = True)
	config.usage.show_event_progress_in_servicelist.addNotifier(refreshServiceList)

        config.usage.show_event_progress_in_servicelist = ConfigSelection(default = 'barright', choices = [
		('barleft', _("Progress bar left")),
		('barright', _("Progress bar right")),
		('percleft', _("Percentage left")),
		('percright', _("Percentage right")),
		('no', _("No")) ])
        config.usage.show_channel_numbers_in_servicelist = ConfigYesNo(default = True)
	config.usage.show_event_progress_in_servicelist.addNotifier(refreshServiceList)
	config.usage.show_channel_numbers_in_servicelist.addNotifier(refreshServiceList)

	nims = [ ("-1", _("auto")) ]
	for x in nimmanager.nim_slots:
		nims.append( (str(x.slot), x.getSlotName()) )
	config.usage.frontend_priority = ConfigSelection(default = "-1", choices = nims)

        config.usage.blinking_display_clock_during_recording = ConfigYesNo(default = False)

	config.usage.show_message_when_recording_starts = ConfigYesNo(default = True)

	config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(default = True)

        def TunerTypePriorityOrderChanged(configElement):
		setTunerTypePriorityOrder(int(configElement.value))
	config.usage.alternatives_priority.addNotifier(TunerTypePriorityOrderChanged, immediate_feedback=False)

	def PreferredTunerChanged(configElement):
		setPreferredTuner(int(configElement.value))
	config.usage.frontend_priority.addNotifier(PreferredTunerChanged)

	def setHDDStandby(configElement):
		for hdd in harddiskmanager.HDDList():
			hdd[1].setIdleTime(int(configElement.value))
	config.usage.hdd_standby.addNotifier(setHDDStandby, immediate_feedback=False)

	def set12VOutput(configElement):
		if configElement.value == "on":
			Misc_Options.getInstance().set_12V_output(1)
		elif configElement.value == "off":
			Misc_Options.getInstance().set_12V_output(0)
	config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

	SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()

	config.usage.keymap = ConfigText(default = eEnv.resolve("${datadir}/enigma2/keymap.xml"))

	config.seek = ConfigSubsection()
	config.seek.selfdefined_13 = ConfigNumber(default=15)
	config.seek.selfdefined_46 = ConfigNumber(default=60)
	config.seek.selfdefined_79 = ConfigNumber(default=300)

	config.seek.speeds_forward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
	config.seek.speeds_backward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
	config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8], choices=[2, 4, 6, 8, 12, 16, 25])

	config.seek.enter_forward = ConfigSelection(default = "2", choices = ["2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])
	config.seek.enter_backward = ConfigSelection(default = "1", choices = ["1", "2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])

	config.seek.on_pause = ConfigSelection(default = "play", choices = [
		("play", _("Play")),
		("step", _("Singlestep (GOP)")),
		("last", _("Last speed")) ])

	config.usage.timerlist_finished_timer_position = ConfigSelection(default = "beginning", choices = [("beginning", _("at beginning")), ("end", _("at end"))])

	def updateEnterForward(configElement):
		if not configElement.value:
			configElement.value = [2]
		updateChoices(config.seek.enter_forward, configElement.value)

	config.seek.speeds_forward.addNotifier(updateEnterForward, immediate_feedback = False)

	def updateEnterBackward(configElement):
		if not configElement.value:
			configElement.value = [2]
		updateChoices(config.seek.enter_backward, configElement.value)

	config.seek.speeds_backward.addNotifier(updateEnterBackward, immediate_feedback = False)

	config.subtitles = ConfigSubsection()
	
	if config.skin.xres.value == 1920:
		config.subtitles.subtitle_fontsize  = ConfigSelection(choices = ["30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56", "58", "60", "62", "64", "66", "68", "70", "72", "74", "76", "78", "80"], default = "54")
	else:
		config.subtitles.subtitle_fontsize  = ConfigSelection(choices = ["16", "18", "20", "22", "24", "26", "28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54"], default = "34")
		
	if SystemInfo["ZapMode"]:
		def setZapmode(el):
			open(SystemInfo["ZapMode"], "w").write(el.value)
		config.misc.zapmode = ConfigSelection(default = "mute", choices = [
			("mute", _("Black screen")), ("hold", _("Hold screen")), ("mutetilllock", _("Black screen till locked")), ("holdtilllock", _("Hold till locked"))])
		config.misc.zapmode.addNotifier(setZapmode, immediate_feedback = False)	
	
	subtitle_delay_choicelist = []
	for i in range(-900000, 1845000, 45000):
		if i == 0:
			subtitle_delay_choicelist.append(("0", _("No delay")))
		else:
			subtitle_delay_choicelist.append(("%d" % i, "%2.1f sec" % (i / 90000.)))
	config.subtitles.subtitle_noPTSrecordingdelay = ConfigSelection(default = "315000", choices = subtitle_delay_choicelist)
	config.subtitles.subtitle_bad_timing_delay = ConfigSelection(default = "0", choices = subtitle_delay_choicelist)
	config.subtitles.dvb_subtitles_yellow = ConfigYesNo(default = False)
	config.subtitles.dvb_subtitles_centered = ConfigYesNo(default = False)
	config.subtitles.dvb_subtitles_backtrans = ConfigSelection(default = "0", choices = [
		("0", _("no transparency")),
		("25", "10%"),
		("50", "20%"),
		("75", "30%"),
		("100", "40%"),
		("125", "50%"),
		("150", "60%"),
		("175", "70%"),
		("200", "80%"),
		("225", "90%"),
		("255", _("full transparency"))])
	
	
	config.autolanguage = ConfigSubsection()
	audio_language_choices=[
		("---", _("None")),
		("orj dos ory org esl qaa und mis mul ORY ORJ Audio_ORJ", _("Original")),
		("ara", _("Arabic")),
		("eus baq", _("Basque")),
		("bul", _("Bulgarian")), 
		("hrv", _("Croatian")),
		("ces cze", _("Czech")),
		("dan", _("Danish")),
		("dut ndl", _("Dutch")),
		("eng qaa", _("English")),
		("est", _("Estonian")),
		("fin", _("Finnish")),
		("fra fre", _("French")),
		("deu ger", _("German")),
		("ell gre", _("Greek")),
		("heb", _("Hebrew")),
		("hun", _("Hungarian")),
		("ita", _("Italian")),
		("lav", _("Latvian")),
		("lit", _("Lithuanian")),
		("ltz", _("Luxembourgish")),
		("nor", _("Norwegian")),
		("pol", _("Polish")),
		("por", _("Portuguese")),
		("fas per", _("Persian")),
		("ron rum", _("Romanian")),
		("rus", _("Russian")),
		("srp", _("Serbian")),
		("slk slo", _("Slovak")),
		("slv", _("Slovenian")),
		("spa", _("Spanish")),
		("swe", _("Swedish")),
		("tha", _("Thai")),
		("tur Audio_TUR", _("Turkish")),
		("und", _("Undetermined")),
		]
	
	config.autolanguage.audio_autoselect1 = ConfigSelection(choices=audio_language_choices, default="---")
	config.autolanguage.audio_autoselect2 = ConfigSelection(choices=audio_language_choices, default="---")
	config.autolanguage.audio_autoselect3 = ConfigSelection(choices=audio_language_choices, default="---")
	config.autolanguage.audio_autoselect4 = ConfigSelection(choices=audio_language_choices, default="---")
	config.autolanguage.audio_defaultac3 = ConfigYesNo(default = False)
	config.autolanguage.audio_usecache = ConfigYesNo(default = True)

	subtitle_language_choices = audio_language_choices[:1] + audio_language_choices [2:]
	config.autolanguage.subtitle_autoselect1 = ConfigSelection(choices=subtitle_language_choices, default="---")
	config.autolanguage.subtitle_autoselect2 = ConfigSelection(choices=subtitle_language_choices, default="---")
	config.autolanguage.subtitle_autoselect3 = ConfigSelection(choices=subtitle_language_choices, default="---")
	config.autolanguage.subtitle_autoselect4 = ConfigSelection(choices=subtitle_language_choices, default="---")
	config.autolanguage.subtitle_hearingimpaired = ConfigYesNo(default = False)
	config.autolanguage.subtitle_defaultimpaired = ConfigYesNo(default = False)
	config.autolanguage.subtitle_defaultdvb = ConfigYesNo(default = False)
	config.autolanguage.subtitle_usecache = ConfigYesNo(default = True)
Esempio n. 5
0
def InitUsageConfig():
    config.usage = ConfigSubsection()
    config.usage.showdish = ConfigYesNo(default=True)
    config.usage.multibouquet = ConfigYesNo(default=True)
    config.usage.multiepg_ask_bouquet = ConfigYesNo(default=False)

    config.usage.hide_number_markers = ConfigYesNo(default=False)
    config.usage.hide_number_markers.addNotifier(refreshServiceList)

    config.usage.quickzap_bouquet_change = ConfigYesNo(default=False)
    config.usage.e1like_radio_mode = ConfigYesNo(default=False)
    config.usage.infobar_timeout = ConfigSelection(
        default="5",
        choices=[("0", _("no timeout")), ("1", "1 " + _("second")),
                 ("2", "2 " + _("seconds")), ("3", "3 " + _("seconds")),
                 ("4", "4 " + _("seconds")), ("5", "5 " + _("seconds")),
                 ("6", "6 " + _("seconds")), ("7", "7 " + _("seconds")),
                 ("8", "8 " + _("seconds")), ("9", "9 " + _("seconds")),
                 ("10", "10 " + _("seconds"))])
    config.usage.show_infobar_on_zap = ConfigYesNo(default=True)
    config.usage.show_infobar_on_skip = ConfigYesNo(default=True)
    config.usage.show_infobar_on_event_change = ConfigYesNo(default=True)
    config.usage.show_eit_nownext = ConfigYesNo(default=True)
    config.usage.hide_zap_errors = ConfigYesNo(default=False)
    config.usage.hide_ci_messages = ConfigYesNo(default=False)
    config.usage.hdd_standby = ConfigSelection(
        default="600",
        choices=[("0", _("no standby")), ("10", "10 " + _("seconds")),
                 ("30", "30 " + _("seconds")), ("60", "1 " + _("minute")),
                 ("120", "2 " + _("minutes")), ("300", "5 " + _("minutes")),
                 ("600", "10 " + _("minutes")), ("1200", "20 " + _("minutes")),
                 ("1800", "30 " + _("minutes")), ("3600", "1 " + _("hour")),
                 ("7200", "2 " + _("hours")), ("14400", "4 " + _("hours"))])
    config.usage.output_12V = ConfigSelection(default="do not change",
                                              choices=[("do not change",
                                                        _("do not change")),
                                                       ("off", _("off")),
                                                       ("on", _("on"))])

    config.usage.pip_zero_button = ConfigSelection(
        default="standard",
        choices=[("standard", _("standard")),
                 ("swap", _("swap PiP and main picture")),
                 ("swapstop", _("move PiP to main picture")),
                 ("stop", _("stop PiP"))])

    config.usage.default_path = ConfigText(default=resolveFilename(SCOPE_HDD))
    config.usage.timer_path = ConfigText(default="<default>")
    config.usage.instantrec_path = ConfigText(default="<default>")
    config.usage.timeshift_path = ConfigText(default="/media/hdd/")
    config.usage.allowed_timeshift_paths = ConfigLocations(
        default=["/media/hdd/"])

    config.usage.on_movie_start = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("resume", _("Resume from last position")),
                 ("beginning", _("Start from the beginning"))])
    config.usage.on_movie_stop = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("movielist", _("Return to movie list")),
                 ("quit", _("Return to previous service"))])
    config.usage.on_movie_eof = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("movielist", _("Return to movie list")),
                 ("quit", _("Return to previous service")),
                 ("pause", _("Pause movie at end"))])

    config.usage.setup_level = ConfigSelection(default="intermediate",
                                               choices=[
                                                   ("simple", _("Simple")),
                                                   ("intermediate",
                                                    _("Intermediate")),
                                                   ("expert", _("Expert"))
                                               ])

    config.usage.on_long_powerpress = ConfigSelection(
        default="show_menu",
        choices=[("show_menu", _("show shutdown menu")),
                 ("shutdown", _("immediate shutdown")),
                 ("standby", _("Standby"))])

    config.usage.on_short_powerpress = ConfigSelection(
        default="standby",
        choices=[("show_menu", _("show shutdown menu")),
                 ("shutdown", _("immediate shutdown")),
                 ("standby", _("Standby"))])

    config.usage.alternatives_priority = ConfigSelection(
        default="0",
        choices=[("0", "DVB-S/-C/-T"), ("1", "DVB-S/-T/-C"),
                 ("2", "DVB-C/-S/-T"), ("3", "DVB-C/-T/-S"),
                 ("4", "DVB-T/-C/-S"), ("5", "DVB-T/-S/-C")])

    config.usage.service_icon_enable = ConfigYesNo(default=False)
    config.usage.service_icon_enable.addNotifier(refreshServiceList)

    config.usage.show_event_progress_in_servicelist = ConfigYesNo(default=True)

    config.usage.show_event_progress_in_servicelist.addNotifier(
        refreshServiceList)

    nims = [("-1", _("auto"))]
    for x in nimmanager.nim_slots:
        nims.append((str(x.slot), x.getSlotName()))
    config.usage.frontend_priority = ConfigSelection(default="-1",
                                                     choices=nims)

    config.usage.blinking_display_clock_during_recording = ConfigYesNo(
        default=False)

    config.usage.show_message_when_recording_starts = ConfigYesNo(default=True)

    config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(
        default=True)

    def TunerTypePriorityOrderChanged(configElement):
        setTunerTypePriorityOrder(int(configElement.value))

    config.usage.alternatives_priority.addNotifier(
        TunerTypePriorityOrderChanged, immediate_feedback=False)

    def PreferredTunerChanged(configElement):
        setPreferredTuner(int(configElement.value))

    config.usage.frontend_priority.addNotifier(PreferredTunerChanged)

    def setHDDStandby(configElement):
        for hdd in harddiskmanager.HDDList():
            hdd[1].setIdleTime(int(configElement.value))

    config.usage.hdd_standby.addNotifier(setHDDStandby,
                                         immediate_feedback=False)

    def set12VOutput(configElement):
        if configElement.value == "on":
            Misc_Options.getInstance().set_12V_output(1)
        elif configElement.value == "off":
            Misc_Options.getInstance().set_12V_output(0)

    config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

    SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()

    config.usage.keymap = ConfigText(
        default=eEnv.resolve("${datadir}/enigma2/keymap.xml"))

    config.seek = ConfigSubsection()
    config.seek.selfdefined_13 = ConfigNumber(default=15)
    config.seek.selfdefined_46 = ConfigNumber(default=60)
    config.seek.selfdefined_79 = ConfigNumber(default=300)

    config.seek.speeds_forward = ConfigSet(
        default=[2, 4, 8, 16, 32, 64, 128],
        choices=[2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
    config.seek.speeds_backward = ConfigSet(
        default=[2, 4, 8, 16, 32, 64, 128],
        choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
    config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8],
                                              choices=[2, 4, 6, 8, 12, 16, 25])

    config.seek.enter_forward = ConfigSelection(default="2",
                                                choices=[
                                                    "2", "4", "6", "8", "12",
                                                    "16", "24", "32", "48",
                                                    "64", "96", "128"
                                                ])
    config.seek.enter_backward = ConfigSelection(default="1",
                                                 choices=[
                                                     "1", "2", "4", "6", "8",
                                                     "12", "16", "24", "32",
                                                     "48", "64", "96", "128"
                                                 ])

    config.seek.on_pause = ConfigSelection(default="play",
                                           choices=[("play", _("Play")),
                                                    ("step",
                                                     _("Singlestep (GOP)")),
                                                    ("last", _("Last speed"))])

    config.usage.timerlist_finished_timer_position = ConfigSelection(
        default="beginning",
        choices=[("beginning", _("at beginning")), ("end", _("at end"))])

    def updateEnterForward(configElement):
        if not configElement.value:
            configElement.value = [2]
        updateChoices(config.seek.enter_forward, configElement.value)

    config.seek.speeds_forward.addNotifier(updateEnterForward,
                                           immediate_feedback=False)

    def updateEnterBackward(configElement):
        if not configElement.value:
            configElement.value = [2]
        updateChoices(config.seek.enter_backward, configElement.value)

    config.seek.speeds_backward.addNotifier(updateEnterBackward,
                                            immediate_feedback=False)

    config.subtitles = ConfigSubsection()
    config.subtitles.subtitle_fontcolor = ConfigSelection(
        default="0",
        choices=[("0", _("default")), ("1", _("white")), ("2", _("yellow")),
                 ("3", _("green")), ("4", _("cyan")), ("5", _("blue")),
                 ("6", _("magneta")), ("7", _("red")), ("8", _("black"))])
    config.subtitles.subtitle_fontsize = ConfigSelection(
        choices=["%d" % x for x in range(16, 101) if not x % 2], default="40")
    config.subtitles.subtitle_bgcolor = ConfigSelection(default="0",
                                                        choices=[
                                                            ("0", _("black")),
                                                            ("1", _("red")),
                                                            ("2",
                                                             _("magneta")),
                                                            ("3", _("blue")),
                                                            ("4", _("cyan")),
                                                            ("5", _("green")),
                                                            ("6", _("yellow")),
                                                            ("7", _("white"))
                                                        ])
    config.subtitles.subtitle_bgopacity = ConfigSelection(
        default="225",
        choices=[("0", _("No transparency")), ("25", "10%"), ("50", "20%"),
                 ("75", "30%"), ("100", "40%"), ("125", "50%"), ("150", "60%"),
                 ("175", "70%"), ("200", "80%"), ("225", "90%"),
                 ("255", _("full transparency"))])

    config.subtitles.subtitle_edgestyle = ConfigSelection(default="2",
                                                          choices=[
                                                              ("0", "None"),
                                                              ("1", "Raised"),
                                                              ("2",
                                                               "Depressed"),
                                                              ("3", "Uniform")
                                                          ])
    config.subtitles.subtitle_edgestyle_level = ConfigSelection(
        choices=["0", "1", "2", "3", "4", "5"], default="3")
    config.subtitles.subtitle_opacity = ConfigSelection(
        default="0",
        choices=[("0", _("No transparency")), ("75", "25%"), ("150", "50%")])
    config.subtitles.subtitle_original_position = ConfigYesNo(default=True)
    config.subtitles.subtitle_alignment = ConfigSelection(choices=[
        ("left", _("left")), ("center", _("center")), ("right", _("right"))
    ],
                                                          default="center")
    config.subtitles.subtitle_position = ConfigSelection(choices=[
        "0", "50", "100", "150", "200", "250", "300", "350", "400", "450",
        "500", "550", "600"
    ],
                                                         default="100")

    config.subtitles.dvb_subtitles_centered = ConfigYesNo(default=False)

    subtitle_delay_choicelist = []
    for i in range(-900000, 1845000, 45000):
        if i == 0:
            subtitle_delay_choicelist.append(("0", _("No delay")))
        else:
            subtitle_delay_choicelist.append(
                (str(i), "%2.1f sec" % (i / 90000.)))
    config.subtitles.subtitle_noPTSrecordingdelay = ConfigSelection(
        default="315000", choices=subtitle_delay_choicelist)
    config.subtitles.subtitle_bad_timing_delay = ConfigSelection(
        default="0", choices=subtitle_delay_choicelist)
    config.subtitles.subtitle_rewrap = ConfigYesNo(default=False)
    config.subtitles.colourise_dialogs = ConfigYesNo(default=False)
    config.subtitles.pango_subtitle_fontswitch = ConfigYesNo(default=True)
    config.subtitles.pango_subtitles_delay = ConfigSelection(
        default="0", choices=subtitle_delay_choicelist)
    config.subtitles.pango_subtitles_fps = ConfigSelection(
        default="1",
        choices=[("1", _("Original")), ("23976", _("23.976")),
                 ("24000", _("24")), ("25000", _("25")), ("29970", _("29.97")),
                 ("30000", _("30"))])
    config.subtitles.pango_autoturnon = ConfigYesNo(default=True)

    config.autolanguage = ConfigSubsection()
    audio_language_choices = [
        ("---", _("None")),
        ("orj dos ory org esl qaa und mis mul ORY ORJ Audio_ORJ",
         _("Original")),
        ("ara", _("Arabic")),
        ("eus baq", _("Basque")),
        ("bul", _("Bulgarian")),
        ("hrv", _("Croatian")),
        ("ces cze", _("Czech")),
        ("dan", _("Danish")),
        ("dut ndl", _("Dutch")),
        ("eng qaa", _("English")),
        ("est", _("Estonian")),
        ("fin", _("Finnish")),
        ("fra fre", _("French")),
        ("deu ger", _("German")),
        ("ell gre", _("Greek")),
        ("heb", _("Hebrew")),
        ("hun", _("Hungarian")),
        ("ita", _("Italian")),
        ("lav", _("Latvian")),
        ("lit", _("Lithuanian")),
        ("ltz", _("Luxembourgish")),
        ("nor", _("Norwegian")),
        ("pol", _("Polish")),
        ("por", _("Portuguese")),
        ("fas per", _("Persian")),
        ("ron rum", _("Romanian")),
        ("rus", _("Russian")),
        ("srp", _("Serbian")),
        ("slk slo", _("Slovak")),
        ("slv", _("Slovenian")),
        ("spa", _("Spanish")),
        ("swe", _("Swedish")),
        ("tha", _("Thai")),
        ("tur Audio_TUR", _("Turkish")),
        ("und", _("Undetermined")),
    ]

    config.autolanguage.audio_autoselect1 = ConfigSelection(
        choices=audio_language_choices, default="---")
    config.autolanguage.audio_autoselect2 = ConfigSelection(
        choices=audio_language_choices, default="---")
    config.autolanguage.audio_autoselect3 = ConfigSelection(
        choices=audio_language_choices, default="---")
    config.autolanguage.audio_autoselect4 = ConfigSelection(
        choices=audio_language_choices, default="---")
    config.autolanguage.audio_defaultac3 = ConfigYesNo(default=False)
    config.autolanguage.audio_usecache = ConfigYesNo(default=True)

    subtitle_language_choices = audio_language_choices[:
                                                       1] + audio_language_choices[
                                                           2:]
    config.autolanguage.subtitle_autoselect1 = ConfigSelection(
        choices=subtitle_language_choices, default="---")
    config.autolanguage.subtitle_autoselect2 = ConfigSelection(
        choices=subtitle_language_choices, default="---")
    config.autolanguage.subtitle_autoselect3 = ConfigSelection(
        choices=subtitle_language_choices, default="---")
    config.autolanguage.subtitle_autoselect4 = ConfigSelection(
        choices=subtitle_language_choices, default="---")
    config.autolanguage.subtitle_hearingimpaired = ConfigYesNo(default=False)
    config.autolanguage.subtitle_defaultimpaired = ConfigYesNo(default=False)
    config.autolanguage.subtitle_defaultdvb = ConfigYesNo(default=False)
    config.autolanguage.subtitle_usecache = ConfigYesNo(default=True)
Esempio n. 6
0
		nimfile = open("/proc/bus/nim_sockets")
		data = nimfile.read().strip()
		nimfile.close()
		return len(data) > 0
	return False

SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots()
SystemInfo["CommonInterfaceCIDelay"] = fileCheck("/proc/stb/tsmux/rmx_delay")
for cislot in range (0, SystemInfo["CommonInterface"]):
	SystemInfo["CI%dSupportsHighBitrates" % cislot] = fileCheck("/proc/stb/tsmux/ci%d_tsclk"  % cislot)
	SystemInfo["CI%dRelevantPidsRoutingSupport" % cislot] = fileCheck("/proc/stb/tsmux/ci%d_relevant_pids_routing"  % cislot)

SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
SystemInfo["PIPAvailable"] = SystemInfo["NumVideoDecoders"] > 1
SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()
SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()
SystemInfo["ZapMode"] = fileCheck("/proc/stb/video/zapmode") or fileCheck("/proc/stb/video/zapping_mode")
SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
SystemInfo["LCDsymbol_circle_recording"] = fileCheck("/proc/stb/lcd/symbol_circle") or getBoxType() in ("hd51", "vs1500") and fileCheck("/proc/stb/lcd/symbol_recording")
SystemInfo["LCDsymbol_timeshift"] = fileCheck("/proc/stb/lcd/symbol_timeshift")
SystemInfo["LCDshow_symbols"] = (getBoxType().startswith("et9") or getBoxType() in  ("hd51", "vs1500")) and fileCheck("/proc/stb/lcd/show_symbols")
SystemInfo["LCDsymbol_hdd"] = getBoxType() in ("hd51", "vs1500") and fileCheck("/proc/stb/lcd/symbol_hdd")
SystemInfo["FrontpanelDisplayGrayscale"] = fileExists("/dev/dbox/oled0")
SystemInfo["LcdDisplay"] = fileExists("/dev/dbox/lcd0")
SystemInfo["DeepstandbySupport"] = getBoxType() != "dm800"
SystemInfo["OledDisplay"] = fileExists(resolveFilename(SCOPE_SKIN, 'lcd_skin/skin_lcd_default.xml'))
SystemInfo["GraphicLCD"] = getBoxType() in ('quadbox2400')
SystemInfo["GBWOL"] = fileExists("/usr/bin/gigablue_wol")
SystemInfo["Fan"] = fileCheck("/proc/stb/fp/fan")
SystemInfo["FanPWM"] = SystemInfo["Fan"] and fileCheck("/proc/stb/fp/fan_pwm")
Esempio n. 7
0
commitLogs = [
	("openATV Enigma2", "https://api.github.com/repos/openatv/enigma2/commits%s" % branch),
	("OE-Alliance Plugins", "https://api.github.com/repos/oe-alliance/oe-alliance-plugins/commits"),
	("Enigma2 Plugins", "https://api.github.com/repos/oe-alliance/enigma2-plugins/commits"),
	("OpenWebif", "https://api.github.com/repos/E2OpenPlugins/e2openplugin-OpenWebif/commits"),
	("MetrixHD Skin", "https://api.github.com/repos/openatv/MetrixHD/commits")
]
BoxInfo.setItem("InformationCommitLogs", commitLogs)
# NOTE: Return the welcome text back to Information.py until SystemInfo can process translation requests.
#
# welcome = [
# 	_("Welcome to %s") % BoxInfo.getItem("displaydistro", "Enigma2")
# ]
# BoxInfo.setItem("InformationDistributionWelcome", welcome)

BoxInfo.setItem("12V_Output", Misc_Options.getInstance().detected_12V_output())  #FIXME : Do we need this?
BoxInfo.setItem("3DMode", fileCheck("/proc/stb/fb/3dmode") or fileCheck("/proc/stb/fb/primary/3d"))
BoxInfo.setItem("3DZNorm", fileCheck("/proc/stb/fb/znorm") or fileCheck("/proc/stb/fb/primary/zoffset"))
BoxInfo.setItem("7segment", DISPLAYTYPE in ("7segment",))
BoxInfo.setItem("AmlogicFamily", SOC_FAMILY.startswith(("aml", "meson")) or exists("/proc/device-tree/amlogic-dt-id") or exists("/usr/bin/amlhalt") or exists("/sys/module/amports"))
BoxInfo.setItem("ArchIsARM64", ARCHITECTURE == "aarch64" or "64" in ARCHITECTURE)
BoxInfo.setItem("ArchIsARM", ARCHITECTURE.startswith(("arm", "cortex")))
BoxInfo.setItem("Blindscan", isPluginInstalled("Blindscan"))
BoxInfo.setItem("BoxName", GetBoxName())
canImageBackup = not MODEL.startswith('az') and not BRAND.startswith('cube') and not BRAND.startswith('wetek') and not MODEL.startswith('alien')
BoxInfo.setItem("canImageBackup", canImageBackup)
BoxInfo.setItem("CanMeasureFrontendInputPower", eDVBResourceManager.getInstance().canMeasureFrontendInputPower())
BoxInfo.setItem("canMultiBoot", MultiBoot.getBootSlots())
BoxInfo.setItem("CanNotDoSimultaneousTranscodeAndPIP", MODEL in ("vusolo4k", "gbquad4k", "gbue4k"))
BoxInfo.setItem("canRecovery", MODEL in ("hd51", "vs1500", "h7", "8100s") and ("disk.img", "mmcblk0p1") or MODEL in ("xc7439", "osmio4k", "osmio4kplus", "osmini4k") and ("emmc.img", "mmcblk1p1") or MODEL in ("gbmv200", "cc1", "sf8008", "sf8008m", "sf8008opt", "sx988", "ustym4kpro", "ustym4kottpremium", "beyonwizv2", "viper4k", "og2ott4k") and ("usb_update.bin", "none"))
BoxInfo.setItem("CanUse3DModeChoices", fileExists("/proc/stb/fb/3dmode_choices") and True or False)
Esempio n. 8
0
def InitUsageConfig():
	config.usage = ConfigSubsection();
	config.usage.showdish = ConfigYesNo(default = False)
	config.usage.multibouquet = ConfigYesNo(default = False)
	config.usage.quickzap_bouquet_change = ConfigYesNo(default = False)
	config.usage.e1like_radio_mode = ConfigYesNo(default = False)
	config.usage.infobar_timeout = ConfigSelection(default = "5", choices = [
		("0", _("no timeout")), ("1", "1 " + _("second")), ("2", "2 " + _("seconds")), ("3", "3 " + _("seconds")),
		("4", "4 " + _("seconds")), ("5", "5 " + _("seconds")), ("6", "6 " + _("seconds")), ("7", "7 " + _("seconds")),
		("8", "8 " + _("seconds")), ("9", "9 " + _("seconds")), ("10", "10 " + _("seconds"))])
	config.usage.show_infobar_on_zap = ConfigYesNo(default = True)
	config.usage.show_infobar_on_skip = ConfigYesNo(default = True)
	config.usage.show_infobar_on_event_change = ConfigYesNo(default = True)
	config.usage.hdd_standby = ConfigSelection(default = "600", choices = [
		("0", _("no standby")), ("10", "10 " + _("seconds")), ("30", "30 " + _("seconds")),
		("60", "1 " + _("minute")), ("120", "2 " + _("minutes")),
		("300", "5 " + _("minutes")), ("600", "10 " + _("minutes")), ("1200", "20 " + _("minutes")),
		("1800", "30 " + _("minutes")), ("3600", "1 " + _("hour")), ("7200", "2 " + _("hours")),
		("14400", "4 " + _("hours")) ])
	config.usage.output_12V = ConfigSelection(default = "do not change", choices = [
		("do not change", _("do not change")), ("off", _("off")), ("on", _("on")) ])

	config.usage.pip_zero_button = ConfigSelection(default = "standard", choices = [
		("standard", _("standard")), ("swap", _("swap PiP and main picture")),
		("swapstop", _("move PiP to main picture")), ("stop", _("stop PiP")) ])

	config.usage.allowed_timeshift_paths = ConfigLocations(default = ["/media/hdd/"])
	config.usage.timeshift_path = ConfigText(default = "/media/hdd")

	config.usage.on_movie_start = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("resume", _("Resume from last position")), ("beginning", _("Start from the beginning")) ])
	config.usage.on_movie_stop = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")) ])
	config.usage.on_movie_eof = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")), ("pause", _("Pause movie at end")) ])

	config.usage.setup_level = ConfigSelection(default = "intermediate", choices = [
		("simple", _("Simple")),
		("intermediate", _("Intermediate")),
		("expert", _("Expert")) ])

	config.usage.on_long_powerpress = ConfigSelection(default = "show_menu", choices = [
		("show_menu", _("show shutdown menu")),
		("shutdown", _("immediate shutdown")) ] )

	config.usage.alternatives_priority = ConfigSelection(default = "0", choices = [
		("0", "DVB-S/-C/-T"),
		("1", "DVB-S/-T/-C"),
		("2", "DVB-C/-S/-T"),
		("3", "DVB-C/-T/-S"),
		("4", "DVB-T/-C/-S"),
		("5", "DVB-T/-S/-C") ])

	config.usage.blinking_display_clock_during_recording = ConfigYesNo(default = False)

	config.usage.show_message_when_recording_starts = ConfigYesNo(default = True)

	config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(default = True)
	
	def TunerTypePriorityOrderChanged(configElement):
		setTunerTypePriorityOrder(int(configElement.value))
	config.usage.alternatives_priority.addNotifier(TunerTypePriorityOrderChanged)

	def setHDDStandby(configElement):
		for hdd in harddiskmanager.HDDList():
			hdd[1].setIdleTime(int(configElement.value))
	config.usage.hdd_standby.addNotifier(setHDDStandby)

	def set12VOutput(configElement):
		if configElement.value == "on":
			Misc_Options.getInstance().set_12V_output(1)
		elif configElement.value == "off":
			Misc_Options.getInstance().set_12V_output(0)
	config.usage.output_12V.addNotifier(set12VOutput)

	SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()

	config.usage.keymap = ConfigText(default = "/usr/share/enigma2/keymap.xml")

	config.seek = ConfigSubsection()
	config.seek.selfdefined_13 = ConfigNumber(default=15)
	config.seek.selfdefined_46 = ConfigNumber(default=60)
	config.seek.selfdefined_79 = ConfigNumber(default=300)

	config.seek.speeds_forward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
	config.seek.speeds_backward = ConfigSet(default=[8, 16, 32, 64, 128], choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
	config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8], choices=[2, 4, 6, 8, 12, 16, 25])

	config.seek.enter_forward = ConfigSelection(default = "2", choices = ["2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])
	config.seek.enter_backward = ConfigSelection(default = "1", choices = ["1", "2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])
	config.seek.stepwise_minspeed = ConfigSelection(default = "16", choices = ["Never", "2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])
	config.seek.stepwise_repeat = ConfigSelection(default = "3", choices = ["2", "3", "4", "5", "6"])

	config.seek.on_pause = ConfigSelection(default = "play", choices = [
		("play", _("Play")),
		("step", _("Singlestep (GOP)")),
		("last", _("Last speed")) ])

	def updateEnterForward(configElement):
		if not configElement.value:
			configElement.value = [2]
		updateChoices(config.seek.enter_forward, configElement.value)

	config.seek.speeds_forward.addNotifier(updateEnterForward, immediate_feedback = False)

	def updateEnterBackward(configElement):
		if not configElement.value:
			configElement.value = [2]
		updateChoices(config.seek.enter_backward, configElement.value)

	config.seek.speeds_backward.addNotifier(updateEnterBackward, immediate_feedback = False)
Esempio n. 9
0
def InitUsageConfig():
	config.misc.useNTPminutes = ConfigSelection(default = "30", choices = [("30", "30" + " " +_("minutes")), ("60", _("Hour")), ("1440", _("Once per day"))])
	config.misc.remotecontrol_text_support = ConfigYesNo(default = True)	

	config.usage = ConfigSubsection()
	config.usage.showdish = ConfigSelection(default = "flashing", choices = [("flashing", _("Flashing")), ("normal", _("Not Flashing")), ("off", _("Off"))])
	config.usage.multibouquet = ConfigYesNo(default = True)

	config.usage.alternative_number_mode = ConfigYesNo(default = False)
	def alternativeNumberModeChange(configElement):
		eDVBDB.getInstance().setNumberingMode(configElement.value)
		refreshServiceList()
	config.usage.alternative_number_mode.addNotifier(alternativeNumberModeChange)

	config.usage.servicetype_icon_mode = ConfigSelection(default = "0", choices = [("0", _("None")), ("1", _("Left from servicename")), ("2", _("Right from servicename"))])  
	config.usage.servicetype_icon_mode.addNotifier(refreshServiceList)

	config.usage.service_icon_enable = ConfigYesNo(default = False)
	config.usage.service_icon_enable.addNotifier(refreshServiceList)
	config.usage.servicelist_cursor_behavior = ConfigSelection(default = "keep", choices = [
		("standard", _("Standard")),
		("keep", _("Keep service")),
		("reverseB", _("Reverse bouquet buttons")),
		("keep reverseB", _("Keep service") + " + " + _("Reverse bouquet buttons"))])

	config.usage.multiepg_ask_bouquet = ConfigYesNo(default = False)

	config.usage.panicbutton = ConfigYesNo(default = True)
	config.usage.quickzap_bouquet_change = ConfigYesNo(default = False)
	config.usage.e1like_radio_mode = ConfigYesNo(default = True)

	choicelist = []
	for i in range(1, 11):
		choicelist.append(("%d" % i, ngettext("%d second", "%d seconds", i) % i))
	config.usage.infobar_timeout = ConfigSelection(default = "5", choices = [("0", _("No timeout"))] + choicelist)
	config.usage.show_infobar_on_zap = ConfigYesNo(default = True)
	config.usage.show_infobar_on_skip = ConfigYesNo(default = True)
	config.usage.show_infobar_on_event_change = ConfigYesNo(default = False)
	config.usage.show_infobar_channel_number = ConfigYesNo(default = False)
	config.usage.show_second_infobar = ConfigSelection(default = "5", choices = [(None, _("None")), ("0", _("No timeout"))] + choicelist + [("EPG",_("EPG")),("INFOBAREPG",_("InfoBar EPG"))])
	def showsecondinfobarChanged(configElement):
		if config.usage.show_second_infobar.value != "INFOBAREPG":
			SystemInfo["InfoBarEpg"] = True
		else:
			SystemInfo["InfoBarEpg"] = False
	config.usage.show_second_infobar.addNotifier(showsecondinfobarChanged, immediate_feedback = True)
	config.usage.infobar_frontend_source = ConfigSelection(default = "tuner", choices = [("settings", _("Settings")), ("tuner", _("Tuner"))])
	
	config.usage.show_picon_bkgrn = ConfigSelection(default = "transparent", choices = [("none", _("Disabled")), ("transparent", _("Transparent")), ("blue", _("Blue")), ("red", _("Red")), ("black", _("Black")), ("white", _("White")), ("lightgrey", _("Light Grey")), ("grey", _("Grey"))])

	config.usage.show_spinner = ConfigYesNo(default = True)
	config.usage.enable_tt_caching = ConfigYesNo(default = True)
	config.usage.sort_settings = ConfigYesNo(default = False)
	config.usage.sort_menus = ConfigYesNo(default = False)
	config.usage.sort_pluginlist = ConfigYesNo(default = True)
	config.usage.movieplayer_pvrstate = ConfigYesNo(default = True)

	choicelist = []
	for i in (10, 30):
		choicelist.append(("%d" % i, ngettext("%d second", "%d seconds", i) % i))
	for i in (60, 120, 300, 600, 1200, 1800):
		m = i / 60
		choicelist.append(("%d" % i, ngettext("%d minute", "%d minutes", m) % m))
	for i in (3600, 7200, 14400):
		h = i / 3600
		choicelist.append(("%d" % i, ngettext("%d hour", "%d hours", h) % h))
	config.usage.hdd_standby = ConfigSelection(default = "300", choices = [("0", _("No standby"))] + choicelist)
	config.usage.output_12V = ConfigSelection(default = "do not change", choices = [
		("do not change", _("Do not change")), ("off", _("Off")), ("on", _("On")) ])

	config.usage.pip_zero_button = ConfigSelection(default = "standard", choices = [
		("standard", _("Standard")), ("swap", _("Swap PiP and main picture")),
		("swapstop", _("Move PiP to main picture")), ("stop", _("Stop PiP")) ])
	config.usage.pip_hideOnExit = ConfigSelection(default = "no", choices = [
		("no", _("No")), ("popup", _("With popup")), ("without popup", _("Without popup")) ])

	if not os.path.exists(resolveFilename(SCOPE_HDD)):
		try:
			os.mkdir(resolveFilename(SCOPE_HDD),0755)
		except:
			pass
	config.usage.default_path = ConfigText(default = resolveFilename(SCOPE_HDD))
	if not config.usage.default_path.value.endswith('/'):
		tmpvalue = config.usage.default_path.value
		config.usage.default_path.setValue(tmpvalue + '/')
		config.usage.default_path.save()
	def defaultpathChanged(configElement):
		if not config.usage.default_path.value.endswith('/'):
			tmpvalue = config.usage.default_path.value
			config.usage.default_path.setValue(tmpvalue + '/')
			config.usage.default_path.save()
	config.usage.default_path.addNotifier(defaultpathChanged, immediate_feedback = False)

	config.usage.timer_path = ConfigText(default = "<default>")
	config.usage.instantrec_path = ConfigText(default = "<default>")

	if not os.path.exists(resolveFilename(SCOPE_TIMESHIFT)):
		try:
			os.mkdir(resolveFilename(SCOPE_TIMESHIFT),0755)
		except:
			pass
	config.usage.timeshift_path = ConfigText(default = resolveFilename(SCOPE_TIMESHIFT))
	if not config.usage.default_path.value.endswith('/'):
		tmpvalue = config.usage.timeshift_path.value
		config.usage.timeshift_path.setValue(tmpvalue + '/')
		config.usage.timeshift_path.save()
	def timeshiftpathChanged(configElement):
		if not config.usage.timeshift_path.value.endswith('/'):
			tmpvalue = config.usage.timeshift_path.value
			config.usage.timeshift_path.setValue(tmpvalue + '/')
			config.usage.timeshift_path.save()
	config.usage.timeshift_path.addNotifier(timeshiftpathChanged, immediate_feedback = False)
	config.usage.allowed_timeshift_paths = ConfigLocations(default = [resolveFilename(SCOPE_TIMESHIFT)])

	config.usage.movielist_trashcan = ConfigYesNo(default=True)
	config.usage.movielist_trashcan_network_clean = ConfigYesNo(default=False)
	config.usage.movielist_trashcan_days = ConfigSelectionNumber(min = 1, max = 31, stepwidth = 1, default = 8, wraparound = True)
	config.usage.movielist_trashcan_reserve = ConfigNumber(default = 40)
	config.usage.on_movie_start = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("resume", _("Resume from last position")), ("beginning", _("Start from the beginning")) ])
	config.usage.on_movie_stop = ConfigSelection(default = "movielist", choices = [
		("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")) ])
	config.usage.on_movie_eof = ConfigSelection(default = "movielist", choices = [
		("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")), ("pause", _("Pause movie at end")), ("playlist", _("Play next (return to movie list)")),
		("playlistquit", _("Play next (return to previous service)")), ("loop", _("Continues play (loop)")), ("repeatcurrent", _("Repeat"))])
	config.usage.next_movie_msg = ConfigYesNo(default = True)
	config.usage.leave_movieplayer_onExit = ConfigSelection(default = "no", choices = [
		("no", _("No")), ("popup", _("With popup")), ("without popup", _("Without popup")) ])

	config.usage.setup_level = ConfigSelection(default = "expert", choices = [
		("simple", _("Simple")),
		("intermediate", _("Intermediate")),
		("expert", _("Expert")) ])

	config.usage.on_long_powerpress = ConfigSelection(default = "show_menu", choices = [
		("show_menu", _("Show shutdown menu")),
		("shutdown", _("Immediate shutdown")),
		("standby", _("Standby")) ] )

	config.usage.on_short_powerpress = ConfigSelection(default = "standby", choices = [
		("show_menu", _("Show shutdown menu")),
		("shutdown", _("Immediate shutdown")),
		("standby", _("Standby")) ] )

	choicelist = [("0", "Disabled")]
	for i in (5, 30, 60, 300, 600, 900, 1200, 1800, 2700, 3600):
		if i < 60:
			m = ngettext("%d second", "%d seconds", i) % i
		else:
			m = abs(i / 60)
			m = ngettext("%d minute", "%d minutes", m) % m
		choicelist.append(("%d" % i, m))
	config.usage.screen_saver = ConfigSelection(default = "0", choices = choicelist)

	config.usage.check_timeshift = ConfigYesNo(default = True)

	config.usage.alternatives_priority = ConfigSelection(default = "0", choices = [
		("0", "DVB-S/-C/-T"),
		("1", "DVB-S/-T/-C"),
		("2", "DVB-C/-S/-T"),
		("3", "DVB-C/-T/-S"),
		("4", "DVB-T/-C/-S"),
		("5", "DVB-T/-S/-C") ])

	nims = [("-1", _("auto"))]
	rec_nims = [("-2", _("Disabled")), ("-1", _("auto"))]
	for x in nimmanager.nim_slots:
		nims.append((str(x.slot), x.getSlotName()))
		rec_nims.append((str(x.slot), x.getSlotName()))
	config.usage.frontend_priority = ConfigSelection(default = "-1", choices = nims)
	config.usage.recording_frontend_priority = ConfigSelection(default = "-2", choices = rec_nims)
	config.misc.disable_background_scan = ConfigYesNo(default = False)

	config.usage.jobtaksextensions = ConfigYesNo(default = True)

	config.usage.servicenum_fontsize = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True)
	config.usage.servicename_fontsize = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True)
	config.usage.serviceinfo_fontsize = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True)
	config.usage.serviceitems_per_page = ConfigSelectionNumber(default = 16, stepwidth = 1, min = 3, max = 40, wraparound = True)
	config.usage.show_servicelist = ConfigYesNo(default = True)
	config.usage.servicelist_mode = ConfigSelection(default = "standard", choices = [
		("standard", _("Standard")),
		("simple", _("Simple")) ] )
	config.usage.servicelistpreview_mode = ConfigYesNo(default = False)
	config.usage.tvradiobutton_mode = ConfigSelection(default="BouquetList", choices = [
					("ChannelList", _("Channel List")),
					("BouquetList", _("Bouquet List")),
					("MovieList", _("Movie List"))])
	config.usage.channelbutton_mode = ConfigSelection(default="0", choices = [
					("0", _("Just change channels")),
					("1", _("Channel List")),
					("2", _("Bouquet List"))])
	config.usage.show_bouquetalways = ConfigYesNo(default = False)
	config.usage.show_event_progress_in_servicelist = ConfigSelection(default = 'barright', choices = [
		('barleft', _("Progress bar left")),
		('barright', _("Progress bar right")),
		('percleft', _("Percentage left")),
		('percright', _("Percentage right")),
		('no', _("No")) ])
	config.usage.show_channel_numbers_in_servicelist = ConfigYesNo(default = True)
	config.usage.show_channel_jump_in_servicelist = ConfigSelection(default="alpha", choices = [
					("quick", _("Quick Actions")),
					("alpha", _("Alpha")),
					("number", _("Number"))])

	config.usage.show_event_progress_in_servicelist.addNotifier(refreshServiceList)
	config.usage.show_channel_numbers_in_servicelist.addNotifier(refreshServiceList)

	config.usage.blinking_display_clock_during_recording = ConfigYesNo(default = False)

	config.usage.show_message_when_recording_starts = ConfigYesNo(default = True)

	config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(default = True)
	config.usage.show_icons_in_movielist = ConfigSelection(default = 'i', choices = [
		('o', _("Off")),
		('p', _("Progress")),
		('s', _("Small progress")),
		('i', _("Icons")),
	])
	config.usage.movielist_unseen = ConfigYesNo(default = True)

	config.usage.swap_snr_on_osd = ConfigYesNo(default = False)
	config.usage.swap_time_display_on_osd = ConfigSelection(default = "0", choices = [("0", _("Skin Setting")), ("1", _("Mins")), ("2", _("Mins Secs")), ("3", _("Hours Mins")), ("4", _("Hours Mins Secs")), ("5", _("Percentage"))])
	config.usage.swap_media_time_display_on_osd = ConfigSelection(default = "0", choices = [("0", _("Skin Setting")), ("1", _("Mins")), ("2", _("Mins Secs")), ("3", _("Hours Mins")), ("4", _("Hours Mins Secs")), ("5", _("Percentage"))])
	config.usage.swap_time_remaining_on_osd = ConfigSelection(default = "0", choices = [("0", _("Remaining")), ("1", _("Elapsed")), ("2", _("Elapsed & Remaining")), ("3", _("Remaining & Elapsed"))])
	config.usage.elapsed_time_positive_osd = ConfigYesNo(default = False)
	config.usage.swap_time_display_on_vfd = ConfigSelection(default = "0", choices = [("0", _("Skin Setting")), ("1", _("Mins")), ("2", _("Mins Secs")), ("3", _("Hours Mins")), ("4", _("Hours Mins Secs")), ("5", _("Percentage"))])
	config.usage.swap_media_time_display_on_vfd = ConfigSelection(default = "0", choices = [("0", _("Skin Setting")), ("1", _("Mins")), ("2", _("Mins Secs")), ("3", _("Hours Mins")), ("4", _("Hours Mins Secs")), ("5", _("Percentage"))])
	config.usage.swap_time_remaining_on_vfd = ConfigSelection(default = "0", choices = [("0", _("Remaining")), ("1", _("Elapsed")), ("2", _("Elapsed & Remaining")), ("3", _("Remaining & Elapsed"))])
	config.usage.elapsed_time_positive_vfd = ConfigYesNo(default = False)

	def SpinnerOnOffChanged(configElement):
		setSpinnerOnOff(int(configElement.value))
	config.usage.show_spinner.addNotifier(SpinnerOnOffChanged)

	def EnableTtCachingChanged(configElement):
		setEnableTtCachingOnOff(int(configElement.value))
	config.usage.enable_tt_caching.addNotifier(EnableTtCachingChanged)

	def TunerTypePriorityOrderChanged(configElement):
		setTunerTypePriorityOrder(int(configElement.value))
	config.usage.alternatives_priority.addNotifier(TunerTypePriorityOrderChanged, immediate_feedback=False)

	def PreferredTunerChanged(configElement):
		setPreferredTuner(int(configElement.value))
	config.usage.frontend_priority.addNotifier(PreferredTunerChanged)

	config.usage.hide_zap_errors = ConfigYesNo(default = False)
	config.usage.hide_ci_messages = ConfigYesNo(default = False)
	config.usage.show_cryptoinfo = ConfigSelection([("0", _("Off")),("1", _("One line")),("2", _("Two lines"))], "2")
	config.usage.show_eit_nownext = ConfigYesNo(default = True)
	config.usage.show_vcr_scart = ConfigYesNo(default = False)

	config.epg = ConfigSubsection()
	config.epg.eit = ConfigYesNo(default = True)
	config.epg.mhw = ConfigYesNo(default = False)
	config.epg.freesat = ConfigYesNo(default = True)
	config.epg.viasat = ConfigYesNo(default = True)
	config.epg.netmed = ConfigYesNo(default = True)

	def EpgSettingsChanged(configElement):
		mask = 0xffffffff
		if not config.epg.eit.value:
			mask &= ~(eEPGCache.NOWNEXT | eEPGCache.SCHEDULE | eEPGCache.SCHEDULE_OTHER)
		if not config.epg.mhw.value:
			mask &= ~eEPGCache.MHW
		if not config.epg.freesat.value:
			mask &= ~(eEPGCache.FREESAT_NOWNEXT | eEPGCache.FREESAT_SCHEDULE | eEPGCache.FREESAT_SCHEDULE_OTHER)
		if not config.epg.viasat.value:
			mask &= ~eEPGCache.VIASAT
		if not config.epg.netmed.value:
			mask &= ~(eEPGCache.NETMED_SCHEDULE | eEPGCache.NETMED_SCHEDULE_OTHER)
		eEPGCache.getInstance().setEpgSources(mask)
	config.epg.eit.addNotifier(EpgSettingsChanged)
	config.epg.mhw.addNotifier(EpgSettingsChanged)
	config.epg.freesat.addNotifier(EpgSettingsChanged)
	config.epg.viasat.addNotifier(EpgSettingsChanged)
	config.epg.netmed.addNotifier(EpgSettingsChanged)

	config.epg.histminutes = ConfigSelectionNumber(min = 0, max = 120, stepwidth = 15, default = 0, wraparound = True)
	def EpgHistorySecondsChanged(configElement):
		eEPGCache.getInstance().setEpgHistorySeconds(config.epg.histminutes.value*60)
	config.epg.histminutes.addNotifier(EpgHistorySecondsChanged)

	config.epg.cacheloadsched = ConfigYesNo(default = False)
	config.epg.cachesavesched = ConfigYesNo(default = False)
	def EpgCacheLoadSchedChanged(configElement):
		import EpgLoadSave
		EpgLoadSave.EpgCacheLoadCheck()
	def EpgCacheSaveSchedChanged(configElement):
		import EpgLoadSave
		EpgLoadSave.EpgCacheSaveCheck()
	config.epg.cacheloadsched.addNotifier(EpgCacheLoadSchedChanged, immediate_feedback = False)
	config.epg.cachesavesched.addNotifier(EpgCacheSaveSchedChanged, immediate_feedback = False)
	config.epg.cacheloadtimer = ConfigSelectionNumber(default = 24, stepwidth = 1, min = 1, max = 24, wraparound = True)
	config.epg.cachesavetimer = ConfigSelectionNumber(default = 24, stepwidth = 1, min = 1, max = 24, wraparound = True)

	config.osd.dst_left = ConfigSelectionNumber(default = 0, stepwidth = 1, min = 0, max = 720, wraparound = False)
	config.osd.dst_width = ConfigSelectionNumber(default = 720, stepwidth = 1, min = 0, max = 720, wraparound = False)
	config.osd.dst_top = ConfigSelectionNumber(default = 0, stepwidth = 1, min = 0, max = 576, wraparound = False)
	config.osd.dst_height = ConfigSelectionNumber(default = 576, stepwidth = 1, min = 0, max = 576, wraparound = False)
	config.osd.alpha = ConfigSelectionNumber(default = 255, stepwidth = 1, min = 0, max = 255, wraparound = False)
	config.av.osd_alpha = NoSave(ConfigNumber(default = 255))
	config.osd.threeDmode = ConfigSelection([("off", _("Off")), ("auto", _("Auto")), ("sidebyside", _("Side by Side")),("topandbottom", _("Top and Bottom"))], "auto")
	config.osd.threeDznorm = ConfigSlider(default = 50, increment = 1, limits = (0, 100))
	config.osd.show3dextensions = ConfigYesNo(default = False)

	hddchoises = [('/etc/enigma2/', 'Internal Flash')]
	for p in harddiskmanager.getMountedPartitions():
		if os.path.exists(p.mountpoint):
			d = os.path.normpath(p.mountpoint)
			if p.mountpoint != '/':
				hddchoises.append((p.mountpoint, d))
	config.misc.epgcachepath = ConfigSelection(default = '/etc/enigma2/', choices = hddchoises)
	config.misc.epgcachefilename = ConfigText(default='epg', fixed_size=False)
	config.misc.epgcache_filename = ConfigText(default = (config.misc.epgcachepath.value + config.misc.epgcachefilename.value.replace('.dat','') + '.dat'))
	def EpgCacheChanged(configElement):
		config.misc.epgcache_filename.setValue(os.path.join(config.misc.epgcachepath.value, config.misc.epgcachefilename.value.replace('.dat','') + '.dat'))
		config.misc.epgcache_filename.save()
		eEPGCache.getInstance().setCacheFile(config.misc.epgcache_filename.value)
		epgcache = eEPGCache.getInstance()
		epgcache.save()
		if not config.misc.epgcache_filename.value.startswith("/etc/enigma2/"):
			if os.path.exists('/etc/enigma2/' + config.misc.epgcachefilename.value.replace('.dat','') + '.dat'):
				os.remove('/etc/enigma2/' + config.misc.epgcachefilename.value.replace('.dat','') + '.dat')
	config.misc.epgcachepath.addNotifier(EpgCacheChanged, immediate_feedback = False)
	config.misc.epgcachefilename.addNotifier(EpgCacheChanged, immediate_feedback = False)

	config.misc.showradiopic = ConfigYesNo(default = True)

	def setHDDStandby(configElement):
		for hdd in harddiskmanager.HDDList():
			hdd[1].setIdleTime(int(configElement.value))
	config.usage.hdd_standby.addNotifier(setHDDStandby, immediate_feedback=False)

	def set12VOutput(configElement):
		if configElement.value == "on":
			Misc_Options.getInstance().set_12V_output(1)
		elif configElement.value == "off":
			Misc_Options.getInstance().set_12V_output(0)
	config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

	SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()

	config.usage.keymap = ConfigText(default = eEnv.resolve("${datadir}/enigma2/keymap.xml"))

	config.network = ConfigSubsection()
	config.network.AFP_autostart = ConfigYesNo(default = True)
	config.network.NFS_autostart = ConfigYesNo(default = True)
	config.network.OpenVPN_autostart = ConfigYesNo(default = True)
	config.network.Samba_autostart = ConfigYesNo(default = True)
	config.network.Inadyn_autostart = ConfigYesNo(default = True)
	config.network.uShare_autostart = ConfigYesNo(default = True)

	config.softwareupdate = ConfigSubsection()
	config.softwareupdate.autosettingsbackup = ConfigYesNo(default = True)
	config.softwareupdate.autoimagebackup = ConfigYesNo(default = False)
	config.softwareupdate.check = ConfigYesNo(default = True)
	config.softwareupdate.checktimer = ConfigSelectionNumber(min = 1, max = 48, stepwidth = 1, default = 6, wraparound = True)
	config.softwareupdate.updatelastcheck = ConfigInteger(default=0)
	config.softwareupdate.updatefound = NoSave(ConfigBoolean(default = False))
	config.softwareupdate.updatebeta = ConfigYesNo(default = False)
	config.softwareupdate.updateisunstable = ConfigInteger(default=0)

	config.timeshift = ConfigSubsection()
	choicelist = [("0", "Disabled")]
	for i in (2, 3, 4, 5, 10, 20, 30):
		choicelist.append(("%d" % i, ngettext("%d second", "%d seconds", i) % i))
	for i in (60, 120, 300):
		m = i / 60
		choicelist.append(("%d" % i, ngettext("%d minute", "%d minutes", m) % m))
	config.timeshift.startdelay = ConfigSelection(default = "0", choices = choicelist)
	config.timeshift.showinfobar = ConfigYesNo(default = True)
	config.timeshift.stopwhilerecording = ConfigYesNo(default = False)
	config.timeshift.favoriteSaveAction = ConfigSelection([("askuser", _("Ask user")),("savetimeshift", _("Save and stop")),("savetimeshiftandrecord", _("Save and record")),("noSave", _("Don't save"))], "askuser")
	config.timeshift.permanentrecording = ConfigYesNo(default = False)
	config.timeshift.isRecording = NoSave(ConfigYesNo(default = False))

	config.seek = ConfigSubsection()
	config.seek.baractivation = ConfigSelection([("leftright", _("Long Left/Right")),("ffrw", _("Long << / >>"))], "leftright")
	config.seek.sensibility = ConfigSelectionNumber(min = 1, max = 10, stepwidth = 1, default = 10, wraparound = True)
	config.seek.selfdefined_13 = ConfigSelectionNumber(min = 1, max = 120, stepwidth = 1, default = 15, wraparound = True)
	config.seek.selfdefined_46 = ConfigSelectionNumber(min = 1, max = 240, stepwidth = 1, default = 60, wraparound = True)
	config.seek.selfdefined_79 = ConfigSelectionNumber(min = 1, max = 480, stepwidth = 1, default = 300, wraparound = True)

	config.seek.speeds_forward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
	config.seek.speeds_backward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
	config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8], choices=[2, 4, 6, 8, 12, 16, 25])

	config.seek.enter_forward = ConfigSelection(default = "2", choices = ["2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])
	config.seek.enter_backward = ConfigSelection(default = "1", choices = ["1", "2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])

	config.seek.on_pause = ConfigSelection(default = "play", choices = [
		("play", _("Play")),
		("step", _("Single step (GOP)")),
		("last", _("Last speed")) ])


	config.crash = ConfigSubsection()
	config.crash.details = ConfigYesNo(default = True)
	config.crash.enabledebug = ConfigYesNo(default = False)
	config.crash.debugloglimit = ConfigSelectionNumber(min = 1, max = 10, stepwidth = 1, default = 4, wraparound = True)
	config.crash.daysloglimit = ConfigSelectionNumber(min = 1, max = 30, stepwidth = 1, default = 8, wraparound = True)
	config.crash.sizeloglimit = ConfigSelectionNumber(min = 1, max = 20, stepwidth = 1, default = 10, wraparound = True)

	debugpath = [('/home/root/logs/', '/home/root/')]
	for p in harddiskmanager.getMountedPartitions():
		if os.path.exists(p.mountpoint):
			d = os.path.normpath(p.mountpoint)
			if p.mountpoint != '/':
				debugpath.append((p.mountpoint + 'logs/', d))
	config.crash.debug_path = ConfigSelection(default = "/home/root/logs/", choices = debugpath)

	def updatedebug_path(configElement):
		if not os.path.exists(config.crash.debug_path.value):
			os.mkdir(config.crash.debug_path.value,0755)
	config.crash.debug_path.addNotifier(updatedebug_path, immediate_feedback = False)

	config.usage.timerlist_finished_timer_position = ConfigSelection(default = "end", choices = [("beginning", _("at beginning")), ("end", _("at end"))])

	def updateEnterForward(configElement):
		if not configElement.value:
			configElement.value = [2]
		updateChoices(config.seek.enter_forward, configElement.value)

	config.seek.speeds_forward.addNotifier(updateEnterForward, immediate_feedback = False)

	def updateEnterBackward(configElement):
		if not configElement.value:
			configElement.value = [2]
		updateChoices(config.seek.enter_backward, configElement.value)

	config.seek.speeds_backward.addNotifier(updateEnterBackward, immediate_feedback = False)

	def updateEraseSpeed(el):
		eBackgroundFileEraser.getInstance().setEraseSpeed(int(el.value))
	def updateEraseFlags(el):
		eBackgroundFileEraser.getInstance().setEraseFlags(int(el.value))
	config.misc.erase_speed = ConfigSelection(default="20", choices = [
		("10", "10 MB/s"),
		("20", "20 MB/s"),
		("50", "50 MB/s"),
		("100", "100 MB/s")])
	config.misc.erase_speed.addNotifier(updateEraseSpeed, immediate_feedback = False)
	config.misc.erase_flags = ConfigSelection(default="1", choices = [
		("0", _("Disable")),
		("1", _("Internal hdd only")),
		("3", _("Everywhere"))])
	config.misc.erase_flags.addNotifier(updateEraseFlags, immediate_feedback = False)

	SystemInfo["ZapMode"] = os.path.exists("/proc/stb/video/zapmode") or os.path.exists("/proc/stb/video/zapping_mode")
	if SystemInfo["ZapMode"]:
		if os.path.exists("/proc/stb/video/zapping_mode"):
			zapfile = "/proc/stb/video/zapping_mode"
		else:
			zapfile = "/proc/stb/video/zapmode"
		zapoptions = [("mute", _("Black screen")), ("hold", _("Hold screen")), ("mutetilllock", _("Black screen till locked")), ("holdtilllock", _("Hold till locked"))]
		def setZapmode(el):
			try:
				file = open(zapfile, "w")
				file.write(el.value)
				file.close()
			except:
				pass
		config.misc.zapmode = ConfigSelection(default = "mute", choices = zapoptions )
		config.misc.zapmode.addNotifier(setZapmode, immediate_feedback = False)
	config.usage.historymode = ConfigSelection(default = "1", choices = [("0", _("Just zap")), ("1", _("Show menu"))])

	config.subtitles = ConfigSubsection()
	config.subtitles.ttx_subtitle_colors = ConfigSelection(default = "1", choices = [
		("0", _("original")),
		("1", _("white")),
		("2", _("yellow")) ])
	config.subtitles.ttx_subtitle_original_position = ConfigYesNo(default = False)
	config.subtitles.subtitle_position = ConfigSelection( choices = ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100", "150", "200", "250", "300", "350", "400", "450"], default = "50")
	config.subtitles.subtitle_alignment = ConfigSelection(choices = [("left", _("left")), ("center", _("center")), ("right", _("right"))], default = "center")
	config.subtitles.subtitle_rewrap = ConfigYesNo(default = False)
	config.subtitles.subtitle_borderwidth = ConfigSelection(choices = ["1", "2", "3", "4", "5"], default = "3")
	config.subtitles.subtitle_fontsize  = ConfigSelection(choices = ["16", "18", "20", "22", "24", "26", "28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54"], default = "34")

	subtitle_delay_choicelist = []
	for i in range(-900000, 1845000, 45000):
		if i == 0:
			subtitle_delay_choicelist.append(("0", _("No delay")))
		else:
			subtitle_delay_choicelist.append(("%d" % i, "%2.1f sec" % (i / 90000.)))
	config.subtitles.subtitle_noPTSrecordingdelay = ConfigSelection(default = "315000", choices = subtitle_delay_choicelist)

	config.subtitles.dvb_subtitles_yellow = ConfigYesNo(default = False)
	config.subtitles.dvb_subtitles_original_position = ConfigSelection(default = "0", choices = [("0", _("Original")), ("1", _("Fixed")), ("2", _("Relative"))])
	config.subtitles.dvb_subtitles_centered = ConfigYesNo(default = True)
	config.subtitles.subtitle_bad_timing_delay = ConfigSelection(default = "0", choices = subtitle_delay_choicelist)
	config.subtitles.dvb_subtitles_backtrans = ConfigSelection(default = "0", choices = [
		("0", _("No transparency")),
		("25", "10%"),
		("50", "20%"),
		("75", "30%"),
		("100", "40%"),
		("125", "50%"),
		("150", "60%"),
		("175", "70%"),
		("200", "80%"),
		("225", "90%"),
		("255", _("Full transparency"))])
	config.subtitles.pango_subtitle_colors = ConfigSelection(default = "0", choices = [
		("0", _("alternative")),
		("1", _("white")),
		("2", _("yellow")) ])
	config.subtitles.pango_subtitles_delay = ConfigSelection(default = "0", choices = subtitle_delay_choicelist)
	config.subtitles.pango_subtitles_fps = ConfigSelection(default = "1", choices = [
		("1", _("Original")),
		("23976", _("23.976")),
		("24000", _("24")),
		("25000", _("25")),
		("29970", _("29.97")),
		("30000", _("30"))])
	config.subtitles.pango_autoturnon = ConfigYesNo(default = True)

	config.autolanguage = ConfigSubsection()
	audio_language_choices=[
		("---", _("None")),
		("und", _("Undetermined")),
		("orj dos ory org esl qaa und mis mul ORY ORJ Audio_ORJ", _("Original")),
		("ara", _("Arabic")),
		("eus baq", _("Basque")),
		("bul", _("Bulgarian")),
		("hrv", _("Croatian")),
		("ces cze", _("Czech")),
		("dan", _("Danish")),
		("dut ndl Deutsch", _("Dutch")),
		("eng qaa Englisch", _("English")),
		("est", _("Estonian")),
		("fin", _("Finnish")),
		("fra fre", _("French")),
		("deu ger", _("German")),
		("ell gre", _("Greek")),
		("heb", _("Hebrew")),
		("hun", _("Hungarian")),
		("ita", _("Italian")),
		("lav", _("Latvian")),
		("lit", _("Lithuanian")),
		("ltz", _("Luxembourgish")),
		("nor", _("Norwegian")),
		("pol", _("Polish")),
		("por", _("Portuguese")),
		("fas per", _("Persian")),
		("ron rum", _("Romanian")),
		("rus", _("Russian")),
		("srp", _("Serbian")),
		("slk slo", _("Slovak")),
		("slv", _("Slovenian")),
		("spa", _("Spanish")),
		("swe", _("Swedish")),
		("tha", _("Thai")),
		("tur Audio_TUR", _("Turkish"))]

	def setEpgLanguage(configElement):
		eServiceEvent.setEPGLanguage(configElement.value)
	config.autolanguage.audio_epglanguage = ConfigSelection(audio_language_choices[:1] + audio_language_choices [2:], default="---")
	config.autolanguage.audio_epglanguage.addNotifier(setEpgLanguage)

	def setEpgLanguageAlternative(configElement):
		eServiceEvent.setEPGLanguageAlternative(configElement.value)
	config.autolanguage.audio_epglanguage_alternative = ConfigSelection(audio_language_choices[:1] + audio_language_choices [2:], default="---")
	config.autolanguage.audio_epglanguage_alternative.addNotifier(setEpgLanguageAlternative)

	config.autolanguage.audio_autoselect1 = ConfigSelection(choices=audio_language_choices, default="---")
	config.autolanguage.audio_autoselect2 = ConfigSelection(choices=audio_language_choices, default="---")
	config.autolanguage.audio_autoselect3 = ConfigSelection(choices=audio_language_choices, default="---")
	config.autolanguage.audio_autoselect4 = ConfigSelection(choices=audio_language_choices, default="---")
	config.autolanguage.audio_defaultac3 = ConfigYesNo(default = True)
	config.autolanguage.audio_defaultddp = ConfigYesNo(default = False)
	config.autolanguage.audio_usecache = ConfigYesNo(default = True)

	subtitle_language_choices = audio_language_choices[:1] + audio_language_choices [2:]
	config.autolanguage.subtitle_autoselect1 = ConfigSelection(choices=subtitle_language_choices, default="---")
	config.autolanguage.subtitle_autoselect2 = ConfigSelection(choices=subtitle_language_choices, default="---")
	config.autolanguage.subtitle_autoselect3 = ConfigSelection(choices=subtitle_language_choices, default="---")
	config.autolanguage.subtitle_autoselect4 = ConfigSelection(choices=subtitle_language_choices, default="---")
	config.autolanguage.subtitle_hearingimpaired = ConfigYesNo(default = False)
	config.autolanguage.subtitle_defaultimpaired = ConfigYesNo(default = False)
	config.autolanguage.subtitle_defaultdvb = ConfigYesNo(default = False)
	config.autolanguage.subtitle_usecache = ConfigYesNo(default = True)
	config.autolanguage.equal_languages = ConfigSelection(default = "15", choices = [
		("0", _("None")),("1", "1"),("2", "2"),("3", "1,2"),
		("4", "3"),("5", "1,3"),("6", "2,3"),("7", "1,2,3"),
		("8", "4"),("9", "1,4"),("10", "2,4"),("11", "1,2,4"),
		("12", "3,4"),("13", "1,3,4"),("14", "2,3,4"),("15", _("All"))])

	config.logmanager = ConfigSubsection()
	config.logmanager.showinextensions = ConfigYesNo(default = False)
	config.logmanager.user = ConfigText(default='', fixed_size=False)
	config.logmanager.useremail = ConfigText(default='', fixed_size=False)
	config.logmanager.usersendcopy = ConfigYesNo(default = True)
	config.logmanager.path = ConfigText(default = "/")
	config.logmanager.additionalinfo = NoSave(ConfigText(default = ""))
	config.logmanager.sentfiles = ConfigLocations(default='')

	config.vixsettings = ConfigSubsection()
	config.vixsettings.Subservice = ConfigYesNo(default = False)
	config.vixsettings.ColouredButtons = ConfigYesNo(default = True)
	config.vixsettings.InfoBarEpg_mode = ConfigSelection(default="3", choices = [
					("0", _("as plugin in extended bar")),
					("1", _("with long OK press")),
					("2", _("with exit button")),
					("3", _("with left/right buttons"))])

	config.epgselection = ConfigSubsection()
	config.epgselection.sort = ConfigSelection(default="0", choices = [("0", _("Time")),("1", _("Alphanumeric"))])
	config.epgselection.overjump = ConfigYesNo(default = False)
	config.epgselection.infobar_type_mode = ConfigSelection(choices = [("graphics",_("Multi EPG")), ("single", _("Single EPG"))], default = "graphics")
	if SystemInfo.get("NumVideoDecoders", 1) > 1:
		config.epgselection.infobar_preview_mode = ConfigSelection(choices = [("0",_("Disabled")), ("1", _("Full screen")), ("2", _("PiP"))], default = "1")
	else:
		config.epgselection.infobar_preview_mode = ConfigSelection(choices = [("0",_("Disabled")), ("1", _("Full screen"))], default = "1")
	config.epgselection.infobar_ok = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap")
	config.epgselection.infobar_oklong = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap + Exit")
	config.epgselection.infobar_itemsperpage = ConfigSelectionNumber(default = 2, stepwidth = 1, min = 1, max = 4, wraparound = True)
	if SystemInfo.get("NumVideoDecoders", 1) > 1:
		if HardwareInfo().is_nextgen():
			previewdefault = "2"
		else:
			previewdefault = "1"
		config.epgselection.infobar_preview_mode = ConfigSelection(choices = [("0",_("Disabled")), ("1", _("Full screen")), ("2", _("PiP"))], default = previewdefault)
	else:
		config.epgselection.infobar_preview_mode = ConfigSelection(choices = [("0",_("Disabled")), ("1", _("Full screen"))], default = "1")
	config.epgselection.infobar_roundto = ConfigSelection(default = "15", choices = [("15", _("%d minutes") % 15), ("30", _("%d minutes") % 30), ("60", _("%d minutes") % 60)])
	config.epgselection.infobar_prevtime = ConfigClock(default = time())
	config.epgselection.infobar_prevtimeperiod = ConfigSelection(default = "180", choices = [("60", _("%d minutes") % 60), ("90", _("%d minutes") % 90), ("120", _("%d minutes") % 120), ("150", _("%d minutes") % 150), ("180", _("%d minutes") % 180), ("210", _("%d minutes") % 210), ("240", _("%d minutes") % 240), ("270", _("%d minutes") % 270), ("300", _("%d minutes") % 300)])
	config.epgselection.infobar_primetimehour = ConfigSelectionNumber(default = 20, stepwidth = 1, min = 00, max = 23, wraparound = True)
	config.epgselection.infobar_primetimemins = ConfigSelectionNumber(default = 00, stepwidth = 1, min = 00, max = 59, wraparound = True)
	config.epgselection.infobar_servicetitle_mode = ConfigSelection(default = "servicename", choices = [("servicename", _("Service Name")),("picon", _("Picon")),("picon+servicename", _("Picon and Service Name")) ])
	config.epgselection.infobar_servfs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True)
	config.epgselection.infobar_eventfs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True)
	config.epgselection.infobar_timelinefs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True)
	config.epgselection.infobar_timeline24h = ConfigYesNo(default = True)
	config.epgselection.infobar_servicewidth = ConfigSelectionNumber(default = 250, stepwidth = 1, min = 70, max = 500, wraparound = True)
	config.epgselection.infobar_piconwidth = ConfigSelectionNumber(default = 100, stepwidth = 1, min = 70, max = 500, wraparound = True)
	config.epgselection.infobar_infowidth = ConfigSelectionNumber(default = 50, stepwidth = 25, min = 0, max = 150, wraparound = True)
	config.epgselection.enhanced_preview_mode = ConfigYesNo(default = True)
	config.epgselection.enhanced_ok = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap")
	config.epgselection.enhanced_oklong = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap + Exit")
	config.epgselection.enhanced_eventfs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True)
	config.epgselection.enhanced_itemsperpage = ConfigSelectionNumber(default = 18, stepwidth = 1, min = 12, max = 40, wraparound = True)
	config.epgselection.multi_showbouquet = ConfigYesNo(default = False)
	config.epgselection.multi_preview_mode = ConfigYesNo(default = True)
	config.epgselection.multi_ok = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap")
	config.epgselection.multi_oklong = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap + Exit")
	config.epgselection.multi_eventfs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True)
	config.epgselection.multi_itemsperpage = ConfigSelectionNumber(default = 18, stepwidth = 1, min = 12, max = 40, wraparound = True)
	config.epgselection.graph_showbouquet = ConfigYesNo(default = False)
	config.epgselection.graph_preview_mode = ConfigYesNo(default = True)
	config.epgselection.graph_type_mode = ConfigSelection(choices = [("graphics",_("Graphics")), ("text", _("Text"))], default = "graphics")
	config.epgselection.graph_ok = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap")
	config.epgselection.graph_oklong = ConfigSelection(choices = [("Zap",_("Zap")), ("Zap + Exit", _("Zap + Exit"))], default = "Zap + Exit")
	config.epgselection.graph_info = ConfigSelection(choices = [("Channel Info", _("Channel Info")), ("Single EPG", _("Single EPG"))], default = "Channel Info")
	config.epgselection.graph_infolong = ConfigSelection(choices = [("Channel Info", _("Channel Info")), ("Single EPG", _("Single EPG"))], default = "Single EPG")
	config.epgselection.graph_roundto = ConfigSelection(default = "15", choices = [("15", _("%d minutes") % 15), ("30", _("%d minutes") % 30), ("60", _("%d minutes") % 60)])
	config.epgselection.graph_prevtime = ConfigClock(default = time())
	config.epgselection.graph_prevtimeperiod = ConfigSelection(default = "180", choices = [("60", _("%d minutes") % 60), ("90", _("%d minutes") % 90), ("120", _("%d minutes") % 120), ("150", _("%d minutes") % 150), ("180", _("%d minutes") % 180), ("210", _("%d minutes") % 210), ("240", _("%d minutes") % 240), ("270", _("%d minutes") % 270), ("300", _("%d minutes") % 300)])
	config.epgselection.graph_primetimehour = ConfigSelectionNumber(default = 20, stepwidth = 1, min = 00, max = 23, wraparound = True)
	config.epgselection.graph_primetimemins = ConfigSelectionNumber(default = 00, stepwidth = 1, min = 00, max = 59, wraparound = True)
	config.epgselection.graph_servicetitle_mode = ConfigSelection(default = "picon+servicename", choices = [("servicename", _("Service Name")),("picon", _("Picon")),("picon+servicename", _("Picon and Service Name")) ])
	config.epgselection.graph_channel1 = ConfigYesNo(default = False)
	config.epgselection.graph_servfs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True)
	config.epgselection.graph_eventfs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True)
	config.epgselection.graph_timelinefs = ConfigSelectionNumber(default = 0, stepwidth = 1, min = -8, max = 10, wraparound = True)
	config.epgselection.graph_timeline24h = ConfigYesNo(default = True)
	config.epgselection.graph_itemsperpage = ConfigSelectionNumber(default = 8, stepwidth = 1, min = 3, max = 16, wraparound = True)
	config.epgselection.graph_pig = ConfigYesNo(default = True)
	config.epgselection.graph_heightswitch = NoSave(ConfigYesNo(default = False))
	config.epgselection.graph_servicewidth = ConfigSelectionNumber(default = 250, stepwidth = 1, min = 70, max = 500, wraparound = True)
	config.epgselection.graph_piconwidth = ConfigSelectionNumber(default = 100, stepwidth = 1, min = 70, max = 500, wraparound = True)
	config.epgselection.graph_infowidth = ConfigSelectionNumber(default = 50, stepwidth = 25, min = 0, max = 150, wraparound = True)

	if not os.path.exists('/usr/softcams/'):
		os.mkdir('/usr/softcams/',0755)
	softcams = os.listdir('/usr/softcams/')
	config.oscaminfo = ConfigSubsection()
	config.oscaminfo.showInExtensions = ConfigYesNo(default=False)
	config.oscaminfo.userdatafromconf = ConfigYesNo(default = False)
	config.oscaminfo.autoupdate = ConfigYesNo(default = False)
	config.oscaminfo.username = ConfigText(default = "username", fixed_size = False, visible_width=12)
	config.oscaminfo.password = ConfigPassword(default = "password", fixed_size = False)
	config.oscaminfo.ip = ConfigIP( default = [ 127,0,0,1 ], auto_jump=True)
	config.oscaminfo.port = ConfigInteger(default = 16002, limits=(0,65536) )
	config.oscaminfo.intervall = ConfigSelectionNumber(min = 1, max = 600, stepwidth = 1, default = 10, wraparound = True)
	SystemInfo["OScamInstalled"] = False

	config.cccaminfo = ConfigSubsection()
	config.cccaminfo.showInExtensions = ConfigYesNo(default=False)
	config.cccaminfo.serverNameLength = ConfigSelectionNumber(min = 10, max = 100, stepwidth = 1, default = 22, wraparound = True)
	config.cccaminfo.name = ConfigText(default="Profile", fixed_size=False)
	config.cccaminfo.ip = ConfigText(default="192.168.2.12", fixed_size=False)
	config.cccaminfo.username = ConfigText(default="", fixed_size=False)
	config.cccaminfo.password = ConfigText(default="", fixed_size=False)
	config.cccaminfo.port = ConfigInteger(default=16001, limits=(1, 65535))
	config.cccaminfo.profile = ConfigText(default="", fixed_size=False)
	config.cccaminfo.ecmInfoEnabled = ConfigYesNo(default=True)
	config.cccaminfo.ecmInfoTime = ConfigSelectionNumber(min = 1, max = 10, stepwidth = 1, default = 5, wraparound = True)
	config.cccaminfo.ecmInfoForceHide = ConfigYesNo(default=True)
	config.cccaminfo.ecmInfoPositionX = ConfigInteger(default=50)
	config.cccaminfo.ecmInfoPositionY = ConfigInteger(default=50)
	config.cccaminfo.blacklist = ConfigText(default="/media/cf/CCcamInfo.blacklisted", fixed_size=False)
	config.cccaminfo.profiles = ConfigText(default="/media/cf/CCcamInfo.profiles", fixed_size=False)
	SystemInfo["CCcamInstalled"] = False
	for softcam in softcams:
		if softcam.lower().startswith('cccam'):
			config.cccaminfo.showInExtensions = ConfigYesNo(default=True)
			SystemInfo["CCcamInstalled"] = True
		elif softcam.lower().startswith('oscam'):
			config.oscaminfo.showInExtensions = ConfigYesNo(default=True)
			SystemInfo["OScamInstalled"] = True

	config.streaming = ConfigSubsection()
	config.streaming.stream_ecm = ConfigYesNo(default = False)
	config.streaming.descramble = ConfigYesNo(default = True)
	config.streaming.stream_eit = ConfigYesNo(default = True)
	config.streaming.stream_ait = ConfigYesNo(default = True)

	config.pluginbrowser = ConfigSubsection()
	config.pluginbrowser.po = ConfigYesNo(default = False)
	config.pluginbrowser.src = ConfigYesNo(default = False)
Esempio n. 10
0
def InitUsageConfig():
    try:
        file = open('/etc/image-version', 'r')
        lines = file.readlines()
        file.close()
        for x in lines:
            splitted = x.split('=')
            if splitted[0] == "box_type":
                folderprefix = splitted[1].replace(
                    '\n', '')  # 0 = release, 1 = experimental
                boxtype = splitted[1].replace(
                    '\n', '')  # 0 = release, 1 = experimental
    except:
        folderprefix = ""
        boxtype = "not detected"
    config.misc.boxtype = ConfigText(default=boxtype)

    config.usage = ConfigSubsection()
    config.usage.showdish = ConfigYesNo(default=True)
    config.usage.multibouquet = ConfigYesNo(default=True)

    config.usage.alternative_number_mode = ConfigYesNo(default=False)

    def alternativeNumberModeChange(configElement):
        eDVBDB.getInstance().setNumberingMode(configElement.value)
        refreshServiceList()

    config.usage.alternative_number_mode.addNotifier(
        alternativeNumberModeChange)

    config.usage.hide_number_markers = ConfigYesNo(default=False)
    config.usage.hide_number_markers.addNotifier(refreshServiceList)

    config.usage.servicetype_icon_mode = ConfigSelection(
        default="0",
        choices=[("0", _("None")), ("1", _("Left from servicename")),
                 ("2", _("Right from servicename"))])
    config.usage.servicetype_icon_mode.addNotifier(refreshServiceList)
    config.usage.crypto_icon_mode = ConfigSelection(
        default="0",
        choices=[("0", _("None")), ("1", _("Left from servicename")),
                 ("2", _("Right from servicename"))])
    config.usage.crypto_icon_mode.addNotifier(refreshServiceList)

    config.usage.service_icon_enable = ConfigYesNo(default=False)
    config.usage.service_icon_enable.addNotifier(refreshServiceList)
    config.usage.servicelist_cursor_behavior = ConfigSelection(
        default="standard",
        choices=[("standard", _("Standard")), ("keep", _("Keep service")),
                 ("reverseB", _("Reverse bouquet buttons")),
                 ("keep reverseB",
                  _("Keep service") + " + " + _("Reverse bouquet buttons"))])

    config.usage.multiepg_ask_bouquet = ConfigYesNo(default=False)

    config.usage.quickzap_bouquet_change = ConfigYesNo(default=False)
    config.usage.e1like_radio_mode = ConfigYesNo(default=True)
    choicelist = []
    for i in range(1, 12):
        choicelist.append(
            ("%d" % i, ngettext("%d second", "%d seconds", i) % i))
    config.usage.infobar_timeout = ConfigSelection(
        default="5", choices=[("0", _("No timeout"))] + choicelist)
    config.usage.show_infobar_on_zap = ConfigYesNo(default=True)
    config.usage.show_infobar_on_skip = ConfigYesNo(default=True)
    config.usage.show_infobar_on_event_change = ConfigYesNo(default=False)
    config.usage.show_second_infobar = ConfigSelection(
        default=None,
        choices=[(None, _("None")),
                 ("0", _("No timeout"))] + choicelist + [("EPG", _("EPG"))])
    config.usage.infobar_frontend_source = ConfigSelection(
        default="tuner",
        choices=[("settings", _("Settings")), ("tuner", _("Tuner"))])
    config.usage.show_spinner = ConfigYesNo(default=True)
    config.usage.enable_tt_caching = ConfigYesNo(default=True)
    choicelist = []
    for i in (10, 30):
        choicelist.append(
            ("%d" % i, ngettext("%d second", "%d seconds", i) % i))
    for i in (60, 120, 300, 600, 1200, 1800):
        m = i / 60
        choicelist.append(
            ("%d" % i, ngettext("%d minute", "%d minutes", m) % m))
    for i in (3600, 7200, 14400):
        h = i / 3600
        choicelist.append(("%d" % i, ngettext("%d hour", "%d hours", h) % h))
    config.usage.hdd_standby = ConfigSelection(
        default="300", choices=[("0", _("No standby"))] + choicelist)
    config.usage.output_12V = ConfigSelection(default="do not change",
                                              choices=[("do not change",
                                                        _("Do not change")),
                                                       ("off", _("Off")),
                                                       ("on", _("On"))])

    config.usage.pip_zero_button = ConfigSelection(
        default="standard",
        choices=[("standard", _("Standard")),
                 ("swap", _("Swap PiP and main picture")),
                 ("swapstop", _("Move PiP to main picture")),
                 ("stop", _("Stop PiP"))])
    config.usage.pip_hideOnExit = ConfigSelection(default="without popup",
                                                  choices=[("no", _("No")),
                                                           ("popup",
                                                            _("With popup")),
                                                           ("without popup",
                                                            _("Without popup"))
                                                           ])

    config.usage.default_path = ConfigText(default=resolveFilename(SCOPE_HDD))
    config.usage.timer_path = ConfigText(default="<default>")
    config.usage.instantrec_path = ConfigText(default="<default>")
    config.usage.timeshift_path = ConfigText(default="/media/hdd/")
    config.usage.allowed_timeshift_paths = ConfigLocations(
        default=["/media/hdd/"])

    config.usage.movielist_trashcan = ConfigYesNo(default=True)
    config.usage.movielist_trashcan_days = ConfigNumber(default=8)
    config.usage.movielist_trashcan_reserve = ConfigNumber(default=40)
    config.usage.on_movie_start = ConfigSelection(
        default="resume",
        choices=[("ask", _("Ask user")),
                 ("resume", _("Resume from last position")),
                 ("beginning", _("Start from the beginning"))])
    config.usage.on_movie_stop = ConfigSelection(
        default="movielist",
        choices=[("ask", _("Ask user")),
                 ("movielist", _("Return to movie list")),
                 ("quit", _("Return to previous service"))])
    config.usage.on_movie_eof = ConfigSelection(
        default="movielist",
        choices=[("ask", _("Ask user")),
                 ("movielist", _("Return to movie list")),
                 ("quit", _("Return to previous service")),
                 ("pause", _("Pause movie at end")),
                 ("playlist", _("Play next (return to movie list)")),
                 ("playlistquit", _("Play next (return to previous service)")),
                 ("loop", _("Continues play (loop)")),
                 ("repeatcurrent", _("Repeat"))])
    config.usage.next_movie_msg = ConfigYesNo(default=True)
    config.usage.leave_movieplayer_onExit = ConfigSelection(
        default="popup",
        choices=[("no", _("No")), ("popup", _("With popup")),
                 ("without popup", _("Without popup"))])

    config.usage.setup_level = ConfigSelection(default="expert",
                                               choices=[
                                                   ("simple", _("Simple")),
                                                   ("intermediate",
                                                    _("Intermediate")),
                                                   ("expert", _("Expert"))
                                               ])

    config.usage.on_long_powerpress = ConfigSelection(
        default="show_menu",
        choices=[("show_menu", _("Show shutdown menu")),
                 ("shutdown", _("Immediate shutdown")),
                 ("standby", _("Standby"))])

    config.usage.on_short_powerpress = ConfigSelection(
        default="standby",
        choices=[("show_menu", _("Show shutdown menu")),
                 ("shutdown", _("Immediate shutdown")),
                 ("standby", _("Standby"))])

    choicelist = []
    for i in range(-21600, 21601, 3600):
        h = abs(i / 3600)
        h = ngettext("%d hour", "%d hours", h) % h
        if i < 0:
            choicelist.append(("%d" % i, _("Shutdown in ") + h))
        elif i > 0:
            choicelist.append(("%d" % i, _("Standby in ") + h))
        else:
            choicelist.append(("0", _("Do nothing")))
    config.usage.inactivity_timer = ConfigSelection(default="0",
                                                    choices=choicelist)
    config.usage.inactivity_timer_blocktime = ConfigYesNo(default=True)
    config.usage.inactivity_timer_blocktime_begin = ConfigClock(
        default=time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
    config.usage.inactivity_timer_blocktime_end = ConfigClock(
        default=time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))

    choicelist = []
    for i in range(-7200, 7201, 900):
        m = abs(i / 60)
        m = ngettext("%d minute", "%d minutes", m) % m
        if i < 0:
            choicelist.append(("%d" % i, _("Shutdown in ") + m))
        elif i > 0:
            choicelist.append(("%d" % i, _("Standby in ") + m))
        else:
            choicelist.append(
                ("event_shutdown", _("Shutdown after current event")))
            choicelist.append(("0", _("Disabled")))
            choicelist.append(
                ("event_standby", _("Standby after current event")))
    config.usage.sleep_timer = ConfigSelection(default="0", choices=choicelist)

    choicelist = [("0", _("Disabled"))]
    for i in range(900, 7201, 900):
        m = abs(i / 60)
        m = ngettext("%d minute", "%d minutes", m) % m
        choicelist.append(("%d" % i, _("after ") + m))
    config.usage.standby_to_shutdown_timer = ConfigSelection(
        default="0", choices=choicelist)

    choicelist = [("0", _("Disabled"))]
    for i in (5, 30, 60, 300, 600, 900, 1200, 1800, 2700, 3600):
        if i < 60:
            m = ngettext("%d second", "%d seconds", i) % i
        else:
            m = abs(i / 60)
            m = ngettext("%d minute", "%d minutes", m) % m
        choicelist.append(("%d" % i, m))
    config.usage.screen_saver = ConfigSelection(default="0",
                                                choices=choicelist)

    config.usage.check_timeshift = ConfigYesNo(default=True)

    choicelist = [("0", _("Disabled"))]
    for i in (2, 3, 4, 5, 10, 20, 30):
        choicelist.append(
            ("%d" % i, ngettext("%d second", "%d seconds", i) % i))
    for i in (60, 120, 300):
        m = i / 60
        choicelist.append(
            ("%d" % i, ngettext("%d minute", "%d minutes", m) % m))
    config.usage.timeshift_start_delay = ConfigSelection(default="0",
                                                         choices=choicelist)

    config.usage.alternatives_priority = ConfigSelection(
        default="0",
        choices=[("0", "DVB-S/-C/-T"), ("1", "DVB-S/-T/-C"),
                 ("2", "DVB-C/-S/-T"), ("3", "DVB-C/-T/-S"),
                 ("4", "DVB-T/-C/-S"), ("5", "DVB-T/-S/-C")])

    nims = [("-1", _("auto"))]
    for x in nimmanager.nim_slots:
        nims.append((str(x.slot), x.getSlotName()))
    config.usage.frontend_priority = ConfigSelection(default="-1",
                                                     choices=list(nims))
    nims.insert(0, ("-2", _("Disabled")))
    config.usage.recording_frontend_priority = ConfigSelection(default="-2",
                                                               choices=nims)
    config.misc.disable_background_scan = ConfigYesNo(default=False)

    config.usage.show_event_progress_in_servicelist = ConfigSelection(
        default='barright',
        choices=[('barleft', _("Progress bar left")),
                 ('barright', _("Progress bar right")),
                 ('percleft', _("Percentage left")),
                 ('percright', _("Percentage right")), ('no', _("No"))])
    config.usage.show_channel_numbers_in_servicelist = ConfigYesNo(
        default=True)
    config.usage.show_event_progress_in_servicelist.addNotifier(
        refreshServiceList)
    config.usage.show_channel_numbers_in_servicelist.addNotifier(
        refreshServiceList)

    config.usage.blinking_display_clock_during_recording = ConfigYesNo(
        default=False)

    config.usage.show_message_when_recording_starts = ConfigYesNo(default=True)

    config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(
        default=True)
    config.usage.show_icons_in_movielist = ConfigSelection(
        default='i',
        choices=[
            ('o', _("Off")),
            ('p', _("Progress")),
            ('s', _("Small progress")),
            ('i', _("Icons")),
        ])
    config.usage.movielist_unseen = ConfigYesNo(default=False)

    config.usage.swap_snr_on_osd = ConfigYesNo(default=False)

    def SpinnerOnOffChanged(configElement):
        setSpinnerOnOff(int(configElement.value))

    config.usage.show_spinner.addNotifier(SpinnerOnOffChanged)

    def EnableTtCachingChanged(configElement):
        setEnableTtCachingOnOff(int(configElement.value))

    config.usage.enable_tt_caching.addNotifier(EnableTtCachingChanged)

    def TunerTypePriorityOrderChanged(configElement):
        setTunerTypePriorityOrder(int(configElement.value))

    config.usage.alternatives_priority.addNotifier(
        TunerTypePriorityOrderChanged, immediate_feedback=False)

    def PreferredTunerChanged(configElement):
        setPreferredTuner(int(configElement.value))

    config.usage.frontend_priority.addNotifier(PreferredTunerChanged)

    config.usage.hide_zap_errors = ConfigYesNo(default=False)
    config.usage.hide_ci_messages = ConfigYesNo(default=False)
    config.usage.show_cryptoinfo = ConfigYesNo(default=True)
    config.usage.show_eit_nownext = ConfigYesNo(default=True)
    config.usage.show_vcr_scart = ConfigYesNo(default=False)

    if SystemInfo["Fan"]:
        choicelist = [('off', _("Off")), ('on', _("On")), ('auto', _("Auto"))]
        if os.path.exists("/proc/stb/fp/fan_choices"):
            choicelist = [
                x for x in choicelist if x[0] in open(
                    "/proc/stb/fp/fan_choices", "r").read().strip().split(" ")
            ]
        config.usage.fan = ConfigSelection(choicelist)

        def fanChanged(configElement):
            file = open("/proc/stb/fp/fan", "w")
            file.write(configElement.value)
            file.close()

        config.usage.fan.addNotifier(fanChanged)

    if SystemInfo["FanPWM"]:

        def fanSpeedChanged(configElement):
            file = open("/proc/stb/fp/fan_pwm", "w")
            file.write(hex(configElement.value)[2:])
            file.close()

        config.usage.fanspeed = ConfigSlider(default=127,
                                             increment=8,
                                             limits=(0, 255))
        config.usage.fanspeed.addNotifier(fanSpeedChanged)

    if SystemInfo["StandbyLED"]:

        def standbyLEDChanged(configElement):
            file = open("/proc/stb/power/standbyled", "w")
            file.write(configElement.value and "on" or "off")
            file.close()

        config.usage.standbyLED = ConfigYesNo(default=True)
        config.usage.standbyLED.addNotifier(standbyLEDChanged)

    config.epg = ConfigSubsection()
    config.epg.eit = ConfigYesNo(default=True)
    config.epg.mhw = ConfigYesNo(default=False)
    config.epg.freesat = ConfigYesNo(default=True)
    config.epg.viasat = ConfigYesNo(default=True)
    config.epg.netmed = ConfigYesNo(default=True)
    config.misc.showradiopic = ConfigYesNo(default=True)

    def EpgSettingsChanged(configElement):
        from enigma import eEPGCache
        mask = 0xffffffff
        if not config.epg.eit.value:
            mask &= ~(eEPGCache.NOWNEXT | eEPGCache.SCHEDULE
                      | eEPGCache.SCHEDULE_OTHER)
        if not config.epg.mhw.value:
            mask &= ~eEPGCache.MHW
        if not config.epg.freesat.value:
            mask &= ~(eEPGCache.FREESAT_NOWNEXT | eEPGCache.FREESAT_SCHEDULE
                      | eEPGCache.FREESAT_SCHEDULE_OTHER)
        if not config.epg.viasat.value:
            mask &= ~eEPGCache.VIASAT
        if not config.epg.netmed.value:
            mask &= ~(eEPGCache.NETMED_SCHEDULE
                      | eEPGCache.NETMED_SCHEDULE_OTHER)
        eEPGCache.getInstance().setEpgSources(mask)

    config.epg.eit.addNotifier(EpgSettingsChanged)
    config.epg.mhw.addNotifier(EpgSettingsChanged)
    config.epg.freesat.addNotifier(EpgSettingsChanged)
    config.epg.viasat.addNotifier(EpgSettingsChanged)
    config.epg.netmed.addNotifier(EpgSettingsChanged)

    config.epg.histminutes = ConfigSelectionNumber(min=0,
                                                   max=120,
                                                   stepwidth=15,
                                                   default=0,
                                                   wraparound=True)

    def EpgHistorySecondsChanged(configElement):
        from enigma import eEPGCache
        eEPGCache.getInstance().setEpgHistorySeconds(
            config.epg.histminutes.getValue() * 60)

    config.epg.histminutes.addNotifier(EpgHistorySecondsChanged)

    def setHDDStandby(configElement):
        for hdd in harddiskmanager.HDDList():
            hdd[1].setIdleTime(int(configElement.value))

    config.usage.hdd_standby.addNotifier(setHDDStandby,
                                         immediate_feedback=False)

    def set12VOutput(configElement):
        if configElement.value == "on":
            Misc_Options.getInstance().set_12V_output(1)
        elif configElement.value == "off":
            Misc_Options.getInstance().set_12V_output(0)

    config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

    SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()

    config.usage.keymap = ConfigText(
        default=eEnv.resolve("${datadir}/enigma2/keymap.xml"))

    config.seek = ConfigSubsection()
    config.seek.selfdefined_13 = ConfigNumber(default=15)
    config.seek.selfdefined_46 = ConfigNumber(default=60)
    config.seek.selfdefined_79 = ConfigNumber(default=300)

    config.seek.speeds_forward = ConfigSet(
        default=[2, 4, 8, 16, 32, 64, 128],
        choices=[2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
    config.seek.speeds_backward = ConfigSet(
        default=[2, 4, 8, 16, 32, 64, 128],
        choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
    config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8],
                                              choices=[2, 4, 6, 8, 12, 16, 25])

    config.seek.enter_forward = ConfigSelection(default="2",
                                                choices=[
                                                    "2", "4", "6", "8", "12",
                                                    "16", "24", "32", "48",
                                                    "64", "96", "128"
                                                ])
    config.seek.enter_backward = ConfigSelection(default="1",
                                                 choices=[
                                                     "1", "2", "4", "6", "8",
                                                     "12", "16", "24", "32",
                                                     "48", "64", "96", "128"
                                                 ])

    config.seek.on_pause = ConfigSelection(default="play",
                                           choices=[("play", _("Play")),
                                                    ("step",
                                                     _("Single step (GOP)")),
                                                    ("last", _("Last speed"))])

    config.crash = ConfigSubsection()
    config.crash.details = ConfigYesNo(default=True)
    config.usage.timerlist_finished_timer_position = ConfigSelection(
        default="end",
        choices=[("beginning", _("At beginning")), ("end", _("At end"))])
    config.crash.enabledebug = ConfigYesNo(default=False)

    debugpath = [('/home/root/logs/', '/home/root/')]
    for p in harddiskmanager.getMountedPartitions():
        d = os.path.normpath(p.mountpoint)
        if os.path.exists(p.mountpoint):
            if p.mountpoint != '/':
                debugpath.append((d + '/logs/', p.mountpoint))
    config.crash.debug_path = ConfigSelection(default="/home/root/logs/",
                                              choices=debugpath)

    def updatedebug_path(configElement):
        if not os.path.exists(config.crash.debug_path.getValue()):
            os.mkdir(config.crash.debug_path.getValue(), 0755)

    config.crash.debug_path.addNotifier(updatedebug_path,
                                        immediate_feedback=False)

    def updateEnterForward(configElement):
        if not configElement.value:
            configElement.value = [2]
        updateChoices(config.seek.enter_forward, configElement.value)

    config.seek.speeds_forward.addNotifier(updateEnterForward,
                                           immediate_feedback=False)

    def updateEnterBackward(configElement):
        if not configElement.value:
            configElement.value = [2]
        updateChoices(config.seek.enter_backward, configElement.value)

    config.seek.speeds_backward.addNotifier(updateEnterBackward,
                                            immediate_feedback=False)

    def updateEraseSpeed(el):
        eBackgroundFileEraser.getInstance().setEraseSpeed(int(el.value))

    def updateEraseFlags(el):
        eBackgroundFileEraser.getInstance().setEraseFlags(int(el.value))

    config.misc.erase_speed = ConfigSelection(default="20",
                                              choices=[("10", "10 MB/s"),
                                                       ("20", "20 MB/s"),
                                                       ("50", "50 MB/s"),
                                                       ("100", "100 MB/s")])
    config.misc.erase_speed.addNotifier(updateEraseSpeed,
                                        immediate_feedback=False)
    config.misc.erase_flags = ConfigSelection(default="1",
                                              choices=[
                                                  ("0", _("Disable")),
                                                  ("1",
                                                   _("Internal hdd only")),
                                                  ("3", _("Everywhere"))
                                              ])
    config.misc.erase_flags.addNotifier(updateEraseFlags,
                                        immediate_feedback=False)

    SystemInfo["ZapMode"] = os.path.exists("/proc/stb/video/zapmode")
    if SystemInfo["ZapMode"]:

        def setZapmode(el):
            try:
                file = open("/proc/stb/video/zapmode", "w")
                file.write(el.value)
                file.close()
            except:
                pass

        config.misc.zapmode = ConfigSelection(
            default="mute",
            choices=[("mute", _("Black screen")), ("hold", _("Hold screen")),
                     ("mutetilllock", _("Black screen till locked")),
                     ("holdtilllock", _("Hold till locked"))])
        config.misc.zapmode.addNotifier(setZapmode, immediate_feedback=False)

    config.subtitles = ConfigSubsection()
    config.subtitles.ttx_subtitle_colors = ConfigSelection(
        default="1",
        choices=[("0", _("original")), ("1", _("white")), ("2", _("yellow"))])
    config.subtitles.ttx_subtitle_original_position = ConfigYesNo(
        default=False)
    config.subtitles.subtitle_position = ConfigSelection(choices=[
        "0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100",
        "150", "200", "250", "300", "350", "400", "450"
    ],
                                                         default="50")
    config.subtitles.subtitle_alignment = ConfigSelection(choices=[
        ("left", _("left")), ("center", _("center")), ("right", _("right"))
    ],
                                                          default="center")
    config.subtitles.subtitle_rewrap = ConfigYesNo(default=False)
    config.subtitles.subtitle_borderwidth = ConfigSelection(
        choices=["1", "2", "3", "4", "5"], default="3")
    config.subtitles.subtitle_fontsize = ConfigSelection(choices=[
        "16", "18", "20", "22", "24", "26", "28", "30", "32", "34", "36", "38",
        "40", "42", "44", "46", "48", "50", "52", "54"
    ],
                                                         default="34")

    subtitle_delay_choicelist = []
    for i in range(-900000, 1845000, 45000):
        if i == 0:
            subtitle_delay_choicelist.append(("0", _("No delay")))
        else:
            subtitle_delay_choicelist.append(
                ("%d" % i, "%2.1f sec" % (i / 90000.)))
    config.subtitles.subtitle_noPTSrecordingdelay = ConfigSelection(
        default="315000", choices=subtitle_delay_choicelist)

    config.subtitles.dvb_subtitles_yellow = ConfigYesNo(default=False)
    config.subtitles.dvb_subtitles_original_position = ConfigSelection(
        default="0",
        choices=[("0", _("Original")), ("1", _("Fixed")),
                 ("2", _("Relative"))])
    config.subtitles.dvb_subtitles_centered = ConfigYesNo(default=True)
    config.subtitles.subtitle_bad_timing_delay = ConfigSelection(
        default="0", choices=subtitle_delay_choicelist)
    config.subtitles.dvb_subtitles_backtrans = ConfigSelection(
        default="0",
        choices=[("0", _("No transparency")), ("25", "10%"), ("50", "20%"),
                 ("75", "30%"), ("100", "40%"), ("125", "50%"), ("150", "60%"),
                 ("175", "70%"), ("200", "80%"), ("225", "90%"),
                 ("255", _("Full transparency"))])
    config.subtitles.pango_subtitle_colors = ConfigSelection(
        default="0",
        choices=[("0", _("alternative")), ("1", _("white")),
                 ("2", _("yellow"))])
    config.subtitles.pango_subtitles_delay = ConfigSelection(
        default="0", choices=subtitle_delay_choicelist)
    config.subtitles.pango_subtitles_fps = ConfigSelection(
        default="1",
        choices=[("1", _("Original")), ("23976", _("23.976")),
                 ("24000", _("24")), ("25000", _("25")), ("29970", _("29.97")),
                 ("30000", _("30"))])
    config.subtitles.pango_autoturnon = ConfigYesNo(default=True)

    config.autolanguage = ConfigSubsection()
    audio_language_choices = [
        ("---", _("None")),
        ("orj dos ory org esl qaa und mis mul ORY ORJ Audio_ORJ",
         _("Original")), ("ara", _("Arabic")), ("eus baq", _("Basque")),
        ("bul", _("Bulgarian")),
        ("hrv", _("Croatian")), ("ces cze", _("Czech")), ("dan", _("Danish")),
        ("dut ndl", _("Dutch")), ("eng qaa", _("English")),
        ("est", _("Estonian")), ("fin", _("Finnish")),
        ("fra fre", _("French")), ("deu ger", _("German")),
        ("ell gre", _("Greek")), ("heb", _("Hebrew")), ("hun", _("Hungarian")),
        ("ita", _("Italian")), ("lav", _("Latvian")), ("lit", _("Lithuanian")),
        ("ltz", _("Luxembourgish")), ("nor", _("Norwegian")),
        ("pol", _("Polish")), ("por", _("Portuguese")),
        ("fas per", _("Persian")), ("ron rum", _("Romanian")),
        ("rus", _("Russian")), ("srp", _("Serbian")), ("slk slo", _("Slovak")),
        ("slv", _("Slovenian")), ("spa", _("Spanish")), ("swe", _("Swedish")),
        ("tha", _("Thai")), ("tur Audio_TUR", _("Turkish"))
    ]

    def setEpgLanguage(configElement):
        eServiceEvent.setEPGLanguage(configElement.value)

    config.autolanguage.audio_epglanguage = ConfigSelection(
        audio_language_choices[:1] + audio_language_choices[2:], default="---")
    config.autolanguage.audio_epglanguage.addNotifier(setEpgLanguage)

    def setEpgLanguageAlternative(configElement):
        eServiceEvent.setEPGLanguageAlternative(configElement.value)

    config.autolanguage.audio_epglanguage_alternative = ConfigSelection(
        audio_language_choices[:1] + audio_language_choices[2:], default="---")
    config.autolanguage.audio_epglanguage_alternative.addNotifier(
        setEpgLanguageAlternative)

    config.autolanguage.audio_autoselect1 = ConfigSelection(
        choices=audio_language_choices, default="---")
    config.autolanguage.audio_autoselect2 = ConfigSelection(
        choices=audio_language_choices, default="---")
    config.autolanguage.audio_autoselect3 = ConfigSelection(
        choices=audio_language_choices, default="---")
    config.autolanguage.audio_autoselect4 = ConfigSelection(
        choices=audio_language_choices, default="---")
    config.autolanguage.audio_defaultac3 = ConfigYesNo(default=False)
    config.autolanguage.audio_defaultddp = ConfigYesNo(default=False)
    config.autolanguage.audio_usecache = ConfigYesNo(default=True)

    subtitle_language_choices = audio_language_choices[:
                                                       1] + audio_language_choices[
                                                           2:]
    config.autolanguage.subtitle_autoselect1 = ConfigSelection(
        choices=subtitle_language_choices, default="---")
    config.autolanguage.subtitle_autoselect2 = ConfigSelection(
        choices=subtitle_language_choices, default="---")
    config.autolanguage.subtitle_autoselect3 = ConfigSelection(
        choices=subtitle_language_choices, default="---")
    config.autolanguage.subtitle_autoselect4 = ConfigSelection(
        choices=subtitle_language_choices, default="---")
    config.autolanguage.subtitle_hearingimpaired = ConfigYesNo(default=False)
    config.autolanguage.subtitle_defaultimpaired = ConfigYesNo(default=False)
    config.autolanguage.subtitle_defaultdvb = ConfigYesNo(default=False)
    config.autolanguage.subtitle_usecache = ConfigYesNo(default=True)
    config.autolanguage.equal_languages = ConfigSelection(default="15",
                                                          choices=[
                                                              ("0", _("None")),
                                                              ("1", "1"),
                                                              ("2", "2"),
                                                              ("3", "1,2"),
                                                              ("4", "3"),
                                                              ("5", "1,3"),
                                                              ("6", "2,3"),
                                                              ("7", "1,2,3"),
                                                              ("8", "4"),
                                                              ("9", "1,4"),
                                                              ("10", "2,4"),
                                                              ("11", "1,2,4"),
                                                              ("12", "3,4"),
                                                              ("13", "1,3,4"),
                                                              ("14", "2,3,4"),
                                                              ("15", _("All"))
                                                          ])

    config.streaming = ConfigSubsection()
    config.streaming.stream_ecm = ConfigYesNo(default=False)
    config.streaming.descramble = ConfigYesNo(default=True)
    config.streaming.stream_eit = ConfigYesNo(default=True)
    config.streaming.stream_ait = ConfigYesNo(default=True)
    config.streaming.authentication = ConfigYesNo(default=False)
Esempio n. 11
0
def InitUsageConfig():
    config.usage = ConfigSubsection()
    config.usage.showdish = ConfigYesNo(default=True)
    config.usage.multibouquet = ConfigYesNo(default=False)
    config.usage.multiepg_ask_bouquet = ConfigYesNo(default=False)

    config.usage.quickzap_bouquet_change = ConfigYesNo(default=False)
    config.usage.e1like_radio_mode = ConfigYesNo(default=False)
    config.usage.infobar_timeout = ConfigSelection(
        default="5",
        choices=[("0", _("no timeout")), ("1", "1 " + _("second")),
                 ("2", "2 " + _("seconds")), ("3", "3 " + _("seconds")),
                 ("4", "4 " + _("seconds")), ("5", "5 " + _("seconds")),
                 ("6", "6 " + _("seconds")), ("7", "7 " + _("seconds")),
                 ("8", "8 " + _("seconds")), ("9", "9 " + _("seconds")),
                 ("10", "10 " + _("seconds"))])
    config.usage.show_infobar_on_zap = ConfigYesNo(default=True)
    config.usage.show_infobar_on_skip = ConfigYesNo(default=True)
    config.usage.show_infobar_on_event_change = ConfigYesNo(default=True)
    config.usage.hdd_standby = ConfigSelection(
        default="600",
        choices=[("0", _("no standby")), ("10", "10 " + _("seconds")),
                 ("30", "30 " + _("seconds")), ("60", "1 " + _("minute")),
                 ("120", "2 " + _("minutes")), ("300", "5 " + _("minutes")),
                 ("600", "10 " + _("minutes")), ("1200", "20 " + _("minutes")),
                 ("1800", "30 " + _("minutes")), ("3600", "1 " + _("hour")),
                 ("7200", "2 " + _("hours")), ("14400", "4 " + _("hours"))])
    config.usage.output_12V = ConfigSelection(default="do not change",
                                              choices=[("do not change",
                                                        _("do not change")),
                                                       ("off", _("off")),
                                                       ("on", _("on"))])

    config.usage.pip_zero_button = ConfigSelection(
        default="standard",
        choices=[("standard", _("standard")),
                 ("swap", _("swap PiP and main picture")),
                 ("swapstop", _("move PiP to main picture")),
                 ("stop", _("stop PiP"))])

    config.usage.default_path = ConfigText(default=resolveFilename(SCOPE_HDD))
    config.usage.timer_path = ConfigText(default="<default>")
    config.usage.instantrec_path = ConfigText(default="<default>")
    config.usage.timeshift_path = ConfigText(default="/media/hdd/")
    config.usage.allowed_timeshift_paths = ConfigLocations(
        default=["/media/hdd/"])

    config.usage.on_movie_start = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("resume", _("Resume from last position")),
                 ("beginning", _("Start from the beginning"))])
    config.usage.on_movie_stop = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("movielist", _("Return to movie list")),
                 ("quit", _("Return to previous service"))])
    config.usage.on_movie_eof = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("movielist", _("Return to movie list")),
                 ("quit", _("Return to previous service")),
                 ("pause", _("Pause movie at end"))])

    config.usage.setup_level = ConfigSelection(default="intermediate",
                                               choices=[
                                                   ("simple", _("Simple")),
                                                   ("intermediate",
                                                    _("Intermediate")),
                                                   ("expert", _("Expert"))
                                               ])

    config.usage.on_long_powerpress = ConfigSelection(
        default="show_menu",
        choices=[("show_menu", _("show shutdown menu")),
                 ("shutdown", _("immediate shutdown")),
                 ("standby", _("Standby"))])

    config.usage.on_short_powerpress = ConfigSelection(
        default="standby",
        choices=[("show_menu", _("show shutdown menu")),
                 ("shutdown", _("immediate shutdown")),
                 ("standby", _("Standby"))])

    config.usage.alternatives_priority = ConfigSelection(
        default="0",
        choices=[("0", "DVB-S/-C/-T"), ("1", "DVB-S/-T/-C"),
                 ("2", "DVB-C/-S/-T"), ("3", "DVB-C/-T/-S"),
                 ("4", "DVB-T/-C/-S"), ("5", "DVB-T/-S/-C")])

    nims = [("-1", _("auto"))]
    for x in nimmanager.nim_slots:
        nims.append((str(x.slot), x.getSlotName()))
    config.usage.frontend_priority = ConfigSelection(default="-1",
                                                     choices=nims)

    config.usage.show_event_progress_in_servicelist = ConfigYesNo(
        default=False)

    config.usage.blinking_display_clock_during_recording = ConfigYesNo(
        default=False)

    config.usage.show_message_when_recording_starts = ConfigYesNo(default=True)

    config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(
        default=True)

    def TunerTypePriorityOrderChanged(configElement):
        setTunerTypePriorityOrder(int(configElement.value))

    config.usage.alternatives_priority.addNotifier(
        TunerTypePriorityOrderChanged, immediate_feedback=False)

    def PreferredTunerChanged(configElement):
        setPreferredTuner(int(configElement.value))

    config.usage.frontend_priority.addNotifier(PreferredTunerChanged)

    def setHDDStandby(configElement):
        for hdd in harddiskmanager.HDDList():
            hdd[1].setIdleTime(int(configElement.value))

    config.usage.hdd_standby.addNotifier(setHDDStandby,
                                         immediate_feedback=False)

    def set12VOutput(configElement):
        if configElement.value == "on":
            Misc_Options.getInstance().set_12V_output(1)
        elif configElement.value == "off":
            Misc_Options.getInstance().set_12V_output(0)

    config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

    SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()

    config.usage.keymap = ConfigText(
        default=eEnv.resolve("${datadir}/enigma2/keymap.xml"))

    config.seek = ConfigSubsection()
    config.seek.selfdefined_13 = ConfigNumber(default=15)
    config.seek.selfdefined_46 = ConfigNumber(default=60)
    config.seek.selfdefined_79 = ConfigNumber(default=300)

    config.seek.speeds_forward = ConfigSet(
        default=[2, 4, 8, 16, 32, 64, 128],
        choices=[2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
    config.seek.speeds_backward = ConfigSet(
        default=[2, 4, 8, 16, 32, 64, 128],
        choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
    config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8],
                                              choices=[2, 4, 6, 8, 12, 16, 25])

    config.seek.enter_forward = ConfigSelection(default="2",
                                                choices=[
                                                    "2", "4", "6", "8", "12",
                                                    "16", "24", "32", "48",
                                                    "64", "96", "128"
                                                ])
    config.seek.enter_backward = ConfigSelection(default="1",
                                                 choices=[
                                                     "1", "2", "4", "6", "8",
                                                     "12", "16", "24", "32",
                                                     "48", "64", "96", "128"
                                                 ])

    config.seek.on_pause = ConfigSelection(default="play",
                                           choices=[("play", _("Play")),
                                                    ("step",
                                                     _("Singlestep (GOP)")),
                                                    ("last", _("Last speed"))])

    config.usage.timerlist_finished_timer_position = ConfigSelection(
        default="beginning",
        choices=[("beginning", _("at beginning")), ("end", _("at end"))])

    def updateEnterForward(configElement):
        if not configElement.value:
            configElement.value = [2]
        updateChoices(config.seek.enter_forward, configElement.value)

    config.seek.speeds_forward.addNotifier(updateEnterForward,
                                           immediate_feedback=False)

    def updateEnterBackward(configElement):
        if not configElement.value:
            configElement.value = [2]
        updateChoices(config.seek.enter_backward, configElement.value)

    config.seek.speeds_backward.addNotifier(updateEnterBackward,
                                            immediate_feedback=False)
Esempio n. 12
0
def FinalInitUsageConfig():
	try:
		usage_old = config.usage.dict().copy()
	except KeyError:
		usage_old = { }

	try:
		seek_old = config.seek.dict().copy()
	except KeyError:
		seek_old = { }

	config.seek.on_pause = ConfigSelection(default = "play", choices = [
		("play", _("Play")),
		("step", _("Singlestep (GOP)")),
		("last", _("Last speed")) ])

	inactivity_shutdown_choices = [ ("never", _("disabled")) ]
	for i in range(1,6):
		inactivity_shutdown_choices.extend([("%d" % i, ngettext("%(num)d hour", "%(num)d hours",i) % {"num" : i})])
	config.usage.inactivity_shutdown = ConfigSelection(default = "3", choices = inactivity_shutdown_choices)
	config.usage.inactivity_shutdown_initialized = ConfigYesNo(default = False)
	config.usage.showdish = ConfigYesNo(default = True)
	config.usage.multibouquet = ConfigYesNo(default = False)
	config.usage.multiepg_ask_bouquet = ConfigYesNo(default = False)

	config.usage.quickzap_bouquet_change = ConfigYesNo(default = False)
	config.usage.e1like_radio_mode = ConfigYesNo(default = False)
	config.usage.infobar_timeout = ConfigSelection(default = "5", choices = [
		("0", _("no timeout")), ("1", "1 " + _("second")), ("2", "2 " + _("seconds")), ("3", "3 " + _("seconds")),
		("4", "4 " + _("seconds")), ("5", "5 " + _("seconds")), ("6", "6 " + _("seconds")), ("7", "7 " + _("seconds")),
		("8", "8 " + _("seconds")), ("9", "9 " + _("seconds")), ("10", "10 " + _("seconds"))])
	config.usage.show_infobar_on_zap = ConfigYesNo(default = True)
	config.usage.show_infobar_on_skip = ConfigYesNo(default = True)
	config.usage.show_infobar_on_event_change = ConfigYesNo(default = True)
	config.usage.hdd_standby = ConfigSelection(default = "600", choices = [
		("0", _("no standby")), ("10", "10 " + _("seconds")), ("30", "30 " + _("seconds")),
		("60", "1 " + _("minute")), ("120", "2 " + _("minutes")),
		("300", "5 " + _("minutes")), ("600", "10 " + _("minutes")), ("1200", "20 " + _("minutes")),
		("1800", "30 " + _("minutes")), ("3600", "1 " + _("hour")), ("7200", "2 " + _("hours")),
		("14400", "4 " + _("hours")) ])
	config.usage.output_12V = ConfigSelection(default = "do not change", choices = [
		("do not change", _("do not change")), ("off", _("off")), ("on", _("on")) ])

	config.usage.pip_zero_button = ConfigSelection(default = "standard", choices = [
		("standard", _("standard")), ("swap", _("swap PiP and main picture")),
		("swapstop", _("move PiP to main picture")), ("stop", _("stop PiP")) ])

	config.usage.default_path = ConfigText(default = resolveFilename(SCOPE_HDD))
	config.usage.timer_path = ConfigText(default = "<default>")
	config.usage.instantrec_path = ConfigText(default = "<default>")
	config.usage.timeshift_path = ConfigText(default = "/media/hdd/")
	config.usage.allowed_timeshift_paths = ConfigLocations(default = ["/media/hdd/"])

	config.usage.on_movie_start = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("resume", _("Resume from last position")), ("beginning", _("Start from the beginning")) ])
	config.usage.on_movie_stop = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")) ])
	config.usage.on_movie_eof = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")), ("pause", _("Pause movie at end")) ])

	config.usage.on_long_powerpress = ConfigSelection(default = "show_menu", choices = [
		("show_menu", _("show shutdown menu")),
		("shutdown", _("immediate shutdown")),
		("standby", _("Idle Mode")) ] )

	config.usage.on_short_powerpress = ConfigSelection(default = "standby", choices = [
		("show_menu", _("show shutdown menu")),
		("shutdown", _("immediate shutdown")),
		("standby", _("Idle Mode")) ] )

	config.usage.alternatives_priority = ConfigSelection(default = "0", choices = [
		("0", "DVB-S/-C/-T"),
		("1", "DVB-S/-T/-C"),
		("2", "DVB-C/-S/-T"),
		("3", "DVB-C/-T/-S"),
		("4", "DVB-T/-C/-S"),
		("5", "DVB-T/-S/-C") ])

	config.usage.show_event_progress_in_servicelist = ConfigYesNo(default = False)

	config.usage.blinking_display_clock_during_recording = ConfigYesNo(default = False)

	config.usage.show_message_when_recording_starts = ConfigYesNo(default = True)

	config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(default = True)

	SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()

	config.usage.timerlist_finished_timer_position = ConfigSelection(default = "beginning", choices = [("beginning", _("at beginning")), ("end", _("at end"))])

	config.usage.text_subtitle_presentation = ConfigSelection(default = "black box", choices = [("black box", _("black box")), ("drop-shadow", _("drop-shadow"))])
	config.usage.ttx_subtitle_prefer_pmt_language_code = ConfigYesNo(default=True)

	# Channelselection settings
	config.usage.configselection_showsettingsincontextmenu = ConfigYesNo(default=True)
	config.usage.configselection_showlistnumbers = ConfigYesNo(default=True)
	config.usage.configselection_showservicename = ConfigYesNo(default=True)
	config.usage.configselection_progressbarposition = ConfigSelection(default = "0", choices = [("0",_("After servicenumber")),("1",_("After servicename")), ("2",_("After servicedescription"))])
	config.usage.configselection_servicenamecolwidth = ConfigInteger(200, limits =(100,400))
	config.usage.configselection_columnstyle = ConfigYesNo(default=False)
	config.usage.configselection_additionaltimedisplayposition = ConfigSelection(default = "1", choices = [("0",_("ahead")),("1",_("behind"))])
	config.usage.configselection_showadditionaltimedisplay = ConfigSelection(default = "0",choices = [("0", _("Off")), ("1", _("Percent")), ("2", _("Remain")),("3", _("Remain / duration")), ("4", _("Elapsed")), ("5", _("Elapsed / duration")), ("6", _("Elapsed / remain / duration")),("7", _("Time"))])
	config.usage.configselection_showpicons = ConfigYesNo(default=False)
	config.usage.configselection_bigpicons = ConfigYesNo(default=False)
	config.usage.configselection_secondlineinfo =  ConfigSelection(default = "0", choices = [("0",_("nothing")),("1",_("short description")), ("2",_("upcoming event"))])

	config.usage.configselection_piconspath = ConfigSelection(default = eEnv.resolve('${datadir}/enigma2/picon_50x30/'), choices = [
				(eEnv.resolve('${datadir}/enigma2/picon_50x30/'), eEnv.resolve('${datadir}/enigma2/picon_50x30')),
				('/media/cf/picon_50x30/', '/media/cf/picon_50x30'),
				('/media/usb/picon_50x30/', '/media/usb/picon_50x30'),
				(eEnv.resolve('${datadir}/enigma2/picon/'), eEnv.resolve('${datadir}/enigma2/picon')),
				('/media/cf/picon/', '/media/cf/picon'),
				('/media/usb/picon/', '/media/usb/picon'),
				])

	config.usage.configselection_showrecordings = ConfigYesNo(default=False)
	config.usage.standby_zaptimer_wakeup = ConfigYesNo(default=True)

	seek = config.seek.dict()
	for (key, value) in seek_old.items():
		value_old = value.value
		configEntry = seek[key]
		value_new = configEntry.value
		if value_old != value_new:
			configEntry.value = value_old
		configEntry._ConfigElement__notifiers = value._ConfigElement__notifiers
		configEntry._ConfigElement__notifiers_final = value._ConfigElement__notifiers_final

	usage = config.usage.dict()
	for (key, value) in usage_old.items():
		value_old = value.value
		configEntry = usage[key]
		value_new = configEntry.value
		if value_old != value_new:
			configEntry.value = value_old
		configEntry._ConfigElement__notifiers = value._ConfigElement__notifiers
		configEntry._ConfigElement__notifiers_final = value._ConfigElement__notifiers_final

	if usage_old.get("alternatives_priority", None) == None:
		def TunerTypePriorityOrderChanged(configElement):
			setTunerTypePriorityOrder(int(configElement.value))
		config.usage.alternatives_priority.addNotifier(TunerTypePriorityOrderChanged, immediate_feedback=False)

	if usage_old.get("hdd_standby", None) == None:
		def setHDDStandby(configElement):
			for hdd in harddiskmanager.HDDList():
				hdd[1].setIdleTime(int(configElement.value))
		config.usage.hdd_standby.addNotifier(setHDDStandby, immediate_feedback=False)

	if usage_old.get("output_12V", None) == None:
		def set12VOutput(configElement):
			if configElement.value == "on":
				Misc_Options.getInstance().set_12V_output(1)
			elif configElement.value == "off":
				Misc_Options.getInstance().set_12V_output(0)
		config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)
Esempio n. 13
0
def InitUsageConfig():
	config.usage = ConfigSubsection();
	config.usage.showdish = ConfigYesNo(default = True)
	config.usage.multibouquet = ConfigYesNo(default = True)
	config.usage.multiepg_ask_bouquet = ConfigYesNo(default = False)

	config.usage.quickzap_bouquet_change = ConfigYesNo(default = True)
	config.usage.e1like_radio_mode = ConfigYesNo(default = True)
	config.usage.infobar_timeout = ConfigSelection(default = "5", choices = [
		("0", _("no timeout")), ("1", "1 " + _("second")), ("2", "2 " + _("seconds")), ("3", "3 " + _("seconds")),
		("4", "4 " + _("seconds")), ("5", "5 " + _("seconds")), ("6", "6 " + _("seconds")), ("7", "7 " + _("seconds")),
		("8", "8 " + _("seconds")), ("9", "9 " + _("seconds")), ("10", "10 " + _("seconds"))])
	config.usage.show_infobar_on_zap = ConfigYesNo(default = True)
	config.usage.show_infobar_on_skip = ConfigYesNo(default = True)
	config.usage.show_infobar_on_event_change = ConfigYesNo(default = True)
	config.usage.hdd_standby = ConfigSelection(default = "60", choices = [
		("0", _("no standby")), ("10", "10 " + _("seconds")), ("30", "30 " + _("seconds")),
		("60", "1 " + _("minute")), ("120", "2 " + _("minutes")),
		("300", "5 " + _("minutes")), ("600", "10 " + _("minutes")), ("1200", "20 " + _("minutes")),
		("1800", "30 " + _("minutes")), ("3600", "1 " + _("hour")), ("7200", "2 " + _("hours")),
		("14400", "4 " + _("hours")) ])
	config.usage.output_12V = ConfigSelection(default = "do not change", choices = [
		("do not change", _("do not change")), ("off", _("off")), ("on", _("on")) ])

	zero_button_choices = [ ("standard", _("standard")),
				("swap", _("swap PiP and main picture")),
				("swapstop", _("move PiP to main picture")),
				("stop", _("stop PiP")),
				("zap_focus", _("toggle zap focus")) ]
	config.usage.pip_zero_button = ConfigSelection(default = "swap", choices = zero_button_choices)
	config.usage.pip_zero_button_doubleclick = ConfigSelection(default = "zap_focus", choices = zero_button_choices)

	config.usage.default_path = ConfigText(default = resolveFilename(SCOPE_HDD))
	config.usage.timer_path = ConfigText(default = "<default>")
	config.usage.instantrec_path = ConfigText(default = "<default>")
	config.usage.timeshift_path = ConfigText(default = "/media/hdd/")
	config.usage.allowed_timeshift_paths = ConfigLocations(default = ["/media/hdd/"])

	config.usage.on_movie_start = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("resume", _("Resume from last position")), ("beginning", _("Start from the beginning")) ])
	config.usage.on_movie_stop = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")) ])
	config.usage.on_movie_eof = ConfigSelection(default = "ask", choices = [
		("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")), ("pause", _("Pause movie at end")), ("restart", _("Start from the beginning")), ("playnext", _("Start next media file")) ])

	config.usage.setup_level = ConfigSelection(default = "expert", choices = [
		("simple", _("Simple")),
		("intermediate", _("Intermediate")),
		("expert", _("Expert")) ])

	config.usage.on_long_powerpress = ConfigSelection(default = "show_menu", choices = [
		("show_menu", _("show shutdown menu")),
		("shutdown", _("immediate shutdown")),
		("standby", _("Standby")),
		("restart", _("Restart")),
		("restart_gui", _("Restart GUI")),
		("nothing", _("do nothing")) ] )
	
	config.usage.on_short_powerpress = ConfigSelection(default = "standby", choices = [
		("show_menu", _("show shutdown menu")),
		("shutdown", _("immediate shutdown")),
		("standby", _("Standby")),
		("restart", _("Restart")),
		("restart_gui", _("Restart GUI")),
		("nothing", _("do nothing")) ] )


	config.usage.alternatives_priority = ConfigSelection(default = "0", choices = [
		("0", "DVB-S/-C/-T"),
		("1", "DVB-S/-T/-C"),
		("2", "DVB-C/-S/-T"),
		("3", "DVB-C/-T/-S"),
		("4", "DVB-T/-C/-S"),
		("5", "DVB-T/-S/-C") ])

	nims = [ ("-1", _("auto")) ]
	for x in nimmanager.nim_slots:
		nims.append( (str(x.slot), x.getSlotName()) )
	config.usage.tuner_priority = ConfigSelection(default = "-1", choices = nims)

	config.usage.show_event_progress_in_servicelist = ConfigYesNo(default = False)

	config.usage.blinking_display_clock_during_recording = ConfigYesNo(default = False)

	config.usage.show_message_when_recording_starts = ConfigYesNo(default = True)

	config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(default = True)
	
	def TunerTypePriorityOrderChanged(configElement):
		setTunerTypePriorityOrder(int(configElement.value))
	config.usage.alternatives_priority.addNotifier(TunerTypePriorityOrderChanged, immediate_feedback=False)

	def PreferredTunerChanged(configElement):
		setPreferredTuner(int(configElement.value))
	config.usage.tuner_priority.addNotifier(PreferredTunerChanged)

	def setHDDStandby(configElement):
		for hdd in harddiskmanager.HDDList():
			hdd[1].setIdleTime(int(configElement.value))
	config.usage.hdd_standby.addNotifier(setHDDStandby, immediate_feedback=False)

	def set12VOutput(configElement):
		if configElement.value == "on":
			Misc_Options.getInstance().set_12V_output(1)
		elif configElement.value == "off":
			Misc_Options.getInstance().set_12V_output(0)
	config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

	SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()

	config.usage.keymap = ConfigText(default = eEnv.resolve("${datadir}/enigma2/keymap.xml"))

	config.seek = ConfigSubsection()
	config.seek.selfdefined_13 = ConfigNumber(default=15)
	config.seek.selfdefined_46 = ConfigNumber(default=60)
	config.seek.selfdefined_79 = ConfigNumber(default=300)

	config.seek.speeds_forward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
	config.seek.speeds_backward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
	config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8], choices=[2, 4, 6, 8, 12, 16, 25])

	config.seek.enter_forward = ConfigSelection(default = "2", choices = ["2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])
	config.seek.enter_backward = ConfigSelection(default = "1", choices = ["1", "2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])

	config.seek.on_pause = ConfigSelection(default = "play", choices = [
		("play", _("Play")),
		("step", _("Singlestep (GOP)")),
		("last", _("Last speed")) ])

	config.usage.timerlist_finished_timer_position = ConfigSelection(default = "beginning", choices = [("beginning", _("at beginning")), ("end", _("at end"))])

	def updateEnterForward(configElement):
		if not configElement.value:
			configElement.value = [2]
		updateChoices(config.seek.enter_forward, configElement.value)

	config.seek.speeds_forward.addNotifier(updateEnterForward, immediate_feedback = False)

	def updateEnterBackward(configElement):
		if not configElement.value:
			configElement.value = [2]
		updateChoices(config.seek.enter_backward, configElement.value)

	config.seek.speeds_backward.addNotifier(updateEnterBackward, immediate_feedback = False)


# VTI Settings start
	config.misc.placeholder = NoSave(ConfigSelection(default = "1", choices = [("1", " ")]))
	config.misc.disable_auto_channel_list = ConfigYesNo(default = False)
	config.misc.allow_service_delete = ConfigYesNo(default = False)
	config.misc.ecm_info = ConfigYesNo(default = True)
	config.misc.enable_custom_mainmenu = ConfigYesNo(default = False)
	config.usage.enable_zaphistory = ConfigYesNo(default = True)
	config.usage.show_epg_progress_percent = ConfigYesNo(default = False)
	config.usage.servicelist_show_picon = ConfigSelection(default = "0", choices = [
		("0", _("off")),
		("100", "100x60 px"),
		("50", "50x30 px"),
		("1", _("user defined")),])
	config.usage.servicelist_picon_dir = ConfigDirectory(default = "/usr/share/enigma2/picon")
	config.usage.servicelist_two_lines = ConfigYesNo(default = False)
	config.usage.servicelist_show_event_time = ConfigYesNo(default = False)
	config.usage.servicelist_mark_rec_service = ConfigYesNo(default = True)
	config.usage.servicelist_show_rec_service_symbol = ConfigYesNo(default = True)
	config.usage.servicelist_show_servicenumber = ConfigYesNo(default = True)
	config.usage.servicelist_name_width = ConfigInteger(default = 200, limits = (1, 1920))
	config.usage.servicelist_use_matrix = ConfigYesNo(default = False)
	config.usage.servicelist_show_next_event = ConfigYesNo(default = False)
	config.usage.servicelist_show_service_type_icon = ConfigYesNo(default = False)
	config.usage.servicelist_preview_mode = ConfigYesNo(default = False)
	config.usage.servicelist_hide_service_name = ConfigYesNo(default = False)
	
	rec_button_choices = \
		[
			("record_menu", _("show record menu")),
			("running_record", _("show running records")),
			("timer_list", _("show timer list")),
			("event_record", _("add recording (stop after current event)")),
			("indefinitely_record", _("add recording (indefinitely)")),
			("manualduration_record", _("add recording (enter recording duration)")),
			("manualendtime_record", _("add recording (enter recording endtime)"))
		]
	
	config.usage.rec_button = ConfigSelection(default = "record_menu", choices = rec_button_choices)
	config.usage.rec_button_long = ConfigSelection(default = "running_record", choices = rec_button_choices)
	
	
	config.usage.remove_finished_timers = ConfigYesNo(default = True)
	config.usage.enable_eit_epg = ConfigYesNo(default = True)
	def setEITepg(configElement):
			from enigma import eEPGCache
			eEPGCache.getInstance().setEITenabled(int(config.usage.enable_eit_epg.getValue()))
	config.usage.enable_eit_epg.addNotifier(setEITepg)
	config.usage.show_nownext_eit = ConfigYesNo(default = True)
	config.usage.show_old_epg = ConfigSelection(default = "0", choices = [
		("0", _("off")),
		("3600", "1 h"),
		("21600", "6 h"),
		("43200", "12 h"),
		("86400", "24 h"),])
	def setOldEPGBuffer(configElement):
			from enigma import eEPGCache
			eEPGCache.getInstance().setOldEPG(int(config.usage.show_old_epg.getValue()))
	config.usage.show_old_epg.addNotifier(setOldEPGBuffer)

	config.usage.epg_buffer = ConfigInteger(default = 14, limits = (1, 28))
	def setEPGBufferDays(configElement):
			from enigma import eEPGCache
			eEPGCache.getInstance().setEPGBuffer(config.usage.epg_buffer.getValue())
	config.usage.epg_buffer.addNotifier(setEPGBufferDays)
	epg_choices = [
		("eventview", _("Event Description")),
		("singleepg", _("Single Service EPG")),
		("multiepg", _("Multi EPG")),
		("epgbar", _("Service EPGBar"))]
	if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/GraphMultiEPG/plugin.py'):
		epg_choices.append(("graphicalmultiepg", _("Graphical Multi EPG")))
	config.usage.epg_default_view = ConfigSelection(default = "eventview", choices = epg_choices)

	config.usage.enable_tt_caching = ConfigYesNo(default = True)
	def EnableTtCachingChanged(configElement):
		setEnableTtCachingOnOff(int(configElement.value))
	config.usage.enable_tt_caching.addNotifier(EnableTtCachingChanged)

	config.usage.stop_seek_eof = ConfigSelection(default = "20", choices = [
		("0", _("off")),
		("10", "10 " + _("seconds")),
		("20", "20 " + _("seconds")),
		("30", "30 " + _("seconds")),
		("60", "60 " + _("seconds"))])

	def updateVideoDirChoice(configElement):
		tmp = configElement.value
		tmp.append(_("off"))
		tmp.append(_("last video"))
		if config.movielist.start_videodir.value in tmp:
			default = config.movielist.start_videodir.value
		else:
			default = _("last video")
		config.movielist.start_videodir.setChoices(tmp, default)
	tmp = config.movielist.videodirs.value
	tmp.append(_("off"))
	tmp.append(_("last video"))
	config.movielist.start_videodir = ConfigSelection(default = _("last video"), choices = tmp)
	config.movielist.videodirs.addNotifier(updateVideoDirChoice)
	config.usage.movielist_folder_based_config = ConfigYesNo(default = True)
	config.usage.movielist_support_pig = ConfigYesNo(default = True)
	config.usage.movielist_last_played_movie = ConfigText(default = "")
	config.usage.movielist_select_last_movie = ConfigYesNo(default = True)
	config.usage.movielist_resume_at_eof = ConfigYesNo(default = True)
	config.usage.movielist_show_cover = ConfigYesNo(default = True)
	config.usage.movielist_show_dir = ConfigYesNo(default = True)
	config.usage.movielist_show_trash_dir = ConfigYesNo(default = False)
	config.usage.movielist_use_trash_dir = ConfigYesNo(default = False)
	config.usage.movielist_show_icon = ConfigYesNo(default = True)
	config.usage.movielist_show_color = ConfigYesNo(default = True)
	config.usage.movielist_show_picon = ConfigYesNo(default = False)
	config.usage.movielist_show_channel_info = ConfigYesNo(default = True)
	config.usage.movielist_show_recording_date = ConfigYesNo(default = True)
	config.usage.movielist_show_file_size = ConfigYesNo(default = True)
	config.usage.movielist_only_day = ConfigYesNo(default = True)
	config.usage.movielist_show_last_stop_time = ConfigYesNo(default = False)
	config.usage.movielist_show_duration = ConfigYesNo(default = True)
	config.usage.movielist_duration_in_min = ConfigYesNo(default = True)
	config.usage.movielist_progress_seen = ConfigInteger(default = 80, limits = (40, 99))
	config.usage.movielist_leave_exit = ConfigYesNo(default = True)
	config.usage.movielist_ask_movie_del = ConfigYesNo(default = False)
	config.usage.movielist_show_progress = ConfigSelection(default = "progress_bar", choices = [
		("progress_bar", _("progress bar")),
		("progress_percent", _("percent")),
		("progress_calculate", _("only calculate")),
		("progress_off", _("off"))])
	config.usage.timerlist_show_icon = ConfigYesNo(default = True)
	config.usage.timerlist_show_epg = ConfigYesNo(default = True)
	config.usage.timerlist_style = ConfigSelection(default = "0", choices = [
		("0", _("Default")),
		("1", _("Style") + " 1"),
		("2", _("Style") + " 2"),
		("3", _("Style") + " 3"),
		("4", _("Style") + " 4"),
		("5", _("Style") + " 5"),])
	config.usage.show_favourites_bouquetup = ConfigYesNo(default = False)
	config.usage.show_servicelist_at_modeswitch = ConfigYesNo(default = False)
	config.usage.use_pig = ConfigYesNo(default = False)
	config.usage.use_extended_pig = ConfigYesNo(default = False)
	config.usage.use_extended_pig_channelselection = ConfigYesNo(default = False)
	config.usage.show_infobar_on_splitscreen = ConfigYesNo(default = False)
	pip_modes = [("splitscreen", _("Split Screen")), ("audiozap", _("Audio Zap")), ("pip", _("Picture in Picture"))]
	config.usage.default_pip_mode = ConfigSelection(default = "splitscreen", choices = pip_modes)
	config.usage.default_zero_double_click_mode = ConfigSelection(default = "pip", choices = pip_modes)
	default_timeout = SystemInfo["CanPiP"] and 500 or 50
	config.usage.zero_doubleclick_timeout = ConfigInteger(default = default_timeout, limits = (50, 5000))
	config.usage.zap_pip = ConfigYesNo(default = True)
	config.usage.zap_before_record = ConfigYesNo(default = False)
	config.usage.zap_notification_record = ConfigYesNo(default = True)
	if SystemInfo["CanPiP"]:
		config.usage.pip_in_EPGBar = ConfigYesNo(default = True)
	else:
		config.usage.pip_in_EPGBar = ConfigYesNo(default = False)
	config.usage.picon_dir = ConfigDirectory(default = "/usr/share/enigma2/picon")
	config.usage.picon_scale = ConfigYesNo(default = True)
	config.usage.sort_menu_byname = ConfigYesNo(default = False)
	config.usage.sort_plugins_byname = ConfigYesNo(default = True)
	config.usage.numberzap_timeout = ConfigInteger(default = 3000, limits = (100, 20000))
	config.usage.numberzap_show_servicename = ConfigYesNo(default = True)
	config.usage.numberzap_show_picon = ConfigYesNo(default = True)
	config.usage.startup_service_leavestandby = ConfigYesNo(default = False)
	config.usage.overzap_notplayable = ConfigYesNo(default = False)
	config.usage.disable_tuner_error_popup = ConfigYesNo(default = False)
	config.usage.disable_infobar_timeout_okbutton = ConfigYesNo(default = False)
	config.usage.ask_timer_file_del = ConfigYesNo(default = True)
	config.usage.record_file_name_date_at_end = ConfigYesNo(default = False)
	config.usage.silent_rec_mode = ConfigYesNo(default = True)
	config.usage.vfd_scroll_delay = ConfigSelection(default = "10000", choices = [
		("10000", "10 " + _("seconds")),
		("20000", "20 " + _("seconds")),
		("30000", "30 " + _("seconds")),
		("60000", "1 " + _("minute")),
		("300000", "5 " + _("minutes")),
		("noscrolling", _("off"))])
	config.usage.vfd_scroll_speed = ConfigSelection(default = "300", choices = [
		("500", _("slow")),
		("300", _("normal")),
		("100", _("fast"))])

	def get_default_RC():
		device = HardwareInfoVu().get_device_name()
		if device =="duo2":
			return "2"
		elif device == "ultimo":
			return "1"
		return "0"

	config.usage.rc_style = ConfigSelection(default = get_default_RC(), choices = [
		("0", "Vu+ 1 (Duo, Solo, Uno, Solo2)"),
		("1", "Vu+ 2 (Ultimo)"),
		("2", "Vu+ 3 (Duo2)")])
	config.usage.use_force_overwrite = ConfigYesNo(default = True)
	config.usage.use_package_conffile = ConfigYesNo(default = True)
	config.usage.use_rm_force_depends = ConfigYesNo(default = False)
	config.usage.use_rm_autoremove = ConfigYesNo(default = True)
	config.usage.check_for_updates = ConfigInteger(default = 8, limits = (0, 24))
	config.usage.show_notification_for_updates = ConfigYesNo(default = True)
	config.usage.update_available = NoSave(ConfigYesNo(default = False))
	config.usage.blinking_rec_symbol_during_recording = ConfigYesNo(default = True)
	config.usage.enable_hbbtv_autostart = ConfigYesNo(default = True)
	config.subtitle = ConfigSubsection()
	config.subtitle.subtitlecolor = ConfigSelection(default = "0", choices = [
		("0", _("original")),
		("1", _("white")),
		("2", _("yellow")),
		("3", _("dark yellow")),
		("4", _("red")),
		("5", _("green")),
		("6", _("cyan")),
		("7", _("grey")),])
	config.subtitle.subtitlefontsize  = ConfigSelection(choices = ["16", "18", "20", "22", "24", "26", "28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "54", "58", "60"], default = "30")
	config.subtitle.subtitlehalignment = ConfigSelection(choices = ["left", "center", "right"], default = "center")
	config.subtitle.dvbsubtitleyellow = ConfigYesNo(default = False)
	config.subtitle.dvbsubtitlecentered = ConfigYesNo(default = False)
	config.subtitle.dvbsubtitlebacktrans = ConfigSelection(default = "0", choices = [
		("0", _("no transparency")),
		("25", "10%"),
		("50", "20%"),
		("75", "30%"),
		("100", "40%"),
		("125", "50%"),
		("150", "60%"),
		("175", "70%"),
		("200", "80%"),
		("225", "90%"),
		("255", _("full transparency"))])
Esempio n. 14
0
def InitUsageConfig():
	try:
		file = open('/etc/image-version', 'r')
		lines = file.readlines()
		file.close()
		for x in lines:
			splitted = x.split('=')
			if splitted[0] == "box_type":
				folderprefix = splitted[1].replace('\n','') # 0 = release, 1 = experimental
				boxtype = splitted[1].replace('\n','') # 0 = release, 1 = experimental
	except:
		folderprefix=""
		boxtype="not detected"
	config.misc.boxtype = ConfigText(default = boxtype)

	config.usage = ConfigSubsection()
	config.usage.showdish = ConfigYesNo(default = True)
	config.usage.multibouquet = ConfigYesNo(default = True)

	config.usage.alternative_number_mode = ConfigYesNo(default = False)
	def alternativeNumberModeChange(configElement):
		eDVBDB.getInstance().setNumberingMode(configElement.value)
		refreshServiceList()
	config.usage.alternative_number_mode.addNotifier(alternativeNumberModeChange)

	config.usage.hide_number_markers = ConfigYesNo(default = False)
	config.usage.hide_number_markers.addNotifier(refreshServiceList)

	config.usage.servicetype_icon_mode = ConfigSelection(default = "0", choices = [("0", _("None")), ("1", _("Left from servicename")), ("2", _("Right from servicename"))])  
	config.usage.servicetype_icon_mode.addNotifier(refreshServiceList)
	config.usage.crypto_icon_mode = ConfigSelection(default = "0", choices = [("0", _("None")), ("1", _("Left from servicename")), ("2", _("Right from servicename"))])
	config.usage.crypto_icon_mode.addNotifier(refreshServiceList)

	config.usage.service_icon_enable = ConfigYesNo(default = False)
	config.usage.service_icon_enable.addNotifier(refreshServiceList)
	config.usage.servicelist_cursor_behavior = ConfigSelection(default = "standard", choices = [
		("standard", _("Standard")),
		("keep", _("Keep service")),
		("reverseB", _("Reverse bouquet buttons")),
		("keep reverseB", _("Keep service") + " + " + _("Reverse bouquet buttons"))])

	config.usage.multiepg_ask_bouquet = ConfigYesNo(default = False)
	
	config.usage.quickzap_bouquet_change = ConfigYesNo(default = False)
	config.usage.e1like_radio_mode = ConfigYesNo(default = True)
	choicelist = []
	for i in range(1, 12):
		choicelist.append(("%d" % i, ngettext("%d second", "%d seconds", i) % i))
	config.usage.infobar_timeout = ConfigSelection(default = "5", choices = [("0", _("No timeout"))] + choicelist)
	config.usage.show_infobar_on_zap = ConfigYesNo(default = True)
	config.usage.show_infobar_on_skip = ConfigYesNo(default = True)
	config.usage.show_infobar_on_event_change = ConfigYesNo(default = False)
	config.usage.show_second_infobar = ConfigSelection(default = None, choices = [(None, _("None")), ("0", _("No timeout"))] + choicelist + [("EPG",_("EPG"))])
	config.usage.infobar_frontend_source = ConfigSelection(default = "tuner", choices = [("settings", _("Settings")), ("tuner", _("Tuner"))])
	config.usage.show_spinner = ConfigYesNo(default = True)
	config.usage.enable_tt_caching = ConfigYesNo(default = True)
	choicelist = []
	for i in (10, 30):
		choicelist.append(("%d" % i, ngettext("%d second", "%d seconds", i) % i))
	for i in (60, 120, 300, 600, 1200, 1800):
		m = i / 60
		choicelist.append(("%d" % i, ngettext("%d minute", "%d minutes", m) % m))
	for i in (3600, 7200, 14400):
		h = i / 3600
		choicelist.append(("%d" % i, ngettext("%d hour", "%d hours", h) % h))
	config.usage.hdd_standby = ConfigSelection(default = "300", choices = [("0", _("No standby"))] + choicelist)
	config.usage.output_12V = ConfigSelection(default = "do not change", choices = [
		("do not change", _("Do not change")), ("off", _("Off")), ("on", _("On")) ])

	config.usage.pip_zero_button = ConfigSelection(default = "standard", choices = [
		("standard", _("Standard")), ("swap", _("Swap PiP and main picture")),
		("swapstop", _("Move PiP to main picture")), ("stop", _("Stop PiP")) ])
	config.usage.pip_hideOnExit = ConfigSelection(default = "without popup", choices = [
		("no", _("No")), ("popup", _("With popup")), ("without popup", _("Without popup")) ])

	config.usage.default_path = ConfigText(default = resolveFilename(SCOPE_HDD))
	config.usage.timer_path = ConfigText(default = "<default>")
	config.usage.instantrec_path = ConfigText(default = "<default>")
	config.usage.timeshift_path = ConfigText(default = "/media/hdd/")
	config.usage.allowed_timeshift_paths = ConfigLocations(default = ["/media/hdd/"])

	config.usage.movielist_trashcan = ConfigYesNo(default=True)
	config.usage.movielist_trashcan_days = ConfigNumber(default=8)
	config.usage.movielist_trashcan_reserve = ConfigNumber(default=40)
	config.usage.on_movie_start = ConfigSelection(default = "resume", choices = [
		("ask", _("Ask user")), ("resume", _("Resume from last position")), ("beginning", _("Start from the beginning")) ])
	config.usage.on_movie_stop = ConfigSelection(default = "movielist", choices = [
		("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")) ])
	config.usage.on_movie_eof = ConfigSelection(default = "movielist", choices = [
		("ask", _("Ask user")), ("movielist", _("Return to movie list")), ("quit", _("Return to previous service")), ("pause", _("Pause movie at end")), ("playlist", _("Play next (return to movie list)")),
		("playlistquit", _("Play next (return to previous service)")), ("loop", _("Continues play (loop)")), ("repeatcurrent", _("Repeat"))])
	config.usage.next_movie_msg = ConfigYesNo(default = True)
	config.usage.leave_movieplayer_onExit = ConfigSelection(default = "popup", choices = [
		("no", _("No")), ("popup", _("With popup")), ("without popup", _("Without popup")) ])

	config.usage.setup_level = ConfigSelection(default = "expert", choices = [
		("simple", _("Simple")),
		("intermediate", _("Intermediate")),
		("expert", _("Expert")) ])

	config.usage.on_long_powerpress = ConfigSelection(default = "show_menu", choices = [
		("show_menu", _("Show shutdown menu")),
		("shutdown", _("Immediate shutdown")),
		("standby", _("Standby")) ] )
	
	config.usage.on_short_powerpress = ConfigSelection(default = "standby", choices = [
		("show_menu", _("Show shutdown menu")),
		("shutdown", _("Immediate shutdown")),
		("standby", _("Standby")) ] )

	choicelist = []
	for i in range(-21600, 21601, 3600):
		h = abs(i / 3600)
		h = ngettext("%d hour", "%d hours", h) % h
		if i < 0:
			choicelist.append(("%d" % i, _("Shutdown in ") + h))
		elif i > 0:
			choicelist.append(("%d" % i, _("Standby in ") + h))
		else:
			choicelist.append(("0", _("Do nothing")))
	config.usage.inactivity_timer = ConfigSelection(default = "0", choices = choicelist)
	config.usage.inactivity_timer_blocktime = ConfigYesNo(default = True)
	config.usage.inactivity_timer_blocktime_begin = ConfigClock(default = time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_end = ConfigClock(default = time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))

	choicelist = []
	for i in range(-7200, 7201, 900):
		m = abs(i / 60)
		m = ngettext("%d minute", "%d minutes", m) % m
		if i < 0:
			choicelist.append(("%d" % i, _("Shutdown in ") + m))
		elif i > 0:
			choicelist.append(("%d" % i, _("Standby in ") + m))
		else:
			choicelist.append(("event_shutdown", _("Shutdown after current event")))
			choicelist.append(("0", _("Disabled")))
			choicelist.append(("event_standby", _("Standby after current event")))
	config.usage.sleep_timer = ConfigSelection(default = "0", choices = choicelist)

	choicelist = [("0", _("Disabled"))]
	for i in range(900, 7201, 900):
		m = abs(i / 60)
		m = ngettext("%d minute", "%d minutes", m) % m
		choicelist.append(("%d" % i, _("after ") + m))
	config.usage.standby_to_shutdown_timer = ConfigSelection(default = "0", choices = choicelist)

	choicelist = [("0", _("Disabled"))]
	for i in (5, 30, 60, 300, 600, 900, 1200, 1800, 2700, 3600):
		if i < 60:
			m = ngettext("%d second", "%d seconds", i) % i
		else:
			m = abs(i / 60)
			m = ngettext("%d minute", "%d minutes", m) % m
		choicelist.append(("%d" % i, m))
	config.usage.screen_saver = ConfigSelection(default = "0", choices = choicelist)

	config.usage.check_timeshift = ConfigYesNo(default = True)

	choicelist = [("0", _("Disabled"))]
	for i in (2, 3, 4, 5, 10, 20, 30):
		choicelist.append(("%d" % i, ngettext("%d second", "%d seconds", i) % i))
	for i in (60, 120, 300):
		m = i / 60
		choicelist.append(("%d" % i, ngettext("%d minute", "%d minutes", m) % m))
	config.usage.timeshift_start_delay = ConfigSelection(default = "0", choices = choicelist)

	config.usage.alternatives_priority = ConfigSelection(default = "0", choices = [
		("0", "DVB-S/-C/-T"),
		("1", "DVB-S/-T/-C"),
		("2", "DVB-C/-S/-T"),
		("3", "DVB-C/-T/-S"),
		("4", "DVB-T/-C/-S"),
		("5", "DVB-T/-S/-C") ])

	nims = [("-1", _("auto"))]
	for x in nimmanager.nim_slots:
		nims.append((str(x.slot), x.getSlotName()))
	config.usage.frontend_priority = ConfigSelection(default = "-1", choices = list(nims))
	nims.insert(0,("-2", _("Disabled")))
	config.usage.recording_frontend_priority = ConfigSelection(default = "-2", choices = nims)
	config.misc.disable_background_scan = ConfigYesNo(default = False)

	config.usage.show_event_progress_in_servicelist = ConfigSelection(default = 'barright', choices = [
		('barleft', _("Progress bar left")),
		('barright', _("Progress bar right")),
		('percleft', _("Percentage left")),
		('percright', _("Percentage right")),
		('no', _("No")) ])
	config.usage.show_channel_numbers_in_servicelist = ConfigYesNo(default = True)
	config.usage.show_event_progress_in_servicelist.addNotifier(refreshServiceList)
	config.usage.show_channel_numbers_in_servicelist.addNotifier(refreshServiceList)

	config.usage.blinking_display_clock_during_recording = ConfigYesNo(default = False)

	config.usage.show_message_when_recording_starts = ConfigYesNo(default = True)

	config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(default = True)
	config.usage.show_icons_in_movielist = ConfigSelection(default = 'i', choices = [
		('o', _("Off")),
		('p', _("Progress")),
		('s', _("Small progress")),
		('i', _("Icons")),
	])
	config.usage.movielist_unseen = ConfigYesNo(default = False)

	config.usage.swap_snr_on_osd = ConfigYesNo(default = False)

	def SpinnerOnOffChanged(configElement):
		setSpinnerOnOff(int(configElement.value))
	config.usage.show_spinner.addNotifier(SpinnerOnOffChanged)

	def EnableTtCachingChanged(configElement):
		setEnableTtCachingOnOff(int(configElement.value))
	config.usage.enable_tt_caching.addNotifier(EnableTtCachingChanged)

	def TunerTypePriorityOrderChanged(configElement):
		setTunerTypePriorityOrder(int(configElement.value))
	config.usage.alternatives_priority.addNotifier(TunerTypePriorityOrderChanged, immediate_feedback=False)

	def PreferredTunerChanged(configElement):
		setPreferredTuner(int(configElement.value))
	config.usage.frontend_priority.addNotifier(PreferredTunerChanged)

	config.usage.hide_zap_errors = ConfigYesNo(default = False)
	config.usage.hide_ci_messages = ConfigYesNo(default = False)
	config.usage.show_cryptoinfo = ConfigYesNo(default = True)
	config.usage.show_eit_nownext = ConfigYesNo(default = True)
	config.usage.show_vcr_scart = ConfigYesNo(default = False)

	if SystemInfo["Fan"]:
		choicelist = [('off', _("Off")), ('on', _("On")), ('auto', _("Auto"))]
		if os.path.exists("/proc/stb/fp/fan_choices"):
			choicelist = [x for x in choicelist if x[0] in open("/proc/stb/fp/fan_choices", "r").read().strip().split(" ")]
		config.usage.fan = ConfigSelection(choicelist)
		def fanChanged(configElement):
			file = open("/proc/stb/fp/fan", "w")
			file.write(configElement.value)
			file.close()
		config.usage.fan.addNotifier(fanChanged)

	if SystemInfo["FanPWM"]:
		def fanSpeedChanged(configElement):
			file = open("/proc/stb/fp/fan_pwm", "w")
			file.write(hex(configElement.value)[2:])
			file.close()
		config.usage.fanspeed = ConfigSlider(default=127, increment=8, limits=(0, 255))
		config.usage.fanspeed.addNotifier(fanSpeedChanged)

	if SystemInfo["StandbyLED"]:
		def standbyLEDChanged(configElement):
			file = open("/proc/stb/power/standbyled", "w")
			file.write(configElement.value and "on" or "off")
			file.close()
		config.usage.standbyLED = ConfigYesNo(default = True)
		config.usage.standbyLED.addNotifier(standbyLEDChanged)

	config.epg = ConfigSubsection()
	config.epg.eit = ConfigYesNo(default = True)
	config.epg.mhw = ConfigYesNo(default = False)
	config.epg.freesat = ConfigYesNo(default = True)
	config.epg.viasat = ConfigYesNo(default = True)
	config.epg.netmed = ConfigYesNo(default = True)
	config.misc.showradiopic = ConfigYesNo(default = True)
	def EpgSettingsChanged(configElement):
		from enigma import eEPGCache
		mask = 0xffffffff
		if not config.epg.eit.value:
			mask &= ~(eEPGCache.NOWNEXT | eEPGCache.SCHEDULE | eEPGCache.SCHEDULE_OTHER)
		if not config.epg.mhw.value:
			mask &= ~eEPGCache.MHW
		if not config.epg.freesat.value:
			mask &= ~(eEPGCache.FREESAT_NOWNEXT | eEPGCache.FREESAT_SCHEDULE | eEPGCache.FREESAT_SCHEDULE_OTHER)
		if not config.epg.viasat.value:
			mask &= ~eEPGCache.VIASAT
		if not config.epg.netmed.value:
			mask &= ~(eEPGCache.NETMED_SCHEDULE | eEPGCache.NETMED_SCHEDULE_OTHER)
		eEPGCache.getInstance().setEpgSources(mask)
	config.epg.eit.addNotifier(EpgSettingsChanged)
	config.epg.mhw.addNotifier(EpgSettingsChanged)
	config.epg.freesat.addNotifier(EpgSettingsChanged)
	config.epg.viasat.addNotifier(EpgSettingsChanged)
	config.epg.netmed.addNotifier(EpgSettingsChanged)

	config.epg.histminutes = ConfigSelectionNumber(min = 0, max = 120, stepwidth = 15, default = 0, wraparound = True)
	def EpgHistorySecondsChanged(configElement):
		from enigma import eEPGCache
		eEPGCache.getInstance().setEpgHistorySeconds(config.epg.histminutes.getValue()*60)
	config.epg.histminutes.addNotifier(EpgHistorySecondsChanged)

	def setHDDStandby(configElement):
		for hdd in harddiskmanager.HDDList():
			hdd[1].setIdleTime(int(configElement.value))
	config.usage.hdd_standby.addNotifier(setHDDStandby, immediate_feedback=False)

	def set12VOutput(configElement):
		if configElement.value == "on":
			Misc_Options.getInstance().set_12V_output(1)
		elif configElement.value == "off":
			Misc_Options.getInstance().set_12V_output(0)
	config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

	SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()

	config.usage.keymap = ConfigText(default = eEnv.resolve("${datadir}/enigma2/keymap.xml"))

	config.seek = ConfigSubsection()
	config.seek.selfdefined_13 = ConfigNumber(default=15)
	config.seek.selfdefined_46 = ConfigNumber(default=60)
	config.seek.selfdefined_79 = ConfigNumber(default=300)

	config.seek.speeds_forward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
	config.seek.speeds_backward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
	config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8], choices=[2, 4, 6, 8, 12, 16, 25])

	config.seek.enter_forward = ConfigSelection(default = "2", choices = ["2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])
	config.seek.enter_backward = ConfigSelection(default = "1", choices = ["1", "2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])

	config.seek.on_pause = ConfigSelection(default = "play", choices = [
		("play", _("Play")),
		("step", _("Single step (GOP)")),
		("last", _("Last speed")) ])


	config.crash = ConfigSubsection()
	config.crash.details = ConfigYesNo(default = True)
	config.usage.timerlist_finished_timer_position = ConfigSelection(default = "end", choices = [("beginning", _("At beginning")), ("end", _("At end"))])
	config.crash.enabledebug = ConfigYesNo(default = False)

	debugpath = [('/home/root/logs/', '/home/root/')]
	for p in harddiskmanager.getMountedPartitions():
		d = os.path.normpath(p.mountpoint)
		if os.path.exists(p.mountpoint):
			if p.mountpoint != '/':
				debugpath.append((d + '/logs/', p.mountpoint))
	config.crash.debug_path = ConfigSelection(default = "/home/root/logs/", choices = debugpath)
	def updatedebug_path(configElement):
		if not os.path.exists(config.crash.debug_path.getValue()):
			os.mkdir(config.crash.debug_path.getValue(),0755)
	config.crash.debug_path.addNotifier(updatedebug_path, immediate_feedback = False)

	def updateEnterForward(configElement):
		if not configElement.value:
			configElement.value = [2]
		updateChoices(config.seek.enter_forward, configElement.value)

	config.seek.speeds_forward.addNotifier(updateEnterForward, immediate_feedback = False)

	def updateEnterBackward(configElement):
		if not configElement.value:
			configElement.value = [2]
		updateChoices(config.seek.enter_backward, configElement.value)

	config.seek.speeds_backward.addNotifier(updateEnterBackward, immediate_feedback = False)

	def updateEraseSpeed(el):
		eBackgroundFileEraser.getInstance().setEraseSpeed(int(el.value))
	def updateEraseFlags(el):
		eBackgroundFileEraser.getInstance().setEraseFlags(int(el.value))
	config.misc.erase_speed = ConfigSelection(default="20", choices = [
		("10", "10 MB/s"),
		("20", "20 MB/s"),
		("50", "50 MB/s"),
		("100", "100 MB/s")])
	config.misc.erase_speed.addNotifier(updateEraseSpeed, immediate_feedback = False)
	config.misc.erase_flags = ConfigSelection(default="1", choices = [
		("0", _("Disable")),
		("1", _("Internal hdd only")),
		("3", _("Everywhere"))])
	config.misc.erase_flags.addNotifier(updateEraseFlags, immediate_feedback = False)

	SystemInfo["ZapMode"] = os.path.exists("/proc/stb/video/zapmode")
	if SystemInfo["ZapMode"]:
		def setZapmode(el):
			try:
				file = open("/proc/stb/video/zapmode", "w")
				file.write(el.value)
				file.close()
			except:
				pass
		config.misc.zapmode = ConfigSelection(default = "mute", choices = [
			("mute", _("Black screen")), ("hold", _("Hold screen")), ("mutetilllock", _("Black screen till locked")), ("holdtilllock", _("Hold till locked"))])
		config.misc.zapmode.addNotifier(setZapmode, immediate_feedback = False)

	config.subtitles = ConfigSubsection()
	config.subtitles.ttx_subtitle_colors = ConfigSelection(default = "1", choices = [
		("0", _("original")),
		("1", _("white")),
		("2", _("yellow")) ])
	config.subtitles.ttx_subtitle_original_position = ConfigYesNo(default = False)
	config.subtitles.subtitle_position = ConfigSelection( choices = ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100", "150", "200", "250", "300", "350", "400", "450"], default = "50")
	config.subtitles.subtitle_alignment = ConfigSelection(choices = [("left", _("left")), ("center", _("center")), ("right", _("right"))], default = "center")
	config.subtitles.subtitle_rewrap = ConfigYesNo(default = False)
	config.subtitles.subtitle_borderwidth = ConfigSelection(choices = ["1", "2", "3", "4", "5"], default = "3")
	config.subtitles.subtitle_fontsize  = ConfigSelection(choices = ["16", "18", "20", "22", "24", "26", "28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54"], default = "34")

	subtitle_delay_choicelist = []
	for i in range(-900000, 1845000, 45000):
		if i == 0:
			subtitle_delay_choicelist.append(("0", _("No delay")))
		else:
			subtitle_delay_choicelist.append(("%d" % i, "%2.1f sec" % (i / 90000.)))
	config.subtitles.subtitle_noPTSrecordingdelay = ConfigSelection(default = "315000", choices = subtitle_delay_choicelist)

	config.subtitles.dvb_subtitles_yellow = ConfigYesNo(default = False)
	config.subtitles.dvb_subtitles_original_position = ConfigSelection(default = "0", choices = [("0", _("Original")), ("1", _("Fixed")), ("2", _("Relative"))])
	config.subtitles.dvb_subtitles_centered = ConfigYesNo(default = True)
	config.subtitles.subtitle_bad_timing_delay = ConfigSelection(default = "0", choices = subtitle_delay_choicelist)
	config.subtitles.dvb_subtitles_backtrans = ConfigSelection(default = "0", choices = [
		("0", _("No transparency")),
		("25", "10%"),
		("50", "20%"),
		("75", "30%"),
		("100", "40%"),
		("125", "50%"),
		("150", "60%"),
		("175", "70%"),
		("200", "80%"),
		("225", "90%"),
		("255", _("Full transparency"))])
	config.subtitles.pango_subtitle_colors = ConfigSelection(default = "0", choices = [
		("0", _("alternative")),
		("1", _("white")),
		("2", _("yellow")) ])
	config.subtitles.pango_subtitles_delay = ConfigSelection(default = "0", choices = subtitle_delay_choicelist)
	config.subtitles.pango_subtitles_fps = ConfigSelection(default = "1", choices = [
		("1", _("Original")),
		("23976", _("23.976")),
		("24000", _("24")),
		("25000", _("25")),
		("29970", _("29.97")),
		("30000", _("30"))])
	config.subtitles.pango_autoturnon = ConfigYesNo(default = True)

	config.autolanguage = ConfigSubsection()
	audio_language_choices=[
		("---", _("None")),
		("orj dos ory org esl qaa und mis mul ORY ORJ Audio_ORJ", _("Original")),
		("ara", _("Arabic")),
		("eus baq", _("Basque")),
		("bul", _("Bulgarian")), 
		("hrv", _("Croatian")),
		("ces cze", _("Czech")),
		("dan", _("Danish")),
		("dut ndl", _("Dutch")),
		("eng qaa", _("English")),
		("est", _("Estonian")),
		("fin", _("Finnish")),
		("fra fre", _("French")),
		("deu ger", _("German")),
		("ell gre", _("Greek")),
		("heb", _("Hebrew")),
		("hun", _("Hungarian")),
		("ita", _("Italian")),
		("lav", _("Latvian")),
		("lit", _("Lithuanian")),
		("ltz", _("Luxembourgish")),
		("nor", _("Norwegian")),
		("pol", _("Polish")),
		("por", _("Portuguese")),
		("fas per", _("Persian")),
		("ron rum", _("Romanian")),
		("rus", _("Russian")),
		("srp", _("Serbian")),
		("slk slo", _("Slovak")),
		("slv", _("Slovenian")),
		("spa", _("Spanish")),
		("swe", _("Swedish")),
		("tha", _("Thai")),
		("tur Audio_TUR", _("Turkish"))]

	def setEpgLanguage(configElement):
		eServiceEvent.setEPGLanguage(configElement.value)
	config.autolanguage.audio_epglanguage = ConfigSelection(audio_language_choices[:1] + audio_language_choices [2:], default="---")
	config.autolanguage.audio_epglanguage.addNotifier(setEpgLanguage)

	def setEpgLanguageAlternative(configElement):
		eServiceEvent.setEPGLanguageAlternative(configElement.value)
	config.autolanguage.audio_epglanguage_alternative = ConfigSelection(audio_language_choices[:1] + audio_language_choices [2:], default="---")
	config.autolanguage.audio_epglanguage_alternative.addNotifier(setEpgLanguageAlternative)

	config.autolanguage.audio_autoselect1 = ConfigSelection(choices=audio_language_choices, default="---")
	config.autolanguage.audio_autoselect2 = ConfigSelection(choices=audio_language_choices, default="---")
	config.autolanguage.audio_autoselect3 = ConfigSelection(choices=audio_language_choices, default="---")
	config.autolanguage.audio_autoselect4 = ConfigSelection(choices=audio_language_choices, default="---")
	config.autolanguage.audio_defaultac3 = ConfigYesNo(default = False)
	config.autolanguage.audio_defaultddp = ConfigYesNo(default = False)
	config.autolanguage.audio_usecache = ConfigYesNo(default = True)

	subtitle_language_choices = audio_language_choices[:1] + audio_language_choices [2:]
	config.autolanguage.subtitle_autoselect1 = ConfigSelection(choices=subtitle_language_choices, default="---")
	config.autolanguage.subtitle_autoselect2 = ConfigSelection(choices=subtitle_language_choices, default="---")
	config.autolanguage.subtitle_autoselect3 = ConfigSelection(choices=subtitle_language_choices, default="---")
	config.autolanguage.subtitle_autoselect4 = ConfigSelection(choices=subtitle_language_choices, default="---")
	config.autolanguage.subtitle_hearingimpaired = ConfigYesNo(default = False)
	config.autolanguage.subtitle_defaultimpaired = ConfigYesNo(default = False)
	config.autolanguage.subtitle_defaultdvb = ConfigYesNo(default = False)
	config.autolanguage.subtitle_usecache = ConfigYesNo(default = True)
	config.autolanguage.equal_languages = ConfigSelection(default = "15", choices = [
		("0", _("None")),("1", "1"),("2", "2"),("3", "1,2"),
		("4", "3"),("5", "1,3"),("6", "2,3"),("7", "1,2,3"),
		("8", "4"),("9", "1,4"),("10", "2,4"),("11", "1,2,4"),
		("12", "3,4"),("13", "1,3,4"),("14", "2,3,4"),("15", _("All"))])

	config.streaming = ConfigSubsection()
	config.streaming.stream_ecm = ConfigYesNo(default = False)
	config.streaming.descramble = ConfigYesNo(default = True)
	config.streaming.stream_eit = ConfigYesNo(default = True)
	config.streaming.stream_ait = ConfigYesNo(default = True)
	config.streaming.authentication = ConfigYesNo(default = False)
Esempio n. 15
0
		def set12VOutput(configElement):
			Misc_Options.getInstance().set_12V_output(configElement.value == "on" and 1 or 0)
Esempio n. 16
0
def InitUsageConfig():
    config.usage = ConfigSubsection()
    config.usage.showdish = ConfigYesNo(default=True)
    config.usage.multibouquet = ConfigYesNo(default=True)
    config.usage.multiepg_ask_bouquet = ConfigYesNo(default=False)

    config.usage.quickzap_bouquet_change = ConfigYesNo(default=True)
    config.usage.e1like_radio_mode = ConfigYesNo(default=True)
    config.usage.infobar_timeout = ConfigSelection(
        default="5",
        choices=[("0", _("no timeout")), ("1", "1 " + _("second")),
                 ("2", "2 " + _("seconds")), ("3", "3 " + _("seconds")),
                 ("4", "4 " + _("seconds")), ("5", "5 " + _("seconds")),
                 ("6", "6 " + _("seconds")), ("7", "7 " + _("seconds")),
                 ("8", "8 " + _("seconds")), ("9", "9 " + _("seconds")),
                 ("10", "10 " + _("seconds"))])
    config.usage.show_infobar_on_zap = ConfigYesNo(default=True)
    config.usage.show_infobar_on_skip = ConfigYesNo(default=True)
    config.usage.show_infobar_on_event_change = ConfigYesNo(default=True)
    config.usage.hdd_standby = ConfigSelection(
        default="1200",
        choices=[("0", _("no standby")), ("10", "10 " + _("seconds")),
                 ("30", "30 " + _("seconds")), ("60", "1 " + _("minute")),
                 ("120", "2 " + _("minutes")), ("300", "5 " + _("minutes")),
                 ("600", "10 " + _("minutes")), ("1200", "20 " + _("minutes")),
                 ("1800", "30 " + _("minutes")), ("3600", "1 " + _("hour")),
                 ("7200", "2 " + _("hours")), ("14400", "4 " + _("hours"))])
    config.usage.output_12V = ConfigSelection(default="do not change",
                                              choices=[("do not change",
                                                        _("do not change")),
                                                       ("off", _("off")),
                                                       ("on", _("on"))])

    zero_button_choices = [("standard", _("standard")),
                           ("swap", _("swap PiP and main picture")),
                           ("swapstop", _("move PiP to main picture")),
                           ("stop", _("stop PiP")),
                           ("zap_focus", _("toggle zap focus"))]
    config.usage.pip_zero_button = ConfigSelection(default="swap",
                                                   choices=zero_button_choices)
    config.usage.pip_zero_button_doubleclick = ConfigSelection(
        default="zap_focus", choices=zero_button_choices)

    config.usage.default_path = ConfigText(default=resolveFilename(SCOPE_HDD))
    config.usage.timer_path = ConfigText(default="<default>")
    config.usage.instantrec_path = ConfigText(default="<default>")
    config.usage.timeshift_path = ConfigText(default="/media/hdd/")
    config.usage.allowed_timeshift_paths = ConfigLocations(
        default=["/media/hdd/"])
    config.usage.vdir_info_path = ConfigText(default="<default>")
    config.usage.days_mark_as_new = ConfigInteger(default=3, limits=(0, 31))
    config.usage.only_unseen_mark_as_new = ConfigYesNo(default=False)

    config.usage.on_movie_start = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("resume", _("Resume from last position")),
                 ("beginning", _("Start from the beginning"))])
    config.usage.on_movie_stop = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("movielist", _("Return to movie list")),
                 ("quit", _("Return to previous service"))])
    config.usage.on_movie_eof = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("movielist", _("Return to movie list")),
                 ("quit", _("Return to previous service")),
                 ("pause", _("Pause movie at end")),
                 ("restart", _("Start from the beginning")),
                 ("playnext", _("Start next media file"))])

    config.usage.setup_level = ConfigSelection(default="expert",
                                               choices=[
                                                   ("simple", _("Simple")),
                                                   ("intermediate",
                                                    _("Intermediate")),
                                                   ("expert", _("Expert"))
                                               ])

    config.usage.on_long_powerpress = ConfigSelection(
        default="show_menu",
        choices=[("show_menu", _("show shutdown menu")),
                 ("shutdown", _("immediate shutdown")),
                 ("standby", _("Standby")), ("restart", _("Restart")),
                 ("restart_gui", _("Restart GUI")),
                 ("nothing", _("do nothing"))])

    config.usage.on_short_powerpress = ConfigSelection(
        default="standby",
        choices=[("show_menu", _("show shutdown menu")),
                 ("shutdown", _("immediate shutdown")),
                 ("standby", _("Standby")), ("restart", _("Restart")),
                 ("restart_gui", _("Restart GUI")),
                 ("nothing", _("do nothing"))])

    config.usage.alternatives_priority = ConfigSelection(
        default="0",
        choices=[("0", "DVB-S/-C/-T"), ("1", "DVB-S/-T/-C"),
                 ("2", "DVB-C/-S/-T"), ("3", "DVB-C/-T/-S"),
                 ("4", "DVB-T/-C/-S"), ("5", "DVB-T/-S/-C")])

    nims = [("-1", _("auto"))]
    for x in nimmanager.nim_slots:
        nims.append((str(x.slot), x.getSlotName()))
    config.usage.tuner_priority = ConfigSelection(default="-1", choices=nims)

    config.usage.show_event_progress_in_servicelist = ConfigYesNo(
        default=False)

    config.usage.blinking_display_clock_during_recording = ConfigYesNo(
        default=False)

    config.usage.show_message_when_recording_starts = ConfigYesNo(default=True)

    config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(
        default=True)

    def TunerTypePriorityOrderChanged(configElement):
        setTunerTypePriorityOrder(int(configElement.value))

    config.usage.alternatives_priority.addNotifier(
        TunerTypePriorityOrderChanged, immediate_feedback=False)

    def PreferredTunerChanged(configElement):
        setPreferredTuner(int(configElement.value))

    config.usage.tuner_priority.addNotifier(PreferredTunerChanged)

    def setHDDStandby(configElement):
        for hdd in harddiskmanager.HDDList():
            hdd[1].setIdleTime(int(configElement.value))

    config.usage.hdd_standby.addNotifier(setHDDStandby,
                                         immediate_feedback=False)

    def set12VOutput(configElement):
        if configElement.value == "on":
            Misc_Options.getInstance().set_12V_output(1)
        elif configElement.value == "off":
            Misc_Options.getInstance().set_12V_output(0)

    config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

    SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()

    config.usage.keymap = ConfigText(
        default=eEnv.resolve("${datadir}/enigma2/keymap.xml"))

    config.seek = ConfigSubsection()
    config.seek.selfdefined_13 = ConfigNumber(default=15)
    config.seek.selfdefined_46 = ConfigNumber(default=60)
    config.seek.selfdefined_79 = ConfigNumber(default=300)

    config.seek.speeds_forward = ConfigSet(
        default=[2, 4, 8, 16, 32, 64, 128],
        choices=[2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
    config.seek.speeds_backward = ConfigSet(
        default=[2, 4, 8, 16, 32, 64, 128],
        choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
    config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8],
                                              choices=[2, 4, 6, 8, 12, 16, 25])

    config.seek.enter_forward = ConfigSelection(default="2",
                                                choices=[
                                                    "2", "4", "6", "8", "12",
                                                    "16", "24", "32", "48",
                                                    "64", "96", "128"
                                                ])
    config.seek.enter_backward = ConfigSelection(default="1",
                                                 choices=[
                                                     "1", "2", "4", "6", "8",
                                                     "12", "16", "24", "32",
                                                     "48", "64", "96", "128"
                                                 ])

    config.seek.on_pause = ConfigSelection(default="play",
                                           choices=[("play", _("Play")),
                                                    ("step",
                                                     _("Singlestep (GOP)")),
                                                    ("last", _("Last speed"))])

    config.usage.timerlist_finished_timer_position = ConfigSelection(
        default="beginning",
        choices=[("beginning", _("at beginning")), ("end", _("at end"))])
    config.usage.timer_avoid_simultaneous_start = ConfigYesNo(default=False)

    config.seek.smartseek_enable = ConfigYesNo(default=True)
    config.seek.smartseek_marker = ConfigYesNo(default=False)
    config.seek.smartseek_time = ConfigInteger(default=300, limits=(60, 999))
    config.seek.smartseek_constant_time = ConfigInteger(default=15,
                                                        limits=(5, 600))
    config.seek.smartseek_remap_skip_fw_rw = ConfigYesNo(default=False)
    config.seek.smartseek_timeout = ConfigInteger(default=8, limits=(5, 30))
    config.seek.smartseek_min_time = ConfigInteger(default=10, limits=(2, 120))

    def updateEnterForward(configElement):
        if not configElement.value:
            configElement.value = [2]
        updateChoices(config.seek.enter_forward, configElement.value)

    config.seek.speeds_forward.addNotifier(updateEnterForward,
                                           immediate_feedback=False)

    def updateEnterBackward(configElement):
        if not configElement.value:
            configElement.value = [2]
        updateChoices(config.seek.enter_backward, configElement.value)

    config.seek.speeds_backward.addNotifier(updateEnterBackward,
                                            immediate_feedback=False)

    # VTI Settings start
    config.usage.show_bsod = ConfigYesNo(default=False)
    config.misc.placeholder = NoSave(
        ConfigSelection(default="1", choices=[("1", " ")]))
    config.misc.use_ci_assignment = ConfigYesNo(default=True)
    config.misc.disable_auto_channel_list = ConfigYesNo(default=False)
    config.misc.allow_service_delete = ConfigYesNo(default=False)
    config.misc.ecm_info = ConfigYesNo(default=True)
    config.misc.enable_custom_mainmenu = ConfigYesNo(default=False)
    config.usage.ts_min_duration = ConfigSelection(default="0",
                                                   choices=[
                                                       ("0", _("off")),
                                                       ("1", _("1 minute")),
                                                       ("2", _("2 minutes")),
                                                       ("5", _("5 minutes")),
                                                       ("10", _("10 minutes")),
                                                   ])
    config.usage.ts_show_old_ts = ConfigYesNo(default=False)
    config.usage.ts_use_history_keys = ConfigYesNo(default=False)
    config.usage.ts_clean_intervall = ConfigSelection(
        default="0", choices=["0", "1", "2", "3", "4", "5", "6", "12", "24"])
    config.usage.ts_clean_ts_older_than = ConfigSelection(default="1",
                                                          choices=[
                                                              ("0.25", "1/4"),
                                                              ("0.5", "1/2"),
                                                              ("1.0", "1"),
                                                              ("2.0", "2"),
                                                              ("3.0", "3"),
                                                              ("4.0", "4"),
                                                              ("5.0", "5")
                                                          ])
    config.usage.ts_ask_before_service_changed = ConfigSelection(
        default="delete",
        choices=[
            ("ask", _("Ask user")),
            ("delete", _("delete timeshift file")),
            ("keep_ts", _("keep timeshift file")),
        ])
    config.usage.ts_auto_start = ConfigSelection(default="0",
                                                 choices=[
                                                     ("0", _("off")),
                                                     ("1", _("1 second")),
                                                     ("2", _("2 seconds")),
                                                     ("3", _("3 seconds")),
                                                     ("4", _("4 seconds")),
                                                     ("5", _("5 seconds")),
                                                     ("10", _("10 seconds")),
                                                     ("20", _("20 seconds")),
                                                     ("30", _("30 seconds")),
                                                     ("60", _("1 minute")),
                                                     ("120", _("2 minutes")),
                                                     ("300", _("5 minutes")),
                                                 ])
    config.usage.ts_event_change = ConfigSelection(
        default="split_and_keep",
        choices=[
            ("ask", _("Ask user")),
            ("continue", _("continue timeshift")),
            ("split_and_keep", _("split & keep")),
            ("split_and_delete", _("split & delete")),
            ("stop_and_keep", _("stop & keep")),
            ("stop_and_delete", _("stop & delete")),
        ])
    config.usage.infobar_dimm = ConfigSelection(default="off",
                                                choices=[
                                                    ("fade_in", _("fade in")),
                                                    ("fade_in_out",
                                                     _("fade in/out")),
                                                    ("fade_out",
                                                     _("fade out")),
                                                    ("off", _("off")),
                                                ])
    config.usage.infobar_dimm_speed = ConfigSelection(default="30",
                                                      choices=[
                                                          ("15", _("fast")),
                                                          ("30", _("default")),
                                                          ("50", _("slow")),
                                                      ])

    config.usage.enable_zaphistory = ConfigYesNo(default=True)
    config.usage.show_epg_progress_percent = ConfigYesNo(default=False)
    config.usage.servicelist_show_picon = ConfigSelection(
        default="0",
        choices=[
            ("0", _("off")),
            ("100", "100x60 px"),
            ("50", "50x30 px"),
            ("1", _("user defined")),
        ])
    config.usage.servicelist_picon_dir = ConfigDirectory(
        default="/usr/share/enigma2/picon")
    config.usage.servicelist_two_lines = ConfigYesNo(default=False)
    config.usage.servicelist_show_event_time = ConfigYesNo(default=False)
    config.usage.servicelist_mark_rec_service = ConfigYesNo(default=True)
    config.usage.servicelist_show_rec_service_symbol = ConfigYesNo(
        default=True)
    config.usage.servicelist_show_servicenumber = ConfigYesNo(default=True)
    config.usage.servicelist_name_width = ConfigInteger(default=200,
                                                        limits=(1, 1920))
    config.usage.servicelist_use_matrix = ConfigYesNo(default=False)
    config.usage.servicelist_show_next_event = ConfigYesNo(default=False)
    config.usage.servicelist_show_service_type_icon = ConfigYesNo(
        default=False)
    config.usage.servicelist_preview_mode = ConfigYesNo(default=False)
    config.usage.servicelist_hide_service_name = ConfigYesNo(default=False)

    rec_button_choices = \
     [
      ("record_menu", _("show record menu")),
      ("running_record", _("show running records")),
      ("timer_list", _("show timer list")),
      ("event_record", _("add recording (stop after current event)")),
      ("indefinitely_record", _("add recording (indefinitely)")),
      ("manualduration_record", _("add recording (enter recording duration)")),
      ("manualendtime_record", _("add recording (enter recording endtime)")),
      ("timeshift_to_record", _("Transform Timeshift into recording"))
     ]

    config.usage.rec_button = ConfigSelection(default="record_menu",
                                              choices=rec_button_choices)
    config.usage.rec_button_long = ConfigSelection(default="running_record",
                                                   choices=rec_button_choices)

    config.usage.remove_finished_timers = ConfigYesNo(default=True)
    config.usage.enable_eit_epg = ConfigYesNo(default=True)

    def setEITepg(configElement):
        from enigma import eEPGCache
        eEPGCache.getInstance().setEITenabled(
            int(config.usage.enable_eit_epg.getValue()))

    config.usage.enable_eit_epg.addNotifier(setEITepg)
    config.usage.show_nownext_eit = ConfigYesNo(default=True)
    config.usage.show_old_epg = ConfigSelection(default="21600",
                                                choices=[
                                                    ("0", _("off")),
                                                    ("3600", "1 h"),
                                                    ("21600", "6 h"),
                                                    ("43200", "12 h"),
                                                    ("86400", "24 h"),
                                                ])

    def setOldEPGBuffer(configElement):
        from enigma import eEPGCache
        eEPGCache.getInstance().setOldEPG(
            int(config.usage.show_old_epg.getValue()))

    config.usage.show_old_epg.addNotifier(setOldEPGBuffer)

    config.usage.epg_buffer = ConfigInteger(default=14, limits=(1, 28))

    def setEPGBufferDays(configElement):
        from enigma import eEPGCache
        eEPGCache.getInstance().setEPGBuffer(
            config.usage.epg_buffer.getValue())

    config.usage.epg_buffer.addNotifier(setEPGBufferDays)
    epg_choices = [("eventview", _("Event Description")),
                   ("singleepg", _("Single Service EPG")),
                   ("multiepg", _("Multi EPG")),
                   ("epgbar", _("Service EPGBar"))]
    if os.path.exists(
            '/usr/lib/enigma2/python/Plugins/Extensions/GraphMultiEPG/plugin.py'
    ):
        epg_choices.append(("graphicalmultiepg", _("Graphical Multi EPG")))
    config.usage.epg_default_view = ConfigSelection(default="eventview",
                                                    choices=epg_choices)

    config.usage.enable_tt_caching = ConfigYesNo(default=True)

    def EnableTtCachingChanged(configElement):
        setEnableTtCachingOnOff(int(configElement.value))

    config.usage.enable_tt_caching.addNotifier(EnableTtCachingChanged)

    config.usage.stop_seek_eof = ConfigSelection(
        default="20",
        choices=[("0", _("off")), ("10", "10 " + _("seconds")),
                 ("20", "20 " + _("seconds")), ("30", "30 " + _("seconds")),
                 ("60", "60 " + _("seconds"))])

    def updateVideoDirChoice(configElement):
        tmp = configElement.value
        tmp.append(("off", _("off")))
        tmp.append(("last_video", _("last video")))
        tmp.append(("latest_movies", _("latest movies")))
        tmp.append(("all_movies", _("All movies")))
        if (config.movielist.start_videodir.value,
                config.movielist.start_videodir.value) in tmp:
            default = config.movielist.start_videodir.value
        else:
            default = "last_video"
        config.movielist.start_videodir.setChoices(tmp, default)

    tmp = []
    for x in config.movielist.videodirs.value:
        tmp.append((x, x))
    tmp.append(("off", _("off")))
    tmp.append(("last_video", _("last video")))
    tmp.append(("latest_movies", _("latest movies")))
    tmp.append(("all_movies", _("All movies")))
    config.movielist.start_videodir = ConfigSelection(default="last_video",
                                                      choices=tmp)
    config.movielist.videodirs.addNotifier(updateVideoDirChoice)
    config.usage.movielist_folder_based_config = ConfigYesNo(default=True)
    config.usage.movielist_support_pig = ConfigYesNo(default=True)
    config.usage.movielist_last_played_movie = ConfigText(default="")
    config.usage.movielist_select_last_movie = ConfigYesNo(default=True)
    config.usage.movielist_resume_at_eof = ConfigYesNo(default=True)
    config.usage.movielist_show_cover = ConfigYesNo(default=True)
    config.usage.movielist_show_dir = ConfigYesNo(default=True)
    config.usage.movielist_show_trash_dir = ConfigYesNo(default=False)
    config.usage.movielist_use_trash_dir = ConfigYesNo(default=False)
    config.usage.movielist_show_icon = ConfigYesNo(default=True)
    config.usage.movielist_show_color = ConfigYesNo(default=True)
    config.usage.movielist_show_picon = ConfigYesNo(default=False)
    config.usage.movielist_show_channel_info = ConfigYesNo(default=True)
    config.usage.movielist_show_recording_date = ConfigYesNo(default=True)
    config.usage.movielist_show_file_size = ConfigYesNo(default=True)
    config.usage.movielist_show_folder_info = ConfigYesNo(default=True)
    config.usage.movielist_show_folder_info_new = ConfigYesNo(default=True)
    config.usage.movielist_show_folder_info_only_new = ConfigYesNo(
        default=True)
    config.usage.movielist_show_folder_info_sort_by_new = ConfigYesNo(
        default=True)
    config.usage.movielist_show_folder_info_dirs = ConfigYesNo(default=False)
    config.usage.movielist_show_folder_info_left = ConfigYesNo(default=False)
    config.usage.movielist_hide_timeshift_files = ConfigYesNo(default=False)
    config.usage.movielist_only_day = ConfigYesNo(default=True)
    config.usage.movielist_show_last_stop_time = ConfigYesNo(default=False)
    config.usage.movielist_show_duration = ConfigYesNo(default=True)
    config.usage.movielist_duration_in_min = ConfigYesNo(default=True)
    config.usage.movielist_progress_seen = ConfigInteger(default=80,
                                                         limits=(40, 99))
    config.usage.movielist_leave_exit = ConfigYesNo(default=True)
    config.usage.movielist_ask_movie_del = ConfigYesNo(default=False)
    config.usage.movielist_show_progress = ConfigSelection(
        default="progress_bar",
        choices=[("progress_bar", _("progress bar")),
                 ("progress_percent", _("percent")),
                 ("progress_calculate", _("only calculate")),
                 ("progress_off", _("off"))])
    config.usage.timerlist_show_icon = ConfigYesNo(default=True)
    config.usage.timerlist_show_epg = ConfigYesNo(default=True)
    config.usage.timerlist_style = ConfigSelection(
        default="0",
        choices=[
            ("0", _("Default")),
            ("1", _("Style") + " 1"),
            ("2", _("Style") + " 2"),
            ("3", _("Style") + " 3"),
            ("4", _("Style") + " 4"),
            ("5", _("Style") + " 5"),
        ])
    config.usage.channelzap_w_bouquet = ConfigYesNo(default=False)
    config.usage.show_favourites_w_bouquet = ConfigSelection(
        default="down",
        choices=[("down", _("Channel -")), ("up", _("Channel +")),
                 ("off", _("off"))])
    config.usage.show_servicelist_at_modeswitch = ConfigYesNo(default=False)
    config.usage.use_pig = ConfigYesNo(default=False)
    config.usage.use_extended_pig = ConfigYesNo(default=False)
    config.usage.use_extended_pig_channelselection = ConfigYesNo(default=False)
    config.usage.show_infobar_on_splitscreen = ConfigYesNo(default=False)
    pip_modes = [("splitscreen", _("Split Screen")),
                 ("audiozap", _("Audio Zap")),
                 ("pip", _("Picture in Picture"))]
    config.usage.default_pip_mode = ConfigSelection(default="splitscreen",
                                                    choices=pip_modes)
    config.usage.default_zero_double_click_mode = ConfigSelection(
        default="pip", choices=pip_modes)
    default_timeout = SystemInfo["CanPiP"] and 500 or 50
    config.usage.zero_doubleclick_timeout = ConfigInteger(
        default=default_timeout, limits=(50, 5000))
    config.usage.zap_pip = ConfigYesNo(default=True)
    config.usage.zap_before_record = ConfigYesNo(default=False)
    config.usage.zap_notification_record = ConfigYesNo(default=True)
    if SystemInfo["CanPiP"]:
        config.usage.pip_in_EPGBar = ConfigYesNo(default=True)
    else:
        config.usage.pip_in_EPGBar = ConfigYesNo(default=False)
    config.usage.picon_dir = ConfigDirectory(
        default="/usr/share/enigma2/picon")
    config.usage.picon_scale = ConfigYesNo(default=True)
    config.usage.sort_menu_byname = ConfigYesNo(default=False)
    config.usage.sort_plugins_byname = ConfigYesNo(default=True)
    config.usage.plugins_sort_mode = ConfigSelection(default="user",
                                                     choices=[
                                                         ("a_z",
                                                          _("alphabetical")),
                                                         ("default",
                                                          _("Default")),
                                                         ("user",
                                                          _("user defined")),
                                                     ])
    config.usage.plugin_sort_weight = ConfigDictionarySet()
    config.usage.menu_sort_mode = ConfigSelection(
        default="user",
        choices=[
            ("a_z", _("alphabetical")),
            ("default", _("Default")),
            ("user", _("user defined")),
        ])
    config.usage.menu_sort_weight = ConfigDictionarySet(
        default={"mainmenu": {
            "submenu": {}
        }})
    config.usage.numberzap_timeout = ConfigInteger(default=3000,
                                                   limits=(100, 20000))
    config.usage.numberzap_show_servicename = ConfigYesNo(default=True)
    config.usage.numberzap_show_picon = ConfigYesNo(default=True)
    config.usage.startup_service_leavestandby = ConfigYesNo(default=False)
    config.usage.overzap_notplayable = ConfigYesNo(default=True)
    config.usage.disable_tuner_error_popup = ConfigYesNo(default=False)
    config.usage.disable_infobar_timeout_okbutton = ConfigYesNo(default=False)
    config.usage.ask_timer_file_del = ConfigYesNo(default=True)
    config.usage.record_file_name_date_at_end = ConfigYesNo(default=False)
    config.usage.silent_rec_mode = ConfigYesNo(default=True)
    config.usage.vfd_scroll_delay = ConfigSelection(
        default="10000",
        choices=[("10000", "10 " + _("seconds")),
                 ("20000", "20 " + _("seconds")),
                 ("30000", "30 " + _("seconds")),
                 ("60000", "1 " + _("minute")),
                 ("300000", "5 " + _("minutes")), ("noscrolling", _("off"))])
    config.usage.vfd_scroll_speed = ConfigSelection(default="300",
                                                    choices=[
                                                        ("500", _("slow")),
                                                        ("300", _("normal")),
                                                        ("100", _("fast"))
                                                    ])

    def get_default_RC():
        device = HardwareInfoVu().get_device_name()
        if device == "duo2":
            return "2"
        elif device == "ultimo":
            return "1"
        return "0"

    config.usage.rc_style = ConfigSelection(
        default=get_default_RC(),
        choices=[("0", "Vu+ 1 (Duo, Solo, Uno, Solo2)"),
                 ("1", "Vu+ 2 (Ultimo)"), ("2", "Vu+ 3 (Duo2)")])
    config.usage.use_force_overwrite = ConfigYesNo(default=True)
    config.usage.use_package_conffile = ConfigYesNo(default=True)
    config.usage.use_rm_force_depends = ConfigYesNo(default=False)
    config.usage.use_rm_autoremove = ConfigYesNo(default=True)
    config.usage.check_for_updates = ConfigInteger(default=0, limits=(0, 24))
    config.usage.show_notification_for_updates = ConfigYesNo(default=True)
    config.usage.update_available = NoSave(ConfigYesNo(default=False))
    config.usage.blinking_rec_symbol_during_recording = ConfigYesNo(
        default=True)
    config.usage.enable_hbbtv_autostart = ConfigYesNo(default=True)
    config.subtitles = ConfigSubsection()
    config.subtitles.subtitle_fontcolor = ConfigSelection(
        default="0",
        choices=[("0", _("default")), ("1", _("white")), ("2", _("yellow")),
                 ("3", _("green")), ("4", _("cyan")), ("5", _("blue")),
                 ("6", _("magneta")), ("7", _("red")), ("8", _("black"))])
    config.subtitles.subtitle_fontsize = ConfigSelection(
        choices=["%d" % x for x in range(16, 101) if not x % 2], default="20")
    config.subtitles.subtitle_padding_y = ConfigSelection(
        choices=["%d" % x for x in range(2, 301) if not x % 2], default="10")
    config.subtitles.subtitle_bgcolor = ConfigSelection(default="0",
                                                        choices=[
                                                            ("0", _("black")),
                                                            ("1", _("red")),
                                                            ("2",
                                                             _("magneta")),
                                                            ("3", _("blue")),
                                                            ("4", _("cyan")),
                                                            ("5", _("green")),
                                                            ("6", _("yellow")),
                                                            ("7", _("white"))
                                                        ])
    config.subtitles.subtitle_bgopacity = ConfigSelection(
        default="225",
        choices=[("0", _("No transparency")), ("25", "10%"), ("50", "20%"),
                 ("75", "30%"), ("100", "40%"), ("125", "50%"), ("150", "60%"),
                 ("175", "70%"), ("200", "80%"), ("225", "90%"),
                 ("255", _("Full transparency"))])
    config.subtitles.subtitle_edgestyle = ConfigSelection(
        default="2",
        choices=[("0", _("None")), ("1", _("Raised")), ("2", _("Depressed")),
                 ("3", _("Uniform"))])
    config.subtitles.subtitle_edgestyle_level = ConfigSelection(
        choices=["0", "1", "2", "3", "4", "5"], default="3")
    config.subtitles.subtitle_opacity = ConfigSelection(
        default="0",
        choices=[("0", _("No transparency")), ("75", "25%"), ("150", "50%")])
    config.subtitles.subtitle_original_position = ConfigYesNo(default=True)
    config.subtitles.subtitle_alignment = ConfigSelection(choices=[
        ("left", _("left")), ("center", _("center")), ("right", _("right"))
    ],
                                                          default="center")
    config.subtitles.subtitle_position = ConfigSelection(choices=[
        "0", "50", "100", "150", "200", "250", "300", "350", "400", "450",
        "500", "550", "600"
    ],
                                                         default="100")

    config.subtitles.dvb_subtitles_centered = ConfigYesNo(default=False)

    subtitle_delay_choicelist = []
    for i in range(-900000, 1845000, 45000):
        if i == 0:
            subtitle_delay_choicelist.append(("0", _("No delay")))
        else:
            subtitle_delay_choicelist.append(
                (str(i), "%2.1f sec" % (i / 90000.)))
    config.subtitles.subtitle_noPTSrecordingdelay = ConfigSelection(
        default="315000", choices=subtitle_delay_choicelist)
    config.subtitles.subtitle_bad_timing_delay = ConfigSelection(
        default="0", choices=subtitle_delay_choicelist)
    config.subtitles.subtitle_rewrap = ConfigYesNo(default=False)
    config.subtitles.colourise_dialogs = ConfigYesNo(default=False)
    config.subtitles.pango_subtitle_fontswitch = ConfigYesNo(default=True)
    config.subtitles.pango_subtitles_delay = ConfigSelection(
        default="0", choices=subtitle_delay_choicelist)
    config.subtitles.pango_subtitles_fps = ConfigSelection(
        default="1",
        choices=[("1", _("Original")), ("23976", _("23.976")),
                 ("24000", _("24")), ("25000", _("25")), ("29970", _("29.97")),
                 ("30000", _("30"))])
    config.subtitles.pango_autoturnon = ConfigYesNo(default=True)

    debug_choices = [
        ("off", _("off")),
        ("console", _("Console")),
        ("file", _("File")),
        ("fileloop", _("File (loop)")),
        ("console|file", _("Console & File")),
        ("console|fileloop", _("Console & File (loop)")),
    ]
    config.usage.debug_config = ConfigSelection(default="off_",
                                                choices=debug_choices)
    debug_file = "/etc/enigma2/dvbapp2debug.conf"
    val = "off"
    if os.path.exists(debug_file):
        f = open(debug_file, "r")
        lines = f.readlines()
        f.close()
        if lines and len(lines):
            val = lines[0].strip()
            is_valid = False
            for x in debug_choices:
                if x[0] == val:
                    is_valid = True
                    config.usage.debug_config.value = val
                    break
    config.usage.debug_config.value = val
Esempio n. 17
0
def getNumVideoDecoders():
	number_of_video_decoders = 0
	while fileExists("/dev/dvb/adapter0/video%d" % (number_of_video_decoders), 'f'):
		number_of_video_decoders += 1
	return number_of_video_decoders

def countFrontpanelLEDs():
	number_of_leds = fileExists("/proc/stb/fp/led_set_pattern") and 1 or 0
	while fileExists("/proc/stb/fp/led%d_pattern" % number_of_leds):
		number_of_leds += 1
	return number_of_leds

SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
SystemInfo["PIPAvailable"] = SystemInfo["NumVideoDecoders"] > 1
SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()
SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()
SystemInfo["ZapMode"] = fileCheck("/proc/stb/video/zapmode") or fileCheck("/proc/stb/video/zapping_mode")
SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
SystemInfo["FrontpanelDisplayGrayscale"] = fileExists("/dev/dbox/oled0")
SystemInfo["DeepstandbySupport"] = HardwareInfo().get_device_name() != "dm800"
SystemInfo["Fan"] = fileCheck("/proc/stb/fp/fan")
SystemInfo["FanPWM"] = SystemInfo["Fan"] and fileCheck("/proc/stb/fp/fan_pwm")
SystemInfo["StandbyLED"] = fileCheck("/proc/stb/power/standbyled")
SystemInfo["WakeOnLAN"] = not HardwareInfo().get_device_model().startswith("et8000") and fileCheck("/proc/stb/power/wol") or fileCheck("/proc/stb/fp/wol")
SystemInfo["HasExternalPIP"] = not HardwareInfo().get_device_model().startswith("et9") and fileCheck("/proc/stb/vmpeg/1/external")
SystemInfo["VideoDestinationConfigurable"] = fileExists("/proc/stb/vmpeg/0/dst_left")
SystemInfo["hasPIPVisibleProc"] = fileCheck("/proc/stb/vmpeg/1/visible")
SystemInfo["VFD_scroll_repeats"] = not HardwareInfo().get_device_model().startswith("et8500") and fileCheck("/proc/stb/lcd/scroll_repeats")
SystemInfo["VFD_scroll_delay"] = not HardwareInfo().get_device_model().startswith("et8500") and fileCheck("/proc/stb/lcd/scroll_delay")
SystemInfo["VFD_initial_scroll_delay"] = not HardwareInfo().get_device_model().startswith("et8500") and fileCheck("/proc/stb/lcd/initial_scroll_delay")
Esempio n. 18
0
def InitUsageConfig():
    config.usage = ConfigSubsection()
    config.usage.showdish = ConfigYesNo(default=True)
    config.usage.multibouquet = ConfigYesNo(default=True)
    config.usage.multiepg_ask_bouquet = ConfigYesNo(default=False)

    config.usage.quickzap_bouquet_change = ConfigYesNo(default=True)
    config.usage.e1like_radio_mode = ConfigYesNo(default=True)
    config.usage.infobar_timeout = ConfigSelection(
        default="5",
        choices=[("0", _("no timeout")), ("1", "1 " + _("second")),
                 ("2", "2 " + _("seconds")), ("3", "3 " + _("seconds")),
                 ("4", "4 " + _("seconds")), ("5", "5 " + _("seconds")),
                 ("6", "6 " + _("seconds")), ("7", "7 " + _("seconds")),
                 ("8", "8 " + _("seconds")), ("9", "9 " + _("seconds")),
                 ("10", "10 " + _("seconds"))])
    config.usage.show_infobar_on_zap = ConfigYesNo(default=True)
    config.usage.show_infobar_on_skip = ConfigYesNo(default=True)
    config.usage.show_infobar_on_event_change = ConfigYesNo(default=True)
    config.usage.hdd_standby = ConfigSelection(
        default="60",
        choices=[("0", _("no standby")), ("10", "10 " + _("seconds")),
                 ("30", "30 " + _("seconds")), ("60", "1 " + _("minute")),
                 ("120", "2 " + _("minutes")), ("300", "5 " + _("minutes")),
                 ("600", "10 " + _("minutes")), ("1200", "20 " + _("minutes")),
                 ("1800", "30 " + _("minutes")), ("3600", "1 " + _("hour")),
                 ("7200", "2 " + _("hours")), ("14400", "4 " + _("hours"))])
    config.usage.output_12V = ConfigSelection(default="do not change",
                                              choices=[("do not change",
                                                        _("do not change")),
                                                       ("off", _("off")),
                                                       ("on", _("on"))])

    zero_button_choices = [("standard", _("standard")),
                           ("swap", _("swap PiP and main picture")),
                           ("swapstop", _("move PiP to main picture")),
                           ("stop", _("stop PiP")),
                           ("zap_focus", _("toggle zap focus"))]
    config.usage.pip_zero_button = ConfigSelection(default="swap",
                                                   choices=zero_button_choices)
    config.usage.pip_zero_button_doubleclick = ConfigSelection(
        default="zap_focus", choices=zero_button_choices)

    config.usage.default_path = ConfigText(default=resolveFilename(SCOPE_HDD))
    config.usage.timer_path = ConfigText(default="<default>")
    config.usage.instantrec_path = ConfigText(default="<default>")
    config.usage.timeshift_path = ConfigText(default="/media/hdd/")
    config.usage.allowed_timeshift_paths = ConfigLocations(
        default=["/media/hdd/"])

    config.usage.on_movie_start = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("resume", _("Resume from last position")),
                 ("beginning", _("Start from the beginning"))])
    config.usage.on_movie_stop = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("movielist", _("Return to movie list")),
                 ("quit", _("Return to previous service"))])
    config.usage.on_movie_eof = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("movielist", _("Return to movie list")),
                 ("quit", _("Return to previous service")),
                 ("pause", _("Pause movie at end")),
                 ("restart", _("Start from the beginning")),
                 ("playnext", _("Start next media file"))])

    config.usage.setup_level = ConfigSelection(default="expert",
                                               choices=[
                                                   ("simple", _("Simple")),
                                                   ("intermediate",
                                                    _("Intermediate")),
                                                   ("expert", _("Expert"))
                                               ])

    config.usage.on_long_powerpress = ConfigSelection(
        default="show_menu",
        choices=[("show_menu", _("show shutdown menu")),
                 ("shutdown", _("immediate shutdown")),
                 ("standby", _("Standby")), ("restart", _("Restart")),
                 ("restart_gui", _("Restart GUI")),
                 ("nothing", _("do nothing"))])

    config.usage.on_short_powerpress = ConfigSelection(
        default="standby",
        choices=[("show_menu", _("show shutdown menu")),
                 ("shutdown", _("immediate shutdown")),
                 ("standby", _("Standby")), ("restart", _("Restart")),
                 ("restart_gui", _("Restart GUI")),
                 ("nothing", _("do nothing"))])

    config.usage.alternatives_priority = ConfigSelection(
        default="0",
        choices=[("0", "DVB-S/-C/-T"), ("1", "DVB-S/-T/-C"),
                 ("2", "DVB-C/-S/-T"), ("3", "DVB-C/-T/-S"),
                 ("4", "DVB-T/-C/-S"), ("5", "DVB-T/-S/-C")])

    nims = [("-1", _("auto"))]
    for x in nimmanager.nim_slots:
        nims.append((str(x.slot), x.getSlotName()))
    config.usage.tuner_priority = ConfigSelection(default="-1", choices=nims)

    config.usage.show_event_progress_in_servicelist = ConfigYesNo(
        default=False)

    config.usage.blinking_display_clock_during_recording = ConfigYesNo(
        default=False)

    config.usage.show_message_when_recording_starts = ConfigYesNo(default=True)

    config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(
        default=True)

    def TunerTypePriorityOrderChanged(configElement):
        setTunerTypePriorityOrder(int(configElement.value))

    config.usage.alternatives_priority.addNotifier(
        TunerTypePriorityOrderChanged, immediate_feedback=False)

    def PreferredTunerChanged(configElement):
        setPreferredTuner(int(configElement.value))

    config.usage.tuner_priority.addNotifier(PreferredTunerChanged)

    def setHDDStandby(configElement):
        for hdd in harddiskmanager.HDDList():
            hdd[1].setIdleTime(int(configElement.value))

    config.usage.hdd_standby.addNotifier(setHDDStandby,
                                         immediate_feedback=False)

    def set12VOutput(configElement):
        if configElement.value == "on":
            Misc_Options.getInstance().set_12V_output(1)
        elif configElement.value == "off":
            Misc_Options.getInstance().set_12V_output(0)

    config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

    SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()

    config.usage.keymap = ConfigText(
        default=eEnv.resolve("${datadir}/enigma2/keymap.xml"))

    config.seek = ConfigSubsection()
    config.seek.selfdefined_13 = ConfigNumber(default=15)
    config.seek.selfdefined_46 = ConfigNumber(default=60)
    config.seek.selfdefined_79 = ConfigNumber(default=300)

    config.seek.speeds_forward = ConfigSet(
        default=[2, 4, 8, 16, 32, 64, 128],
        choices=[2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
    config.seek.speeds_backward = ConfigSet(
        default=[2, 4, 8, 16, 32, 64, 128],
        choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
    config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8],
                                              choices=[2, 4, 6, 8, 12, 16, 25])

    config.seek.enter_forward = ConfigSelection(default="2",
                                                choices=[
                                                    "2", "4", "6", "8", "12",
                                                    "16", "24", "32", "48",
                                                    "64", "96", "128"
                                                ])
    config.seek.enter_backward = ConfigSelection(default="1",
                                                 choices=[
                                                     "1", "2", "4", "6", "8",
                                                     "12", "16", "24", "32",
                                                     "48", "64", "96", "128"
                                                 ])

    config.seek.on_pause = ConfigSelection(default="play",
                                           choices=[("play", _("Play")),
                                                    ("step",
                                                     _("Singlestep (GOP)")),
                                                    ("last", _("Last speed"))])

    config.usage.timerlist_finished_timer_position = ConfigSelection(
        default="beginning",
        choices=[("beginning", _("at beginning")), ("end", _("at end"))])

    def updateEnterForward(configElement):
        if not configElement.value:
            configElement.value = [2]
        updateChoices(config.seek.enter_forward, configElement.value)

    config.seek.speeds_forward.addNotifier(updateEnterForward,
                                           immediate_feedback=False)

    def updateEnterBackward(configElement):
        if not configElement.value:
            configElement.value = [2]
        updateChoices(config.seek.enter_backward, configElement.value)

    config.seek.speeds_backward.addNotifier(updateEnterBackward,
                                            immediate_feedback=False)

    # VTI Settings start
    config.misc.placeholder = NoSave(
        ConfigSelection(default="1", choices=[("1", " ")]))
    config.misc.disable_auto_channel_list = ConfigYesNo(default=False)
    config.misc.allow_service_delete = ConfigYesNo(default=False)
    config.misc.ecm_info = ConfigYesNo(default=True)
    config.misc.enable_custom_mainmenu = ConfigYesNo(default=False)
    config.usage.enable_zaphistory = ConfigYesNo(default=True)
    config.usage.show_epg_progress_percent = ConfigYesNo(default=False)
    config.usage.servicelist_show_picon = ConfigSelection(
        default="0",
        choices=[
            ("0", _("off")),
            ("100", "100x60 px"),
            ("50", "50x30 px"),
            ("1", _("user defined")),
        ])
    config.usage.servicelist_picon_dir = ConfigDirectory(
        default="/usr/share/enigma2/picon")
    config.usage.servicelist_two_lines = ConfigYesNo(default=False)
    config.usage.servicelist_show_event_time = ConfigYesNo(default=False)
    config.usage.servicelist_mark_rec_service = ConfigYesNo(default=True)
    config.usage.servicelist_show_rec_service_symbol = ConfigYesNo(
        default=True)
    config.usage.servicelist_show_servicenumber = ConfigYesNo(default=True)
    config.usage.servicelist_name_width = ConfigInteger(default=200,
                                                        limits=(1, 1920))
    config.usage.servicelist_use_matrix = ConfigYesNo(default=False)
    config.usage.servicelist_show_next_event = ConfigYesNo(default=False)
    config.usage.servicelist_show_service_type_icon = ConfigYesNo(
        default=False)
    config.usage.servicelist_preview_mode = ConfigYesNo(default=False)
    config.usage.servicelist_hide_service_name = ConfigYesNo(default=False)

    rec_button_choices = \
     [
      ("record_menu", _("show record menu")),
      ("running_record", _("show running records")),
      ("timer_list", _("show timer list")),
      ("event_record", _("add recording (stop after current event)")),
      ("indefinitely_record", _("add recording (indefinitely)")),
      ("manualduration_record", _("add recording (enter recording duration)")),
      ("manualendtime_record", _("add recording (enter recording endtime)"))
     ]

    config.usage.rec_button = ConfigSelection(default="record_menu",
                                              choices=rec_button_choices)
    config.usage.rec_button_long = ConfigSelection(default="running_record",
                                                   choices=rec_button_choices)

    config.usage.remove_finished_timers = ConfigYesNo(default=True)
    config.usage.enable_eit_epg = ConfigYesNo(default=True)

    def setEITepg(configElement):
        from enigma import eEPGCache
        eEPGCache.getInstance().setEITenabled(
            int(config.usage.enable_eit_epg.getValue()))

    config.usage.enable_eit_epg.addNotifier(setEITepg)
    config.usage.show_nownext_eit = ConfigYesNo(default=True)
    config.usage.show_old_epg = ConfigSelection(default="0",
                                                choices=[
                                                    ("0", _("off")),
                                                    ("3600", "1 h"),
                                                    ("21600", "6 h"),
                                                    ("43200", "12 h"),
                                                    ("86400", "24 h"),
                                                ])

    def setOldEPGBuffer(configElement):
        from enigma import eEPGCache
        eEPGCache.getInstance().setOldEPG(
            int(config.usage.show_old_epg.getValue()))

    config.usage.show_old_epg.addNotifier(setOldEPGBuffer)

    config.usage.epg_buffer = ConfigInteger(default=14, limits=(1, 28))

    def setEPGBufferDays(configElement):
        from enigma import eEPGCache
        eEPGCache.getInstance().setEPGBuffer(
            config.usage.epg_buffer.getValue())

    config.usage.epg_buffer.addNotifier(setEPGBufferDays)
    epg_choices = [("eventview", _("Event Description")),
                   ("singleepg", _("Single Service EPG")),
                   ("multiepg", _("Multi EPG")),
                   ("epgbar", _("Service EPGBar"))]
    if os.path.exists(
            '/usr/lib/enigma2/python/Plugins/Extensions/GraphMultiEPG/plugin.py'
    ):
        epg_choices.append(("graphicalmultiepg", _("Graphical Multi EPG")))
    config.usage.epg_default_view = ConfigSelection(default="eventview",
                                                    choices=epg_choices)

    config.usage.enable_tt_caching = ConfigYesNo(default=True)

    def EnableTtCachingChanged(configElement):
        setEnableTtCachingOnOff(int(configElement.value))

    config.usage.enable_tt_caching.addNotifier(EnableTtCachingChanged)

    config.usage.stop_seek_eof = ConfigSelection(
        default="20",
        choices=[("0", _("off")), ("10", "10 " + _("seconds")),
                 ("20", "20 " + _("seconds")), ("30", "30 " + _("seconds")),
                 ("60", "60 " + _("seconds"))])

    def updateVideoDirChoice(configElement):
        tmp = configElement.value
        tmp.append(_("off"))
        tmp.append(_("last video"))
        if config.movielist.start_videodir.value in tmp:
            default = config.movielist.start_videodir.value
        else:
            default = _("last video")
        config.movielist.start_videodir.setChoices(tmp, default)

    tmp = config.movielist.videodirs.value
    tmp.append(_("off"))
    tmp.append(_("last video"))
    config.movielist.start_videodir = ConfigSelection(default=_("last video"),
                                                      choices=tmp)
    config.movielist.videodirs.addNotifier(updateVideoDirChoice)
    config.usage.movielist_folder_based_config = ConfigYesNo(default=True)
    config.usage.movielist_support_pig = ConfigYesNo(default=True)
    config.usage.movielist_last_played_movie = ConfigText(default="")
    config.usage.movielist_select_last_movie = ConfigYesNo(default=True)
    config.usage.movielist_resume_at_eof = ConfigYesNo(default=True)
    config.usage.movielist_show_cover = ConfigYesNo(default=True)
    config.usage.movielist_show_dir = ConfigYesNo(default=True)
    config.usage.movielist_show_trash_dir = ConfigYesNo(default=False)
    config.usage.movielist_use_trash_dir = ConfigYesNo(default=False)
    config.usage.movielist_show_icon = ConfigYesNo(default=True)
    config.usage.movielist_show_color = ConfigYesNo(default=True)
    config.usage.movielist_show_picon = ConfigYesNo(default=False)
    config.usage.movielist_show_channel_info = ConfigYesNo(default=True)
    config.usage.movielist_show_recording_date = ConfigYesNo(default=True)
    config.usage.movielist_show_file_size = ConfigYesNo(default=True)
    config.usage.movielist_only_day = ConfigYesNo(default=True)
    config.usage.movielist_show_last_stop_time = ConfigYesNo(default=False)
    config.usage.movielist_show_duration = ConfigYesNo(default=True)
    config.usage.movielist_duration_in_min = ConfigYesNo(default=True)
    config.usage.movielist_progress_seen = ConfigInteger(default=80,
                                                         limits=(40, 99))
    config.usage.movielist_leave_exit = ConfigYesNo(default=True)
    config.usage.movielist_ask_movie_del = ConfigYesNo(default=False)
    config.usage.movielist_show_progress = ConfigSelection(
        default="progress_bar",
        choices=[("progress_bar", _("progress bar")),
                 ("progress_percent", _("percent")),
                 ("progress_calculate", _("only calculate")),
                 ("progress_off", _("off"))])
    config.usage.timerlist_show_icon = ConfigYesNo(default=True)
    config.usage.timerlist_show_epg = ConfigYesNo(default=True)
    config.usage.timerlist_style = ConfigSelection(
        default="0",
        choices=[
            ("0", _("Default")),
            ("1", _("Style") + " 1"),
            ("2", _("Style") + " 2"),
            ("3", _("Style") + " 3"),
            ("4", _("Style") + " 4"),
            ("5", _("Style") + " 5"),
        ])
    config.usage.show_favourites_bouquetup = ConfigYesNo(default=False)
    config.usage.show_servicelist_at_modeswitch = ConfigYesNo(default=False)
    config.usage.use_pig = ConfigYesNo(default=False)
    config.usage.use_extended_pig = ConfigYesNo(default=False)
    config.usage.use_extended_pig_channelselection = ConfigYesNo(default=False)
    config.usage.show_infobar_on_splitscreen = ConfigYesNo(default=False)
    pip_modes = [("splitscreen", _("Split Screen")),
                 ("audiozap", _("Audio Zap")),
                 ("pip", _("Picture in Picture"))]
    config.usage.default_pip_mode = ConfigSelection(default="splitscreen",
                                                    choices=pip_modes)
    config.usage.default_zero_double_click_mode = ConfigSelection(
        default="pip", choices=pip_modes)
    default_timeout = SystemInfo["CanPiP"] and 500 or 50
    config.usage.zero_doubleclick_timeout = ConfigInteger(
        default=default_timeout, limits=(50, 5000))
    config.usage.zap_pip = ConfigYesNo(default=True)
    config.usage.zap_before_record = ConfigYesNo(default=False)
    config.usage.zap_notification_record = ConfigYesNo(default=True)
    if SystemInfo["CanPiP"]:
        config.usage.pip_in_EPGBar = ConfigYesNo(default=True)
    else:
        config.usage.pip_in_EPGBar = ConfigYesNo(default=False)
    config.usage.picon_dir = ConfigDirectory(
        default="/usr/share/enigma2/picon")
    config.usage.picon_scale = ConfigYesNo(default=True)
    config.usage.sort_menu_byname = ConfigYesNo(default=False)
    config.usage.sort_plugins_byname = ConfigYesNo(default=True)
    config.usage.numberzap_timeout = ConfigInteger(default=3000,
                                                   limits=(100, 20000))
    config.usage.numberzap_show_servicename = ConfigYesNo(default=True)
    config.usage.numberzap_show_picon = ConfigYesNo(default=True)
    config.usage.startup_service_leavestandby = ConfigYesNo(default=False)
    config.usage.overzap_notplayable = ConfigYesNo(default=False)
    config.usage.disable_tuner_error_popup = ConfigYesNo(default=False)
    config.usage.disable_infobar_timeout_okbutton = ConfigYesNo(default=False)
    config.usage.ask_timer_file_del = ConfigYesNo(default=True)
    config.usage.record_file_name_date_at_end = ConfigYesNo(default=False)
    config.usage.silent_rec_mode = ConfigYesNo(default=True)
    config.usage.vfd_scroll_delay = ConfigSelection(
        default="10000",
        choices=[("10000", "10 " + _("seconds")),
                 ("20000", "20 " + _("seconds")),
                 ("30000", "30 " + _("seconds")),
                 ("60000", "1 " + _("minute")),
                 ("300000", "5 " + _("minutes")), ("noscrolling", _("off"))])
    config.usage.vfd_scroll_speed = ConfigSelection(default="300",
                                                    choices=[
                                                        ("500", _("slow")),
                                                        ("300", _("normal")),
                                                        ("100", _("fast"))
                                                    ])

    def get_default_RC():
        device = HardwareInfoVu().get_device_name()
        if device == "duo2":
            return "2"
        elif device == "ultimo":
            return "1"
        return "0"

    config.usage.rc_style = ConfigSelection(
        default=get_default_RC(),
        choices=[("0", "Vu+ 1 (Duo, Solo, Uno, Solo2)"),
                 ("1", "Vu+ 2 (Ultimo)"), ("2", "Vu+ 3 (Duo2)")])
    config.usage.use_force_overwrite = ConfigYesNo(default=True)
    config.usage.use_package_conffile = ConfigYesNo(default=True)
    config.usage.use_rm_force_depends = ConfigYesNo(default=False)
    config.usage.use_rm_autoremove = ConfigYesNo(default=True)
    config.usage.check_for_updates = ConfigInteger(default=8, limits=(0, 24))
    config.usage.show_notification_for_updates = ConfigYesNo(default=True)
    config.usage.update_available = NoSave(ConfigYesNo(default=False))
    config.usage.blinking_rec_symbol_during_recording = ConfigYesNo(
        default=True)
    config.usage.enable_hbbtv_autostart = ConfigYesNo(default=True)
    config.subtitle = ConfigSubsection()
    config.subtitle.subtitlecolor = ConfigSelection(default="0",
                                                    choices=[
                                                        ("0", _("original")),
                                                        ("1", _("white")),
                                                        ("2", _("yellow")),
                                                        ("3",
                                                         _("dark yellow")),
                                                        ("4", _("red")),
                                                        ("5", _("green")),
                                                        ("6", _("cyan")),
                                                        ("7", _("grey")),
                                                    ])
    config.subtitle.subtitlefontsize = ConfigSelection(choices=[
        "16", "18", "20", "22", "24", "26", "28", "30", "32", "34", "36", "38",
        "40", "42", "44", "46", "48", "50", "54", "58", "60"
    ],
                                                       default="30")
    config.subtitle.subtitlehalignment = ConfigSelection(
        choices=["left", "center", "right"], default="center")
    config.subtitle.dvbsubtitleyellow = ConfigYesNo(default=False)
    config.subtitle.dvbsubtitlecentered = ConfigYesNo(default=False)
    config.subtitle.dvbsubtitlebacktrans = ConfigSelection(
        default="0",
        choices=[("0", _("no transparency")), ("25", "10%"), ("50", "20%"),
                 ("75", "30%"), ("100", "40%"), ("125", "50%"), ("150", "60%"),
                 ("175", "70%"), ("200", "80%"), ("225", "90%"),
                 ("255", _("full transparency"))])
Esempio n. 19
0
		def set12VOutput(configElement):
			Misc_Options.getInstance().set_12V_output(configElement.value == "on" and 1 or 0)
Esempio n. 20
0
def FinalInitUsageConfig():
    try:
        usage_old = config.usage.dict().copy()
    except KeyError:
        usage_old = {}

    try:
        seek_old = config.seek.dict().copy()
    except KeyError:
        seek_old = {}

    #We have do it again to ensure tranlsations are applied after language load has finished
    config.usage.setup_level = ConfigSelection(default="intermediate",
                                               choices=[
                                                   ("simple", _("Simple")),
                                                   ("intermediate",
                                                    _("Intermediate")),
                                                   ("expert", _("Expert"))
                                               ])

    config.seek.on_pause = ConfigSelection(default="play",
                                           choices=[("play", _("Play")),
                                                    ("step",
                                                     _("Singlestep (GOP)")),
                                                    ("last", _("Last speed"))])

    inactivity_shutdown_choices = [("never", _("disabled"))]
    for i in range(1, 6):
        inactivity_shutdown_choices.extend([
            ("%d" % i, ngettext("%(num)d hour", "%(num)d hours", i) % {
                "num": i
            })
        ])
    config.usage.inactivity_shutdown = ConfigSelection(
        default="3", choices=inactivity_shutdown_choices)
    config.usage.inactivity_shutdown_initialized = ConfigYesNo(default=False)
    config.usage.showdish = ConfigYesNo(default=True)
    config.usage.multibouquet = ConfigYesNo(default=False)
    config.usage.multiepg_ask_bouquet = ConfigYesNo(default=False)

    config.usage.quickzap_bouquet_change = ConfigYesNo(default=False)
    config.usage.e1like_radio_mode = ConfigYesNo(default=False)
    config.usage.infobar_timeout = ConfigSelection(
        default="5",
        choices=[("0", _("no timeout")), ("1", "1 " + _("second")),
                 ("2", "2 " + _("seconds")), ("3", "3 " + _("seconds")),
                 ("4", "4 " + _("seconds")), ("5", "5 " + _("seconds")),
                 ("6", "6 " + _("seconds")), ("7", "7 " + _("seconds")),
                 ("8", "8 " + _("seconds")), ("9", "9 " + _("seconds")),
                 ("10", "10 " + _("seconds"))])
    config.usage.show_infobar_on_zap = ConfigYesNo(default=True)
    config.usage.show_infobar_on_skip = ConfigYesNo(default=True)
    config.usage.show_infobar_on_event_change = ConfigYesNo(default=True)
    config.usage.hdd_standby = ConfigSelection(
        default="600",
        choices=[("0", _("no standby")), ("10", "10 " + _("seconds")),
                 ("30", "30 " + _("seconds")), ("60", "1 " + _("minute")),
                 ("120", "2 " + _("minutes")), ("300", "5 " + _("minutes")),
                 ("600", "10 " + _("minutes")), ("1200", "20 " + _("minutes")),
                 ("1800", "30 " + _("minutes")), ("3600", "1 " + _("hour")),
                 ("7200", "2 " + _("hours")), ("14400", "4 " + _("hours"))])
    config.usage.output_12V = ConfigSelection(default="do not change",
                                              choices=[("do not change",
                                                        _("do not change")),
                                                       ("off", _("off")),
                                                       ("on", _("on"))])

    config.usage.pip_zero_button = ConfigSelection(
        default="standard",
        choices=[("standard", _("standard")),
                 ("swap", _("swap PiP and main picture")),
                 ("swapstop", _("move PiP to main picture")),
                 ("stop", _("stop PiP"))])

    config.usage.default_path = ConfigText(default=resolveFilename(SCOPE_HDD))
    config.usage.timer_path = ConfigText(default="<default>")
    config.usage.instantrec_path = ConfigText(default="<default>")
    config.usage.timeshift_path = ConfigText(default="/media/hdd/")
    config.usage.allowed_timeshift_paths = ConfigLocations(
        default=["/media/hdd/"])

    config.usage.on_movie_start = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("resume", _("Resume from last position")),
                 ("beginning", _("Start from the beginning"))])
    config.usage.on_movie_stop = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("movielist", _("Return to movie list")),
                 ("quit", _("Return to previous service"))])
    config.usage.on_movie_eof = ConfigSelection(
        default="ask",
        choices=[("ask", _("Ask user")),
                 ("movielist", _("Return to movie list")),
                 ("quit", _("Return to previous service")),
                 ("pause", _("Pause movie at end"))])

    config.usage.on_long_powerpress = ConfigSelection(
        default="show_menu",
        choices=[("show_menu", _("show shutdown menu")),
                 ("shutdown", _("immediate shutdown")),
                 ("standby", _("Idle Mode"))])

    config.usage.on_short_powerpress = ConfigSelection(
        default="standby",
        choices=[("show_menu", _("show shutdown menu")),
                 ("shutdown", _("immediate shutdown")),
                 ("standby", _("Idle Mode"))])

    config.usage.alternatives_priority = ConfigSelection(
        default="0",
        choices=[("0", "DVB-S/-C/-T"), ("1", "DVB-S/-T/-C"),
                 ("2", "DVB-C/-S/-T"), ("3", "DVB-C/-T/-S"),
                 ("4", "DVB-T/-C/-S"), ("5", "DVB-T/-S/-C")])

    config.usage.show_event_progress_in_servicelist = ConfigYesNo(
        default=False)

    config.usage.blinking_display_clock_during_recording = ConfigYesNo(
        default=False)

    config.usage.show_message_when_recording_starts = ConfigYesNo(default=True)

    config.usage.load_length_of_movies_in_moviellist = ConfigYesNo(
        default=True)

    SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()

    config.usage.timerlist_finished_timer_position = ConfigSelection(
        default="beginning",
        choices=[("beginning", _("at beginning")), ("end", _("at end"))])

    config.usage.text_subtitle_presentation = ConfigSelection(
        default="black box",
        choices=[("black box", _("black box")),
                 ("drop-shadow", _("drop-shadow"))])
    config.usage.text_subtitle_black_box_transparency = ConfigSlider(
        default=0x64, increment=5, limits=(0, 0xff))
    config.usage.ttx_subtitle_prefer_pmt_language_code = ConfigYesNo(
        default=True)

    # Channelselection settings
    config.usage.configselection_showsettingsincontextmenu = ConfigYesNo(
        default=True)
    config.usage.configselection_showlistnumbers = ConfigYesNo(default=True)
    config.usage.configselection_showservicename = ConfigYesNo(default=True)
    config.usage.configselection_progressbarposition = ConfigSelection(
        default="0",
        choices=[("0", _("After servicenumber")),
                 ("1", _("After servicename")),
                 ("2", _("After servicedescription"))])
    config.usage.configselection_servicenamecolwidth = ConfigInteger(
        200, limits=(100, 400))
    config.usage.configselection_columnstyle = ConfigYesNo(default=False)
    config.usage.configselection_additionaltimedisplayposition = ConfigSelection(
        default="1", choices=[("0", _("ahead")), ("1", _("behind"))])
    config.usage.configselection_showadditionaltimedisplay = ConfigSelection(
        default="0",
        choices=[("0", _("Off")), ("1", _("Percent")), ("2", _("Remain")),
                 ("3", _("Remain / duration")), ("4", _("Elapsed")),
                 ("5", _("Elapsed / duration")),
                 ("6", _("Elapsed / remain / duration")), ("7", _("Time"))])
    config.usage.configselection_showpicons = ConfigYesNo(default=False)
    config.usage.configselection_bigpicons = ConfigYesNo(default=False)
    config.usage.configselection_secondlineinfo = ConfigSelection(
        default="0",
        choices=[("0", _("nothing")), ("1", _("short description")),
                 ("2", _("upcoming event"))])

    config.usage.configselection_piconspath = ConfigSelection(
        default=eEnv.resolve('${datadir}/enigma2/picon_50x30/'),
        choices=[
            (eEnv.resolve('${datadir}/enigma2/picon_50x30/'),
             eEnv.resolve('${datadir}/enigma2/picon_50x30')),
            (eEnv.resolve('${datadir}/enigma2/picon/'),
             eEnv.resolve('${datadir}/enigma2/picon')),
        ])

    config.usage.configselection_showrecordings = ConfigYesNo(default=False)
    config.usage.standby_zaptimer_wakeup = ConfigYesNo(default=True)

    seek = config.seek.dict()
    for (key, value) in seek_old.items():
        value_old = value.value
        configEntry = seek[key]
        value_new = configEntry.value
        if value_old != value_new:
            configEntry.value = value_old
        configEntry._ConfigElement__notifiers = value._ConfigElement__notifiers
        configEntry._ConfigElement__notifiers_final = value._ConfigElement__notifiers_final

    usage = config.usage.dict()
    for (key, value) in usage_old.items():
        value_old = value.value
        configEntry = usage[key]
        value_new = configEntry.value
        if value_old != value_new:
            configEntry.value = value_old
        configEntry._ConfigElement__notifiers = value._ConfigElement__notifiers
        configEntry._ConfigElement__notifiers_final = value._ConfigElement__notifiers_final

    if usage_old.get("alternatives_priority", None) == None:

        def TunerTypePriorityOrderChanged(configElement):
            setTunerTypePriorityOrder(int(configElement.value))

        config.usage.alternatives_priority.addNotifier(
            TunerTypePriorityOrderChanged, immediate_feedback=False)

    if usage_old.get("hdd_standby", None) == None:

        def setHDDStandby(configElement):
            for hdd in harddiskmanager.HDDList():
                hdd[1].setIdleTime(int(configElement.value))

        config.usage.hdd_standby.addNotifier(setHDDStandby,
                                             immediate_feedback=False)

    if usage_old.get("output_12V", None) == None:

        def set12VOutput(configElement):
            if configElement.value == "on":
                Misc_Options.getInstance().set_12V_output(1)
            elif configElement.value == "off":
                Misc_Options.getInstance().set_12V_output(0)

        config.usage.output_12V.addNotifier(set12VOutput,
                                            immediate_feedback=False)

    config.usage.record_mode = ConfigSelection(
        default="direct_io",
        choices=[("direct_io", _("Direct IO (default)")),
                 ("cached_io", _("Cached IO"))])