Beispiel #1
0
	def threaded_function(self):
		if "epg" in config.usage.remote_fallback_import.value:
			config.misc.epgcache_filename = ConfigText(default="/epg.dat")
			print "Writing epg.dat file on sever box"
			try:
				self.getUrl("%s/web/saveepg" % self.url, timeout=30).read()
			except:
				self.ImportChannelsDone(False, _("Error when writing epg.dat on server"))
				return
			print "[Import Channels] Get EPG Location"
			try:
				epgdatfile = [x for x in self.getUrl("%s/file?file=/etc/enigma2/settings" % self.url).readlines() if x.startswith('config.misc.epgcache_filename=')]
				epgdatfile = epgdatfile and epgdatfile[0].split('=')[1].strip() or "/hdd/epg.dat"
				try:
					files = [file for file in loads(self.getUrl("%s/file?dir=%s" % (self.url, os.path.dirname(epgdatfile))).read())["files"] if os.path.basename(file).startswith(os.path.basename(epgdatfile))]
				except:
					files = [file for file in loads(self.getUrl("%s/file?dir=/" % self.url).read())["files"] if os.path.basename(file).startswith("epg.dat")]
				epg_location = files[0] if files else None
			except:
				self.ImportChannelsDone(False, _("Error while retreiving location of epg.dat on server"))
				return
			if epg_location:
				print "[Import Channels] Copy EPG file..."
				try:
					open(config.misc.epgcache_filename.value, "wb").write(self.getUrl("%s/file?file=%s" % (self.url, epg_location)).read())
				except:
					self.ImportChannelsDone(False, _("Error while retreiving epg.dat from server"))
			else:
				self.ImportChannelsDone(False, _("No epg.dat file found server"))
		if "channels" in config.usage.remote_fallback_import.value:
			try:
				os.mkdir("/tmp/tmp")
			except:
				pass
			print "[Import Channels] reading dir"
			try:
				files = [file for file in loads(self.getUrl("%s/file?dir=/etc/enigma2" % self.url).read())["files"] if os.path.basename(file).startswith(settingfiles)]
				for file in files:
					file = file.encode("UTF-8")
					print "[Import Channels] Downloading %s" % file
					destination = "/tmp/tmp"
					try:
						open("%s/%s" % (destination, os.path.basename(file)), "wb").write(self.getUrl("%s/file?file=%s" % (self.url, file)).read())
					except:
						self.ImportChannelsDone(False, _("ERROR downloading file %s") % file)
						return
			except:
				self.ImportChannelsDone(False, _("Error %s") % self.url)
				return

			print "[Import Channels] Removing files..."
			files = [file for file in os.listdir("/etc/enigma2") if file.startswith(settingfiles)]
			for file in files:
				os.remove("/etc/enigma2/%s" % file)
			print "[Import Channels] copying files..."
			files = [x for x in os.listdir("/tmp/tmp") if x.startswith(settingfiles)]
			for file in files:
				shutil.move("/tmp/tmp/%s" % file, "/etc/enigma2/%s" % file)
			os.rmdir("/tmp/tmp")
		self.ImportChannelsDone(True, {"channels": _("Channels"), "epg": _("EPG"), "channels_epg": _("Channels and EPG")}[config.usage.remote_fallback_import.value])
Beispiel #2
0
def InitSetupDevices():
    def timezoneNotifier(configElement):
        timezones.activateTimezone(configElement.index)

    config.timezone = ConfigSubsection()
    config.timezone.val = ConfigSelection(
        default=timezones.getDefaultTimezone(),
        choices=timezones.getTimezoneList())
    config.timezone.val.addNotifier(timezoneNotifier)

    def keyboardNotifier(configElement):
        keyboard.activateKeyboardMap(configElement.index)

    config.keyboard = ConfigSubsection()
    config.keyboard.keymap = ConfigSelection(
        default=keyboard.getDefaultKeyboardMap(),
        choices=keyboard.getKeyboardMaplist())
    config.keyboard.keymap.addNotifier(keyboardNotifier)

    def languageNotifier(configElement):
        language.activateLanguage(configElement.value)

    config.osd = ConfigSubsection()
    config.osd.language = ConfigText(default='it_IT')
    config.osd.language.addNotifier(languageNotifier)
    config.parental = ConfigSubsection()
    config.parental.lock = ConfigOnOff(default=False)
    config.parental.setuplock = ConfigOnOff(default=False)
    config.expert = ConfigSubsection()
    config.expert.satpos = ConfigOnOff(default=True)
    config.expert.fastzap = ConfigOnOff(default=True)
    config.expert.skipconfirm = ConfigOnOff(default=False)
    config.expert.hideerrors = ConfigOnOff(default=False)
    config.expert.autoinfo = ConfigOnOff(default=True)
Beispiel #3
0
def InitSetupDevices():
    def keyboardNotifier(configElement):
        keyboard.activateKeyboardMap(configElement.index)

    config.keyboard = ConfigSubsection()
    config.keyboard.keymap = ConfigSelection(
        default=keyboard.getDefaultKeyboardMap(),
        choices=keyboard.getKeyboardMaplist())
    config.keyboard.keymap.addNotifier(keyboardNotifier)

    def languageNotifier(configElement):
        language.activateLanguage(configElement.value)

    config.osd = ConfigSubsection()
    if getMachineBrand() == 'Atto.TV':
        defaultLanguage = "pt_BR"
    elif getMachineBrand() == 'Zgemma':
        defaultLanguage = "en_US"
    elif getMachineBrand() == 'Beyonwiz':
        defaultLanguage = "en_GB"
    else:
        defaultLanguage = "de_DE"
    config.osd.language = ConfigText(default=defaultLanguage)
    config.osd.language.addNotifier(languageNotifier)

    config.parental = ConfigSubsection()
    config.parental.lock = ConfigOnOff(default=False)
    config.parental.setuplock = ConfigOnOff(default=False)

    config.expert = ConfigSubsection()
    config.expert.satpos = ConfigOnOff(default=True)
    config.expert.fastzap = ConfigOnOff(default=True)
    config.expert.skipconfirm = ConfigOnOff(default=False)
    config.expert.hideerrors = ConfigOnOff(default=False)
    config.expert.autoinfo = ConfigOnOff(default=True)
def InitSetupDevices():

	'''	def timezoneNotifier(configElement):
		timezones.activateTimezone(configElement.index)

	config.timezone = ConfigSubsection();
	config.timezone.val = ConfigSelection(default = timezones.getDefaultTimezone(), choices = timezones.getTimezoneList())
	config.timezone.val.addNotifier(timezoneNotifier)

	def keyboardNotifier(configElement):
		keyboard.activateKeyboardMap(configElement.index)

	config.keyboard = ConfigSubsection();
	config.keyboard.keymap = ConfigSelection(default = keyboard.getDefaultKeyboardMap(), choices = keyboard.getKeyboardMaplist())
	config.keyboard.keymap.addNotifier(keyboardNotifier)
'''
	def languageNotifier(configElement):
		language.activateLanguage(configElement.value)

	config.osd = ConfigSubsection()
	
	if os.path.exists('/var/tuxbox/config/neutrino.conf'):
		with open('/var/tuxbox/config/neutrino.conf', 'r') as f:
			for line in f.readlines():
				if line.startswith('language='):
					lang = line.split("=")[1].strip()
					if lang == 'polski':
						config.osd.language = ConfigText(default = "pl_PL");
					elif lang == 'deutsch':
						config.osd.language = ConfigText(default = "de_DE");
					else:
						config.osd.language = ConfigText(default = "en_EN");
						
	config.osd.language.addNotifier(languageNotifier)

	config.parental = ConfigSubsection();
	config.parental.lock = ConfigOnOff(default = False)
	config.parental.setuplock = ConfigOnOff(default = False)

	config.expert = ConfigSubsection();
	config.expert.satpos = ConfigOnOff(default = True)
	config.expert.fastzap = ConfigOnOff(default = True)
	config.expert.skipconfirm = ConfigOnOff(default = False)
	config.expert.hideerrors = ConfigOnOff(default = False)
	config.expert.autoinfo = ConfigOnOff(default = True)
Beispiel #5
0
def BaseInitUsageConfig():
    config.usage = ConfigSubsection()

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

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

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

    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)
Beispiel #6
0
def InitClientMode():
    config.clientmode = ConfigSubsection()
    config.clientmode.enabled = ConfigYesNo(default=False)

    def clientModeChanged(configElement):
        SystemInfo["ClientModeEnabled"] = configElement.value == True
        SystemInfo["ClientModeDisabled"] = configElement.value != True

    config.clientmode.enabled.addNotifier(clientModeChanged,
                                          immediate_feedback=True,
                                          initial_call=True)
    config.clientmode.serverAddressType = ConfigSelection(default="ip",
                                                          choices=[
                                                              ("ip", _("IP")),
                                                              ("domain",
                                                               _("Domain"))
                                                          ])
    config.clientmode.serverIP = ConfigIP(default=[0, 0, 0, 0], auto_jump=True)
    config.clientmode.serverDomain = ConfigText(default="", fixed_size=False)
    config.clientmode.serverStreamingPort = ConfigInteger(default=8001,
                                                          limits=(1, 65535))
    config.clientmode.serverFTPusername = ConfigText(default="root",
                                                     fixed_size=False)
    config.clientmode.serverFTPpassword = ConfigText(default="",
                                                     fixed_size=False)
    config.clientmode.serverFTPPort = ConfigInteger(default=21,
                                                    limits=(1, 65535))
    config.clientmode.passive = ConfigYesNo(False)
    config.clientmode.enableSchedule = ConfigYesNo(False)
    config.clientmode.scheduleRepeatInterval = ConfigSelection(
        default="360",
        choices=[("60", _("Every hour")), ("120", _("Every 2 hours")),
                 ("180", _("Every 3 hours")), ("360", _("Every 6 hours")),
                 ("720", _("Every 12 hours")), ("daily", _("Daily"))])
    config.clientmode.scheduletime = ConfigClock(default=0)  # 1:00
    # to reinstate normal mode settings
    config.clientmode.nim_cache = ConfigText(default="", fixed_size=False)
    config.clientmode.remote_fallback_enabled_cache = ConfigYesNo(
        default=False)
    config.clientmode.remote_fallback_cache = ConfigText(default="",
                                                         fixed_size=False)
    config.clientmode.timer_sanity_check_enabled_cache = ConfigYesNo(
        default=True)
Beispiel #7
0
def InitSetupDevices():

	def timezoneNotifier(configElement):
		timezones.activateTimezone(configElement.index)

	config.timezone = ConfigSubsection()
	config.timezone.val = ConfigSelection(default = timezones.getDefaultTimezone(), choices = timezones.getTimezoneList())
	config.timezone.val.addNotifier(timezoneNotifier)

	def keyboardNotifier(configElement):
		keyboard.activateKeyboardMap(configElement.index)

	config.keyboard = ConfigSubsection()
	config.keyboard.keymap = ConfigSelection(default = keyboard.getDefaultKeyboardMap(), choices = keyboard.getKeyboardMaplist())
	config.keyboard.keymap.addNotifier(keyboardNotifier)

	def languageNotifier(configElement):
		language.activateLanguage(configElement.value)

	config.osd = ConfigSubsection();
	
	if open("/proc/stb/info/boxtype").read().strip() == "ini-9000ru":
		config.osd.language = ConfigText(default = "ru_RU");
	elif open("/proc/stb/info/boxtype").read().strip() == "ini-5000ru":
		config.osd.language = ConfigText(default = "ru_RU");
	elif open("/proc/stb/info/boxtype").read().strip() == "ini-1000ru":
		config.osd.language = ConfigText(default = "ru_RU");
	else:
		config.osd.language = ConfigText(default = "en_GB");

	config.osd.language.addNotifier(languageNotifier)

	config.parental = ConfigSubsection()
	config.parental.lock = ConfigOnOff(default = False)
	config.parental.setuplock = ConfigOnOff(default = False)

	config.expert = ConfigSubsection()
	config.expert.satpos = ConfigOnOff(default = True)
	config.expert.fastzap = ConfigOnOff(default = True)
	config.expert.skipconfirm = ConfigOnOff(default = False)
	config.expert.hideerrors = ConfigOnOff(default = False)
	config.expert.autoinfo = ConfigOnOff(default = True)
Beispiel #8
0
def InitSetupDevices():
    def timezoneNotifier(configElement):
        timezones.activateTimezone(configElement.index)

    config.timezone = ConfigSubsection()
    config.timezone.val = ConfigSelection(
        default=timezones.getDefaultTimezone(),
        choices=timezones.getTimezoneList())
    config.timezone.val.addNotifier(timezoneNotifier)

    def keyboardNotifier(configElement):
        keyboard.activateKeyboardMap(configElement.index)

    config.keyboard = ConfigSubsection()
    config.keyboard.keymap = ConfigSelection(
        default=keyboard.getDefaultKeyboardMap(),
        choices=keyboard.getKeyboardMaplist())
    config.keyboard.keymap.addNotifier(keyboardNotifier)

    def languageNotifier(configElement):
        language.activateLanguage(configElement.value)

    config.osd = ConfigSubsection()
    if getMachineBrand() in ('Vimastec'):
        config.osd.language = ConfigText(default="fr_FR")
    elif getMachineBrand() in ('Zgemma',
                               'Beyonwiz') or getBrandOEM() in ('airdigital'):
        config.osd.language = ConfigText(default="en_US")
    else:
        config.osd.language = ConfigText(default="de_DE")
    config.osd.language.addNotifier(languageNotifier)

    config.parental = ConfigSubsection()
    config.parental.lock = ConfigOnOff(default=False)
    config.parental.setuplock = ConfigOnOff(default=False)

    config.expert = ConfigSubsection()
    config.expert.satpos = ConfigOnOff(default=True)
    config.expert.fastzap = ConfigOnOff(default=True)
    config.expert.skipconfirm = ConfigOnOff(default=False)
    config.expert.hideerrors = ConfigOnOff(default=False)
    config.expert.autoinfo = ConfigOnOff(default=True)
Beispiel #9
0
def InitUsageConfig():
	config.usage = ConfigSubsection()
	config.usage.subnetwork = ConfigYesNo(default = True)
	config.usage.subnetwork_cable = ConfigYesNo(default = True)
	config.usage.subnetwork_terrestrial = ConfigYesNo(default = True)
	config.usage.showdish = ConfigYesNo(default = True)
	config.misc.showrotorposition = ConfigSelection(default = "no", choices = [("no", _("no")), ("yes", _("yes")), ("withtext", _("with text")), ("tunername", _("with tuner name"))])
	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 = True)
	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)

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

	choicelist = [("by skin", _("As defined by the skin"))]
	for i in range (5,41):
		choicelist.append((str(i)))
	config.usage.servicelist_number_of_services = ConfigSelection(default = "by skin", choices = choicelist)
	config.usage.servicelist_number_of_services.addNotifier(refreshServiceList)

	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 = [("0", _("No timeout"))]
	for i in range(1, 12):
		choicelist.append((str(i), ngettext("%d second", "%d seconds", i) % i))
	config.usage.infobar_timeout = ConfigSelection(default = "5", choices = 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 = "0", choices = [("", _("None"))] + choicelist + [("EPG",_("EPG"))])
	config.usage.show_simple_second_infobar = ConfigYesNo(default = False)
	config.usage.infobar_frontend_source = ConfigSelection(default = "settings", choices = [("settings", _("Settings")), ("tuner", _("Tuner"))])
	config.usage.oldstyle_zap_controls = ConfigYesNo(default = False)
	config.usage.oldstyle_channel_select_controls = ConfigYesNo(default = False)
	config.usage.zap_with_ch_buttons = ConfigYesNo(default = False)
	config.usage.ok_is_channelselection = ConfigYesNo(default = False)
	config.usage.volume_instead_of_channelselection = ConfigYesNo(default = False)
	config.usage.channelselection_preview = ConfigYesNo(default = False)
	config.usage.show_spinner = ConfigYesNo(default = True)
	config.usage.menu_sort_weight = ConfigDictionarySet(default = { "mainmenu" : {"submenu" : {} }})
	config.usage.menu_sort_mode = ConfigSelection(default = "default", choices = [("a_z", _("alphabetical")), ("default", _("Default")), ("user", _("user defined")), ("user_hidden", _("user defined hidden"))])
	config.usage.menu_show_numbers = ConfigSelection(default = "no", choices = [("no", _("no")), ("menu&plugins", _("in menu and plugins")), ("menu", _("in menu only")), ("plugins", _("in plugins only"))])
	config.usage.menu_path = ConfigSelection(default = "off", choices = [
		("off", _("Disabled")),
		("small", _("Small")),
		("large", _("Large")),])
	config.usage.enable_tt_caching = ConfigYesNo(default = True)
	config.usage.sort_settings = ConfigYesNo(default=False)
	choicelist = []
	for i in (10, 30):
		choicelist.append((str(i), ngettext("%d second", "%d seconds", i) % i))
	for i in (60, 120, 300, 600, 1200, 1800):
		m = i / 60
		choicelist.append((str(i), ngettext("%d minute", "%d minutes", m) % m))
	for i in (3600, 7200, 14400):
		h = i / 3600
		choicelist.append((str(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")) ])
	choicelist = [("-1", _("Disabled")), ("0", _("No timeout"))]
	for i in [60, 300, 600, 900, 1800, 2700, 3600]:
		m = i/60
		choicelist.append((str(i), ngettext("%d minute", "%d minutes", m) % m))
	config.usage.pip_last_service_timeout = ConfigSelection(default = "0", choices = choicelist)

	config.usage.default_path = ConfigText(default = "")
	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 yes", _("Ask user") + " " + _("default") + " " + _("yes")),
		("ask no", _("Ask user") + " " + _("default") + " " + _("no")),
		("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.last_movie_played = ConfigText()
	config.usage.leave_movieplayer_onExit = ConfigSelection(default = "popup", choices = [
		("no", _("no")), ("popup", _("With popup")), ("without popup", _("Without popup")), ("movielist", _("Return to movie list")) ])

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

	config.usage.startup_to_standby = ConfigSelection(default = "no", choices = [
		("no", _("no")),
		("yes", _("yes")),
		("except", _("No, except Wakeup timer")) ])

	config.usage.wakeup_enabled = ConfigSelection(default = "no", choices = [
		("no", _("no")),
		("yes", _("yes")),
		("standby", _("Yes, only from standby")),
		("deepstandby", _("Yes, only from deep standby")) ])
	config.usage.wakeup_day = ConfigSubDict()
	config.usage.wakeup_time = ConfigSubDict()
	for i in range(7):
		config.usage.wakeup_day[i] = ConfigEnableDisable(default = False)
		config.usage.wakeup_time[i] = ConfigClock(default = ((6 * 60 + 0) * 60))

	choicelist = [("0", _("Do nothing"))]
	for i in range(3600, 21601, 3600):
		h = abs(i / 3600)
		h = ngettext("%d hour", "%d hours", h) % h
		choicelist.append((str(i), _("Standby in ") + h))
	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, 18, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_end = ConfigClock(default = time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_extra = ConfigYesNo(default = False)
	config.usage.inactivity_timer_blocktime_extra_begin = ConfigClock(default = time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_extra_end = ConfigClock(default = time.mktime((0, 0, 0, 9, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_by_weekdays = ConfigYesNo(default = False)
	config.usage.inactivity_timer_blocktime_day = ConfigSubDict()
	config.usage.inactivity_timer_blocktime_begin_day = ConfigSubDict()
	config.usage.inactivity_timer_blocktime_end_day = ConfigSubDict()
	config.usage.inactivity_timer_blocktime_extra_day = ConfigSubDict()
	config.usage.inactivity_timer_blocktime_extra_begin_day = ConfigSubDict()
	config.usage.inactivity_timer_blocktime_extra_end_day = ConfigSubDict()
	for i in range(7):
		config.usage.inactivity_timer_blocktime_day[i] = ConfigYesNo(default = False)
		config.usage.inactivity_timer_blocktime_begin_day[i] = ConfigClock(default = time.mktime((0, 0, 0, 18, 0, 0, 0, 0, 0)))
		config.usage.inactivity_timer_blocktime_end_day[i] = ConfigClock(default = time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))
		config.usage.inactivity_timer_blocktime_extra_day[i] = ConfigYesNo(default = False)
		config.usage.inactivity_timer_blocktime_extra_begin_day[i] = ConfigClock(default = time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
		config.usage.inactivity_timer_blocktime_extra_end_day[i] = ConfigClock(default = time.mktime((0, 0, 0, 9, 0, 0, 0, 0, 0)))

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

	choicelist = [("0", _("Disabled"))]
	for i in [300, 600] + range(900, 14401, 900):
		m = abs(i / 60)
		m = ngettext("%d minute", "%d minutes", m) % m
		choicelist.append((str(i), _("after ") + m))
	config.usage.standby_to_shutdown_timer = ConfigSelection(default = "0", choices = choicelist)
	config.usage.standby_to_shutdown_timer_blocktime = ConfigYesNo(default = False)
	config.usage.standby_to_shutdown_timer_blocktime_begin = ConfigClock(default = time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
	config.usage.standby_to_shutdown_timer_blocktime_end = ConfigClock(default = time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))

	choicelist = [("0", _("Disabled"))]
	for m in (1, 5, 10, 15, 30, 60):
		choicelist.append((str(m * 60), ngettext("%d minute", "%d minutes", m) % m))
	config.usage.screen_saver = ConfigSelection(default = "300", choices = choicelist)

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

	choicelist = [("0", _("Disabled"))]
	for i in (2, 3, 4, 5, 10, 20, 30):
		choicelist.append((str(i), ngettext("%d second", "%d seconds", i) % i))
	for i in (60, 120, 300):
		m = i / 60
		choicelist.append((str(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"),
		("127", _("No priority")) ])

	def remote_fallback_changed(configElement):
		if configElement.value:
			configElement.value = "%s%s" % (not configElement.value.startswith("http://") and "http://" or "", configElement.value)
			configElement.value = "%s%s" % (configElement.value, configElement.value.count(":") == 1 and ":8001" or "")
	config.usage.remote_fallback_enabled = ConfigYesNo(default = False)
	config.usage.remote_fallback = ConfigText(default = "", fixed_size = False)
	config.usage.remote_fallback.addNotifier(remote_fallback_changed, immediate_feedback=False)
	config.usage.remote_fallback_import_url = ConfigText(default = "", fixed_size = False)
	config.usage.remote_fallback_import_url.addNotifier(remote_fallback_changed, immediate_feedback=False)
	config.usage.remote_fallback_alternative = ConfigYesNo(default = False)
	config.usage.remote_fallback_dvb_t = ConfigText(default = "", fixed_size = False)
	config.usage.remote_fallback_dvb_t.addNotifier(remote_fallback_changed, immediate_feedback=False)
	config.usage.remote_fallback_dvb_c = ConfigText(default = "", fixed_size = False)
	config.usage.remote_fallback_dvb_c.addNotifier(remote_fallback_changed, immediate_feedback=False)
	config.usage.remote_fallback_atsc = ConfigText(default = "", fixed_size = False)
	config.usage.remote_fallback_atsc.addNotifier(remote_fallback_changed, immediate_feedback=False)
	config.usage.remote_fallback_import = ConfigSelection(default = "", choices = [("", _("No")), ("channels", _("Channels only")), ("channels_epg", _("Channels and EPG")), ("epg", _("EPG only"))])
	config.usage.remote_fallback_import_restart = ConfigYesNo(default = False)
	config.usage.remote_fallback_import_standby = ConfigYesNo(default = False)
	config.usage.remote_fallback_ok = ConfigYesNo(default = False)
	config.usage.remote_fallback_nok = ConfigYesNo(default = False)
	config.usage.remote_fallback_extension_menu = ConfigYesNo(default = False)
	config.usage.remote_fallback_external_timer = ConfigYesNo(default = False)
	config.usage.remote_fallback_openwebif_customize = ConfigYesNo(default = False)
	config.usage.remote_fallback_openwebif_userid = ConfigText(default = "root")
	config.usage.remote_fallback_openwebif_password = ConfigPassword(default = "default")
	config.usage.remote_fallback_openwebif_port = ConfigInteger(default=80, limits=(0,65535))
	config.usage.remote_fallback_dvbt_region = ConfigText(default = "fallback DVB-T/T2 Europe")

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

	dvbs_nims = [("-2", _("Disabled"))]
	dvbt_nims = [("-2", _("Disabled"))]
	dvbc_nims = [("-2", _("Disabled"))]
	atsc_nims = [("-2", _("Disabled"))]

	nims = [("-1", _("auto"))]
	for x in nimmanager.nim_slots:
		if x.isCompatible("DVB-S"):
			dvbs_nims.append((str(x.slot), x.getSlotName()))
		elif x.isCompatible("DVB-T"):
			dvbt_nims.append((str(x.slot), x.getSlotName()))
		elif x.isCompatible("DVB-C"):
			dvbc_nims.append((str(x.slot), x.getSlotName()))
		elif x.isCompatible("ATSC"):
			atsc_nims.append((str(x.slot), x.getSlotName()))
		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.usage.frontend_priority_dvbs = ConfigSelection(default = "-2", choices = list(dvbs_nims))
	dvbs_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_dvbs = ConfigSelection(default = "-2", choices = dvbs_nims)
	config.usage.frontend_priority_dvbt = ConfigSelection(default = "-2", choices = list(dvbt_nims))
	dvbt_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_dvbt = ConfigSelection(default = "-2", choices = dvbt_nims)
	config.usage.frontend_priority_dvbc = ConfigSelection(default = "-2", choices = list(dvbc_nims))
	dvbc_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_dvbc = ConfigSelection(default = "-2", choices = dvbc_nims)
	config.usage.frontend_priority_atsc = ConfigSelection(default = "-2", choices = list(atsc_nims))
	atsc_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_atsc = ConfigSelection(default = "-2", choices = atsc_nims)

	SystemInfo["DVB-S_priority_tuner_available"] = len(dvbs_nims) > 3 and any(len(i) > 2 for i in (dvbt_nims, dvbc_nims, atsc_nims))
	SystemInfo["DVB-T_priority_tuner_available"] = len(dvbt_nims) > 3 and any(len(i) > 2 for i in (dvbs_nims, dvbc_nims, atsc_nims))
	SystemInfo["DVB-C_priority_tuner_available"] = len(dvbc_nims) > 3 and any(len(i) > 2 for i in (dvbs_nims, dvbt_nims, atsc_nims))
	SystemInfo["ATSC_priority_tuner_available"] = len(atsc_nims) > 3 and any(len(i) > 2 for i in (dvbs_nims, dvbc_nims, dvbt_nims))

	config.misc.disable_background_scan = ConfigYesNo(default = False)
	config.misc.use_ci_assignment = 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.show_picon_in_display = ConfigYesNo(default = True)
	config.usage.hide_zap_errors = 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)
	config.usage.show_update_disclaimer = 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")][:SystemInfo["HasFullHDSkinSupport"] and 4 or 3])

	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):
			open(SystemInfo["Fan"], "w").write(configElement.value)
		config.usage.fan.addNotifier(fanChanged)

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

	if SystemInfo["PowerLED"]:
		def powerLEDChanged(configElement):
			open(SystemInfo["PowerLED"], "w").write(configElement.value and "on" or "off")
		config.usage.powerLED = ConfigYesNo(default = True)
		config.usage.powerLED.addNotifier(powerLEDChanged)

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

	if SystemInfo["SuspendLED"]:
		def suspendLEDChanged(configElement):
			open(SystemInfo["SuspendLED"], "w").write(configElement.value and "on" or "off")
		config.usage.suspendLED = ConfigYesNo(default = True)
		config.usage.suspendLED.addNotifier(suspendLEDChanged)

	if SystemInfo["PowerOffDisplay"]:
		def powerOffDisplayChanged(configElement):
			open(SystemInfo["PowerOffDisplay"], "w").write(configElement.value and "1" or "0")
		config.usage.powerOffDisplay = ConfigYesNo(default = True)
		config.usage.powerOffDisplay.addNotifier(powerOffDisplayChanged)

	if SystemInfo["LCDshow_symbols"]:
		def lcdShowSymbols(configElement):
			open(SystemInfo["LCDshow_symbols"], "w").write(configElement.value and "1" or "0")
		config.usage.lcd_show_symbols = ConfigYesNo(default = True)
		config.usage.lcd_show_symbols.addNotifier(lcdShowSymbols)

	if SystemInfo["WakeOnLAN"]:
		def wakeOnLANChanged(configElement):
			if "fp" in SystemInfo["WakeOnLAN"]:
				open(SystemInfo["WakeOnLAN"], "w").write(configElement.value and "enable" or "disable")
			else:
				open(SystemInfo["WakeOnLAN"], "w").write(configElement.value and "on" or "off")
		config.usage.wakeOnLAN = ConfigYesNo(default = False)
		config.usage.wakeOnLAN.addNotifier(wakeOnLANChanged)

	if SystemInfo["hasXcoreVFD"]:
		def set12to8characterVFD(configElement):
			open(SystemInfo["hasXcoreVFD"], "w").write(not configElement.value and "1" or "0")
		config.usage.toggle12to8characterVFD = ConfigYesNo(default = False)
		config.usage.toggle12to8characterVFD.addNotifier(set12to8characterVFD)

	if SystemInfo["LcdLiveTVMode"]:
		def setLcdLiveTVMode(configElement):
			open(SystemInfo["LcdLiveTVMode"], "w").write(configElement.value)
		config.usage.LcdLiveTVMode = ConfigSelection(default = "0", choices=[str(x) for x in range(0,9)])
		config.usage.LcdLiveTVMode.addNotifier(setLcdLiveTVMode)

	if SystemInfo["LcdLiveDecoder"]:
		def setLcdLiveDecoder(configElement):
			open(SystemInfo["LcdLiveDecoder"], "w").write(configElement.value)
		config.usage.LcdLiveDecoder = ConfigSelection(default = "0", choices=[str(x) for x in range(0,4)])
		config.usage.LcdLiveDecoder.addNotifier(setLcdLiveDecoder)

	config.usage.boolean_graphic = ConfigSelection(default="true", choices={"false": _("no"), "true": _("yes"), "only_bool": _("yes, but not in multi selections")})

	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.epg.virgin = ConfigYesNo(default = False)
	config.epg.opentv = ConfigYesNo(default = False)
	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)
		if not config.epg.virgin.value:
			mask &= ~(eEPGCache.VIRGIN_NOWNEXT | eEPGCache.VIRGIN_SCHEDULE)
		if not config.epg.opentv.value:
			mask &= ~eEPGCache.OPENTV
		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.virgin.addNotifier(EpgSettingsChanged)
	config.epg.opentv.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)

	if SystemInfo["12V_Output"]:
		def set12VOutput(configElement):
			Misc_Options.getInstance().set_12V_output(configElement.value == "on" and 1 or 0)
		config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

	config.usage.keymap = ConfigText(default = eEnv.resolve("${datadir}/enigma2/keymap.xml"))
	config.usage.keytrans = ConfigText(default = eEnv.resolve("${datadir}/enigma2/keytranslation.xml"))
	config.usage.alternative_imagefeed = ConfigText(default="", fixed_size=False)

	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.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)

	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)

	if SystemInfo["VFD_scroll_repeats"]:
		def scroll_repeats(el):
			open(SystemInfo["VFD_scroll_repeats"], "w").write(el.value)
		choicelist = []
		for i in range(1, 11, 1):
			choicelist.append((str(i)))
		config.usage.vfd_scroll_repeats = ConfigSelection(default = "3", choices = choicelist)
		config.usage.vfd_scroll_repeats.addNotifier(scroll_repeats, immediate_feedback = False)

	if SystemInfo["VFD_scroll_delay"]:
		def scroll_delay(el):
			open(SystemInfo["VFD_scroll_delay"], "w").write(el.value)
		choicelist = []
		for i in range(0, 1001, 50):
			choicelist.append((str(i)))
		config.usage.vfd_scroll_delay = ConfigSelection(default = "150", choices = choicelist)
		config.usage.vfd_scroll_delay.addNotifier(scroll_delay, immediate_feedback = False)

	if SystemInfo["VFD_initial_scroll_delay"]:
		def initial_scroll_delay(el):
			open(SystemInfo["VFD_initial_scroll_delay"], "w").write(el.value)
		choicelist = []
		for i in range(0, 20001, 500):
			choicelist.append((str(i)))
		config.usage.vfd_initial_scroll_delay = ConfigSelection(default = "1000", choices = choicelist)
		config.usage.vfd_initial_scroll_delay.addNotifier(initial_scroll_delay, immediate_feedback = False)

	if SystemInfo["VFD_final_scroll_delay"]:
		def final_scroll_delay(el):
			open(SystemInfo["VFD_final_scroll_delay"], "w").write(el.value)
		choicelist = []
		for i in range(0, 20001, 500):
			choicelist.append((str(i)))
		config.usage.vfd_final_scroll_delay = ConfigSelection(default = "1000", choices = choicelist)
		config.usage.vfd_final_scroll_delay.addNotifier(final_scroll_delay, immediate_feedback = False)

	if SystemInfo["HasBypassEdidChecking"]:
		def setHasBypassEdidChecking(configElement):
			open(SystemInfo["HasBypassEdidChecking"], "w").write(configElement.value)
		config.av.bypassEdidChecking = ConfigSelection(default = "00000000", choices = [ ("00000001", _("yes")), ("00000000", _("no"))] )
		config.av.bypassEdidChecking.addNotifier(setHasBypassEdidChecking)

	if SystemInfo["HasColorspace"]:
		def setHaveColorspace(configElement):
			open(SystemInfo["HasColorspace"], "w").write(configElement.value)
		if SystemInfo["HasColorspaceSimple"]:
			config.av.hdmicolorspace = ConfigSelection(default = "Edid(Auto)", choices={"Edid(Auto)": _("Auto"), "Hdmi_Rgb": _("RGB"), "444": _("YCbCr444"), "422": _("YCbCr422"), "420": _("YCbCr420")})
		else:
			config.av.hdmicolorspace = ConfigSelection(default = "auto", choices={"auto": _("auto"), "rgb": _("rgb"), "420": _("420"), "422": _("422"), "444": _("444")})
		config.av.hdmicolorspace.addNotifier(setHaveColorspace)

	if SystemInfo["HasColordepth"]:
		def setHaveColordepth(configElement):
			open(SystemInfo["HasColordepth"], "w").write(configElement.value)
		config.av.hdmicolordepth = ConfigSelection(default = "auto", choices={"auto": _("Auto"), "8bit": _("8bit"), "10bit": _("10bit"), "12bit": _("12bit")})
		config.av.hdmicolordepth.addNotifier(setHaveColordepth)

	if SystemInfo["HasHDMIpreemphasis"]:
		def setHDMIpreemphasis(configElement):
			open(SystemInfo["HasHDMIpreemphasis"], "w").write(configElement.value)
		config.av.hdmipreemphasis = ConfigSelection(default = "off", choices = [ ("on", _("yes")), ("off", _("no"))] )
		config.av.hdmipreemphasis.addNotifier(setHDMIpreemphasis)

	if SystemInfo["HasColorimetry"]:
		def setColorimetry(configElement):
			open(SystemInfo["HasColorimetry"], "w").write(configElement.value)
		config.av.hdmicolorimetry = ConfigSelection(default = "auto", choices = [("auto", _("Auto")), ("bt2020ncl", _("BT 2020 NCL")), ("bt2020cl", _("BT 2020 CL")), ("bt709", _("BT 709"))])
		config.av.hdmicolorimetry.addNotifier(setColorimetry)

	if SystemInfo["HasHdrType"]:
		def setHdmiHdrType(configElement):
			open(SystemInfo["HasHdrType"], "w").write(configElement.value)
		config.av.hdmihdrtype = ConfigSelection(default = "auto", choices={"auto": _("Auto"), "none": _("SDR"), "hdr10": _("HDR10"), "hlg": _("HLG"), "dolby": _("Dolby")})
		config.av.hdmihdrtype.addNotifier(setHdmiHdrType)
		
	if SystemInfo["HDRSupport"]:
		def setHlgSupport(configElement):
			open("/proc/stb/hdmi/hlg_support", "w").write(configElement.value)
		config.av.hlg_support = ConfigSelection(default = "auto(EDID)", 
			choices = [ ("auto(EDID)", _("controlled by HDMI")), ("yes", _("force enabled")), ("no", _("force disabled")) ])
		config.av.hlg_support.addNotifier(setHlgSupport)

		def setHdr10Support(configElement):
			open("/proc/stb/hdmi/hdr10_support", "w").write(configElement.value)
		config.av.hdr10_support = ConfigSelection(default = "auto(EDID)", 
			choices = [ ("auto(EDID)", _("controlled by HDMI")), ("yes", _("force enabled")), ("no", _("force disabled")) ])
		config.av.hdr10_support.addNotifier(setHdr10Support)

		def setDisable12Bit(configElement):
			open("/proc/stb/video/disable_12bit", "w").write(configElement.value)
		config.av.allow_12bit = ConfigSelection(default = "0", choices = [ ("0", _("yes")), ("1", _("no")) ]);
		config.av.allow_12bit.addNotifier(setDisable12Bit)

		def setDisable10Bit(configElement):
			open("/proc/stb/video/disable_10bit", "w").write(configElement.value)
		config.av.allow_10bit = ConfigSelection(default = "0", choices = [ ("0", _("yes")), ("1", _("no")) ]);
		config.av.allow_10bit.addNotifier(setDisable10Bit)

	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.colourise_dialogs = ConfigYesNo(default = False)
	config.subtitles.subtitle_borderwidth = ConfigSelection(choices = ["1", "2", "3", "4", "5"], default = "3")
	config.subtitles.subtitle_fontsize  = ConfigSelection(choices = ["%d" % x for x in range(16,101) if not x % 2], default = "40")
	config.subtitles.showbackground = 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.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.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 = "1", choices = [
		("0", _("alternative")),
		("1", _("white")),
		("2", _("yellow")) ])
	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")),
		("chn sgp", _("Chinese - Simplified")),
		("twn hkn",_("Chinese - Traditional")),
		("ces cze", _("Czech")),
		("dan", _("Danish")),
		("dut ndl nld", _("Dutch")),
		("eng qaa", _("English")),
		("est", _("Estonian")),
		("fin", _("Finnish")),
		("fra fre", _("French")),
		("deu ger", _("German")),
		("ell gre grc", _("Greek")),
		("heb", _("Hebrew")),
		("hun", _("Hungarian")),
		("ind", _("Indonesian")),
		("ita", _("Italian")),
		("lav", _("Latvian")),
		("lit", _("Lithuanian")),
		("ltz", _("Luxembourgish")),
		("nor", _("Norwegian")),
		("fas per fa pes", _("Persian")),
		("pol", _("Polish")),
		("por dub Dub DUB ud1", _("Portuguese")),
		("ron rum", _("Romanian")),
		("rus", _("Russian")),
		("srp", _("Serbian")),
		("slk slo", _("Slovak")),
		("slv", _("Slovenian")),
		("spa", _("Spanish")),
		("swe", _("Swedish")),
		("tha", _("Thai")),
		("tur Audio_TUR", _("Turkish")),
		("ukr Ukr", _("Ukrainian"))]

	epg_language_choices = audio_language_choices[:1] + audio_language_choices [2:]
	def setEpgLanguage(configElement):
		eServiceEvent.setEPGLanguage(configElement.value)
	def setEpgLanguageAlternative(configElement):
		eServiceEvent.setEPGLanguageAlternative(configElement.value)
	def epglanguage(configElement):
		config.autolanguage.audio_epglanguage.setChoices([x for x in epg_language_choices if x[0] and x[0] != config.autolanguage.audio_epglanguage_alternative.value or not x[0] and not config.autolanguage.audio_epglanguage_alternative.value])
		config.autolanguage.audio_epglanguage_alternative.setChoices([x for x in epg_language_choices if x[0] and x[0] != config.autolanguage.audio_epglanguage.value or not x[0]])
	config.autolanguage.audio_epglanguage = ConfigSelection(epg_language_choices, default="")
	config.autolanguage.audio_epglanguage_alternative = ConfigSelection(epg_language_choices, default="")
	config.autolanguage.audio_epglanguage.addNotifier(setEpgLanguage)
	config.autolanguage.audio_epglanguage.addNotifier(epglanguage, initial_call=False)
	config.autolanguage.audio_epglanguage_alternative.addNotifier(setEpgLanguageAlternative)
	config.autolanguage.audio_epglanguage_alternative.addNotifier(epglanguage)

	def getselectedlanguages(range):
		return [eval("config.autolanguage.audio_autoselect%x.value" % x) for x in range]
	def autolanguage(configElement):
		config.autolanguage.audio_autoselect1.setChoices([x for x in audio_language_choices if x[0] and x[0] not in getselectedlanguages((2,3,4)) or not x[0] and not config.autolanguage.audio_autoselect2.value])
		config.autolanguage.audio_autoselect2.setChoices([x for x in audio_language_choices if x[0] and x[0] not in getselectedlanguages((1,3,4)) or not x[0] and not config.autolanguage.audio_autoselect3.value])
		config.autolanguage.audio_autoselect3.setChoices([x for x in audio_language_choices if x[0] and x[0] not in getselectedlanguages((1,2,4)) or not x[0] and not config.autolanguage.audio_autoselect4.value])
		config.autolanguage.audio_autoselect4.setChoices([x for x in audio_language_choices if x[0] and x[0] not in getselectedlanguages((1,2,3)) or not x[0]])
	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_autoselect1.addNotifier(autolanguage, initial_call=False)
	config.autolanguage.audio_autoselect2.addNotifier(autolanguage, initial_call=False)
	config.autolanguage.audio_autoselect3.addNotifier(autolanguage, initial_call=False)
	config.autolanguage.audio_autoselect4.addNotifier(autolanguage)
	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:]
	def getselectedsublanguages(range):
		return [eval("config.autolanguage.subtitle_autoselect%x.value" % x) for x in range]
	def autolanguagesub(configElement):
		config.autolanguage.subtitle_autoselect1.setChoices([x for x in subtitle_language_choices if x[0] and x[0] not in getselectedsublanguages((2,3,4)) or not x[0] and not config.autolanguage.subtitle_autoselect2.value])
		config.autolanguage.subtitle_autoselect2.setChoices([x for x in subtitle_language_choices if x[0] and x[0] not in getselectedsublanguages((1,3,4)) or not x[0] and not config.autolanguage.subtitle_autoselect3.value])
		config.autolanguage.subtitle_autoselect3.setChoices([x for x in subtitle_language_choices if x[0] and x[0] not in getselectedsublanguages((1,2,4)) or not x[0] and not config.autolanguage.subtitle_autoselect4.value])
		config.autolanguage.subtitle_autoselect4.setChoices([x for x in subtitle_language_choices if x[0] and x[0] not in getselectedsublanguages((1,2,3)) or not x[0]])
		choicelist = [('0', _("None"))]
		for y in range(1, 15 if config.autolanguage.subtitle_autoselect4.value else (7 if config.autolanguage.subtitle_autoselect3.value else(4 if config.autolanguage.subtitle_autoselect2.value else (2 if config.autolanguage.subtitle_autoselect1.value else 0)))):
			choicelist.append((str(y), ", ".join([eval("config.autolanguage.subtitle_autoselect%x.getText()" % x) for x in (y & 1, y & 2, y & 4 and 3, y & 8 and 4) if x])))
		if config.autolanguage.subtitle_autoselect3.value:
			choicelist.append((str(y+1), "All"))
		config.autolanguage.equal_languages.setChoices(choicelist, default="0")
	config.autolanguage.equal_languages = ConfigSelection(default="0", choices=[str(x) for x in range(0, 16)])
	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_autoselect1.addNotifier(autolanguagesub, initial_call=False)
	config.autolanguage.subtitle_autoselect2.addNotifier(autolanguagesub, initial_call=False)
	config.autolanguage.subtitle_autoselect3.addNotifier(autolanguagesub, initial_call=False)
	config.autolanguage.subtitle_autoselect4.addNotifier(autolanguagesub)
	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.streaming = ConfigSubsection()
	config.streaming.stream_ecm = ConfigYesNo(default = False)
	config.streaming.descramble = ConfigYesNo(default = True)
	config.streaming.descramble_client = ConfigYesNo(default = False)
	config.streaming.stream_eit = ConfigYesNo(default = True)
	config.streaming.stream_ait = ConfigYesNo(default = True)
	config.streaming.authentication = ConfigYesNo(default = False)

	config.mediaplayer = ConfigSubsection()
	config.mediaplayer.useAlternateUserAgent = ConfigYesNo(default=False)
	config.mediaplayer.alternateUserAgent = ConfigText(default="")

	config.misc.softcam_setup = ConfigSubsection()
	config.misc.softcam_setup.extension_menu = ConfigYesNo(default = True)
Beispiel #10
0
def InitUsageConfig():

    # iq [
    from Tools.HardwareInfo import HardwareInfo
    boxtype = HardwareInfo().get_device_name()
    if boxtype == "twin":
        boxtype = "tmtwin"
    elif boxtype == "ios100hd":
        boxtype = "ios100"
# ]

    config.misc.boxtype = ConfigText(default=boxtype)

    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=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.sort_pluginlist = ConfigYesNo(
        default=True)  # sort plugins list
    config.usage.show_infobar_on_event_change = ConfigYesNo(default=False)
    # [iq
    #config.usage.show_second_infobar = ConfigSelection(default = None, choices = [(None, _("None")), ("0", _("no timeout"))] + choicelist)
    config.usage.show_second_infobar = ConfigSelection(
        default="5",
        choices=[(None, _("None")), ("0", _("no timeout"))] + choicelist)
    # iq]
    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"))])

    # iq [
    if HardwareInfo().get_device_name() == "ios300hd":
        os.system("rm /hdd; ln -s /media/usb /hdd")
# ]
    config.usage.default_path = ConfigText(default=resolveFilename(SCOPE_HDD))
    config.usage.timer_path = ConfigText(default="<default>")
    config.usage.instantrec_path = ConfigText(default="<default>")
    # if [
    if HardwareInfo().get_device_name() == "ios300hd":
        config.usage.timeshift_path = ConfigText(default="/media/usb/")
        config.usage.allowed_timeshift_paths = ConfigLocations(
            default=["/media/usb/"])
    else:
        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"))])

    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 = ConfigYesNo(default=True)
    config.usage.show_channel_numbers_in_servicelist = ConfigYesNo(
        default=True)

    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', _("Progress Small")),
            ('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",
                                                     _("Singlestep (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 updateFlushSize(el):
        enigma.setFlushSize(int(el.value))
        print "[SETTING] getFlushSize=", enigma.getFlushSize()

    config.misc.flush_size = ConfigSelection(default="0",
                                             choices=[("0", "Off"),
                                                      ("524288", "512kB"),
                                                      ("1048576", "1 MB"),
                                                      ("2097152", "2 MB"),
                                                      ("4194304", "4 MB")])
    config.misc.flush_size.addNotifier(updateFlushSize,
                                       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", _("Letzeburgesch")), ("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 = ConfigSelection(
        audio_language_choices[:1] + audio_language_choices[2:],
        default="eng qaa")  # [iq]
    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_autoselect1 = ConfigSelection(
        choices=audio_language_choices, default="eng qaa")  # [iq]
    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)  # [iq]
    #config.autolanguage.audio_defaultac3 = ConfigYesNo(default = False)		# [iq]
    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_autoselect1 = ConfigSelection(
        choices=subtitle_language_choices, default="eng qaa")  # [iq]
    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 = [
    config.autolanguage.equal_languages = ConfigSelection(
        default="0",
        choices=[  # [iq]
            ("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")
        ])

    # [ iqteam
    config.fan_config = ConfigSubsection()
    config.fan_config.offset = ConfigNumber(default=0)
    config.fan_config.default = ConfigNumber(default=5)
    config.fan_config.increment = ConfigNumber(default=5)
    config.fan_config.configured = ConfigYesNo(default=False)

    config.swupdate = ConfigSubsection()
    config.swupdate.folderprefix = ConfigText(default='', fixed_size=False)
    config.swupdate.downloadlocation = ConfigSelection(choices=[])

    config.vfd_scroll = ConfigYesNo(default=True)

    config.usage.background_hddjob = ConfigYesNo(default=False)  # [iq]
    config.usage.try_cooltvguide = ConfigYesNo(default=True)  # [iq]
    # iqteam ]
    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)
Beispiel #11
0
def InitUsageConfig():
    config.usage = ConfigSubsection()
    config.usage.subnetwork = ConfigYesNo(default=True)
    config.usage.subnetwork_cable = ConfigYesNo(default=True)
    config.usage.subnetwork_terrestrial = ConfigYesNo(default=True)
    config.usage.showdish = ConfigYesNo(default=True)
    config.misc.showrotorposition = ConfigSelection(
        default='no',
        choices=[('no', _('no')), ('yes', _('yes')),
                 ('withtext', _('with text')),
                 ('tunername', _('with tuner name'))])
    config.usage.multibouquet = ConfigYesNo(default=True)
    config.usage.alternative_number_mode = ConfigYesNo(default=True)

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

    config.usage.alternative_number_mode.addNotifier(
        alternativeNumberModeChange)
    config.usage.hide_number_markers = ConfigYesNo(default=True)
    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)
    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.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'))])
    choicelist = [('by skin', _('As defined by the skin'))]
    for i in range(5, 41):
        choicelist.append(str(i))

    config.usage.servicelist_number_of_services = ConfigSelection(
        default='by skin', choices=choicelist)
    config.usage.servicelist_number_of_services.addNotifier(refreshServiceList)
    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 = [('0', _('No timeout'))]
    for i in range(1, 20):
        choicelist.append((str(i), ngettext('%d second', '%d seconds', i) % i))

    config.usage.infobar_timeout = ConfigSelection(default='5',
                                                   choices=choicelist)
    config.usage.show_infobar_do_dimming = ConfigYesNo(default=True)
    config.usage.show_infobar_dimming_speed = ConfigSelectionNumber(
        min=1, max=40, stepwidth=1, default=40, wraparound=True)
    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=5,
        choices=[("", _('None'))] + choicelist + [('EPG', _('EPG'))])
    config.usage.show_simple_second_infobar = ConfigYesNo(default=True)
    config.usage.infobar_frontend_source = ConfigSelection(
        default='settings',
        choices=[('settings', _('Settings')), ('tuner', _('Tuner'))])
    config.usage.oldstyle_zap_controls = ConfigYesNo(default=False)
    config.usage.oldstyle_channel_select_controls = ConfigYesNo(default=False)
    config.usage.zap_with_ch_buttons = ConfigYesNo(default=False)
    config.usage.ok_is_channelselection = ConfigYesNo(default=False)
    config.usage.volume_instead_of_channelselection = ConfigYesNo(
        default=False)
    config.usage.channelselection_preview = ConfigYesNo(default=False)
    config.usage.show_spinner = ConfigYesNo(default=True)
    config.usage.menu_sort_weight = ConfigDictionarySet(
        default={'mainmenu': {
            'submenu': {}
        }})
    config.usage.menu_sort_mode = ConfigSelection(
        default='default',
        choices=[('a_z', _('alphabetical')), ('default', _('Default')),
                 ('user', _('user defined'))])
    config.usage.menu_show_numbers = ConfigYesNo(default=False)
    config.usage.menu_path = ConfigSelection(default='off',
                                             choices=[('off', _('Disabled')),
                                                      ('small', _('Small')),
                                                      ('large', _('Large'))])
    config.usage.enable_tt_caching = ConfigYesNo(default=True)
    choicelist = []
    for i in (10, 30):
        choicelist.append((str(i), ngettext('%d second', '%d seconds', i) % i))

    for i in (60, 120, 300, 600, 1200, 1800):
        m = i / 60
        choicelist.append((str(i), ngettext('%d minute', '%d minutes', m) % m))

    for i in (3600, 7200, 14400):
        h = i / 3600
        choicelist.append((str(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'))
                                                           ])
    choicelist = [('-1', _('Disabled')), ('0', _('No timeout'))]
    for i in [60, 300, 600, 900, 1800, 2700, 3600]:
        m = i / 60
        choicelist.append((str(i), ngettext('%d minute', '%d minutes', m) % m))

    config.usage.pip_last_service_timeout = ConfigSelection(default='0',
                                                            choices=choicelist)
    config.usage.default_path = ConfigText(default='')
    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.ncaminfo = ConfigSubsection()
    config.ncaminfo.showInExtensions = ConfigYesNo(default=False)
    config.ncaminfo.userdatafromconf = ConfigYesNo(default=False)
    config.ncaminfo.autoupdate = ConfigYesNo(default=False)
    config.ncaminfo.username = ConfigText(default='username',
                                          fixed_size=False,
                                          visible_width=12)
    config.ncaminfo.password = ConfigPassword(default='password',
                                              fixed_size=False)
    config.ncaminfo.ip = ConfigIP(default=[127, 0, 0, 1], auto_jump=True)
    config.ncaminfo.port = ConfigInteger(default=8181, limits=(0, 65536))
    config.ncaminfo.intervall = ConfigSelectionNumber(min=1,
                                                      max=600,
                                                      stepwidth=1,
                                                      default=10,
                                                      wraparound=True)
    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)
    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 yes', _('Ask user') + ' ' + _('default') + ' ' + _('yes')),
            ('ask no', _('Ask user') + ' ' + _('default') + ' ' + _('no')),
            ('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.last_movie_played = ConfigText()
    config.usage.leave_movieplayer_onExit = ConfigSelection(
        default='popup',
        choices=[('no', _('No')), ('popup', _('With popup')),
                 ('without popup', _('Without popup')),
                 ('movielist', _('Return to movie list'))])
    config.usage.setup_level = ConfigSelection(default='expert',
                                               choices=[
                                                   ('simple', _('Normal')),
                                                   ('intermediate',
                                                    _('Advanced')),
                                                   ('expert', _('Expert'))
                                               ])
    config.usage.startup_to_standby = ConfigSelection(
        default='no',
        choices=[('no', _('No')), ('yes', _('Yes')),
                 ('except', _('No, except Wakeup timer'))])
    config.usage.wakeup_menu = ConfigNothing()
    config.usage.wakeup_enabled = ConfigYesNo(default=False)
    config.usage.wakeup_day = ConfigSubDict()
    config.usage.wakeup_time = ConfigSubDict()
    for i in range(7):
        config.usage.wakeup_day[i] = ConfigEnableDisable(default=False)
        config.usage.wakeup_time[i] = ConfigClock(default=21600)

    choicelist = [('0', _('Do nothing'))]
    for i in range(3600, 21601, 3600):
        h = abs(i / 3600)
        h = ngettext('%d hour', '%d hours', h) % h
        choicelist.append((str(i), _('Standby in ') + h))

    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, 18, 0, 0, 0, 0, 0)))
    config.usage.inactivity_timer_blocktime_end = ConfigClock(
        default=time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))
    config.usage.inactivity_timer_blocktime_extra = ConfigYesNo(default=False)
    config.usage.inactivity_timer_blocktime_extra_begin = ConfigClock(
        default=time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
    config.usage.inactivity_timer_blocktime_extra_end = ConfigClock(
        default=time.mktime((0, 0, 0, 9, 0, 0, 0, 0, 0)))
    choicelist = [('0', _('Disabled')),
                  ('event_standby', _('Standby after current event'))]
    for i in range(900, 7201, 900):
        m = abs(i / 60)
        m = ngettext('%d minute', '%d minutes', m) % m
        choicelist.append((str(i), _('Standby in ') + m))

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

    config.usage.standby_to_shutdown_timer = ConfigSelection(
        default='0', choices=choicelist)
    config.usage.standby_to_shutdown_timer_blocktime = ConfigYesNo(
        default=True)
    config.usage.standby_to_shutdown_timer_blocktime_begin = ConfigClock(
        default=time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
    config.usage.standby_to_shutdown_timer_blocktime_end = ConfigClock(
        default=time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))
    choicelist = [('0', _('Disabled'))]
    for m in (1, 5, 10, 15, 30, 60):
        choicelist.append(
            (str(m * 60), ngettext('%d minute', '%d minutes', m) % m))

    config.usage.screen_saver = ConfigSelection(default='300',
                                                choices=choicelist)
    config.usage.check_timeshift = ConfigYesNo(default=True)
    choicelist = [('0', _('Disabled'))]
    for i in (2, 3, 4, 5, 10, 20, 30):
        choicelist.append((str(i), ngettext('%d second', '%d seconds', i) % i))

    for i in (60, 120, 300):
        m = i / 60
        choicelist.append((str(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'),
                 ('127', _('No priority'))])
    config.usage.remote_fallback_enabled = ConfigYesNo(default=False)
    config.usage.remote_fallback = ConfigText(default='', fixed_size=False)
    config.usage.show_timer_conflict_warning = ConfigYesNo(default=True)
    dvbs_nims = [('-2', _('Disabled'))]
    dvbt_nims = [('-2', _('Disabled'))]
    dvbc_nims = [('-2', _('Disabled'))]
    atsc_nims = [('-2', _('Disabled'))]
    nims = [('-1', _('auto'))]
    for x in nimmanager.nim_slots:
        if x.isCompatible('DVB-S'):
            dvbs_nims.append((str(x.slot), x.getSlotName()))
        elif x.isCompatible('DVB-T'):
            dvbt_nims.append((str(x.slot), x.getSlotName()))
        elif x.isCompatible('DVB-C'):
            dvbc_nims.append((str(x.slot), x.getSlotName()))
        elif x.isCompatible('ATSC'):
            atsc_nims.append((str(x.slot), x.getSlotName()))
        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.usage.frontend_priority_dvbs = ConfigSelection(
        default='-2', choices=list(dvbs_nims))
    dvbs_nims.insert(1, ('-1', _('auto')))
    config.usage.recording_frontend_priority_dvbs = ConfigSelection(
        default='-2', choices=dvbs_nims)
    config.usage.frontend_priority_dvbt = ConfigSelection(
        default='-2', choices=list(dvbt_nims))
    dvbt_nims.insert(1, ('-1', _('auto')))
    config.usage.recording_frontend_priority_dvbt = ConfigSelection(
        default='-2', choices=dvbt_nims)
    config.usage.frontend_priority_dvbc = ConfigSelection(
        default='-2', choices=list(dvbc_nims))
    dvbc_nims.insert(1, ('-1', _('auto')))
    config.usage.recording_frontend_priority_dvbc = ConfigSelection(
        default='-2', choices=dvbc_nims)
    config.usage.frontend_priority_atsc = ConfigSelection(
        default="-2", choices=list(atsc_nims))
    atsc_nims.insert(1, ('-1', _('auto')))
    config.usage.recording_frontend_priority_atsc = ConfigSelection(
        default='-2', choices=atsc_nims)

    SystemInfo['DVB-S_priority_tuner_available'] = len(dvbs_nims) > 3 and any(
        len(i) > 2 for i in (dvbt_nims, dvbc_nims, atsc_nims))
    SystemInfo['DVB-T_priority_tuner_available'] = len(dvbt_nims) > 3 and any(
        len(i) > 2 for i in (dvbs_nims, dvbc_nims, atsc_nims))
    SystemInfo['DVB-C_priority_tuner_available'] = len(dvbc_nims) > 3 and any(
        len(i) > 2 for i in (dvbs_nims, dvbt_nims, atsc_nims))
    SystemInfo['ATSC_priority_tuner_available'] = len(atsc_nims) > 3 and any(
        len(i) > 2 for i in (dvbs_nims, dvbc_nims, dvbt_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=True)
    config.usage.show_cryptoinfo = ConfigYesNo(default=True)
    config.usage.show_eit_nownext = ConfigYesNo(default=True)
    config.usage.show_vcr_scart = ConfigYesNo(default=False)
    config.usage.show_update_disclaimer = 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')
        ][:SystemInfo['HasFullHDSkinSupport'] and 4 or 3])
    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):
            open(SystemInfo['Fan'], 'w').write(configElement.value)

        config.usage.fan.addNotifier(fanChanged)
    if SystemInfo['FanPWM']:

        def fanSpeedChanged(configElement):
            open(SystemInfo['FanPWM'], 'w').write(hex(configElement.value)[2:])

        config.usage.fanspeed = ConfigSlider(default=127,
                                             increment=8,
                                             limits=(0, 255))
        config.usage.fanspeed.addNotifier(fanSpeedChanged)
    if SystemInfo['StandbyLED']:

        def standbyLEDChanged(configElement):
            open(SystemInfo['StandbyLED'],
                 'w').write(configElement.value and 'on' or 'off')

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

        if SystemInfo["PowerOffDisplay"]:

            def powerOffDisplayChanged(configElement):
                open(SystemInfo["PowerOffDisplay"],
                     "w").write(configElement.value and "1" or "0")

            config.usage.powerOffDisplay = ConfigYesNo(default=True)
            config.usage.powerOffDisplay.addNotifier(powerOffDisplayChanged)

    if SystemInfo['WakeOnLAN']:

        def wakeOnLANChanged(configElement):
            if 'fp' in SystemInfo['WakeOnLAN']:
                open(SystemInfo['WakeOnLAN'],
                     'w').write(configElement.value and 'enable' or 'disable')
            else:
                open(SystemInfo['WakeOnLAN'],
                     'w').write(configElement.value and 'on' or 'off')

        config.usage.wakeOnLAN = ConfigYesNo(default=False)
        config.usage.wakeOnLAN.addNotifier(wakeOnLANChanged)

    if SystemInfo["hasXcoreVFD"]:

        def set12to8characterVFD(configElement):
            open(SystemInfo["hasXcoreVFD"],
                 "w").write(not configElement.value and "1" or "0")

        config.usage.toggle12to8characterVFD = ConfigYesNo(default=False)
        config.usage.toggle12to8characterVFD.addNotifier(set12to8characterVFD)

    if SystemInfo["LcdLiveTVMode"]:

        def setLcdLiveTVMode(configElement):
            open(SystemInfo["LcdLiveTVMode"], "w").write(configElement.value)

        config.usage.LcdLiveTVMode = ConfigSelection(
            default="0", choices=[str(x) for x in range(0, 9)])
        config.usage.LcdLiveTVMode.addNotifier(setLcdLiveTVMode)

    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.epg.virgin = ConfigYesNo(default=False)
    config.misc.showradiopic = ConfigYesNo(default=True)

    def EpgSettingsChanged(configElement):
        from enigma import eEPGCache
        mask = 4294967295L
        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)
        if not config.epg.virgin.value:
            mask &= ~(eEPGCache.VIRGIN_NOWNEXT | eEPGCache.VIRGIN_SCHEDULE)
        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.virgin.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)
    if SystemInfo['12V_Output']:

        def set12VOutput(configElement):
            Misc_Options.getInstance().set_12V_output(
                configElement.value == 'on' and 1 or 0)

        config.usage.output_12V.addNotifier(set12VOutput,
                                            immediate_feedback=False)
    config.usage.keymap = ConfigText(
        default=eEnv.resolve('${datadir}/enigma2/keymap.xml'))
    config.usage.keytrans = ConfigText(
        default=eEnv.resolve('${datadir}/enigma2/keytranslation.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.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)

    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)
    config.usage.historymode = ConfigSelection(default='1',
                                               choices=[('0', _('Just zap')),
                                                        ('1', _('Show menu'))])

    if SystemInfo['VFD_scroll_repeats']:

        def scroll_repeats(el):
            open(SystemInfo['VFD_scroll_repeats'], 'w').write(el.value)

        choicelist = []
        for i in range(1, 11, 1):
            choicelist.append(str(i))
        config.usage.vfd_scroll_repeats = ConfigSelection(default='3',
                                                          choices=choicelist)
        config.usage.vfd_scroll_repeats.addNotifier(scroll_repeats,
                                                    immediate_feedback=False)

    if SystemInfo['VFD_scroll_delay']:

        def scroll_delay(el):
            open(SystemInfo['VFD_scroll_delay'], 'w').write(el.value)

        choicelist = []
        for i in range(0, 1001, 50):
            choicelist.append(str(i))
        config.usage.vfd_scroll_delay = ConfigSelection(default='150',
                                                        choices=choicelist)
        config.usage.vfd_scroll_delay.addNotifier(scroll_delay,
                                                  immediate_feedback=False)

    if SystemInfo['VFD_initial_scroll_delay']:

        def initial_scroll_delay(el):
            open(SystemInfo['VFD_initial_scroll_delay'], 'w').write(el.value)

        choicelist = []
        for i in range(0, 20001, 500):
            choicelist.append(str(i))
        config.usage.vfd_initial_scroll_delay = ConfigSelection(
            default='1000', choices=choicelist)
        config.usage.vfd_initial_scroll_delay.addNotifier(
            initial_scroll_delay, immediate_feedback=False)

    if SystemInfo['VFD_final_scroll_delay']:

        def final_scroll_delay(el):
            open(SystemInfo['VFD_final_scroll_delay'], 'w').write(el.value)

        choicelist = []
        for i in range(0, 20001, 500):
            choicelist.append(str(i))
        config.usage.vfd_final_scroll_delay = ConfigSelection(
            default='1000', choices=choicelist)
        config.usage.vfd_final_scroll_delay.addNotifier(
            final_scroll_delay, immediate_feedback=False)

    if SystemInfo['HasForceLNBOn']:

        def forceLNBPowerChanged(configElement):
            open(SystemInfo['HasForceLNBOn'], 'w').write(configElement.value)

        config.misc.forceLnbPower = ConfigSelection(default='on',
                                                    choices=[('on', _('Yes')),
                                                             ('off', _('No'))])
        config.misc.forceLnbPower.addNotifier(forceLNBPowerChanged)

    if SystemInfo['HasForceToneburst']:

        def forceToneBurstChanged(configElement):
            open(SystemInfo['HasForceToneburst'],
                 'w').write(configElement.value)

        config.misc.forceToneBurst = ConfigSelection(default='enable',
                                                     choices=[
                                                         ('enable', _('Yes')),
                                                         ('disable', _('No'))
                                                     ])
        config.misc.forceToneBurst.addNotifier(forceToneBurstChanged)

    if SystemInfo['HasBypassEdidChecking']:

        def setHasBypassEdidChecking(configElement):
            open(SystemInfo['HasBypassEdidChecking'],
                 'w').write(configElement.value)

        config.av.bypassEdidChecking = ConfigSelection(default='00000000',
                                                       choices=[('00000001',
                                                                 _('Yes')),
                                                                ('00000000',
                                                                 _('No'))])
        config.av.bypassEdidChecking.addNotifier(setHasBypassEdidChecking)

    if SystemInfo['HasColorspace']:

        def setHaveColorspace(configElement):
            open(SystemInfo['HasColorspace'], 'w').write(configElement.value)

        if SystemInfo['HasColorspaceSimple']:
            config.av.hdmicolorspace = ConfigSelection(default='Edid(Auto)',
                                                       choices={
                                                           'Edid(Auto)':
                                                           _('Auto'),
                                                           'Hdmi_Rgb': _('RGB')
                                                       })
        else:
            config.av.hdmicolorspace = ConfigSelection(default='auto',
                                                       choices={
                                                           'auto': _('auto'),
                                                           'rgb': _('rgb'),
                                                           '420': _('420'),
                                                           '422': _('422'),
                                                           '444': _('444')
                                                       })
        config.av.hdmicolorspace.addNotifier(setHaveColorspace)
    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.colourise_dialogs = ConfigYesNo(default=False)
    config.subtitles.subtitle_borderwidth = ConfigSelection(
        choices=['1', '2', '3', '4', '5'], default='3')
    config.subtitles.subtitle_fontsize = ConfigSelection(
        choices=['%d' % x for x in range(16, 101) if not x % 2], default='40')
    config.subtitles.showbackground = 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.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.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='1',
        choices=[('0', _('alternative')), ('1', _('white')),
                 ('2', _('yellow'))])
    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 dub DUB', _('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')),
        ('ukr Ukr', _('Ukrainian'))
    ]

    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.descramble_client = ConfigYesNo(default=False)
    config.streaming.stream_eit = ConfigYesNo(default=True)
    config.streaming.stream_ait = ConfigYesNo(default=True)
    config.streaming.authentication = ConfigYesNo(default=False)
    config.mediaplayer = ConfigSubsection()
    config.mediaplayer.useAlternateUserAgent = ConfigYesNo(default=False)
    config.mediaplayer.alternateUserAgent = ConfigText(default='')
Beispiel #12
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)
Beispiel #13
0
def InitUsageConfig():
    config.usage = ConfigSubsection()
    config.usage.showdish = ConfigYesNo(default=True)
    config.usage.multibouquet = ConfigYesNo(default=True)
    config.usage.quickzap_bouquet_change = ConfigYesNo(default=False)
    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=False)
    config.usage.show_spinner = ConfigYesNo(default=True)
    config.usage.enable_tt_caching = ConfigYesNo(default=True)
    config.usage.hdd_standby = ConfigSelection(
        default="300",
        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.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"))])

    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 = ConfigYesNo(default=True)

    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 = ConfigYesNo(default=True)

    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)

    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",
                                                     _("Singlestep (GOP)")),
                                                    ("last", _("Last speed"))])

    config.crash = ConfigSubsection()
    config.crash.details = ConfigYesNo(default=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 updateFlushSize(el):
        enigma.setFlushSize(int(el.value))
        print "[SETTING] getFlushSize=", enigma.getFlushSize()

    def updateDemuxSize(el):
        enigma.setDemuxSize(int(el.value))
        print "[SETTING] getDemuxSize=", enigma.getDemuxSize()

    config.misc.flush_size = ConfigSelection(default="0",
                                             choices=[("0", "Off"),
                                                      ("524288", "512kB"),
                                                      ("1048576", "1 MB"),
                                                      ("2097152", "2 MB"),
                                                      ("4194304", "4 MB")])
    config.misc.flush_size.addNotifier(updateFlushSize,
                                       immediate_feedback=False)
    config.misc.demux_size = ConfigSelection(default="1540096",
                                             choices=[
                                                 ("770048", "Small 0.7 MB"),
                                                 ("962560", "Normal 1 MB"),
                                                 ("1540096", "Large 1.5MB"),
                                                 ("1925120", "Huge 2 MB")
                                             ])
    config.misc.demux_size.addNotifier(updateDemuxSize,
                                       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 = ConfigYesNo(default=False)
    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", "center", "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"
    ],
                                                         default="34")
    config.subtitles.subtitle_noPTSrecordingdelay = ConfigSelection(
        default="315000",
        choices=[("0", "No Delay"), ("45000", "0.5 sec"), ("90000", "1.0 sec"),
                 ("135000", "1.5 sec"), ("180000", "2.0 sec"),
                 ("225000", "2.5 sec"), ("270000", "3.0 sec"),
                 ("315000", "3.5 sec"), ("360000", "4.0 sec"),
                 ("405000", "4.5 sec"), ("450000", "5.0 sec"),
                 ("495000", "5.5 sec"), ("540000", "6.0 sec"),
                 ("585000", "6.5 sec"), ("630000", "7.0 sec"),
                 ("475000", "7.5 sec"), ("720000", "8.0 sec"),
                 ("765000", "8.5 sec"), ("810000", "9.0 sec"),
                 ("855000", "9.5 sec"), ("900000", "10.0 sec")])

    config.autolanguage = ConfigSubsection()
    subtitle_language_choices = [("---", "None"), ("ara", "Arabic"),
                                 ("eus baq", "Basque"), ("hrv", "Croatian"),
                                 ("ces cze", "Czech"), ("dan", "Danish"),
                                 ("dut ndl", "Dutch"), ("eng", "English"),
                                 ("est", "Estonian"), ("fin", "Finnish"),
                                 ("fra fre", "French"), ("deu ger", "German"),
                                 ("ell gre", "Greek"), ("hun", "Hungarian"),
                                 ("ita", "Italian"), ("lat", "Latvian"),
                                 ("lit", "Lithuanian"),
                                 ("ltz", "Letzeburgesch"),
                                 ("nob", "Norwegian"), ("pol", "Polish"),
                                 ("por", "Portuguese"), ("fas per", "Persian"),
                                 ("ron rum", "Romanian"), ("rus", "Russian"),
                                 ("srp", "Serbian"), ("slk slo", "Slovak"),
                                 ("slv", "Slovenian"), ("spa", "Spanish"),
                                 ("swe", "Swedish"), ("tur", "Turkish")]
    audio_language_choices = [("---", "None"),
                              ("orj dos ory org esl qaa und", "Original"),
                              ("ara", "Arabic"), ("eus baq", "Basque"),
                              ("hrv", "Croatian"), ("ces cze", "Czech"),
                              ("dan", "Danish"), ("dut ndl", "Dutch"),
                              ("eng", "English"), ("est", "Estonian"),
                              ("fin", "Finnish"), ("fra fre", "French"),
                              ("deu ger", "German"), ("ell gre", "Greek"),
                              ("hun", "Hungarian"), ("ita", "Italian"),
                              ("lat", "Latvian"), ("lit", "Lithuanian"),
                              ("ltz", "Letzeburgesch"), ("nob", "Norwegian"),
                              ("pol", "Polish"), ("por", "Portuguese"),
                              ("fas per", "Persian"), ("ron rum", "Romanian"),
                              ("rus", "Russian"), ("srp", "Serbian"),
                              ("slk slo", "Slovak"), ("slv", "Slovenian"),
                              ("spa", "Spanish"), ("swe", "Swedish"),
                              ("tur", "Turkish")]
    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)
    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="0",
                                                          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")
                                                          ])
Beispiel #14
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)
Beispiel #15
0
def InitUsageConfig():
    config.misc.useNTPminutes = ConfigSelection(
        default="30",
        choices=[("30", "30" + " " + _("minutes")), ("60", _("Hour")),
                 ("1440", _("Once per day"))])
    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.hide_number_markers = ConfigYesNo(default=False)
    config.usage.hide_number_markers.addNotifier(refreshServiceList)

    config.usage.icon_crypt = ConfigYesNo(default=False)
    config.usage.icon_crypt.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.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="11",
        choices=[(None, _("None")),
                 ("0", _("No timeout"))] + choicelist + [("EPG", _("EPG"))])
    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)
    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/"])

    if os.path.exists('/usr/bin/'):
        softcams = os.listdir('/usr/bin/')
    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.startswith('CCcam') or softcam.startswith('cccam'):
            config.cccaminfo.showInExtensions = ConfigYesNo(default=True)
            SystemInfo["CCcamInstalled"] = True
        elif softcam.startswith('OScam') or softcam.startswith('oscam'):
            config.oscaminfo.showInExtensions = ConfigYesNo(default=True)
            SystemInfo["OScamInstalled"] = True

    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=nims)
    nims.append(("-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=True)
    config.usage.hide_ci_messages = ConfigYesNo(default=True)
    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)

    config.epg = ConfigSubsection()
    config.epg.eit = ConfigYesNo(default=True)
    config.epg.mhw = ConfigYesNo(default=True)
    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.network = ConfigSubsection()
    config.network.Inadyn_autostart = ConfigYesNo(default=False)

    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)

    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.getValue()):
            os.mkdir(config.crash.debug_path.getValue(), 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):
        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")

    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):
        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)

    #config.osd = ConfigSubsection()
    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)
    choiceoptions = [("mode1", _("Mode 1")), ("mode2", _("Mode 2"))]
    config.osd.threeDsetmode = ConfigSelection(default='mode1',
                                               choices=choiceoptions)
Beispiel #16
0
def InitUsageConfig():
	config.usage = ConfigSubsection()
	config.usage.showdish = ConfigYesNo(default = True)
	config.misc.showrotorposition = ConfigSelection(default = "no", choices = [("no", _("no")), ("yes", _("yes")), ("withtext", _("with text")), ("tunername", _("with tuner name"))])
	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 = True)
	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)

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

	choicelist = [("by skin", _("As defined by the skin"))]
	for i in range (5,41):
		choicelist.append((str(i)))
	config.usage.servicelist_number_of_services = ConfigSelection(default = "by skin", choices = choicelist)
	config.usage.servicelist_number_of_services.addNotifier(refreshServiceList)

	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 = [("0", _("No timeout"))]
	for i in range(1, 12):
		choicelist.append((str(i), ngettext("%d second", "%d seconds", i) % i))
	config.usage.infobar_timeout = ConfigSelection(default = "5", choices = 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 = "5", choices = [("-1", _("None"))] + choicelist + [("EPG",_("EPG"))])
	config.usage.show_simple_second_infobar = ConfigYesNo(default = False)
	config.usage.infobar_frontend_source = ConfigSelection(default = "tuner", choices = [("settings", _("Settings")), ("tuner", _("Tuner"))])
	config.usage.oldstyle_zap_controls = ConfigYesNo(default = False)
	config.usage.oldstyle_channel_select_controls = ConfigYesNo(default = False)
	config.usage.zap_with_ch_buttons = ConfigYesNo(default = True)
	config.usage.ok_is_channelselection = ConfigYesNo(default = False)
	config.usage.volume_instead_of_channelselection = ConfigYesNo(default = False)
	config.usage.channelselection_preview = ConfigYesNo(default = False)
	config.usage.show_spinner = ConfigYesNo(default = True)
	config.usage.menu_sort_weight = ConfigDictionarySet(default = { "mainmenu" : {"submenu" : {} }})
	config.usage.menu_sort_mode = ConfigSelection(default = "user", choices = [
		("a_z", _("alphabetical")),
		("default", _("Default")),
		("user", _("user defined")),])
	config.usage.menu_show_numbers = ConfigYesNo(default = False)
	config.usage.menu_path = ConfigSelection(default = "off", choices = [
		("off", _("Disabled")),
		("small", _("Small")),
		("large", _("Large")),])
	config.usage.enable_tt_caching = ConfigYesNo(default = True)
	choicelist = []
	for i in (10, 30):
		choicelist.append((str(i), ngettext("%d second", "%d seconds", i) % i))
	for i in (60, 120, 300, 600, 1200, 1800):
		m = i / 60
		choicelist.append((str(i), ngettext("%d minute", "%d minutes", m) % m))
	for i in (3600, 7200, 14400):
		h = i / 3600
		choicelist.append((str(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")) ])
	choicelist = [("-1", _("Disabled")), ("0", _("No timeout"))]
	for i in [60, 300, 600, 900, 1800, 2700, 3600]:
		m = i/60
		choicelist.append((str(i), ngettext("%d minute", "%d minutes", m) % m))
	config.usage.pip_last_service_timeout = ConfigSelection(default = "0", choices = choicelist)

	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.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)

	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.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 yes", _("Ask user") + " " + _("default") + " " + _("yes")),
		("ask no", _("Ask user") + " " + _("default") + " " + _("no")),
		("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")), ("playallvideos", _("Play All Videos (without infos)"))])
	config.usage.next_movie_msg = ConfigYesNo(default = True)
	config.usage.last_movie_played = ConfigText()
	config.usage.leave_movieplayer_onExit = ConfigSelection(default = "popup", choices = [
		("no", _("No")), ("popup", _("With popup")), ("without popup", _("Without popup")), ("movielist", _("Return to movie list")) ])

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

	config.usage.startup_to_standby = ConfigSelection(default = "no", choices = [
		("no", _("No")),
		("yes", _("Yes")),
		("except", _("No, except Wakeup timer")) ])

	config.usage.wakeup_enabled = ConfigSelection(default = "no", choices = [
		("no", _("No")),
		("yes", _("Yes")),
		("standby", _("Yes, only from standby")),
		("deepstandby", _("Yes, only from deep standby")) ])
	config.usage.wakeup_day = ConfigSubDict()
	config.usage.wakeup_time = ConfigSubDict()
	for i in range(7):
		config.usage.wakeup_day[i] = ConfigEnableDisable(default = False)
		config.usage.wakeup_time[i] = ConfigClock(default = ((6 * 60 + 0) * 60))

	choicelist = [("0", _("Do nothing"))]
	for i in range(3600, 21601, 3600):
		h = abs(i / 3600)
		h = ngettext("%d hour", "%d hours", h) % h
		choicelist.append((str(i), _("Standby in ") + h))
	config.usage.inactivity_timer = ConfigSelection(default = "0", choices = choicelist)
	config.usage.inactivity_timer_deep_standby = ConfigSelection(default = "deep", choices = [ ("deep", _("Deep standby")), ("standby",  _("Standby"))] )
	config.usage.inactivity_timer_blocktime = ConfigYesNo(default = False)
	config.usage.inactivity_timer_blocktime_begin = ConfigClock(default = time.mktime((0, 0, 0, 18, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_end = ConfigClock(default = time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_extra = ConfigYesNo(default = False)
	config.usage.inactivity_timer_blocktime_extra_begin = ConfigClock(default = time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_extra_end = ConfigClock(default = time.mktime((0, 0, 0, 9, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_by_weekdays = ConfigYesNo(default = False)
	config.usage.inactivity_timer_blocktime_day = ConfigSubDict()
	config.usage.inactivity_timer_blocktime_begin_day = ConfigSubDict()
	config.usage.inactivity_timer_blocktime_end_day = ConfigSubDict()
	config.usage.inactivity_timer_blocktime_extra_day = ConfigSubDict()
	config.usage.inactivity_timer_blocktime_extra_begin_day = ConfigSubDict()
	config.usage.inactivity_timer_blocktime_extra_end_day = ConfigSubDict()
	for i in range(7):
		config.usage.inactivity_timer_blocktime_day[i] = ConfigYesNo(default = False)
		config.usage.inactivity_timer_blocktime_begin_day[i] = ConfigClock(default = time.mktime((0, 0, 0, 18, 0, 0, 0, 0, 0)))
		config.usage.inactivity_timer_blocktime_end_day[i] = ConfigClock(default = time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))
		config.usage.inactivity_timer_blocktime_extra_day[i] = ConfigYesNo(default = False)
		config.usage.inactivity_timer_blocktime_extra_begin_day[i] = ConfigClock(default = time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
		config.usage.inactivity_timer_blocktime_extra_end_day[i] = ConfigClock(default = time.mktime((0, 0, 0, 9, 0, 0, 0, 0, 0)))

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

	choicelist = [("0", _("Disabled"))]
	for i in [60, 300, 600] + range(900, 7201, 900):
		m = abs(i / 60)
		m = ngettext("%d minute", "%d minutes", m) % m
		choicelist.append((str(i), _("after ") + m))
	config.usage.standby_to_shutdown_timer = ConfigSelection(default = "0", choices = choicelist)
	config.usage.standby_to_shutdown_timer_blocktime = ConfigYesNo(default = False)
	config.usage.standby_to_shutdown_timer_blocktime_begin = ConfigClock(default = time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
	config.usage.standby_to_shutdown_timer_blocktime_end = ConfigClock(default = time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))

	choicelist = [("0", _("Disabled"))]
	for m in (1, 5, 10, 15, 30, 60):
		choicelist.append((str(m * 60), ngettext("%d minute", "%d minutes", m) % m))
	config.usage.screen_saver = ConfigSelection(default = "300", choices = choicelist)

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

	choicelist = [("0", _("Disabled"))]
	for i in (2, 3, 4, 5, 10, 20, 30):
		choicelist.append((str(i), ngettext("%d second", "%d seconds", i) % i))
	for i in (60, 120, 300):
		m = i / 60
		choicelist.append((str(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"),
		("127", _("No priority")) ])

	def remote_fallback_changed(configElement):
		if configElement.value:
			configElement.value = "%s%s" % (not configElement.value.startswith("http://") and "http://" or "", configElement.value)
			configElement.value = "%s%s" % (configElement.value, configElement.value.count(":") == 1 and ":8001" or "")
	config.usage.remote_fallback_enabled = ConfigYesNo(default = False)
	config.usage.remote_fallback = ConfigText(default = "", fixed_size = False)
	config.usage.remote_fallback.addNotifier(remote_fallback_changed, immediate_feedback=False)

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

	dvbs_nims = [("-2", _("Disabled"))]
	dvbt_nims = [("-2", _("Disabled"))]
	dvbc_nims = [("-2", _("Disabled"))]
	atsc_nims = [("-2", _("Disabled"))]

	nims = [("-1", _("auto"))]
	for x in nimmanager.nim_slots:
		if x.isCompatible("DVB-S"):
			dvbs_nims.append((str(x.slot), x.getSlotName()))
		elif x.isCompatible("DVB-T"):
			dvbt_nims.append((str(x.slot), x.getSlotName()))
		elif x.isCompatible("DVB-C"):
			dvbc_nims.append((str(x.slot), x.getSlotName()))
		elif x.isCompatible("ATSC"):
			atsc_nims.append((str(x.slot), x.getSlotName()))
		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.usage.frontend_priority_dvbs = ConfigSelection(default = "-2", choices = list(dvbs_nims))
	dvbs_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_dvbs = ConfigSelection(default = "-2", choices = dvbs_nims)
	config.usage.frontend_priority_dvbt = ConfigSelection(default = "-2", choices = list(dvbt_nims))
	dvbt_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_dvbt = ConfigSelection(default = "-2", choices = dvbt_nims)
	config.usage.frontend_priority_dvbc = ConfigSelection(default = "-2", choices = list(dvbc_nims))
	dvbc_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_dvbc = ConfigSelection(default = "-2", choices = dvbc_nims)
	config.usage.frontend_priority_atsc = ConfigSelection(default = "-2", choices = list(atsc_nims))
	atsc_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_atsc = ConfigSelection(default = "-2", choices = atsc_nims)

	SystemInfo["DVB-S_priority_tuner_available"] = len(dvbs_nims) > 3 and any(len(i) > 2 for i in (dvbt_nims, dvbc_nims, atsc_nims))
	SystemInfo["DVB-T_priority_tuner_available"] = len(dvbt_nims) > 3 and any(len(i) > 2 for i in (dvbs_nims, dvbc_nims, atsc_nims))
	SystemInfo["DVB-C_priority_tuner_available"] = len(dvbc_nims) > 3 and any(len(i) > 2 for i in (dvbs_nims, dvbt_nims, atsc_nims))
	SystemInfo["ATSC_priority_tuner_available"] = len(atsc_nims) > 3 and any(len(i) > 2 for i in (dvbs_nims, dvbc_nims, dvbt_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)
        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.show_picon_in_display = ConfigYesNo(default = True)
	config.usage.hide_zap_errors = 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)
	config.usage.show_update_disclaimer = 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")][:SystemInfo["HasFullHDSkinSupport"] and 4 or 3])

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

	if SystemInfo["WakeOnLAN"]:
		def wakeOnLANChanged(configElement):
			if "fp" in SystemInfo["WakeOnLAN"]:
				open(SystemInfo["WakeOnLAN"], "w").write(configElement.value and "enable" or "disable")
			else:
				open(SystemInfo["WakeOnLAN"], "w").write(configElement.value and "on" or "off")
		config.usage.wakeOnLAN = ConfigYesNo(default = False)
		config.usage.wakeOnLAN.addNotifier(wakeOnLANChanged)

	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.epg.virgin = ConfigYesNo(default = False)
	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)
		if not config.epg.virgin.value:
			mask &= ~(eEPGCache.VIRGIN_NOWNEXT | eEPGCache.VIRGIN_SCHEDULE)
		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.virgin.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)

	hddchoices = [('/', 'Internal Flash'), ('/hdd', '/hdd')]
	for p in harddiskmanager.getMountedPartitions():
		if os.path.exists(p.mountpoint):
			d = os.path.normpath(p.mountpoint)
			if p.mountpoint != '/':
				hddchoices.append((p.mountpoint, d))
	config.misc.epgcachepath = ConfigSelection(default = '/hdd', choices = hddchoices)
	def EpgCacheChanged(configElement):
		eEPGCache.getInstance().setCacheFile(config.misc.epgcachepath.value + "/epg.dat")
		epgcache = eEPGCache.getInstance()
		epgcache.save()
	config.misc.epgcachepath.addNotifier(EpgCacheChanged, immediate_feedback = False)

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

	if SystemInfo["12V_Output"]:
		def set12VOutput(configElement):
			Misc_Options.getInstance().set_12V_output(configElement.value == "on" and 1 or 0)
		config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

	config.usage.keymap = ConfigText(default = eEnv.resolve("${datadir}/enigma2/keymap.xml"))
	config.usage.keytrans = ConfigText(default = eEnv.resolve("${datadir}/enigma2/keytranslation.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.seek.withjumps = 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):
		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)

	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)

	if SystemInfo["HasForceLNBOn"]:
		def forceLNBPowerChanged(configElement):
			open(SystemInfo["HasForceLNBOn"], "w").write(configElement.value)
		config.misc.forceLnbPower = ConfigSelection(default = "on", choices = [ ("on", _("Yes")), ("off", _("No"))] )
		config.misc.forceLnbPower.addNotifier(forceLNBPowerChanged)

	if SystemInfo["HasForceToneburst"]:
		def forceToneBurstChanged(configElement):
			open(SystemInfo["HasForceToneburst"], "w").write(configElement.value)
		config.misc.forceToneBurst = ConfigSelection(default = "enable", choices = [ ("enable", _("Yes")), ("disable", _("No"))] )
		config.misc.forceToneBurst.addNotifier(forceToneBurstChanged)

	if SystemInfo["HasBypassEdidChecking"]:
		def setHasBypassEdidChecking(configElement):
			open(SystemInfo["HasBypassEdidChecking"], "w").write(configElement.value)
		config.av.bypassEdidChecking = ConfigSelection(default = "00000000", choices = [ ("00000001", _("Yes")), ("00000000", _("No"))] )
		config.av.bypassEdidChecking.addNotifier(setHasBypassEdidChecking)

	if SystemInfo["HasColorspace"]:
		def setHaveColorspace(configElement):
			open(SystemInfo["HasColorspace"], "w").write(configElement.value)
		if SystemInfo["HasColorspaceSimple"]:
			config.av.hdmicolorspace = ConfigSelection(default = "Edid(Auto)", choices={"Edid(Auto)": _("Auto"), "Hdmi_Rgb": _("RGB"), "444": _("YCbCr444"), "422": _("YCbCr422"), "420": _("YCbCr420")})
		else:
			config.av.hdmicolorspace = ConfigSelection(default = "auto", choices={"auto": _("auto"), "rgb": _("rgb"), "420": _("420"), "422": _("422"), "444": _("444")})
		config.av.hdmicolorspace.addNotifier(setHaveColorspace)

	if SystemInfo["HasColordepth"]:
		def setHaveColordepth(configElement):
			open(SystemInfo["HasColordepth"], "w").write(configElement.value)
		config.av.hdmicolordepth = ConfigSelection(default = "auto", choices={"auto": _("Auto"), "8bit": _("8bit"), "10bit": _("10bit"), "12bit": _("12bit")})
		config.av.hdmicolordepth.addNotifier(setHaveColordepth)

	if SystemInfo["HasHDMIpreemphasis"]:
		def setHDMIpreemphasis(configElement):
			open(SystemInfo["HasHDMIpreemphasis"], "w").write(configElement.value)
		config.av.hdmipreemphasis = ConfigSelection(default = "off", choices = [ ("on", _("Yes")), ("off", _("No"))] )
		config.av.hdmipreemphasis.addNotifier(setHDMIpreemphasis)

	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.colourise_dialogs = ConfigYesNo(default = False)
	config.subtitles.subtitle_borderwidth = ConfigSelection(choices = ["1", "2", "3", "4", "5"], default = "3")
	config.subtitles.subtitle_fontsize  = ConfigSelection(choices = ["%d" % x for x in range(16,101) if not x % 2], default = "40")
	config.subtitles.showbackground = 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.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 = "1", choices = [
		("0", _("alternative")),
		("1", _("white")),
		("2", _("yellow")) ])
	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")),
		("chn sgp", _("Simplified Chinese")),
		("twn hkn",_("Traditional Chinese")),
		("ces cze", _("Czech")),
		("dan", _("Danish")),
		("dut ndl nld", _("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 dub Dub DUB ud1", _("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")),
		("ukr Ukr", _("Ukrainian"))]

	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.descramble_client = ConfigYesNo(default = False)
	config.streaming.stream_eit = ConfigYesNo(default = True)
	config.streaming.stream_ait = ConfigYesNo(default = True)
	config.streaming.authentication = ConfigYesNo(default = False)

	SystemInfo["GraphMultiEpg"] = os.path.exists("/usr/lib/enigma2/python/Plugins/Extensions/GraphMultiEPG")
	if SystemInfo["GraphMultiEpg"]:
		config.misc.graph_mepg = ConfigSubsection()
		config.misc.graph_mepg.extension_menu = ConfigYesNo(default = True)
		
	config.misc.ci_autopin = ConfigYesNo(default = False)

	config.mediaplayer = ConfigSubsection()
	config.mediaplayer.useAlternateUserAgent = ConfigYesNo(default=False)
	config.mediaplayer.alternateUserAgent = ConfigText(default="")
Beispiel #17
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.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.resume_treshold = ConfigInteger(default=30, limits=[0, 300])

    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)

    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)

    config.usage.record_mode = ConfigSelection(
        default="direct_io",
        choices=[("direct_io", _("Direct IO (default)")),
                 ("cached_io", _("Cached IO"))])
Beispiel #18
0
def InitUsageConfig():
    config.usage = ConfigSubsection()
    config.usage.showdish = ConfigYesNo(default=True)
    config.misc.showrotorposition = ConfigSelection(default='no', choices=[('no', _('no')),
     ('yes', _('yes')),
     ('withtext', _('with text')),
     ('tunername', _('with tuner name'))])
    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=True)
    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)
    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.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'))])
    choicelist = [('by skin', _('As defined by the skin'))]
    for i in range(5, 41):
        choicelist.append(str(i))

    config.usage.servicelist_number_of_services = ConfigSelection(default='by skin', choices=choicelist)
    config.usage.servicelist_number_of_services.addNotifier(refreshServiceList)
    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 = [('0', _('No timeout'))]
    for i in range(1, 12):
        choicelist.append((str(i), ngettext('%d second', '%d seconds', i) % i))

    config.usage.infobar_timeout = ConfigSelection(default='5', choices=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'))] + choicelist + [('EPG', _('EPG'))])
    config.usage.show_simple_second_infobar = ConfigYesNo(default=True)
    config.usage.infobar_frontend_source = ConfigSelection(default='tuner', choices=[('settings', _('Settings')), ('tuner', _('Tuner'))])
    config.usage.oldstyle_zap_controls = ConfigYesNo(default=False)
    config.usage.oldstyle_channel_select_controls = ConfigYesNo(default=False)
    config.usage.zap_with_ch_buttons = ConfigYesNo(default=False)
    config.usage.ok_is_channelselection = ConfigYesNo(default=False)
    config.usage.volume_instead_of_channelselection = ConfigYesNo(default=False)
    config.usage.channelselection_preview = ConfigYesNo(default=False)
    config.usage.show_spinner = ConfigYesNo(default=True)
    config.usage.menu_sort_weight = ConfigDictionarySet(default={'mainmenu': {'submenu': {}}})
    config.usage.menu_sort_mode = ConfigSelection(default='default', choices=[('a_z', _('alphabetical')), ('default', _('Default')), ('user', _('user defined'))])
    config.usage.menu_path = ConfigSelection(default='off', choices=[('off', _('Disabled')), ('small', _('Small')), ('large', _('Large'))])
    config.usage.enable_tt_caching = ConfigYesNo(default=True)
    choicelist = []
    for i in (10, 30):
        choicelist.append((str(i), ngettext('%d second', '%d seconds', i) % i))

    for i in (60, 120, 300, 600, 1200, 1800):
        m = i / 60
        choicelist.append((str(i), ngettext('%d minute', '%d minutes', m) % m))

    for i in (3600, 7200, 14400):
        h = i / 3600
        choicelist.append((str(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'))])
    choicelist = [('-1', _('Disabled')), ('0', _('No timeout'))]
    for i in [60,
     300,
     600,
     900,
     1800,
     2700,
     3600]:
        m = i / 60
        choicelist.append((str(i), ngettext('%d minute', '%d minutes', m) % m))

    config.usage.pip_last_service_timeout = ConfigSelection(default='0', choices=choicelist)
    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.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)
    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 yes', _('Ask user') + ' ' + _('default') + ' ' + _('yes')),
     ('ask no', _('Ask user') + ' ' + _('default') + ' ' + _('no')),
     ('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.last_movie_played = ConfigText()
    config.usage.leave_movieplayer_onExit = ConfigSelection(default='popup', choices=[('no', _('No')),
     ('popup', _('With popup')),
     ('without popup', _('Without popup')),
     ('movielist', _('Return to movie list'))])
    config.usage.setup_level = ConfigSelection(default='expert', choices=[('simple', _('Simple')), ('intermediate', _('Intermediate')), ('expert', _('Expert'))])
    config.usage.startup_to_standby = ConfigSelection(default='no', choices=[('no', _('No')), ('yes', _('Yes')), ('except', _('No, except Wakeup timer'))])
    config.usage.wakeup_menu = ConfigNothing()
    config.usage.wakeup_enabled = ConfigYesNo(default=False)
    config.usage.wakeup_day = ConfigSubDict()
    config.usage.wakeup_time = ConfigSubDict()
    for i in range(7):
        config.usage.wakeup_day[i] = ConfigEnableDisable(default=False)
        config.usage.wakeup_time[i] = ConfigClock(default=21600)

    choicelist = [('0', _('Do nothing'))]
    for i in range(3600, 21601, 3600):
        h = abs(i / 3600)
        h = ngettext('%d hour', '%d hours', h) % h
        choicelist.append((str(i), _('Standby in ') + h))

    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, 18, 0, 0, 0, 0, 0)))
    config.usage.inactivity_timer_blocktime_end = ConfigClock(default=time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))
    config.usage.inactivity_timer_blocktime_extra = ConfigYesNo(default=False)
    config.usage.inactivity_timer_blocktime_extra_begin = ConfigClock(default=time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
    config.usage.inactivity_timer_blocktime_extra_end = ConfigClock(default=time.mktime((0, 0, 0, 9, 0, 0, 0, 0, 0)))
    choicelist = [('0', _('Disabled')), ('event_standby', _('Standby after current event'))]
    for i in range(900, 7201, 900):
        m = abs(i / 60)
        m = ngettext('%d minute', '%d minutes', m) % m
        choicelist.append((str(i), _('Standby in ') + m))

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

    config.usage.standby_to_shutdown_timer = ConfigSelection(default='0', choices=choicelist)
    config.usage.standby_to_shutdown_timer_blocktime = ConfigYesNo(default=True)
    config.usage.standby_to_shutdown_timer_blocktime_begin = ConfigClock(default=time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
    config.usage.standby_to_shutdown_timer_blocktime_end = ConfigClock(default=time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))
    choicelist = [('0', _('Disabled'))]
    for m in (1, 5, 10, 15, 30, 60):
        choicelist.append((str(m * 60), ngettext('%d minute', '%d minutes', m) % m))

    config.usage.screen_saver = ConfigSelection(default='300', choices=choicelist)
    config.usage.check_timeshift = ConfigYesNo(default=True)
    choicelist = [('0', _('Disabled'))]
    for i in (2, 3, 4, 5, 10, 20, 30):
        choicelist.append((str(i), ngettext('%d second', '%d seconds', i) % i))

    for i in (60, 120, 300):
        m = i / 60
        choicelist.append((str(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'),
     ('127', _('No priority'))])
    config.usage.remote_fallback_enabled = ConfigYesNo(default=False)
    config.usage.remote_fallback = ConfigText(default='', fixed_size=False)
    config.usage.show_timer_conflict_warning = ConfigYesNo(default=True)
    dvbs_nims = [('-2', _('Disabled'))]
    dvbt_nims = [('-2', _('Disabled'))]
    dvbc_nims = [('-2', _('Disabled'))]
    atsc_nims = [("-2", _("Disabled"))]
    nims = [('-1', _('auto'))]
    for x in nimmanager.nim_slots:
        if x.isCompatible('DVB-S'):
            dvbs_nims.append((str(x.slot), x.getSlotName()))
        elif x.isCompatible('DVB-T'):
            dvbt_nims.append((str(x.slot), x.getSlotName()))
        elif x.isCompatible('DVB-C'):
            dvbc_nims.append((str(x.slot), x.getSlotName()))
        elif x.isCompatible("ATSC"):
			atsc_nims.append((str(x.slot), x.getSlotName()))    
        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.usage.frontend_priority_dvbs = ConfigSelection(default='-2', choices=list(dvbs_nims))
    dvbs_nims.insert(1, ('-1', _('auto')))
    config.usage.recording_frontend_priority_dvbs = ConfigSelection(default='-2', choices=dvbs_nims)
    config.usage.frontend_priority_dvbt = ConfigSelection(default='-2', choices=list(dvbt_nims))
    dvbt_nims.insert(1, ('-1', _('auto')))
    config.usage.recording_frontend_priority_dvbt = ConfigSelection(default='-2', choices=dvbt_nims)
    config.usage.frontend_priority_dvbc = ConfigSelection(default='-2', choices=list(dvbc_nims))
    dvbc_nims.insert(1, ('-1', _('auto')))
    config.usage.recording_frontend_priority_dvbc = ConfigSelection(default='-2', choices=dvbc_nims)
    config.usage.frontend_priority_atsc = ConfigSelection(default = "-2", choices = list(atsc_nims))
	atsc_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_atsc = ConfigSelection(default = "-2", choices = atsc_nims)
Beispiel #19
0
def InitUsageConfig():
    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=True)
    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)

    choicelist = [("-1", _("Disable"))]
    for i in range(0, 1300, 100):
        choicelist.append(
            ("%d" % 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.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 = [("0", _("No timeout"))]
    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=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"))] + choicelist + [("EPG", _("EPG"))])
    config.usage.infobar_frontend_source = ConfigSelection(
        default="tuner",
        choices=[("settings", _("Settings")), ("tuner", _("Tuner"))])
    config.usage.oldstyle_zap_controls = ConfigYesNo(default=False)
    config.usage.oldstyle_channel_select_controls = ConfigYesNo(default=False)
    config.usage.zap_with_ch_buttons = ConfigYesNo(default=False)
    config.usage.ok_is_channelselection = ConfigYesNo(default=False)
    config.usage.volume_instead_of_channelselection = ConfigYesNo(
        default=False)
    config.usage.channelselection_preview = ConfigYesNo(default=False)
    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"))
                                                           ])
    choicelist = [("-1", _("Disabled")), ("0", _("No timeout"))]
    for i in [60, 300, 600, 900, 1800, 2700, 3600]:
        m = i / 60
        choicelist.append(
            ("%d" % i, ngettext("%d minute", "%d minutes", m) % m))
    config.usage.pip_last_service_timeout = ConfigSelection(default="0",
                                                            choices=choicelist)

    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 yes", _("Ask user") + " " + _("default") + " " + _("yes")),
            ("ask no", _("Ask user") + " " + _("default") + " " + _("no")),
            ("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.last_movie_played = ConfigText()
    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.startup_to_standby = ConfigYesNo(default=False)

    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", _("Do nothing"))]
    for i in range(3600, 21601, 3600):
        h = abs(i / 3600)
        h = ngettext("%d hour", "%d hours", h) % h
        choicelist.append(("%d" % i, _("Standby in ") + h))
    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 = [("0", _("Disabled")),
                  ("event_standby", _("Standby after current event"))]
    for i in range(900, 7201, 900):
        m = abs(i / 60)
        m = ngettext("%d minute", "%d minutes", m) % m
        choicelist.append(("%d" % i, _("Standby in ") + m))
    config.usage.sleep_timer = ConfigSelection(default="0", choices=choicelist)

    choicelist = [("0", _("Disabled"))]
    for i in [60, 300, 600] + 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)
    config.usage.standby_to_shutdown_timer_blocktime = ConfigYesNo(
        default=True)
    config.usage.standby_to_shutdown_timer_blocktime_begin = ConfigClock(
        default=time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
    config.usage.standby_to_shutdown_timer_blocktime_end = ConfigClock(
        default=time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))

    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="60",
                                                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"),
                 ("127", "No priority")])

    config.usage.remote_fallback_enabled = ConfigYesNo(default=False)
    config.usage.remote_fallback = ConfigText(default="", fixed_size=False)

    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=True)
    config.usage.show_cryptoinfo = ConfigYesNo(default=True)
    config.usage.show_eit_nownext = ConfigYesNo(default=True)
    config.usage.show_vcr_scart = ConfigYesNo(default=False)
    config.usage.show_update_disclaimer = 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")])

    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):
            open(SystemInfo["Fan"], "w").write(configElement.value)

        config.usage.fan.addNotifier(fanChanged)

    if SystemInfo["FanPWM"]:

        def fanSpeedChanged(configElement):
            open(SystemInfo["FanPWM"], "w").write(hex(configElement.value)[2:])

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

    if SystemInfo["StandbyLED"]:

        def standbyLEDChanged(configElement):
            open(SystemInfo["StandbyLED"],
                 "w").write(configElement.value and "on" or "off")

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

    if SystemInfo["WakeOnLAN"]:

        def wakeOnLANChanged(configElement):
            if "fp" in SystemInfo["WakeOnLAN"]:
                open(SystemInfo["WakeOnLAN"],
                     "w").write(configElement.value and "enable" or "disable")
            else:
                open(SystemInfo["WakeOnLAN"],
                     "w").write(configElement.value and "on" or "off")

        config.usage.wakeOnLAN = ConfigYesNo(default=False)
        config.usage.wakeOnLAN.addNotifier(wakeOnLANChanged)

    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.epg.virgin = ConfigYesNo(default=False)
    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)
        if not config.epg.virgin.value:
            mask &= ~(eEPGCache.VIRGIN_NOWNEXT | eEPGCache.VIRGIN_SCHEDULE)
        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.virgin.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)

    if SystemInfo["12V_Output"]:

        def set12VOutput(configElement):
            Misc_Options.getInstance().set_12V_output(
                configElement.value == "on" and 1 or 0)

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

    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):
        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)

    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)

    if SystemInfo["VFD_scroll_repeats"]:

        def scroll_repeats(el):
            open(SystemInfo["VFD_scroll_repeats"], "w").write(el.value)

        choicelist = []
        for i in range(1, 11, 1):
            choicelist.append(("%d" % i))
        config.usage.vfd_scroll_repeats = ConfigSelection(default="3",
                                                          choices=choicelist)
        config.usage.vfd_scroll_repeats.addNotifier(scroll_repeats,
                                                    immediate_feedback=False)

    if SystemInfo["VFD_scroll_delay"]:

        def scroll_delay(el):
            open(SystemInfo["VFD_scroll_delay"], "w").write(el.value)

        choicelist = []
        for i in range(0, 1001, 50):
            choicelist.append(("%d" % i))
        config.usage.vfd_scroll_delay = ConfigSelection(default="150",
                                                        choices=choicelist)
        config.usage.vfd_scroll_delay.addNotifier(scroll_delay,
                                                  immediate_feedback=False)

    if SystemInfo["VFD_initial_scroll_delay"]:

        def initial_scroll_delay(el):
            open(SystemInfo["VFD_initial_scroll_delay"], "w").write(el.value)

        choicelist = []
        for i in range(0, 20001, 500):
            choicelist.append(("%d" % i))
        config.usage.vfd_initial_scroll_delay = ConfigSelection(
            default="1000", choices=choicelist)
        config.usage.vfd_initial_scroll_delay.addNotifier(
            initial_scroll_delay, immediate_feedback=False)

    if SystemInfo["VFD_final_scroll_delay"]:

        def final_scroll_delay(el):
            open(SystemInfo["VFD_final_scroll_delay"], "w").write(el.value)

        choicelist = []
        for i in range(0, 20001, 500):
            choicelist.append(("%d" % i))
        config.usage.vfd_final_scroll_delay = ConfigSelection(
            default="1000", choices=choicelist)
        config.usage.vfd_final_scroll_delay.addNotifier(
            final_scroll_delay, 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")),
        ("ukr Ukr", _("Ukrainian"))
    ]

    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)
Beispiel #20
0
config.hdmicec.tv_wakeup_detection = ConfigSelection(choices={
    "wakeup":
    _("Wakeup"),
    "tvreportphysicaladdress":
    _("TV physical address report"),
    "sourcerequest":
    _("Source request"),
    "streamrequest":
    _("Stream request"),
    "osdnamerequest":
    _("OSD name request"),
    "activity":
    _("Any activity"),
},
                                                     default="streamrequest")
config.hdmicec.fixed_physical_address = ConfigText(default="0.0.0.0")
config.hdmicec.volume_forwarding = ConfigYesNo(default=False)
config.hdmicec.control_receiver_wakeup = ConfigYesNo(default=False)
config.hdmicec.control_receiver_standby = ConfigYesNo(default=False)
config.hdmicec.handle_deepstandby_events = ConfigYesNo(default=False)
config.hdmicec.preemphasis = ConfigYesNo(default=False)
choicelist = []
for i in (10, 50, 100, 150, 250):
    choicelist.append(("%d" % i, "%d ms" % i))
config.hdmicec.minimum_send_interval = ConfigSelection(
    default="0", choices=[("0", _("Disabled"))] + choicelist)


class HdmiCec:
    instance = None
Beispiel #21
0
        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)
    if SystemInfo['12V_Output']:

        def set12VOutput(configElement):
            Misc_Options.getInstance().set_12V_output(configElement.value == 'on' and 1 or 0)

        config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)
    config.usage.keymap = ConfigText(default=eEnv.resolve('${datadir}/enigma2/keymap.xml'))
    config.usage.keytrans = ConfigText(default=eEnv.resolve('${datadir}/enigma2/keytranslation.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,
Beispiel #22
0
def InitUsageConfig():
	config.misc.useNTPminutes = ConfigSelection(default="30", choices=[("30", "30" + " " + _("minutes")), ("60", _("Hour")), ("1440", _("Once per day"))])
	if getBrandOEM() in ('vuplus'):
		config.misc.remotecontrol_text_support = ConfigYesNo(default=True)
	else:
		config.misc.remotecontrol_text_support = ConfigYesNo(default=False)

	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=True)

	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.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="3", choices=[("0", _("None")), ("1", _("Left from servicename")), ("2", _("Right from servicename")), ("3", _("Red colored"))])
	config.usage.record_indicator_mode.addNotifier(refreshServiceList)

	choicelist = [("-1", _("Disable"))]
	for i in range(0, 1300, 100):
		choicelist.append(("%d" % 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.service_icon_enable = ConfigYesNo(default=True)
	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.defaultEPGType sets the guide type for
	# the INFO button

	config.usage.defaultEPGType = ConfigSelection(default="None", choices=[])
	if config.usage.defaultEPGType.saved_value is not None:
		config.usage.defaultEPGType.setChoices([config.usage.defaultEPGType.saved_value])
		config.usage.defaultEPGType.load()

	# config.usage.defaultGuideType sets the guide type for
	# the EPG button

	config.usage.defaultGuideType = ConfigSelection(default="None", choices=[])
	if config.usage.defaultGuideType.saved_value is not None:
		config.usage.defaultGuideType.setChoices([config.usage.defaultGuideType.saved_value])
		config.usage.defaultGuideType.load()

	config.usage.panicbutton = 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, 10) + range(10, 91, 10):
		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_do_dimming = ConfigYesNo(default=True)
	config.usage.show_infobar_dimming_speed = ConfigSelectionNumber(min=1, max=40, stepwidth=1, default=40, wraparound=True)
	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 = ConfigYesNo(default=True)
	config.usage.second_infobar_timeout = ConfigSelection(default="0", choices=[("0", _("no timeout"))] + choicelist)

	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"))])
	choicelist = [("-1", _("Disabled")), ("0", _("No timeout"))]
	for i in [60, 300, 600, 900, 1800, 2700, 3600]:
		m = i / 60
		choicelist.append(("%d" % i, ngettext("%d minute", "%d minutes", m) % m))
	config.usage.pip_last_service_timeout = ConfigSelection(default="0", choices=choicelist)

	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(default=8, min=1, max=31, stepwidth=1, wraparound=True)
	config.usage.movielist_trashcan_reserve = ConfigNumber(default=40)
	config.usage.on_movie_start = ConfigSelection(default="ask yes", choices=[
		("ask yes", _("Ask user (with default as 'yes')")),
		("ask no", _("Ask user (with default as 'no')")),
		("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.leave_movieplayer_onExit = ConfigSelection(default="no", choices=[
		("no", _("No")),
		("popup", _("With popup")),
		("without popup", _("Without popup"))])
	config.usage.next_movie_msg = ConfigYesNo(default=True)
	config.usage.last_movie_played = ConfigText()

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

	config.usage.help_sortorder = ConfigSelection(default="headings+alphabetic", choices=[
		("headings+alphabetic", _("Alphabetical under headings")),
		("flat+alphabetic", _("Flat alphabetical")),
		("flat+remotepos", _("Flat by position on remote")),
		("flat+remotegroups", _("Flat by key group on remote"))])

	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="5", 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"),
		("127", "No priority")])

	config.usage.remote_fallback_enabled = ConfigYesNo(default=False)
	config.usage.remote_fallback = ConfigText(default="", fixed_size=False)

	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()))
	try:
		config.usage.frontend_priority = ConfigSelection(default="0", choices=nims)
	except:
		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=10, 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 search")),
		("number", _("Number search"))])

	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=False)

	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)

	config.usage.lcd_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.lcd_scroll_speed = ConfigSelection(default="300", choices=[
		("500", _("slow")),
		("300", _("normal")),
		("100", _("fast"))])

	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=True)
	config.usage.hide_ci_messages = ConfigYesNo(default=True)
	config.usage.show_cryptoinfo = ConfigSelection(default="0", choices=[("0", _("Off")), ("1", _("One line")), ("2", _("Two lines"))])
	config.usage.show_eit_nownext = ConfigYesNo(default=True)
	config.usage.show_vcr_scart = ConfigYesNo(default=False)
	config.usage.pic_resolution = ConfigSelection(default=None, choices=[(None, _("Same resolution as skin")), ("(720, 576)", "720x576"), ("(1280, 720)", "1280x720"), ("(1920, 1080)", "1920x1080")])

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

	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)
		if not config.epg.virgin.value:
			mask &= ~(eEPGCache.VIRGIN_NOWNEXT | eEPGCache.VIRGIN_SCHEDULE)
		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.virgin.addNotifier(EpgSettingsChanged)

	config.epg.histminutes = ConfigSelectionNumber(default=0, min=0, max=120, stepwidth=15, 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)

	if SystemInfo["12V_Output"]:
		def set12VOutput(configElement):
			Misc_Options.getInstance().set_12V_output(configElement.value == "on" and 1 or 0)
		config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

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

	config.network = ConfigSubsection()
	if SystemInfo["WakeOnLAN"]:
		def wakeOnLANChanged(configElement):
			if getBoxType() in ('et10000', 'gbquadplus', 'gbquad', 'gb800ueplus', 'gb800seplus', 'gbipbox'):
				open(SystemInfo["WakeOnLAN"], "w").write(configElement.value and "on" or "off")
			else:
				open(SystemInfo["WakeOnLAN"], "w").write(configElement.value and "enable" or "disable")
		config.network.wol = ConfigYesNo(default=False)
		config.network.wol.addNotifier(wakeOnLANChanged)
	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.check = ConfigYesNo(default=True)
	config.softwareupdate.checktimer = ConfigSelection(choices=[
		("1", "hour"),
		("2", "2 hours"),
		("3", "3 hours"),
		("4", "4 hours"),
		("6", "6 hours"),
		("8", "8 hours"),
		("12", "12 hours"),
		("24", "24 hours"),
		("48", "2 days"),
	], default="1")
	config.softwareupdate.updatefound = NoSave(ConfigBoolean(default=False))
	config.softwareupdate.updatebeta = ConfigYesNo(default=True)
	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="10", choices=choicelist)
	config.timeshift.showinfobar = ConfigYesNo(default=True)
	config.timeshift.stopwhilerecording = ConfigYesNo(default=False)
	config.timeshift.favoriteSaveAction = ConfigSelection(default="askuser", choices=[("askuser", _("Ask user")), ("savetimeshift", _("Save and stop")), ("savetimeshiftandrecord", _("Save and record")), ("noSave", _("Don't save"))])
	config.timeshift.permanentrecording = ConfigYesNo(default=False)
	config.timeshift.isRecording = NoSave(ConfigYesNo(default=False))

	config.seek = ConfigSubsection()
	config.seek.autoskip = ConfigYesNo(default=True)
	config.seek.baractivation = ConfigSelection(default="leftright", choices=[("leftright", _("Long Left/Right")), ("ffrw", _("Long << / >>"))])
	config.seek.sensibility = ConfigSelection(default="10", choices=[
		("1", _("0.1%")), ("2", _("0.2%")), ("5", _("0.5%")),
		("10", _("1%")), ("20", _("2%")), ("50", _("5%")),
		("100", _("10%"))])
	config.seek.updown_skips = ConfigYesNo(default=True)
	config.seek.selfdefined_up = ConfigSelectionNumber(default=180, min=1, max=300, stepwidth=1, wraparound=True)
	config.seek.selfdefined_down = ConfigSelectionNumber(default=60, min=1, max=300, stepwidth=1, wraparound=True)
	config.seek.selfdefined_left = ConfigSelectionNumber(default=10, min=1, max=300, stepwidth=1, wraparound=True)
	config.seek.selfdefined_right = ConfigSelectionNumber(default=10, min=1, max=300, stepwidth=1, wraparound=True)
	config.seek.number_skips = ConfigYesNo(default=False)
	config.seek.selfdefined_13 = ConfigSelectionNumber(default=30, min=1, max=300, stepwidth=1, wraparound=True)
	config.seek.selfdefined_46 = ConfigSelectionNumber(default=180, min=5, max=1800, stepwidth=5, wraparound=True)
	config.seek.selfdefined_79 = ConfigSelectionNumber(default=300, min=10, max=3600, stepwidth=10, 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"])

	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.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(default=4, min=1, max=10, stepwidth=1, wraparound=True)
	config.crash.daysloglimit = ConfigSelectionNumber(default=8, min=1, max=30, stepwidth=1, wraparound=True)
	config.crash.sizeloglimit = ConfigSelectionNumber(default=10, min=1, max=20, stepwidth=1, 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 updateEraseSpeed(el):
		eBackgroundFileEraser.getInstance().setEraseSpeed(int(el.value))

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

	config.misc.erase_speed = ConfigSelection(default="100", 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="0", choices=[
		("0", _("Disable")),
		("1", _("Internal hdd only")),
		("3", _("Everywhere"))])
	config.misc.erase_flags.addNotifier(updateEraseFlags, immediate_feedback=False)

	if SystemInfo["ZapMode"]:
		def setZapmode(el):
			file = open(SystemInfo["ZapMode"], "w")
			file.write(el.value)
			file.close()
		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.usage.historymode = ConfigSelection(default="1", choices=[("0", _("Just zap")), ("1", _("Show menu"))])

	config.subtitles = ConfigSubsection()
	config.subtitles.ttx_subtitle_colors = ConfigSelection(default="0", choices=[
		("0", _("original")),
		("1", _("white")),
		("2", _("yellow"))])
	config.subtitles.ttx_subtitle_original_position = ConfigYesNo(default=False)
	config.subtitles.subtitle_position = ConfigSelection(default="50", choices=["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100", "150", "200", "250", "300", "350", "400", "450"])
	config.subtitles.subtitle_alignment = ConfigSelection(default="center", choices=[("left", _("left")), ("center", _("center")), ("right", _("right"))])
	config.subtitles.subtitle_rewrap = ConfigYesNo(default=False)
	config.subtitles.subtitle_borderwidth = ConfigSelection(default="3", choices=["1", "2", "3", "4", "5"])
	config.subtitles.subtitle_fontsize = ConfigSelection(choices=["%d" % x for x in range(16, 101) if not x % 2], default="38")

	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="0", 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="1", choices=[
		("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 Dutch", _("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")),
		("ukr Ukr", _("Ukrainian"))]

	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=True)
	config.vixsettings.ColouredButtons = ConfigYesNo(default=False)
	config.vixsettings.InfoBarEpg_mode = ConfigSelection(default="0", 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(default="graphics", choices=[("graphics", _("Multi EPG")), ("single", _("Single EPG"))])
	if SystemInfo.get("NumVideoDecoders", 1) > 1:
		config.epgselection.infobar_preview_mode = ConfigSelection(default="1", choices=[("0", _("Disabled")), ("1", _("Full screen")), ("2", _("PiP"))])
	else:
		config.epgselection.infobar_preview_mode = ConfigSelection(default="1", choices=[("0", _("Disabled")), ("1", _("Full screen"))])
	config.epgselection.infobar_ok = ConfigSelection(default="Zap", choices=[("Zap", _("Zap")), ("Zap + Exit", _("Zap + Exit"))])
	config.epgselection.infobar_oklong = ConfigSelection(default="Zap + Exit", choices=[("Zap", _("Zap")), ("Zap + Exit", _("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(default=previewdefault, choices=[("0", _("Disabled")), ("1", _("Full screen")), ("2", _("PiP"))])
	else:
		config.epgselection.infobar_preview_mode = ConfigSelection(default="1", choices=[("0", _("Disabled")), ("1", _("Full screen"))])
	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="picon+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=200, 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(default="Zap", choices=[("Zap", _("Zap")), ("Zap + Exit", _("Zap + Exit"))])
	config.epgselection.enhanced_oklong = ConfigSelection(default="Zap + Exit", choices=[("Zap", _("Zap")), ("Zap + Exit", _("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(default="Zap", choices=[("Zap", _("Zap")), ("Zap + Exit", _("Zap + Exit"))])
	config.epgselection.multi_oklong = ConfigSelection(default="Zap + Exit", choices=[("Zap", _("Zap")), ("Zap + Exit", _("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(default="graphics", choices=[("graphics", _("Graphics")), ("text", _("Text"))])
	config.epgselection.graph_ok = ConfigSelection(default="Zap", choices=[("Zap", _("Zap")), ("Zap + Exit", _("Zap + Exit"))])
	config.epgselection.graph_oklong = ConfigSelection(default="Zap + Exit", choices=[("Zap", _("Zap")), ("Zap + Exit", _("Zap + Exit"))])
	config.epgselection.graph_info = ConfigSelection(default="Channel Info", choices=[("Channel Info", _("Channel Info")), ("Single EPG", _("Single EPG"))])
	config.epgselection.graph_infolong = ConfigSelection(default="Single EPG", choices=[("Channel Info", _("Channel Info")), ("Single EPG", _("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=20, 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/emu_scripts/'):
		os.mkdir('/usr/emu_scripts/', 0755)
	softcams = os.listdir('/usr/emu_scripts/')
	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(default=10, min=1, max=600, stepwidth=1, wraparound=True)
	SystemInfo["OScamInstalled"] = False

	config.cccaminfo = ConfigSubsection()
	config.cccaminfo.showInExtensions = ConfigYesNo(default=False)
	config.cccaminfo.serverNameLength = ConfigSelectionNumber(default=22, min=10, max=100, stepwidth=1, 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(default=5, min=1, max=10, stepwidth=1, 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.streaming.authentication = ConfigYesNo(default=False)

	config.pluginbrowser = ConfigSubsection()
	config.pluginbrowser.po = ConfigYesNo(default=False)
	config.pluginbrowser.src = ConfigYesNo(default=False)
Beispiel #23
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"))])
Beispiel #24
0
def InitUsageConfig():
	config.usage = ConfigSubsection()
	config.usage.showdish = ConfigYesNo(default = True)
	config.misc.showrotorposition = ConfigSelection(default = "no", choices = [("no", _("no")), ("yes", _("yes")), ("withtext", _("with text")), ("tunername", _("with tuner name"))])
	config.usage.multibouquet = ConfigYesNo(default = True)
	config.usage.volumestep = ConfigSelection(default = "2", choices = [("2"), ("5")])
	config.usage.alternative_number_mode = ConfigYesNo(default = False)

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

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

	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.service_icon_enable = ConfigYesNo(default = False)
	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 = [("0", _("No timeout"))]
	for i in range(1, 12):
		choicelist.append((str(i), ngettext("%d second", "%d seconds", i) % i))
	config.usage.infobar_timeout = ConfigSelection(default = "5", choices = 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"))] + choicelist + [("EPG",_("EPG"))])
	config.usage.show_simple_second_infobar = ConfigYesNo(default = True)
	config.usage.infobar_frontend_source = ConfigSelection(default = "tuner", choices = [("settings", _("Settings")), ("tuner", _("Tuner"))])
	config.usage.oldstyle_zap_controls = ConfigYesNo(default = False)
	config.usage.oldstyle_channel_select_controls = ConfigYesNo(default = False)
	config.usage.zap_with_ch_buttons = ConfigYesNo(default = True)
	config.usage.ok_is_channelselection = ConfigYesNo(default = True)
	config.usage.volume_instead_of_channelselection = ConfigYesNo(default = False)
	config.usage.channelselection_preview = ConfigYesNo(default = False)
	config.usage.show_spinner = ConfigYesNo(default = True)
	config.usage.enable_tt_caching = ConfigYesNo(default = True)
	choicelist = []
	for i in (10, 30):
		choicelist.append((str(i), ngettext("%d second", "%d seconds", i) % i))
	for i in (60, 120, 300, 600, 1200, 1800):
		m = i / 60
		choicelist.append((str(i), ngettext("%d minute", "%d minutes", m) % m))
	for i in (3600, 7200, 14400):
		h = i / 3600
		choicelist.append((str(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")) ])
	choicelist = [("-1", _("Disabled")), ("0", _("No timeout"))]
	for i in [60, 300, 600, 900, 1800, 2700, 3600]:
		m = i/60
		choicelist.append((str(i), ngettext("%d minute", "%d minutes", m) % m))
	config.usage.pip_last_service_timeout = ConfigSelection(default = "0", choices = choicelist)

	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 yes", _("Ask user") + " " + _("default") + " " + _("yes")),
		("ask no", _("Ask user") + " " + _("default") + " " + _("no")),
		("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.last_movie_played = ConfigText()
	config.usage.leave_movieplayer_onExit = ConfigSelection(default = "popup", choices = [
		("no", _("No")), ("popup", _("With popup")), ("without popup", _("Without popup")), ("movielist", _("Return to movie list")) ])

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

	config.usage.startup_to_standby = ConfigSelection(default = "no", choices = [
		("no", _("No")),
		("yes", _("Yes")),
		("except", _("No, except Wakeup timer")) ])

	config.usage.wakeup_menu = ConfigNothing()
	config.usage.wakeup_enabled = ConfigYesNo(default = False)
	config.usage.wakeup_day = ConfigSubDict()
	config.usage.wakeup_time = ConfigSubDict()
	for i in range(7):
		config.usage.wakeup_day[i] = ConfigEnableDisable(default = False)
		config.usage.wakeup_time[i] = ConfigClock(default = ((6 * 60 + 0) * 60))

	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", _("Do nothing"))]
	for i in range(3600, 21601, 3600):
		h = abs(i / 3600)
		h = ngettext("%d hour", "%d hours", h) % h
		choicelist.append((str(i), _("Standby in ") + h))
	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, 18, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_end = ConfigClock(default = time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_extra = ConfigYesNo(default = False)
	config.usage.inactivity_timer_blocktime_extra_begin = ConfigClock(default = time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_extra_end = ConfigClock(default = time.mktime((0, 0, 0, 9, 0, 0, 0, 0, 0)))

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

	choicelist = [("0", _("Disabled"))]
	for i in [60, 300, 600] + range(900, 7201, 900):
		m = abs(i / 60)
		m = ngettext("%d minute", "%d minutes", m) % m
		choicelist.append((str(i), _("after ") + m))
	config.usage.standby_to_shutdown_timer = ConfigSelection(default = "0", choices = choicelist)
	config.usage.standby_to_shutdown_timer_blocktime = ConfigYesNo(default = True)
	config.usage.standby_to_shutdown_timer_blocktime_begin = ConfigClock(default = time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
	config.usage.standby_to_shutdown_timer_blocktime_end = ConfigClock(default = time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))

	choicelist = [("0", _("Disabled"))]
	for m in (1, 5, 10, 15, 30, 60):
		choicelist.append((str(m * 60), ngettext("%d minute", "%d minutes", m) % m))
	config.usage.screen_saver = ConfigSelection(default = "300", choices = choicelist)

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

	choicelist = [("0", _("Disabled"))]
	for i in (2, 3, 4, 5, 10, 20, 30):
		choicelist.append((str(i), ngettext("%d second", "%d seconds", i) % i))
	for i in (60, 120, 300):
		m = i / 60
		choicelist.append((str(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"),
		("127", _("No priority")) ])

	config.usage.remote_fallback_enabled = ConfigYesNo(default = False)
	config.usage.remote_fallback_recording_enabled = ConfigYesNo(default = False)
	config.usage.remote_fallback = ConfigText(default = "", fixed_size = False)
	config.usage.show_timer_conflict_warning = ConfigYesNo(default = True)

	dvbs_nims = [("-2", _("Disabled"))]
	dvbt_nims = [("-2", _("Disabled"))]
	dvbc_nims = [("-2", _("Disabled"))]
	nims = [("-1", _("auto"))]
	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.usage.frontend_priority_dvbs = ConfigSelection(default = "-2", choices = list(dvbs_nims))
	dvbs_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_dvbs = ConfigSelection(default = "-2", choices = dvbs_nims)
	config.usage.frontend_priority_dvbt = ConfigSelection(default = "-2", choices = list(dvbt_nims))
	dvbt_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_dvbt = ConfigSelection(default = "-2", choices = dvbt_nims)
	config.usage.frontend_priority_dvbc = ConfigSelection(default = "-2", choices = list(dvbc_nims))
	dvbc_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_dvbc = ConfigSelection(default = "-2", choices = dvbc_nims)
	SystemInfo["DVB-S_priority_tuner_available"] = len(dvbs_nims) > 3 and (len(dvbt_nims) > 2 or len(dvbc_nims) > 2)
	SystemInfo["DVB-T_priority_tuner_available"] = len(dvbt_nims) > 3 and (len(dvbs_nims) > 2 or len(dvbc_nims) > 2)
	SystemInfo["DVB-C_priority_tuner_available"] = len(dvbc_nims) > 3 and (len(dvbs_nims) > 2 or len(dvbt_nims) > 2)

	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.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)

	config.usage.hide_zap_errors = ConfigYesNo(default = False)
	config.usage.hide_ci_messages = ConfigYesNo(default = True)
	config.usage.show_cryptoinfo = ConfigYesNo(default = True)
	config.usage.show_eit_nownext = ConfigYesNo(default = True)
	config.usage.show_vcr_scart = ConfigYesNo(default = False)
	config.usage.show_update_disclaimer = 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")])

	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)

	if SystemInfo["FanPWM"]:
		config.usage.fanspeed = ConfigSlider(default=127, increment=8, limits=(0, 255))

	if SystemInfo["StandbyLED"]:
		config.usage.standbyLED = ConfigYesNo(default = True)

	if SystemInfo["WakeOnLAN"]:
		config.usage.wakeOnLAN = 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)
	config.epg.virgin = ConfigYesNo(default = False)
	config.misc.showradiopic = ConfigYesNo(default = True)

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

	config.usage.keymap = ConfigText(default = resolveFilename(SCOPE_SKIN , "keymap.xml"))
	config.usage.keytrans = ConfigText(default = resolveFilename(SCOPE_SKIN ,"keytranslation.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.usage.timerlist_finished_timer_position = ConfigSelection(default = "end", choices = [("beginning", _("At beginning")), ("end", _("At end"))])

	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_flags = ConfigSelection(default="1", choices = [
		("0", _("Disable")),
		("1", _("Internal hdd only")),
		("3", _("Everywhere"))])

	if SystemInfo["ZapMode"]:
		config.misc.zapmode = ConfigSelection(default = "mute", choices = [
			("mute", _("Black screen")), ("hold", _("Hold screen")), ("mutetilllock", _("Black screen till locked")), ("holdtilllock", _("Hold till locked"))])

	if SystemInfo["VFD_scroll_repeats"]:
		choicelist = []
		for i in range(1, 11, 1):
			choicelist.append((str(i)))
		config.usage.vfd_scroll_repeats = ConfigSelection(default = "3", choices = choicelist)

	if SystemInfo["VFD_scroll_delay"]:
		choicelist = []
		for i in range(0, 1001, 50):
			choicelist.append((str(i)))
		config.usage.vfd_scroll_delay = ConfigSelection(default = "150", choices = choicelist)

	if SystemInfo["VFD_initial_scroll_delay"]:
		choicelist = []
		for i in range(0, 20001, 500):
			choicelist.append((str(i)))
		config.usage.vfd_initial_scroll_delay = ConfigSelection(default = "1000", choices = choicelist)

	if SystemInfo["VFD_final_scroll_delay"]:
		choicelist = []
		for i in range(0, 20001, 500):
			choicelist.append((str(i)))
		config.usage.vfd_final_scroll_delay = ConfigSelection(default = "1000", choices = choicelist)

	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.colourise_dialogs = ConfigYesNo(default = False)
	config.subtitles.subtitle_borderwidth = ConfigSelection(choices = ["1", "2", "3", "4", "5"], default = "3")
	config.subtitles.subtitle_fontsize  = ConfigSelection(choices = ["%d" % x for x in range(16,101) if not x % 2], default = "40")
	config.subtitles.showbackground = 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.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 = "1", choices = [
		("0", _("alternative")),
		("1", _("white")),
		("2", _("yellow")) ])
	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 dub DUB", _("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")),
		("ukr Ukr", _("Ukrainian"))]

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

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

	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.descramble_client = ConfigYesNo(default = False)
	config.streaming.stream_eit = ConfigYesNo(default = True)
	config.streaming.stream_ait = ConfigYesNo(default = True)
	config.streaming.authentication = ConfigYesNo(default = False)
Beispiel #25
0
 def __init__(self):
     config.hdmicec = ConfigSubsection()
     config.hdmicec.enabled = ConfigYesNo(default=False)
     config.hdmicec.logenabledserial = ConfigYesNo(default=False)
     config.hdmicec.logenabledfile = ConfigYesNo(default=False)
     config.hdmicec.tvstandby = ConfigYesNo(default=False)
     config.hdmicec.tvwakeup = ConfigYesNo(default=False)
     config.hdmicec.boxstandby = ConfigYesNo(default=False)
     config.hdmicec.enabletvrc = ConfigYesNo(default=True)
     config.hdmicec.active_source_reply = ConfigYesNo(default=True)
     config.hdmicec.standby_message = ConfigSelection(
         choices={
             "standby,inactive": _("TV standby"),
             "standby,avpwroff,inactive,": _("TV + A/V standby"),
             "inactive": _("Source inactive"),
             "nothing": _("Nothing"),
         },
         default="standby,inactive")
     config.hdmicec.deepstandby_message = ConfigSelection(
         choices={
             "standby,inactive": _("TV standby"),
             "standby,avdeeppwroff,inactive": _("TV + A/V standby"),
             "inactive": _("Source inactive"),
             "nothing": _("Nothing"),
         },
         default="standby,inactive")
     config.hdmicec.wakeup_message = ConfigSelection(
         choices={
             "wakeup,active,activevu": _("TV wakeup"),
             "wakeup,avpwron,active,activevu": _("TV + A/V wakeup"),
             "active": _("Source active"),
             "nothing": _("Nothing"),
         },
         default="wakeup,active,activevu")
     config.hdmicec.vustandby_message = ConfigSelection(choices={
         "vustandby":
         _("VU standby"),
         "vudeepstandby":
         _("VU DeepStandby"),
         "vunothing":
         _("Nothing"),
     },
                                                        default="vustandby")
     config.hdmicec.vuwakeup_message = ConfigSelection(choices={
         "vuwakeup":
         _("VU wakeup"),
         "vunothing":
         _("Nothing"),
     },
                                                       default="vuwakeup")
     config.hdmicec.tvinput = ConfigSelection(default="1",
                                              choices=[("1", _("HDMI 1")),
                                                       ("2", _("HDMI 2")),
                                                       ("3", _("HDMI 3")),
                                                       ("4", _("HDMI 4")),
                                                       ("5", _("HDMI 5"))])
     config.hdmicec.avinput = ConfigSelection(default="0",
                                              choices=[
                                                  ("0",
                                                   _("no A/V Receiver")),
                                                  ("1", _("HDMI 1")),
                                                  ("2", _("HDMI 2")),
                                                  ("3", _("HDMI 3")),
                                                  ("4", _("HDMI 4")),
                                                  ("5", _("HDMI 5"))
                                              ])
     config.hdmicec.devicename = ConfigText(default=self.getDeviceName(),
                                            visible_width=50,
                                            fixed_size=False)
     config.misc.standbyCounter.addNotifier(self.enterStandby,
                                            initial_call=False)
     config.misc.DeepStandbyOn.addNotifier(self.enterDeepStandby,
                                           initial_call=False)
     self.leaveDeepStandby()
Beispiel #26
0
def InitUsageConfig():
	config.misc.useNTPminutes = ConfigSelection(default = "30", choices = [("30", "30" + " " +_("minutes")), ("60", _("Hour")), ("1440", _("Once per day"))])
	config.usage = ConfigSubsection()
	config.usage.showdish = ConfigYesNo(default = True)
	config.misc.showrotorposition = ConfigSelection(default = "no", choices = [("no", _("no")), ("yes", _("yes")), ("withtext", _("with text")), ("tunername", _("with tuner name"))])
	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 = True)
	config.usage.hide_number_markers.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.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.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)

	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.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)

	config.usage.volume_step_slow = ConfigSelectionNumber(default = 1, stepwidth = 1, min = 1, max = 10, wraparound = False)
	config.usage.volume_step_fast = ConfigSelectionNumber(default = 3, stepwidth = 1, min = 1, max = 10, wraparound = False)

	choicelist = [("0", _("No timeout"))]
	for i in range(1, 12):
		choicelist.append((str(i), ngettext("%d second", "%d seconds", i) % i))
	config.usage.infobar_timeout = ConfigSelection(default = "5", choices = 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 = "11", choices = [(None, _("None"))] + choicelist + [("EPG",_("EPG"))])
	config.usage.infobar_frontend_source = ConfigSelection(default = "tuner", choices = [("settings", _("Settings")), ("tuner", _("Tuner"))])
	config.usage.oldstyle_zap_controls = ConfigSelection(default = "standard", choices = [
		("standard", _("Standard")),
		("neutrino", _("Neutrino")),
		("openspa", _("OpenSPA")) ])
	config.usage.oldstyle_channel_select_controls =  ConfigYesNo(default = False)
	config.usage.zap_with_ch_buttons = ConfigYesNo(default = False)
	config.usage.ok_is_channelselection = ConfigYesNo(default = False)
	config.usage.channelselection_preview = ConfigYesNo(default = False)
	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)
	choicelist = []
	for i in (10, 30):
		choicelist.append((str(i), ngettext("%d second", "%d seconds", i) % i))
	for i in (60, 120, 300, 600, 1200, 1800):
		m = i / 60
		choicelist.append((str(i), ngettext("%d minute", "%d minutes", m) % m))
	for i in (3600, 7200, 14400):
		h = i / 3600
		choicelist.append((str(i), ngettext("%d hour", "%d hours", h) % h))
	config.usage.hdd_standby = ConfigSelection(default = "300", choices = [("0", _("No standby"))] + choicelist)
	config.usage.hdd_standby_in_standby = ConfigSelection(default = "-1", choices = [("-1", _("Same as in active")), ("0", _("No standby"))] + choicelist)
	config.usage.hdd_timer = ConfigYesNo(default = False)
	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")) ])
	choicelist = [("-1", _("Disabled")), ("0", _("No timeout"))]
	for i in [60, 300, 600, 900, 1800, 2700, 3600]:
		m = i/60
		choicelist.append((str(i), ngettext("%d minute", "%d minutes", m) % m))
	config.usage.pip_last_service_timeout = ConfigSelection(default = "0", choices = choicelist)

	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.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)

	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)

	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 yes", _("Ask user") + " " + _("default") + " " + _("yes")),
		("ask no", _("Ask user") + " " + _("default") + " " + _("no")),
		("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.last_movie_played = ConfigText()
	config.usage.leave_movieplayer_onExit = ConfigSelection(default = "popup", choices = [
		("no", _("No")), ("popup", _("With popup")), ("without popup", _("Without popup")), ("movielist", _("Return to movie list")) ])

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

	config.usage.startup_to_standby = ConfigSelection(default = "no", choices = [
		("no", _("No")),
		("yes", _("Yes")),
		("except", _("No, except Wakeup timer")) ])

	config.usage.wakeup_menu = ConfigNothing()
	config.usage.wakeup_enabled = ConfigYesNo(default = False)
	config.usage.wakeup_day = ConfigSubDict()
	config.usage.wakeup_time = ConfigSubDict()
	for i in range(7):
		config.usage.wakeup_day[i] = ConfigEnableDisable(default = False)
		config.usage.wakeup_time[i] = ConfigClock(default = ((6 * 60 + 0) * 60))

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

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

	choicelist = [("0", _("Do nothing"))]
	for i in range(3600, 21601, 3600):
		h = abs(i / 3600)
		h = ngettext("%d hour", "%d hours", h) % h
		choicelist.append((str(i), _("Standby in ") + h))
	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, 18, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_end = ConfigClock(default = time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_extra = ConfigYesNo(default = False)
	config.usage.inactivity_timer_blocktime_extra_begin = ConfigClock(default = time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
	config.usage.inactivity_timer_blocktime_extra_end = ConfigClock(default = time.mktime((0, 0, 0, 9, 0, 0, 0, 0, 0)))

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

	choicelist = [("0", _("Disabled"))]
	for i in [60, 300, 600] + range(900, 7201, 900):
		m = abs(i / 60)
		m = ngettext("%d minute", "%d minutes", m) % m
		choicelist.append((str(i), _("after ") + m))
	config.usage.standby_to_shutdown_timer = ConfigSelection(default = "0", choices = choicelist)
	config.usage.standby_to_shutdown_timer_blocktime = ConfigYesNo(default = True)
	config.usage.standby_to_shutdown_timer_blocktime_begin = ConfigClock(default = time.mktime((0, 0, 0, 6, 0, 0, 0, 0, 0)))
	config.usage.standby_to_shutdown_timer_blocktime_end = ConfigClock(default = time.mktime((0, 0, 0, 23, 0, 0, 0, 0, 0)))

	choicelist = [("0", _("Disabled"))]
	for m in (1, 5, 10, 15, 30, 60):
		choicelist.append((str(m * 60), ngettext("%d minute", "%d minutes", m) % m))
	config.usage.screen_saver = ConfigSelection(default = "300", choices = choicelist)

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

	choicelist = [("0", _("Disabled"))]
	for i in (2, 3, 4, 5, 10, 20, 30):
		choicelist.append((str(i), ngettext("%d second", "%d seconds", i) % i))
	for i in (60, 120, 300):
		m = i / 60
		choicelist.append((str(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"),
		("127", _("No priority")) ])

	config.usage.remote_fallback_enabled = ConfigYesNo(default = False)
	config.usage.remote_fallback = ConfigText(default = _("http://IP-ADDRESS:8001"), fixed_size = False)
	config.usage.show_timer_conflict_warning = ConfigYesNo(default = True)

	dvbs_nims = [("-2", _("Disabled"))]
	dvbt_nims = [("-2", _("Disabled"))]
	dvbc_nims = [("-2", _("Disabled"))]
	nims = [("-1", _("auto"))]
	for x in nimmanager.nim_slots:
		if x.isCompatible("DVB-S"):
			dvbs_nims.append((str(x.slot), x.getSlotName()))
		elif x.isCompatible("DVB-T"):
			dvbt_nims.append((str(x.slot), x.getSlotName()))
		elif x.isCompatible("DVB-C"):
			dvbc_nims.append((str(x.slot), x.getSlotName()))
		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.usage.frontend_priority_dvbs = ConfigSelection(default = "-2", choices = list(dvbs_nims))
	dvbs_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_dvbs = ConfigSelection(default = "-2", choices = dvbs_nims)
	config.usage.frontend_priority_dvbt = ConfigSelection(default = "-2", choices = list(dvbt_nims))
	dvbt_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_dvbt = ConfigSelection(default = "-2", choices = dvbt_nims)
	config.usage.frontend_priority_dvbc = ConfigSelection(default = "-2", choices = list(dvbc_nims))
	dvbc_nims.insert(1,("-1", _("auto")))
	config.usage.recording_frontend_priority_dvbc = ConfigSelection(default = "-2", choices = dvbc_nims)
	SystemInfo["DVB-S_priority_tuner_available"] = len(dvbs_nims) > 3 and (len(dvbt_nims) > 2 or len(dvbc_nims) > 2)
	SystemInfo["DVB-T_priority_tuner_available"] = len(dvbt_nims) > 3 and (len(dvbs_nims) > 2 or len(dvbc_nims) > 2)
	SystemInfo["DVB-C_priority_tuner_available"] = len(dvbc_nims) > 3 and (len(dvbs_nims) > 2 or len(dvbt_nims) > 2)
 
	config.misc.disable_background_scan = ConfigYesNo(default = False)

	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 = 14, stepwidth = 1, min = 8, max = 20, wraparound = True)

	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.blinking_rec_symbol_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)

	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)
	config.usage.lcd_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.lcd_scroll_speed = ConfigSelection(default = "300", choices = [
		("500", _("slow")),
		("300", _("normal")),
		("100", _("fast"))])

	config.usage.maxchannelnumlen = ConfigSelection(default = "5", choices = [("4", _("4")), ("5", _("5"))])
	config.usage.numzaptimeoutmode = ConfigSelection(default = "standard", choices = [("standard", _("Standard")), ("userdefined", _("User defined")), ("off", _("off"))])
	config.usage.numzaptimeout1 = ConfigSlider(default = 3000, increment = 250, limits = (750, 5000))
	config.usage.numzaptimeout2 = ConfigSlider(default = 1000, increment = 250, limits = (750, 5000))

	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 = True)
	config.usage.show_cryptoinfo = ConfigYesNo(default = True)
	config.usage.show_eit_nownext = ConfigYesNo(default = True)
	config.usage.show_vcr_scart = ConfigYesNo(default = False)
	config.usage.show_update_disclaimer = 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")])

	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):
			open(SystemInfo["Fan"], "w").write(configElement.value)
		config.usage.fan.addNotifier(fanChanged)

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

	if SystemInfo["StandbyLED"]:
		def standbyLEDChanged(configElement):
			open(SystemInfo["StandbyLED"], "w").write(configElement.value and "on" or "off")
		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 = True)
	config.epg.freesat = ConfigYesNo(default = True)
	config.epg.viasat = ConfigYesNo(default = True)
	config.epg.netmed = ConfigYesNo(default = True)
	config.epg.virgin = ConfigYesNo(default = False)
	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)
		if not config.epg.virgin.value:
			mask &= ~(eEPGCache.VIRGIN_NOWNEXT | eEPGCache.VIRGIN_SCHEDULE)
		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.virgin.addNotifier(EpgSettingsChanged)

	config.epg.maxdays = ConfigSelectionNumber(min = 1, max = 28, stepwidth = 1, default = 5, wraparound = True)
	def EpgmaxdaysChanged(configElement):
		from enigma import eEPGCache
		eEPGCache.getInstance().setEpgmaxdays(config.epg.maxdays.getValue())
	config.epg.maxdays.addNotifier(EpgmaxdaysChanged)

	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)

	if SystemInfo["12V_Output"]:
		def set12VOutput(configElement):
			Misc_Options.getInstance().set_12V_output(configElement.value == "on" and 1 or 0)
		config.usage.output_12V.addNotifier(set12VOutput, immediate_feedback=False)

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

	config.network = ConfigSubsection()
	if SystemInfo["WakeOnLAN"]:
		def wakeOnLANChanged(configElement):
			if getBoxType() in ('et7000', 'et7500', 'gbx1', 'gbx3', 'et10000', 'gbquadplus', 'gbquad', 'gb800ueplus', 'gb800seplus', 'gbultraue', 'gbultrase', 'gbipbox', 'quadbox2400', 'mutant2400', 'et7x00', 'et8500', 'et8500s'):
				open(SystemInfo["WakeOnLAN"], "w").write(configElement.value and "on" or "off")
			else:
				open(SystemInfo["WakeOnLAN"], "w").write(configElement.value and "enable" or "disable")	
		config.network.wol = ConfigYesNo(default = False)
		config.network.wol.addNotifier(wakeOnLANChanged)

	config.network.Inadyn_autostart = ConfigYesNo(default = False)
	config.network.OpenVPN_autostart = ConfigYesNo(default = False)

	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)

	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)
	if not os.path.exists("/home"):
		os.mkdir("/home",0755)
	if not os.path.exists("/home/root"):
		os.mkdir("/home/root",0755)

	def updatedebug_path(configElement):
		if not os.path.exists(config.crash.debug_path.value):
			try:
				os.mkdir(config.crash.debug_path.value,0755)
			except:
				print "Failed to create log path: %s" % config.crash.debug_path.value
	config.crash.debug_path.addNotifier(updatedebug_path, immediate_feedback = False)

	crashlogheader = "We are really sorry. Your receiver encountered " \
					 "a software problem, and needs to be restarted.\n" \
					 "Please send the logfile %senigma2_crash_xxxxxx.log to http://openspa.info.\n" \
					 "Your receiver restarts in 10 seconds!\n" \
					 "Component: enigma2" % config.crash.debug_path.value
	config.crash.debug_text = ConfigText(default=_(crashlogheader), fixed_size=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)

	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)

	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.colourise_dialogs = ConfigYesNo(default = False)
	config.subtitles.subtitle_borderwidth = ConfigSelection(choices = ["1", "2", "3", "4", "5"], default = "3")
	config.subtitles.subtitle_fontsize  = ConfigSelection(choices = ["%d" % x for x in range(16,101) if not x % 2], default = "40")
	config.subtitles.showbackground = 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.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 = "1", choices = [
		("0", _("alternative")),
		("1", _("white")),
		("2", _("yellow")) ])
	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"))]

	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.descramble_client = ConfigYesNo(default = False)
	config.streaming.stream_eit = ConfigYesNo(default = True)
	config.streaming.stream_ait = ConfigYesNo(default = True)
	config.streaming.authentication = ConfigYesNo(default = False)

	#config.osd = ConfigSubsection()
	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.osd.alpha_teletext = ConfigSelectionNumber(default = 255, stepwidth = 1, min = 0, max = 255, wraparound = False)
	config.osd.alpha_webbrowser = 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)
	choiceoptions = [("mode1", _("Mode 1")), ("mode2", _("Mode 2"))]
	config.osd.threeDsetmode = ConfigSelection(default = 'mode1' , choices = choiceoptions )
Beispiel #27
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