示例#1
0
def InitUsageConfig():
	config.misc.boxtype = ConfigText(default = getHWType())
	config.misc.remotecontrol_text_support = ConfigYesNo(default = False)

	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):
		enigma.eDVBDB.getInstance().setNumberingMode(configElement.value)
		refreshServiceList()
	config.usage.alternative_number_mode.addNotifier(alternativeNumberModeChange)

	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.show_spinner = ConfigYesNo(default = True)
	config.usage.sort_settings = ConfigYesNo(default = False)	# unused by sif.. just for compatibility with oe-alliance mount manager
	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.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)"))])
	config.usage.next_movie_msg = ConfigYesNo(default = True)

	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")) ] )


	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.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.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":
			enigma.Misc_Options.getInstance().set_12V_output(1)
		elif configElement.value == "off":
			enigma.Misc_Options.getInstance().set_12V_output(0)
	config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

	SystemInfo["12V_Output"] = enigma.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 = 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):
		enigma.eBackgroundFileEraser.getInstance().setEraseSpeed(int(el.value))
	def updateEraseFlags(el):
		enigma.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")
	choicelist = []
	for i in range(45000, 945000, 45000):
		choicelist.append(("%d" % i, "%2.1f sec" % (i / 90000.)))
	config.subtitles.subtitle_noPTSrecordingdelay = ConfigSelection(default = "315000", choices = [("0", _("No 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 = 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.subtitles.pango_subtitles_yellow = ConfigYesNo(default = False)

	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")),
		("lat", _("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):
		enigma.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):
		enigma.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_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)
示例#2
0
from Screen import Screen
from Components.ActionMap import ActionMap
from Components.config import config
from Components.AVSwitch import AVSwitch
from Components.SystemInfo import SystemInfo
from GlobalActions import globalActionMap
from enigma import eDVBVolumecontrol
from SIFTeam.Extra.HWType import getHWType

boxtype = getHWType()
if boxtype == 'gb800se' or boxtype == 'gb800solo' or boxtype == 'gb800ue':
	from enigma import eTimer, evfd
	from time import localtime, time
	from os import system 	

inStandby = None

def readled():
	try:
		fp = open('/etc/vfdled','r')
		forled = fp.read()
		fp.close()
	except:
		fp = open('/etc/vfdled','w')
		forled = str(['True', '1', '2', '3', 'True', '24h'])
		fp.write(forled)
		fp.close()
	return eval(forled)

class Standby(Screen):
	def Power(self):
示例#3
0
from Screen import Screen
from Components.ActionMap import ActionMap
from Components.config import config
from Components.AVSwitch import AVSwitch
from Components.SystemInfo import SystemInfo
from GlobalActions import globalActionMap
from enigma import eDVBVolumecontrol
from SIFTeam.Extra.HWType import getHWType

boxtype = getHWType()
if boxtype == 'gb800se' or boxtype == 'gb800solo' or boxtype == 'gb800ue':
    from enigma import eTimer, evfd
    from time import localtime, time
    from os import system

inStandby = None


def readled():
    try:
        fp = open('/etc/vfdled', 'r')
        forled = fp.read()
        fp.close()
    except:
        fp = open('/etc/vfdled', 'w')
        forled = str(['True', '1', '2', '3', 'True', '24h'])
        fp.write(forled)
        fp.close()
    return eval(forled)

示例#4
0
def InitUsageConfig():
    config.misc.boxtype = ConfigText(default=getHWType())
    config.misc.remotecontrol_text_support = ConfigYesNo(default=False)

    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):
        enigma.eDVBDB.getInstance().setNumberingMode(configElement.value)
        refreshServiceList()

    config.usage.alternative_number_mode.addNotifier(
        alternativeNumberModeChange)

    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.show_spinner = ConfigYesNo(default=True)
    config.usage.sort_settings = ConfigYesNo(
        default=False
    )  # unused by sif.. just for compatibility with oe-alliance mount manager
    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.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)"))])
    config.usage.next_movie_msg = ConfigYesNo(default=True)

    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"))])

    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.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.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":
            enigma.Misc_Options.getInstance().set_12V_output(1)
        elif configElement.value == "off":
            enigma.Misc_Options.getInstance().set_12V_output(0)

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

    SystemInfo["12V_Output"] = enigma.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=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):
        enigma.eBackgroundFileEraser.getInstance().setEraseSpeed(int(el.value))

    def updateEraseFlags(el):
        enigma.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")
    choicelist = []
    for i in range(45000, 945000, 45000):
        choicelist.append(("%d" % i, "%2.1f sec" % (i / 90000.)))
    config.subtitles.subtitle_noPTSrecordingdelay = ConfigSelection(
        default="315000", choices=[("0", _("No 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=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.subtitles.pango_subtitles_yellow = ConfigYesNo(default=False)

    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")), ("lat", _("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):
        enigma.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):
        enigma.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_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)