コード例 #1
0
    def prepare(self):
        self.activityTimer.stop()

        self.provider_delete = ConfigYesNo(default=False)
        self.provider_enabled = ConfigYesNo(default=False)
        self.provider_enabled.value = self.provider.enabled
        self.provider_name = ConfigText(default='',
                                        fixed_size=False,
                                        visible_width=20)
        self.provider_name.value = self.provider.name if self.provider.name != 'New' else ''
        self.provider_settings_level = ConfigSelection(
            default='simple', choices=['simple', 'expert'])
        self.provider_settings_level.value = self.provider.settings_level
        self.provider_m3u_url = ConfigText(default='',
                                           fixed_size=False,
                                           visible_width=20)
        self.provider_m3u_url.value = self.provider.m3u_url
        self.provider_epg_url = ConfigText(default='',
                                           fixed_size=False,
                                           visible_width=20)
        self.provider_epg_url.value = self.provider.epg_url
        self.provider_username = ConfigText(default='', fixed_size=False)
        self.provider_username.value = self.provider.username
        self.provider_password = ConfigPassword(default='', fixed_size=False)
        self.provider_password.value = self.provider.password
        self.provider_multi_vod = ConfigEnableDisable(default=False)
        self.provider_multi_vod.value = self.provider.multi_vod
        self.provider_picons = ConfigYesNo(default=False)
        self.provider_picons.value = self.provider.picons
        self.provider_bouquet_pos = ConfigSelection(default='bottom',
                                                    choices=['bottom', 'top'])
        if self.provider.bouquet_top:
            self.provider_bouquet_pos.value = 'top'
        self.provider_all_bouquet = ConfigYesNo(default=False)
        self.provider_all_bouquet.value = self.provider.all_bouquet
        self.provider_iptv_types = ConfigEnableDisable(default=False)
        self.provider_iptv_types.value = self.provider.iptv_types
        self.provider_streamtype_tv = ConfigSelection(
            default='', choices=[' ', '1', '4097', '5001', '5002'])
        self.provider_streamtype_tv.value = self.provider.streamtype_tv
        self.provider_streamtype_vod = ConfigSelection(
            default='', choices=[' ', '4097', '5001', '5002'])
        self.provider_streamtype_vod.value = self.provider.streamtype_vod
        # n.b. first option in stream type choice lists is an intentional single space
        self.provider_sref_override = ConfigEnableDisable(default=False)
        self.provider_sref_override.value = self.provider.sref_override
        self.provider_bouquet_download = ConfigEnableDisable(default=False)
        self.provider_bouquet_download.value = self.provider.bouquet_download

        self.create_setup()
        self['pleasewait'].hide()
        self['actions'].setEnabled(True)
コード例 #2
0
    def new(self):
        l = config.plugins.simpleRSS.feed
        s = ConfigSubsection()
        s.uri = ConfigText(default="http://", fixed_size=False)
        s.autoupdate = ConfigEnableDisable(default=True)
        id = len(l)
        l.append(s)

        self.session.openWithCallback(self.conditionalNew, RSSFeedEdit, id)
コード例 #3
0
	def createConfig(self):
		self.sharenameEntry = None
		self.mounttypeEntry = None
		self.activeEntry = None
		self.ipEntry = None
		self.sharedirEntry = None
		self.optionsEntry = None
		self.usernameEntry = None
		self.passwordEntry = None
		self.hdd_replacementEntry = None
		self.sharetypelist = [("nfs", _("NFS share")), ("cifs", _("CIFS share"))]

		mounttype = self.mountinfo.get('mounttype')
		if not mounttype:
			mounttype = "nfs"
		active = self.mountinfo.get('active', 'True') == 'True'
		if self.mountinfo.has_key('ip'):
			if self.mountinfo['ip'] is False:
				ip = [192, 168, 0, 0]
			else:
				ip = self.convertIP(self.mountinfo['ip'])
		else:
			ip = [192, 168, 0, 0]
		sharename = self.mountinfo.get('sharename', "Sharename")
		sharedir = self.mountinfo.get('sharedir', "/media/hdd")
		username = self.mountinfo.get('username', "")
		password = self.mountinfo.get('password', "")
		hdd_replacement = self.mountinfo.get('hdd_replacement', False)
		if hdd_replacement == 'True':
			hdd_replacement = True
		else:
			hdd_replacement = False
		if sharename is False:
			sharename = "Sharename"
		if sharedir is False:
			sharedir = "/media/hdd"
		if mounttype == "nfs":
			defaultOptions = "rw,nolock,soft"
		else:
			defaultOptions = "rw"
		if username is False:
			username = ""
		if password is False:
			password = ""
		options = self.mountinfo.get('options', defaultOptions)

		self.activeConfigEntry = NoSave(ConfigEnableDisable(default = active))
		self.ipConfigEntry = NoSave(ConfigIP(default = ip))
		self.sharenameConfigEntry = NoSave(ConfigText(default = sharename, visible_width = 50, fixed_size = False))
		self.sharedirConfigEntry = NoSave(ConfigText(default = sharedir, visible_width = 50, fixed_size = False))
		self.optionsConfigEntry = NoSave(ConfigText(default = defaultOptions, visible_width = 50, fixed_size = False))
		if options is not False:
			self.optionsConfigEntry.value = options
		self.usernameConfigEntry = NoSave(ConfigText(default = username, visible_width = 50, fixed_size = False))
		self.passwordConfigEntry = NoSave(ConfigPassword(default = password, visible_width = 50, fixed_size = False))
		self.mounttypeConfigEntry = NoSave(ConfigSelection(self.sharetypelist, default = mounttype ))
		self.hdd_replacementConfigEntry = NoSave(ConfigYesNo(default = hdd_replacement))
コード例 #4
0
    def __init__(self, session, params=None):
        debug("[EmailConfigAccount] __init__")
        self._session = session
        Screen.__init__(self, session)
        self.setTitle(_("Account Setup"))
        self.list = []
        ConfigListScreen.__init__(self, self.list, session=session)
        self["buttonred"] = Label(_("cancel"))
        self["buttongreen"] = Label(_("ok"))
        self["setupActions"] = ActionMap(
            ["SetupActions"], {
                "green": self.save,
                "red": self.cancel,
                "save": self.save,
                "cancel": self.cancel,
                "ok": self.save,
            }, -2)

        if params:
            (self._name, self._server, self._port, self._user, self._password,
             self._interval, self._maxmail, self._listall) = params
        else:
            (self._name, self._server, self._port, self._user, self._password,
             self._interval, self._maxmail,
             self._listall) = ("", "", "993", "", "", "60", "50", False)
        self._cName = ConfigText(self._name, fixed_size=False)
        self._cServer = ConfigText(self._server, fixed_size=False)
        self._cPort = ConfigSelection(choices=[("143", "143"),
                                               ("993", "993 (SSL)")],
                                      default=self._port)
        self._cUser = ConfigText(self._user, fixed_size=False)
        self._cPassword = ConfigPassword(self._password, fixed_size=False)
        self._cInterval = ConfigText(self._interval, fixed_size=False)
        self._cInterval.setUseableChars('0123456789,')
        self._cMaxmail = ConfigText(self._maxmail, fixed_size=False)
        self._cMaxmail.setUseableChars('0123456789,')
        self._cListall = ConfigEnableDisable(self._listall)

        self.list = [
            getConfigListEntry(_("account name"), self._cName),
            getConfigListEntry(_("IMAP Server"), self._cServer),
            getConfigListEntry(_("IMAP Port"), self._cPort),
            getConfigListEntry(_("user name"), self._cUser),
            getConfigListEntry(_("password"), self._cPassword),
            getConfigListEntry(_("mail check interval (minutes)"),
                               self._cInterval),
            getConfigListEntry(_("maximum mail size to fetch"),
                               self._cMaxmail),
            getConfigListEntry(_("list all mailboxes"), self._cListall)
        ]
        self["config"].list = self.list
        self["config"].l.setList(self.list)
コード例 #5
0
def addFeed(address, auto=False):
    l = config.plugins.simpleRSS.feed

    # Create new Item
    s = ConfigSubsection()
    s.uri = ConfigText(default="http://", fixed_size=False)
    s.autoupdate = ConfigEnableDisable(default=True)

    # Set values
    s.uri.value = address
    s.autoupdate.value = auto

    # Save
    l.append(s)
    l.save()
コード例 #6
0
	def __init__(self, session, filterset, excludes, includes):
		Screen.__init__(self, session)

		# Summary
		self.setup_title = _("AutoTimer Filters")
		self.onChangedEntry = []

		self.typeSelection = NoSave(ConfigSelection(choices = [
			("title", _("in Title")),
			("short", _("in Shortdescription")),
			("desc", _("in Description")),
			("day", _("on Weekday"))]
		))
		self.typeSelection.addNotifier(self.refresh, initial_call = False)

		self.enabled = NoSave(ConfigEnableDisable(default = filterset))

		self.excludes = excludes
		self.includes = includes

		self.reloadList()

		ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changed)

		# Initialize Buttons
		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("Save"))
		self["key_yellow"] = StaticText(_("delete"))
		self["key_blue"] = StaticText(_("New"))

		# Define Actions
		self["actions"] = ActionMap(["SetupActions", "ColorActions"],
			{
				"cancel": self.cancel,
				"save": self.save,
				"ok": self.ok,
				"yellow": self.remove,
				"blue": self.new
			}, -2
		)

		# Trigger change
		self.changed()

		self.onLayoutFinish.append(self.setCustomTitle)
コード例 #7
0
	def __init__(self, session, servicerestriction, servicelist, bouquetlist):
		Screen.__init__(self, session)

		# Summary
		self.setup_title = _("AutoTimer Services")
		self.onChangedEntry = []

		self.services = (
			servicelist[:],
			bouquetlist[:]
		)

		self.enabled = NoSave(ConfigEnableDisable(default = servicerestriction))
		self.typeSelection = NoSave(ConfigSelection(choices = [
			("channels", _("Channels")),
			("bouquets", _("Bouquets"))]
		))
		self.typeSelection.addNotifier(self.refresh, initial_call = False)

		self.reloadList()

		ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changed)

		# Initialize Buttons
		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("OK"))
		self["key_yellow"] = StaticText(_("Delete"))
		self["key_blue"] = StaticText(_("New"))

		# Define Actions
		self["actions"] = ActionMap(["SetupActions", "ColorActions"],
			{
				"cancel": self.cancel,
				"save": self.save,
				"yellow": self.remove,
				"blue": self.new
			}
		)

		# Trigger change
		self.changed()

		self.onLayoutFinish.append(self.setCustomTitle)
コード例 #8
0
ファイル: anzeige.py プロジェクト: fs-plugins/wiffi2e2
    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = "wiffi_Setup"
        HelpableScreen.__init__(self)
        titel1 = "wiffi2e2FS " + _("Settings")
        #self.wiffi_ip=str(conf["wiffi_ip"])
        self.wiffi_ip = NoSave(
            ConfigText(default=str(wiffi_conf["wiffi_ip"]), fixed_size=False))
        self.debug = NoSave(ConfigEnableDisable(default=wiffi_conf["debug"]))
        self["key_red"] = Label(_("Cancel"))
        self["balken"] = Label(
            _("Press OK") + ", " + _("Select with left / right") + " " +
            _("main") + ", " + _("Infoline") + ", " +
            _("Default for full screen and diashow") + ", " + _("Thumbnails"))
        self["key_green"] = Label(_("Save"))
        self["key_yellow"] = Label("")
        self["key_blue"] = Label("")
        self["pic_red"] = Pixmap()
        self["pic_green"] = Pixmap()
        self["pic_yellow"] = Pixmap()
        self["pic_blue"] = Pixmap()
        self["bgr2"] = Pixmap()
        self.onChangedEntry = []
        self.session = session

        self["pcfsKeyActions"] = HelpableActionMap(
            self, "pcfsKeyActions", {
                "green": (self.save, _("Save")),
                "red": (self.keyCancel, _("Cancel")),
                "ok": (self.ok_button, _("edit if possible")),
                "cancel": (self.keyCancel, _("Cancel and close")),
            }, -2)
        self.refresh()
        self.setTitle(titel1)
        ConfigListScreen.__init__(
            self, self.liste,
            on_change=self.reloadList)  # on_change = self.changedEntry)
コード例 #9
0
 ConfigEnableDisable, ConfigNumber, ConfigText, ConfigSelection, \
 ConfigYesNo, ConfigPassword

from Components.PluginComponent import plugins

# Initialize Configuration
config.plugins.simpleRSS = ConfigSubsection()
simpleRSS = config.plugins.simpleRSS
simpleRSS.update_notification = ConfigSelection(choices=[
    ("notification", _("Notification")), ("preview", _("Preview")),
    ("ticker", _("Ticker")), ("none", _("none"))
],
                                                default="preview")
simpleRSS.interval = ConfigNumber(default=15)
simpleRSS.feedcount = ConfigNumber(default=0)
simpleRSS.autostart = ConfigEnableDisable(default=False)
simpleRSS.keep_running = ConfigEnableDisable(default=True)
simpleRSS.feed = ConfigSubList()
i = 0
while i < simpleRSS.feedcount.value:
    s = ConfigSubsection()
    s.uri = ConfigText(default="http://", fixed_size=False)
    s.autoupdate = ConfigEnableDisable(default=True)
    simpleRSS.feed.append(s)
    i += 1
    del s
simpleRSS.enable_google_reader = ConfigYesNo(default=False)
simpleRSS.google_username = ConfigText(default="", fixed_size=False)
simpleRSS.google_password = ConfigPassword(default="")

del simpleRSS, i
コード例 #10
0
ファイル: ui.py プロジェクト: carlo0815/openNFR-gui2
    def __init__(self, session, args=0):
        self.session = session
        self.setup_title = _("AutoBackup Configuration")
        config.plugins.configurationbackup = ConfigSubsection()
        config.plugins.configurationbackup.enabled = ConfigEnableDisable(
            default=False)
        config.plugins.configurationbackup.maxbackup = ConfigInteger(
            default=99, limits=(0, 99))
        config.plugins.configurationbackup.backuplocation = ConfigText(
            default='/media/hdd/', visible_width=50, fixed_size=False)
        config.plugins.configurationbackup.wakeup = ConfigClock(
            default=((3 * 60) + 0) * 60)  # 3:00
        config.plugins.configurationbackup.backupdirs = ConfigLocations(
            default=[
                eEnv.resolve(
                    '${sysconfdir}/enigma2/'), '/etc/network/interfaces',
                '/etc/wpa_supplicant.conf', '/etc/wpa_supplicant.ath0.conf',
                '/etc/wpa_supplicant.wlan0.conf', '/etc/resolv.conf',
                '/etc/default_gw', '/etc/hostname'
            ])

        Screen.__init__(self, session)
        cfg = config.plugins.configurationbackup
        choices = getLocationChoices()
        self.setTitle(_("AutoBackup Configuration"))
        if choices:
            currentwhere = cfg.backuplocation.value
            defaultchoice = choices[0][0]
            for k, v in choices:
                if k == currentwhere:
                    defaultchoice = k
                    break
        else:
            defaultchoice = ""
            choices = [("", _("Nowhere"))]
        self.cfgwhere = ConfigSelection(default=defaultchoice, choices=choices)
        configList = [
            getConfigListEntry(_("Backup location"), self.cfgwhere),
            getConfigListEntry(_("Daily automatic backup"),
                               config.plugins.configurationbackup.enabled),
            getConfigListEntry(_("Automatic start time"),
                               config.plugins.configurationbackup.wakeup),
            getConfigListEntry(_("Max. saved backup"),
                               config.plugins.configurationbackup.maxbackup),
        ]
        ConfigListScreen.__init__(self,
                                  configList,
                                  session=session,
                                  on_change=self.changedEntry)
        self["key_red"] = Button(_("Cancel"))
        self["key_green"] = Button(_("Ok"))
        self["key_blue"] = Button("")
        self["statusbar"] = Label()
        self["status"] = Label()
        self["setupActions"] = ActionMap(
            ["SetupActions", "ColorActions", "MenuActions"], {
                "red": self.cancel,
                "green": self.save,
                "blue": self.disable,
                "save": self.save,
                "cancel": self.cancel,
                "ok": self.save,
            }, -2)
        self.onChangedEntry = []
        self.data = ''
        self.container = enigma.eConsoleAppContainer()
        self.container.appClosed.append(self.appClosed)
        self.container.dataAvail.append(self.dataAvail)
        self.cfgwhere.addNotifier(self.changedWhere)
        self.onClose.append(self.__onClose)
コード例 #11
0
ファイル: AVSwitch.py プロジェクト: builder07/enigma2_python3
def InitAVSwitch():
    config.av = ConfigSubsection()
    if model == "vuduo" or getBoxBrand() == "ixuss":
        config.av.yuvenabled = ConfigBoolean(default=False)
    else:
        config.av.yuvenabled = ConfigBoolean(default=True)
    colorformat_choices = {"cvbs": _("CVBS")}

    # when YUV, Scart or S-Video is not support by HW, don't let the user select it
    if SystemInfo["HasYPbPr"]:
        colorformat_choices["yuv"] = _("YPbPr")
    if SystemInfo["HasScart"]:
        colorformat_choices["rgb"] = _("RGB")

    config.av.colorformat = ConfigSelection(choices=colorformat_choices,
                                            default="cvbs")
    config.av.aspectratio = ConfigSelection(choices={
        "4_3_letterbox":
        _("4:3 Letterbox"),
        "4_3_panscan":
        _("4:3 PanScan"),
        "16_9":
        _("16:9"),
        "16_9_always":
        _("16:9 always"),
        "16_10_letterbox":
        _("16:10 Letterbox"),
        "16_10_panscan":
        _("16:10 PanScan"),
        "16_9_letterbox":
        _("16:9 Letterbox")
    },
                                            default="16_9")
    config.av.aspect = ConfigSelection(choices={
        "4_3": _("4:3"),
        "16_9": _("16:9"),
        "16_10": _("16:10"),
        "auto": _("Automatic")
    },
                                       default="auto")
    policy2_choices = {
        # TRANSLATORS: (aspect ratio policy: black bars on top/bottom) in doubt, keep english term.
        "letterbox": _("Letterbox"),
        # TRANSLATORS: (aspect ratio policy: cropped content on left/right) in doubt, keep english term
        "panscan": _("Pan&scan"),
        # TRANSLATORS: (aspect ratio policy: scale as close to fullscreen as possible)
        "scale": _("Just scale")
    }
    try:
        if "full" in open("/proc/stb/video/policy2_choices").read():
            # TRANSLATORS: (aspect ratio policy: display as fullscreen, even if the content aspect ratio does not match the screen ratio)
            policy2_choices.update({"full": _("Full screen")})
    except:
        pass
    try:
        if "auto" in open("/proc/stb/video/policy2_choices").read():
            # TRANSLATORS: (aspect ratio policy: automatically select the best aspect ratio mode)
            policy2_choices.update({"auto": _("Auto")})
    except:
        pass
    config.av.policy_169 = ConfigSelection(choices=policy2_choices,
                                           default="scale")
    policy_choices = {
        # TRANSLATORS: (aspect ratio policy: black bars on left/right) in doubt, keep english term.
        "pillarbox": _("Pillarbox"),
        # TRANSLATORS: (aspect ratio policy: cropped content on left/right) in doubt, keep english term
        "panscan": _("Pan&scan"),
        # TRANSLATORS: (aspect ratio policy: scale as close to fullscreen as possible)
        "scale": _("Just scale")
    }
    try:
        if "nonlinear" in open("/proc/stb/video/policy_choices").read():
            # TRANSLATORS: (aspect ratio policy: display as fullscreen, with stretching the left/right)
            policy_choices.update({"nonlinear": _("Nonlinear")})
    except:
        pass
    try:
        if "full" in open("/proc/stb/video/policy_choices").read():
            # TRANSLATORS: (aspect ratio policy: display as fullscreen, even if the content aspect ratio does not match the screen ratio)
            policy_choices.update({"full": _("Full screen")})
    except:
        pass
    try:
        if "auto" in open("/proc/stb/video/policy_choices").read():
            # TRANSLATORS: (aspect ratio policy: automatically select the best aspect ratio mode)
            policy_choices.update({"auto": _("Auto")})
    except:
        pass
    config.av.policy_43 = ConfigSelection(choices=policy_choices,
                                          default="scale")
    config.av.tvsystem = ConfigSelection(choices={
        "pal": _("PAL"),
        "ntsc": _("NTSC"),
        "multinorm": _("multinorm")
    },
                                         default="pal")
    config.av.wss = ConfigEnableDisable(default=True)
    config.av.generalAC3delay = ConfigSelectionNumber(-1000,
                                                      1000,
                                                      5,
                                                      default=0)
    config.av.generalPCMdelay = ConfigSelectionNumber(-1000,
                                                      1000,
                                                      5,
                                                      default=0)
    config.av.vcrswitch = ConfigEnableDisable(default=False)

    iAVSwitch = AVSwitch()

    def setColorFormat(configElement):
        if model == "et6x00":
            map = {"cvbs": 3, "rgb": 3, "svideo": 2, "yuv": 3}
        elif platform == "gb7356" or model.startswith('et'):
            map = {"cvbs": 0, "rgb": 3, "svideo": 2, "yuv": 3}
        else:
            map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3}
        iAVSwitch.setColorFormat(map[configElement.value])

    def setAspectRatio(configElement):
        map = {
            "4_3_letterbox": 0,
            "4_3_panscan": 1,
            "16_9": 2,
            "16_9_always": 3,
            "16_10_letterbox": 4,
            "16_10_panscan": 5,
            "16_9_letterbox": 6
        }
        iAVSwitch.setAspectRatio(map[configElement.value])

    def setSystem(configElement):
        map = {"pal": 0, "ntsc": 1, "multinorm": 2}
        iAVSwitch.setSystem(map[configElement.value])

    def setWSS(configElement):
        iAVSwitch.setAspectWSS()

    # this will call the "setup-val" initial
    config.av.colorformat.addNotifier(setColorFormat)
    config.av.aspectratio.addNotifier(setAspectRatio)
    config.av.tvsystem.addNotifier(setSystem)
    config.av.wss.addNotifier(setWSS)

    iAVSwitch.setInput("ENCODER")  # init on startup
    if platform == "gb7356" or model in (
            "et5x00", "et6x00", "ixussone", "ixusszero", "axodin", "axase3",
            "optimussos1", "optimussos2", "gb800seplus", "gb800ueplus",
            "gbultrase", "gbultraue", "gbultraueh", "twinboxlcd"):
        detected = False
    else:
        detected = eAVSwitch.getInstance().haveScartSwitch()

    SystemInfo["ScartSwitch"] = detected

    if SystemInfo["CanDownmixAC3"]:

        def setAC3Downmix(configElement):
            if SystemInfo["DreamBoxAudio"]:
                open("/proc/stb/audio/ac3", "w").write(configElement.value)
            else:
                open("/proc/stb/audio/ac3",
                     "w").write(configElement.value and "downmix"
                                or "passthrough")

        if SystemInfo["DreamBoxAudio"]:
            choice_list = [("downmix", _("Downmix")),
                           ("passthrough", _("Passthrough")),
                           ("multichannel", _("convert to multi-channel PCM")),
                           ("hdmi_best", _("use best / controlled by HDMI"))]
            config.av.downmix_ac3 = ConfigSelection(choices=choice_list,
                                                    default="downmix")
        else:
            config.av.downmix_ac3 = ConfigYesNo(default=True)
        config.av.downmix_ac3.addNotifier(setAC3Downmix)

    if SystemInfo["CanAC3plusTranscode"]:

        def setAC3plusTranscode(configElement):
            open("/proc/stb/audio/ac3plus", "w").write(configElement.value)

        if SystemInfo["DreamBoxAudio"]:
            choice_list = [("use_hdmi_caps", _("controlled by HDMI")),
                           ("force_ac3", _("convert to AC3")),
                           ("multichannel", _("convert to multi-channel PCM")),
                           ("hdmi_best", _("use best / controlled by HDMI")),
                           ("force_ddp", _("force AC3plus"))]
            config.av.transcodeac3plus = ConfigSelection(choices=choice_list,
                                                         default="force_ac3")
        elif platform in ("gb7252", "gb72604"):
            choice_list = [("downmix", _("Downmix")),
                           ("passthrough", _("Passthrough")),
                           ("force_ac3", _("convert to AC3")),
                           ("multichannel", _("convert to multi-channel PCM")),
                           ("force_dts", _("convert to DTS"))]
            config.av.transcodeac3plus = ConfigSelection(choices=choice_list,
                                                         default="force_ac3")
        else:
            choice_list = [("use_hdmi_caps", _("controlled by HDMI")),
                           ("force_ac3", _("convert to AC3"))]
            config.av.transcodeac3plus = ConfigSelection(choices=choice_list,
                                                         default="force_ac3")
        config.av.transcodeac3plus.addNotifier(setAC3plusTranscode)

    if SystemInfo["CanDownmixDTS"]:

        def setDTSDownmix(configElement):
            open("/proc/stb/audio/dts",
                 "w").write(configElement.value and "downmix" or "passthrough")

        config.av.downmix_dts = ConfigYesNo(default=True)
        config.av.downmix_dts.addNotifier(setDTSDownmix)

    if SystemInfo["CanDTSHD"]:

        def setDTSHD(configElement):
            open("/proc/stb/audio/dtshd", "w").write(configElement.value)

        if model in ("dm7080", "dm820"):
            choice_list = [("use_hdmi_caps", _("controlled by HDMI")),
                           ("force_dts", _("convert to DTS"))]
            config.av.dtshd = ConfigSelection(choices=choice_list,
                                              default="use_hdmi_caps")
        else:
            choice_list = [("downmix", _("Downmix")),
                           ("force_dts", _("convert to DTS")),
                           ("use_hdmi_caps", _("controlled by HDMI")),
                           ("multichannel", _("convert to multi-channel PCM")),
                           ("hdmi_best", _("use best / controlled by HDMI"))]
            config.av.dtshd = ConfigSelection(choices=choice_list,
                                              default="downmix")
        config.av.dtshd.addNotifier(setDTSHD)

    if SystemInfo["CanWMAPRO"]:

        def setWMAPRO(configElement):
            open("/proc/stb/audio/wmapro", "w").write(configElement.value)

        choice_list = [("downmix", _("Downmix")),
                       ("passthrough", _("Passthrough")),
                       ("multichannel", _("convert to multi-channel PCM")),
                       ("hdmi_best", _("use best / controlled by HDMI"))]
        config.av.wmapro = ConfigSelection(choices=choice_list,
                                           default="downmix")
        config.av.wmapro.addNotifier(setWMAPRO)

    if SystemInfo["CanDownmixAAC"]:

        def setAACDownmix(configElement):
            if SystemInfo["DreamBoxAudio"] or platform in ("gb7252",
                                                           "gb72604"):
                open("/proc/stb/audio/aac", "w").write(configElement.value)
            else:
                open("/proc/stb/audio/aac",
                     "w").write(configElement.value and "downmix"
                                or "passthrough")

        if SystemInfo["DreamBoxAudio"]:
            choice_list = [("downmix", _("Downmix")),
                           ("passthrough", _("Passthrough")),
                           ("multichannel", _("convert to multi-channel PCM")),
                           ("hdmi_best", _("use best / controlled by HDMI"))]
            config.av.downmix_aac = ConfigSelection(choices=choice_list,
                                                    default="downmix")
        elif platform in ("gb7252", "gb72604"):
            choice_list = [("downmix", _("Downmix")),
                           ("passthrough", _("Passthrough")),
                           ("multichannel", _("convert to multi-channel PCM")),
                           ("force_ac3", _("convert to AC3")),
                           ("force_dts", _("convert to DTS")),
                           ("use_hdmi_cacenter", _("use_hdmi_cacenter")),
                           ("wide", _("wide")), ("extrawide", _("extrawide"))]
            config.av.downmix_aac = ConfigSelection(choices=choice_list,
                                                    default="downmix")
        else:
            config.av.downmix_aac = ConfigYesNo(default=True)
        config.av.downmix_aac.addNotifier(setAACDownmix)

    if SystemInfo["CanDownmixAACPlus"]:

        def setAACDownmixPlus(configElement):
            open("/proc/stb/audio/aacplus", "w").write(configElement.value)

        choice_list = [("downmix", _("Downmix")),
                       ("passthrough", _("Passthrough")),
                       ("multichannel", _("convert to multi-channel PCM")),
                       ("force_ac3", _("convert to AC3")),
                       ("force_dts", _("convert to DTS")),
                       ("use_hdmi_cacenter", _("use_hdmi_cacenter")),
                       ("wide", _("wide")), ("extrawide", _("extrawide"))]
        config.av.downmix_aacplus = ConfigSelection(choices=choice_list,
                                                    default="downmix")
        config.av.downmix_aacplus.addNotifier(setAACDownmixPlus)

    if SystemInfo["CanAACTranscode"]:

        def setAACTranscode(configElement):
            open("/proc/stb/audio/aac_transcode",
                 "w").write(configElement.value)

        choice_list = [("off", _("off")), ("ac3", _("AC3")), ("dts", _("DTS"))]
        config.av.transcodeaac = ConfigSelection(choices=choice_list,
                                                 default="off")
        config.av.transcodeaac.addNotifier(setAACTranscode)
    else:
        config.av.transcodeaac = ConfigNothing()

    if SystemInfo["CanBTAudio"]:

        def setBTAudio(configElement):
            open("/proc/stb/audio/btaudio", "w").write(configElement.value)

        choice_list = [("off", _("off")), ("on", _("on"))]
        config.av.btaudio = ConfigSelection(choices=choice_list, default="off")
        config.av.btaudio.addNotifier(setBTAudio)
    else:
        config.av.btaudio = ConfigNothing()

    if SystemInfo["CanBTAudioDelay"]:

        def setBTAudioDelay(configElement):
            open("/proc/stb/audio/btaudio",
                 "w").write(format(configElement.value * 90))

        config.av.btaudiodelay = ConfigSelectionNumber(-1000,
                                                       1000,
                                                       5,
                                                       default=0)
        config.av.btaudiodelay.addNotifier(setBTAudioDelay)
    else:
        config.av.btaudiodelay = ConfigNothing()

    if SystemInfo["CanChangeOsdAlpha"]:

        def setAlpha(config):
            open("/proc/stb/video/alpha", "w").write(str(config.value))

        config.av.osd_alpha = ConfigSlider(default=255, limits=(0, 255))
        config.av.osd_alpha.addNotifier(setAlpha)

    if SystemInfo["ScalerSharpness"]:

        def setScaler_sharpness(config):
            myval = int(config.value)
            try:
                print("--> setting scaler_sharpness to: %0.8X" % myval)
                open("/proc/stb/vmpeg/0/pep_scaler_sharpness",
                     "w").write("%0.8X" % myval)
                open("/proc/stb/vmpeg/0/pep_apply", "w").write("1")
            except IOError:
                print("[AVSwitch] couldn't write pep_scaler_sharpness")

        if platform == "gb7356":
            config.av.scaler_sharpness = ConfigSlider(default=5,
                                                      limits=(0, 26))
        else:
            config.av.scaler_sharpness = ConfigSlider(default=13,
                                                      limits=(0, 26))
        config.av.scaler_sharpness.addNotifier(setScaler_sharpness)
    else:
        config.av.scaler_sharpness = NoSave(ConfigNothing())

    if SystemInfo["HasMultichannelPCM"]:

        def setMultichannelPCM(configElement):
            open(SystemInfo["HasMultichannelPCM"],
                 "w").write(configElement.value and "enable" or "disable")

        config.av.multichannel_pcm = ConfigYesNo(default=False)
        config.av.multichannel_pcm.addNotifier(setMultichannelPCM)

    if SystemInfo["HasAutoVolume"]:

        def setAutoVolume(configElement):
            open(SystemInfo["HasAutoVolume"], "w").write(configElement.value)

        config.av.autovolume = ConfigSelection(default="none",
                                               choices=[("none", _("off")),
                                                        ("hdmi", _("HDMI")),
                                                        ("spdif", _("SPDIF")),
                                                        ("dac", _("DAC"))])
        config.av.autovolume.addNotifier(setAutoVolume)

    if SystemInfo["HasAutoVolumeLevel"]:

        def setAutoVolumeLevel(configElement):
            open(SystemInfo["HasAutoVolumeLevel"],
                 "w").write(configElement.value and "enabled" or "disabled")

        config.av.autovolumelevel = ConfigYesNo(default=False)
        config.av.autovolumelevel.addNotifier(setAutoVolumeLevel)

    if SystemInfo["Has3DSurround"]:

        def set3DSurround(configElement):
            open(SystemInfo["Has3DSurround"], "w").write(configElement.value)

        config.av.surround_3d = ConfigSelection(default="none",
                                                choices=[("none", _("off")),
                                                         ("hdmi", _("HDMI")),
                                                         ("spdif", _("SPDIF")),
                                                         ("dac", _("DAC"))])
        config.av.surround_3d.addNotifier(set3DSurround)

    if SystemInfo["Has3DSpeaker"]:

        def set3DSpeaker(configElement):
            open(SystemInfo["Has3DSpeaker"], "w").write(configElement.value)

        config.av.speaker_3d = ConfigSelection(default="center",
                                               choices=[("center",
                                                         _("center")),
                                                        ("wide", _("wide")),
                                                        ("extrawide",
                                                         _("extra wide"))])
        config.av.speaker_3d.addNotifier(set3DSpeaker)

    if SystemInfo["Has3DSurroundSpeaker"]:

        def set3DSurroundSpeaker(configElement):
            open(SystemInfo["Has3DSurroundSpeaker"],
                 "w").write(configElement.value)

        config.av.surround_3d_speaker = ConfigSelection(
            default="disabled",
            choices=[("disabled", _("off")), ("center", _("center")),
                     ("wide", _("wide")), ("extrawide", _("extra wide"))])
        config.av.surround_3d_speaker.addNotifier(set3DSurroundSpeaker)

    if SystemInfo["Has3DSurroundSoftLimiter"]:

        def set3DSurroundSoftLimiter(configElement):
            open(SystemInfo["Has3DSurroundSoftLimiter"],
                 "w").write(configElement.value and "enabled" or "disabled")

        config.av.surround_softlimiter_3d = ConfigYesNo(default=False)
        config.av.surround_softlimiter_3d.addNotifier(set3DSurroundSoftLimiter)

    if SystemInfo["HDMIAudioSource"]:

        def setHDMIAudioSource(configElement):
            open(SystemInfo["HDMIAudioSource"], "w").write(configElement.value)

        config.av.hdmi_audio_source = ConfigSelection(default="pcm",
                                                      choices=[
                                                          ("pcm", _("PCM")),
                                                          ("spdif", _("SPDIF"))
                                                      ])
        config.av.hdmi_audio_source.addNotifier(setHDMIAudioSource)

    def setVolumeStepsize(configElement):
        eDVBVolumecontrol.getInstance().setVolumeSteps(int(
            configElement.value))

    config.av.volume_stepsize = ConfigSelectionNumber(1, 10, 1, default=5)
    config.av.volume_stepsize.addNotifier(setVolumeStepsize)
コード例 #12
0
 ('-r800', _('800*450')),
 ('-r600', _('600*337')),
 ('Disabled', _('Skin resolution'))])
config.plugins.PPrestige.format = ConfigSelection(default='-j80', choices=[('-j100', _('jpg100')),
 ('-j80', _('jpg80')),
 ('-j60', _('jpg60')),
 ('-j40', _('jpg40')),
 ('-j20', _('jpg20')),
 ('-p', _('PNG'))])
config.plugins.PPrestige.fixedaspectratio = ConfigSelection(default='Disabled', choices=[('-n', _('Enabled')), ('Disabled', _('Off'))])
config.plugins.PPrestige.always43 = ConfigSelection(default='Disabled', choices=[('-l', _('Enabled')), ('Disabled', _('Off'))])
config.plugins.PPrestige.bicubic = ConfigSelection(default='Disabled', choices=[('-b', _('Enabled')), ('Disabled', _('Off'))])
config.PPrestige.framesize = ConfigInteger(default=30, limits=(5, 99))
config.PPrestige.slidetime = ConfigInteger(default=10, limits=(1, 60))
config.PPrestige.resize = ConfigSelection(default='1', choices=[('0', _('simple')), ('1', _('better'))])
config.PPrestige.cache = ConfigEnableDisable(default=True)
config.PPrestige.lastDir = ConfigText(default=resolveFilename(SCOPE_MEDIA))
config.PPrestige.infoline = ConfigEnableDisable(default=True)
config.PPrestige.loop = ConfigEnableDisable(default=True)
config.PPrestige.bgcolor = ConfigSelection(default='#00000000', choices=[('#00000000', _('black')),
 ('#009eb9ff', _('blue')),
 ('#00ff5a51', _('red')),
 ('#00ffe875', _('yellow')),
 ('#0038FF48', _('green'))])
config.PPrestige.textcolor = ConfigSelection(default='#00ff5a51', choices=[('#6495ED', _('CornflowerBlue')),
 ('#009eb9ff', _('blue')),
 ('#00ff5a51', _('red')),
 ('#00ffe875', _('yellow')),
 ('#0038FF48', _('green'))])
EMbaseInfoBarPlugins__init__ = None
EMStartOnlyOneTime = False
コード例 #13
0
    def __init__(self, session, iface, plugin_path):
        self.skin = setupSamba.skin
        self.session = session
        Screen.__init__(self, session)

        self.container = eConsoleAppContainer()
        self.container.appClosed.append(self.runFinished)
        self.container.dataAvail.append(self.dataAvail)

        if isRunning('smbd') and isRunning('nmbd'):
            isEnabled = True
        else:
            isEnabled = False

        confError = False
        tmp = getAttribute('/etc/samba/smb.conf', 'global', 'server string')
        if tmp != None:
            serverString = tmp
        else:
            serverString = 'READERROR server string'
            confError = True

        tmp = getAttribute('/etc/samba/smb.conf', 'global', 'netbios name')
        if tmp != None:
            netbiosName = tmp
        else:
            netbiosName = 'READERROR netbios name'
            confError = True

        tmp = getAttribute('/etc/samba/smb.conf', 'global', 'workgroup')
        if tmp != None:
            workgroup = tmp
        else:
            workgroup = 'READERROR workgroup'
            confError = True

        self.activeConfigEntry = NoSave(ConfigEnableDisable(default=isEnabled))
        self.serverStringConfigEntry = NoSave(
            ConfigText(default=serverString,
                       visible_width=50,
                       fixed_size=False))
        self.netbiosNameConfigEntry = NoSave(
            ConfigText(default=netbiosName, visible_width=50,
                       fixed_size=False))
        self.workgroupConfigEntry = NoSave(
            ConfigText(default=workgroup, visible_width=50, fixed_size=False))

        self["smbdLabel"] = Label()
        self["nmbdLabel"] = Label()
        self["ButtonGreen"] = Pixmap()
        self["ButtonGreentext"] = Button(
            _("save and start/restart Samba-Server"))
        self["ButtonRed"] = Pixmap()
        self["ButtonRedtext"] = Label(_("Close"))

        self.startingUp = False
        self.goingDown = False
        self.cmdlist = []
        self.run = 0

        self.createSetup()
        ConfigListScreen.__init__(self, self.list, session=session)
        self.activeConfigEntry.addNotifier(self.toggleServer)

        self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], {
            "cancel": self.cancel,
            "red": self.cancel,
            "green": self.green
        }, -2)

        if confError:
            self.onExecBegin.append(self.errorMbox)
コード例 #14
0
ファイル: plugin.py プロジェクト: pr2git/XMLTV-Import
		return 256


def calcDefaultStarttime():
	try:
		# Use the last MAC byte as time offset (half-minute intervals)
		offset = lastMACbyte() * 30
	except:
		offset = 7680
	return (5 * 60 * 60) + offset


from boxbranding import getImageDistro
#Set default configuration
config.plugins.epgimport = ConfigSubsection()
config.plugins.epgimport.enabled = ConfigEnableDisable(default=False)
config.plugins.epgimport.runboot = ConfigSelection(default="4", choices=[
		("1", _("always")),
		("2", _("only manual boot")),
		("3", _("only automatic boot")),
		("4", _("never"))
		])
config.plugins.epgimport.runboot_restart = ConfigYesNo(default=False)
config.plugins.epgimport.runboot_day = ConfigYesNo(default=False)
config.plugins.epgimport.wakeupsleep = ConfigEnableDisable(default=False)
config.plugins.epgimport.wakeup = ConfigClock(default=calcDefaultStarttime())
# Different default in OpenATV:
if getImageDistro() in ("openatv"):
	config.plugins.epgimport.showinplugins = ConfigYesNo(default=False)
else:
	config.plugins.epgimport.showinplugins = ConfigYesNo(default=True)
コード例 #15
0
config.plugins.epgrefresh_extra.manual_save = ConfigSelection(choices = [("1", _("Press OK"))], default = "1")
config.plugins.epgrefresh_extra.manual_load = ConfigSelection(choices = [("1", _("Press OK"))], default = "1")
config.plugins.epgrefresh_extra.manual_reload = ConfigSelection(choices = [("1", _("Press OK"))], default = "1")
config.plugins.epgrefresh_extra.main_menu = ConfigYesNo(default = False)
config.plugins.epgrefresh_extra.epgcachepath = ConfigDirectory('/media/hdd/')
config.plugins.epgrefresh_extra.bookmarks = ConfigLocations(default=['/media/hdd/'])
config.plugins.epgrefresh_extra.epgcachefilename = ConfigText(default="epg", fixed_size=False)
config.plugins.epgrefresh_extra.save_backup = ConfigYesNo(default = False)
config.plugins.epgrefresh_extra.delete_backup = ConfigSelection(choices = [("1", _("Press OK"))], default = "1")
config.plugins.epgrefresh_extra.restore_backup = ConfigSelection(choices = [("1", _("Press OK"))], default = "1")
config.plugins.epgrefresh_extra.autorestore_backup = ConfigYesNo(default = False)
config.plugins.epgrefresh_extra.show_autozap = ConfigYesNo(default = False)
config.plugins.epgrefresh_extra.timeout_autozap = ConfigInteger(default = 15, limits= (10, 90))
config.plugins.epgrefresh_extra.day_refresh = ConfigSubDict()
for i in range(7):
	config.plugins.epgrefresh_extra.day_refresh[i] = ConfigEnableDisable(default = True)

#pragma mark - Workaround for unset clock
from enigma import eDVBLocalTimeHandler

def timeCallback(isCallback=True):
	"""Time Callback/Autostart management."""
	thInstance = eDVBLocalTimeHandler.getInstance()
	if isCallback:
		# NOTE: this assumes the clock is actually ready when called back
		# this may not be true, but we prefer silently dying to waiting forever
		thInstance.m_timeUpdated.get().remove(timeCallback)
	elif not thInstance.ready():
		thInstance.m_timeUpdated.get().append(timeCallback)
		return
コード例 #16
0
    def __init__(self, session, exportDir, client, options):
        self.skin = editExportEntry.skin
        self.session = session
        Screen.__init__(self, session)

        nfsoptions = [\
        "ro,sync",
        "rw,sync",
        "ro,async",
        "rw,async",
        "ro,no_root_squash",
        "rw,no_root_squash",
        "ro,no_subtree_check",
        "rw,no_subtree_check",
        "ro,insecure",
        "rw,insecure",
        "ro,insecure,no_subtree_check",
        "rw,insecure,no_subtree_check",
        "ro,sync,no_subtree_check",
        "rw,sync,no_subtree_check",
        "ro,async,no_subtree_check",
        "rw,async,no_subtree_check",
        "ro,no_root_squash,no_subtree_check",
        "rw,no_root_squash,no_subtree_check",
        "ro,no_root_squash,sync",
        "rw,no_root_squash,sync",
        "ro,no_root_squash,sync,no_subtree_check",
        "rw,no_root_squash,sync,no_subtree_check",
        "ro,no_root_squash,async",
        "rw,no_root_squash,async",
        "ro,no_root_squash,async,no_subtree_check",
        "rw,no_root_squash,async,no_subtree_check"]

        optionsEntrys = {}
        for x in nfsoptions:
            optionsEntrys[x] = x

        clientIP = [192, 168, 0, 0]
        self.netmask = ''

        tmp = client.split('/')
        if len(tmp) > 1:
            client = tmp[0]
            self.netmask = tmp[1]

        if client == '*':
            everyIP = True
        else:
            everyIP = False
            theIP = client.split('.')
            clientIP = []
            for x in theIP:
                clientIP.append(int(x))

        self.exportDirConfigEntry = NoSave(ConfigDirectory(exportDir))
        self.everyIPConfigEntry = NoSave(ConfigEnableDisable(default=everyIP))
        self.clientConfigEntry = NoSave(ConfigIP(clientIP))
        self.optionsConfigEntry = NoSave(
            ConfigSelection(optionsEntrys, options))

        ConfigListScreen.__init__(self, [])
        self.createSetup()
        self.everyIPConfigEntry.addNotifier(self.toggleEveryIP)

        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions"], {
                "cancel": self.cancel,
                "red": self.cancel,
                "green": self.green,
                "ok": self.ok
            }, -2)

        self["ButtonGreen"] = Pixmap()
        self["ButtonGreentext"] = Label(_("Save and Close"))
        self["ButtonRed"] = Pixmap()
        self["ButtonRedtext"] = Label(_("Close"))
コード例 #17
0
	def createSetup(self):
		self.tuneTimer.stop()
		self.list = []
		self.multiscanlist = []
		index_to_scan = int(self.scan_nims.value)
		config_list = True
		self.tunerEntry = getConfigListEntry(_("Tuner"), self.scan_nims)
		self.list.append(self.tunerEntry)
		
		if self.scan_nims == [ ]:
			return
		
		self.typeOfScanEntry = None
		self.systemEntry = None
		self.satelliteEntry = None
		self.modulationEntry = None
		self.transpondersEntry = None
		self.scan_networkScan.value = False
		nim = nimmanager.nim_slots[index_to_scan]
		if nim.isCompatible("DVB-S"):
			self.typeOfScanEntry = getConfigListEntry(_("Type of scan"), self.scan_type)
			self.list.append(self.typeOfScanEntry)

			if self.scan_type.value == "single_transponder":
				self.updateSatList()
				sat = self.satList[index_to_scan][self.scan_satselection[index_to_scan].index]
				self.updateTranspondersList(sat[0])
				if nim.isCompatible("DVB-S2"):
					self.systemEntry = getConfigListEntry(_('System'), self.scan_sat.system)
					self.list.append(self.systemEntry)
				else:
					self.scan_sat.system.value = eDVBFrontendParametersSatellite.System_DVB_S
				self.list.append(getConfigListEntry(_('Satellite'), self.scan_satselection[index_to_scan]))
				self.list.append(getConfigListEntry(_('Frequency'), self.scan_sat.frequency))
				self.list.append(getConfigListEntry(_('Inversion'), self.scan_sat.inversion))
				self.list.append(getConfigListEntry(_('Symbol Rate'), self.scan_sat.symbolrate))
				self.list.append(getConfigListEntry(_("Polarity"), self.scan_sat.polarization))
				if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S:
					self.list.append(getConfigListEntry(_("FEC"), self.scan_sat.fec))
				elif self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
					self.list.append(getConfigListEntry(_("FEC"), self.scan_sat.fec_s2))
					self.modulationEntry = getConfigListEntry(_('Modulation'), self.scan_sat.modulation)
					self.list.append(self.modulationEntry)
					self.list.append(getConfigListEntry(_('Rolloff'), self.scan_sat.rolloff))
					self.list.append(getConfigListEntry(_('Pilot'), self.scan_sat.pilot))
			elif self.scan_type.value == "predefined_transponder":
				self.updateSatList()
				self.satelliteEntry = getConfigListEntry(_('Satellite'), self.scan_satselection[index_to_scan])
				self.list.append(self.satelliteEntry)
				sat = self.satList[index_to_scan][self.scan_satselection[index_to_scan].index]
				self.updateTranspondersList(sat[0])
				self.transpondersEntry = getConfigListEntry(_('Transponder'), self.scan_transponders)
				self.list.append(self.transpondersEntry)
			elif self.scan_type.value == "single_satellite":
				self.updateSatList()
				sat = self.satList[index_to_scan][self.scan_satselection[index_to_scan].index]
				self.updateTranspondersList(sat[0])
				print self.scan_satselection[index_to_scan]
				self.list.append(getConfigListEntry(_("Satellite"), self.scan_satselection[index_to_scan]))
				self.scan_networkScan.value = True
			elif self.scan_type.value == "multisat":
				tlist = []
				SatList = nimmanager.getSatListForNim(index_to_scan)
				for x in SatList:
					if self.Satexists(tlist, x[0]) == 0:
						tlist.append(x[0])
						sat = ConfigEnableDisable(default = self.scan_type.value.find("_yes") != -1 and True or False)
						configEntry = getConfigListEntry(nimmanager.getSatDescription(x[0]), sat)
						self.list.append(configEntry)
						self.multiscanlist.append((x[0], sat))
						sat.addNotifier(self.retune, initial_call = False)
				self.scan_networkScan.value = True
			elif self.scan_type.value == "provider":
				config_list = False
				satList = nimmanager.getSatListForNim(index_to_scan)
				satchoises = [("none", _("None"))]
				for sat in satList:
					if sat[0] == 360:
						satchoises.append(("ntv", _("NTV Plus")))
						satchoises.append(("tricolor", _("Tricolor TV")))
						satchoises.append(("lybid", _("Lybid TV ")))
					elif sat[0] == 3560:
						satchoises.append(("xtra", _("Xtra TV")))
					elif sat[0] == 600:
						satchoises.append(("aktiv", _("Aktiv TV")))
					elif sat[0] == 750:
						satchoises.append(("raduga", _("Raduga TV")))
					elif sat[0] == 850:
						satchoises.append(("kontinent", _("Kontinent TV")))
				self.provider_list = ConfigSelection(default = "none", choices = satchoises)
				ProviderEntry = getConfigListEntry(_("Provider"), self.provider_list)
				self.list.append(ProviderEntry)
				self.provider_list.addNotifier(self.retune, initial_call = False)
				if self.provider_list.value == "none":
					self.retune(None)

		self.list.append(getConfigListEntry(_("Network scan"), self.scan_networkScan))
		self.list.append(getConfigListEntry(_("Clear before scan"), self.scan_clearallservices))
		if config_list:
			self.list.append(getConfigListEntry(_("Only Free scan"), self.scan_onlyfree))
		self["config"].list = self.list
		self["config"].l.setList(self.list)
コード例 #18
0
		InfoBarPiP.togglePipzap = InfoBarPiP_togglePipzap

	baseMethods.InfoBarPiP_showPiP = InfoBarPiP.showPiP
	InfoBarPiP.showPiP = InfoBarPiP_showPiP

	baseMethods.PictureInPicture__init__ = PictureInPicture.__init__
	PictureInPicture.__init__ = PictureInPicture__init__

	PictureInPicture.active = PictureInPicture_active
	PictureInPicture.inactive = PictureInPicture_inactive

	baseMethods.PictureInPicture_move = PictureInPicture.move
	PictureInPicture.move = PictureInPicture_move

config.plugins.pipzap = ConfigSubsection()
config.plugins.pipzap.enable_hotkey = ConfigEnableDisable(default = True)
config.plugins.pipzap.show_in_plugins = ConfigEnableDisable(default = False)
config.plugins.pipzap.show_label = ConfigEnableDisable(default = True)
config.plugins.pipzap.show_help = ConfigEnableDisable(default = True)

def autostart(reason, **kwargs):
	if reason == 0:
		overwriteFunctions()

def activate(session, *args, **kwargs):
	infobar = InfoBar.instance
	if not infobar:
		session.open(MessageBox, _("Unable to access InfoBar.\npipzap not available."), MessageBox.TYPE_ERROR)
	elif hasattr(infobar, 'togglePipzap'): # check if plugin is already hooked into enigma2
		infobar.togglePipzap()
	else:
コード例 #19
0
ファイル: __init__.py プロジェクト: OpenViX/HRTunerProxy
    6085: 'iptv'
}

config.hrtunerproxy = ConfigSubsection()
config.hrtunerproxy.bouquets_list = ConfigSubDict()
for type in tunerTypes:
    config.hrtunerproxy.bouquets_list[type] = ConfigSelection(
        default=None,
        choices=[(None, _('Not set')), ('all', _('All'))] + getBouquetsList())
config.hrtunerproxy.iptv_tunercount = ConfigSelectionNumber(min=1,
                                                            max=10,
                                                            stepwidth=1,
                                                            default=2,
                                                            wraparound=True)
config.hrtunerproxy.slotsinuse = NoSave(ConfigNumber())
config.hrtunerproxy.debug = ConfigEnableDisable(default=False)


def getVersion():
    if path.exists(
            "/usr/lib/enigma2/python/Plugins/SystemPlugins/HRTunerProxy/PLUGIN_VERSION"
    ):
        f = open(
            "/usr/lib/enigma2/python/Plugins/SystemPlugins/HRTunerProxy/PLUGIN_VERSION"
        )
        PLUGIN_VERSION = _('v%s ') % f.read().replace('\n', '')
        f.close()
    else:
        PLUGIN_VERSION = ''
    return PLUGIN_VERSION
コード例 #20
0
config.infobartunerstate.list_goesup = ConfigYesNo(default=False)

config.infobartunerstate.infobar_timeout = ConfigSelectionNumber(0,
                                                                 100,
                                                                 1,
                                                                 default=0)
config.infobartunerstate.wake_hdd = ConfigYesNo(default=False)
config.infobartunerstate.skip_mounts = ConfigYesNo(default=True)
config.infobartunerstate.background_transparency = ConfigYesNo(default=False)

config.infobartunerstate.log_shell = ConfigYesNo(default=False)
config.infobartunerstate.log_write = ConfigYesNo(default=False)
config.infobartunerstate.log_file = ConfigText(
    default="/tmp/infobartunerstate.log", fixed_size=False)

config.infobartunerstate.log_shell = ConfigEnableDisable(default=False)
config.infobartunerstate.log_write = ConfigEnableDisable(default=False)
config.infobartunerstate.log_file = ConfigText(default="/tmp/pushservice.log",
                                               fixed_size=False)

# Globals
gInfoBarTunerState = None

# Temporary if we do not import the modules the config will not be loaded
from Plugins.Extensions.InfoBarTunerState.Handler import *


#######################################################
# Plugin main function
def Plugins(**kwargs):
    descriptors = []
コード例 #21
0
ファイル: plugin.py プロジェクト: ostende/enigma2-plugins
# -*- coding: iso-8859-1 -*-
from Plugins.Plugin import PluginDescriptor
from Components.config import config, ConfigSubsection, ConfigEnableDisable
from Screens.Standby import Standby, inStandby
from StartupToStandbyConfiguration import StartupToStandbyConfiguration
from Tools import Notifications

config.plugins.startuptostandby = ConfigSubsection()
config.plugins.startuptostandby.enabled = ConfigEnableDisable(default=False)


def main(session, **kwargs):
    print "[StartupToStandby] Open Config Screen"
    session.open(StartupToStandbyConfiguration)


# sessionstart
def sessionstart(reason, session=None):
    print "[StartupToStandby] autostart"
    if config.plugins.startuptostandby.enabled.value and reason == 0 and not inStandby:
        Notifications.AddNotificationWithID("Standby", Standby)


def Plugins(path, **kwargs):
    return [
        PluginDescriptor(name="StartupToStandby",
                         description="Startup To Standby",
                         where=PluginDescriptor.WHERE_PLUGINMENU,
                         fnc=main,
                         needsRestart=False),
        PluginDescriptor(name="StartupToStandby",
コード例 #22
0
def InitAVSwitch():
    config.av.yuvenabled = ConfigBoolean(default=True)
    colorformat_choices = {
        "cvbs": _("CVBS"),
        "rgb": _("RGB"),
        "svideo": _("S-Video")
    }
    # when YUV is not enabled, don't let the user select it
    if config.av.yuvenabled.value:
        colorformat_choices["yuv"] = _("YPbPr")
    config.av.autores = ConfigSelection(choices={
        "disabled": _("Disabled"),
        "all": _("All resolutions"),
        "hd": _("only HD")
    },
                                        default="disabled")
    choicelist = []
    for i in range(5, 16):
        choicelist.append(
            ("%d" % i, ngettext("%d second", "%d seconds", i) % i))
    config.av.autores_label_timeout = ConfigSelection(
        default="5", choices=[("0", _("Not Shown"))] + choicelist)
    config.av.autores_delay = ConfigSelectionNumber(min=0,
                                                    max=15000,
                                                    stepwidth=500,
                                                    default=500,
                                                    wraparound=True)
    config.av.autores_deinterlace = ConfigYesNo(default=False)
    config.av.autores_sd = ConfigSelection(choices={
        "720p": _("720p"),
        "1080i": _("1080i")
    },
                                           default="720p")
    config.av.autores_480p24 = ConfigSelection(choices={
        "480p24": _("480p 24Hz"),
        "720p24": _("720p 24Hz"),
        "1080p24": _("1080p 24Hz")
    },
                                               default="1080p24")
    config.av.autores_720p24 = ConfigSelection(choices={
        "720p24": _("720p 24Hz"),
        "1080p24": _("1080p 24Hz")
    },
                                               default="1080p24")
    config.av.autores_1080p24 = ConfigSelection(choices={
        "1080p24": _("1080p 24Hz"),
        "1080p25": _("1080p 25Hz")
    },
                                                default="1080p24")
    config.av.autores_1080p25 = ConfigSelection(choices={
        "1080p25": _("1080p 25Hz"),
        "1080p50": _("1080p 50Hz")
    },
                                                default="1080p25")
    config.av.autores_1080p30 = ConfigSelection(choices={
        "1080p30": _("1080p 30Hz"),
        "1080p60": _("1080p 60Hz")
    },
                                                default="1080p30")
    config.av.autores_2160p24 = ConfigSelection(choices={
        "2160p24": _("2160p 24Hz"),
        "2160p25": _("2160p 25Hz"),
        "2160p30": _("2160p 30Hz")
    },
                                                default="2160p24")
    config.av.autores_2160p25 = ConfigSelection(choices={
        "2160p25": _("2160p 25Hz"),
        "2160p50": _("2160p 50Hz")
    },
                                                default="2160p25")
    config.av.autores_2160p30 = ConfigSelection(choices={
        "2160p30": _("2160p 30Hz"),
        "2160p60": _("2160p 60Hz")
    },
                                                default="2160p30")
    config.av.colorformat = ConfigSelection(choices=colorformat_choices,
                                            default="rgb")
    config.av.aspectratio = ConfigSelection(choices={
        "4_3_letterbox":
        _("4:3 Letterbox"),
        "4_3_panscan":
        _("4:3 PanScan"),
        "16_9":
        _("16:9"),
        "16_9_always":
        _("16:9 always"),
        "16_10_letterbox":
        _("16:10 Letterbox"),
        "16_10_panscan":
        _("16:10 PanScan"),
        "16_9_letterbox":
        _("16:9 Letterbox")
    },
                                            default="16_9")
    config.av.aspect = ConfigSelection(choices={
        "4:3": _("4:3"),
        "16:9": _("16:9"),
        "16:10": _("16:10"),
        "auto": _("Automatic")
    },
                                       default="16:9")
    policy2_choices = {
        "letterbox": _(
            "Letterbox"
        ),  # TRANSLATORS: (aspect ratio policy: black bars on top/bottom) in doubt, keep english term.
        "panscan": _(
            "Pan&scan"
        ),  # TRANSLATORS: (aspect ratio policy: cropped content on left/right) in doubt, keep english term
        "scale": _(
            "Just scale"
        )  # TRANSLATORS: (aspect ratio policy: display as fullscreen, even if this breaks the aspect)
    }
    if path.exists("/proc/stb/video/policy2_choices"):
        f = open("/proc/stb/video/policy2_choices")
        if "auto" in f.readline():
            policy2_choices.update(
                {"auto": _("Auto")}
            )  # TRANSLATORS: (aspect ratio policy: always try to display as fullscreen, when there is no content (black bars) on left/right, even if this breaks the aspect.
        f.close()
    config.av.policy_169 = ConfigSelection(choices=policy2_choices,
                                           default="letterbox")
    policy_choices = {
        "panscan": _(
            "Pillarbox"
        ),  # TRANSLATORS: (aspect ratio policy: black bars on left/right) in doubt, keep english term.
        "letterbox": _(
            "Pan&scan"
        ),  # TRANSLATORS: (aspect ratio policy: cropped content on left/right) in doubt, keep english term
        # "nonlinear": _("Nonlinear"),					# TRANSLATORS: (aspect ratio policy: display as fullscreen, with stretching the left/right)
        "bestfit": _(
            "Just scale"
        )  # TRANSLATORS: (aspect ratio policy: display as fullscreen, even if this breaks the aspect)
    }
    if path.exists("/proc/stb/video/policy_choices"):
        f = open("/proc/stb/video/policy_choices")
        if "auto" in f.readline():
            policy_choices.update(
                {"auto": _("Auto")}
            )  # TRANSLATORS: (aspect ratio policy: always try to display as fullscreen, when there is no content (black bars) on left/right, even if this breaks the aspect.
        f.close()
    config.av.policy_43 = ConfigSelection(choices=policy_choices,
                                          default="panscan")
    config.av.tvsystem = ConfigSelection(choices={
        "pal": _("PAL"),
        "ntsc": _("NTSC"),
        "multinorm": _("multinorm")
    },
                                         default="pal")
    config.av.wss = ConfigEnableDisable(default=True)
    config.av.generalAC3delay = ConfigSelectionNumber(-1000,
                                                      1000,
                                                      5,
                                                      default=0)
    config.av.generalPCMdelay = ConfigSelectionNumber(-1000,
                                                      1000,
                                                      5,
                                                      default=0)
    config.av.vcrswitch = ConfigEnableDisable(default=False)
    config.av.aspect.setValue("16:9")
    config.av.aspect.addNotifier(iAVSwitch.setAspect)
    config.av.wss.addNotifier(iAVSwitch.setWss)
    config.av.policy_43.addNotifier(iAVSwitch.setPolicy43)
    config.av.policy_169.addNotifier(iAVSwitch.setPolicy169)

    def setColorFormat(configElement):
        if config.av.videoport and config.av.videoport.value in (
                "YPbPr", "Scart-YPbPr"):
            iAVSwitch.setColorFormat(3)
        elif config.av.videoport and config.av.videoport.value in ("RCA"):
            iAVSwitch.setColorFormat(0)
        else:
            map = {"cvbs": 0, "rgb": 1, "svideo": 2, "yuv": 3}
            iAVSwitch.setColorFormat(map[configElement.value])

    config.av.colorformat.addNotifier(setColorFormat)

    def setAspectRatio(configElement):
        map = {
            "4_3_letterbox": 0,
            "4_3_panscan": 1,
            "16_9": 2,
            "16_9_always": 3,
            "16_10_letterbox": 4,
            "16_10_panscan": 5,
            "16_9_letterbox": 6
        }
        iAVSwitch.setAspectRatio(map[configElement.value])

    def readChoices(procx, choices, default):
        with open(procx, "r") as myfile:
            procChoices = myfile.read().strip()
        if procChoices:
            choiceslist = procChoices.split(" ")
            choices = [(item, _(item)) for item in choiceslist]
            default = choiceslist[0]
            print("[AVSwitch][readChoices from Proc] choices=%s, default=%s" %
                  (choices, default))
        return (choices, default)

    iAVSwitch.setInput("ENCODER")  # Init on startup.
    SystemInfo["ScartSwitch"] = eAVSwitch.getInstance().haveScartSwitch()

    if SystemInfo["Canedidchecking"]:

        def setEDIDBypass(configElement):
            open(SystemInfo["Canedidchecking"],
                 "w").write("00000001" if configElement.value else "00000000")

        config.av.bypass_edid_checking = ConfigYesNo(default=False)
        config.av.bypass_edid_checking.addNotifier(setEDIDBypass)
    else:
        config.av.bypass_edid_checking = ConfigNothing()

    if SystemInfo["havecolorspace"]:

        def setHDMIColorspace(configElement):
            open(SystemInfo["havecolorspace"], "w").write(configElement.value)

        if getBrandOEM() == "vuplus" and SystemInfo["HasMMC"]:
            choices = [("Edid(Auto)", _("Auto")), ("Hdmi_Rgb", _("RGB")),
                       ("444", _("YCbCr444")), ("422", _("YCbCr422")),
                       ("420", _("YCbCr420"))]
            default = "Edid(Auto)"
        else:
            choices = [("auto", _("Auto")), ("rgb", _("RGB")),
                       ("420", _("420")), ("422", _("422")), ("444", _("444"))]
            default = "auto"
        if SystemInfo["havecolorspacechoices"] and SystemInfo["CanProc"]:
            f = "/proc/stb/video/hdmi_colorspace_choices"
            (choices, default) = readChoices(f, choices, default)
        config.av.hdmicolorspace = ConfigSelection(choices=choices,
                                                   default=default)
        config.av.hdmicolorspace.addNotifier(setHDMIColorspace)
    else:
        config.av.hdmicolorspace = ConfigNothing()

    if SystemInfo["havecolorimetry"]:

        def setHDMIColorimetry(configElement):
            open(SystemInfo["havecolorimetry"], "w").write(configElement.value)

        choices = [("auto", _("auto")), ("bt2020ncl", _("BT 2020 NCL")),
                   ("bt2020cl", _("BT 2020 CL")), ("bt709", _("BT 709"))]
        default = "auto"
        if SystemInfo["havecolorimetrychoices"] and SystemInfo["CanProc"]:
            f = "/proc/stb/video/hdmi_colorimetry_choices"
            (choices, default) = readChoices(f, choices, default)
        config.av.hdmicolorimetry = ConfigSelection(choices=choices,
                                                    default=default)
        config.av.hdmicolorimetry.addNotifier(setHDMIColorimetry)
    else:
        config.av.hdmicolorimetry = ConfigNothing()

    if SystemInfo["havehdmicolordepth"]:

        def setHdmiColordepth(configElement):
            open(SystemInfo["havehdmicolordepth"],
                 "w").write(configElement.value)

        choices = [("auto", _("Auto")), ("8bit", _("8bit")),
                   ("10bit", _("10bit")), ("12bit", _("12bit"))]
        default = "auto"
        if SystemInfo["havehdmicolordepthchoices"] and SystemInfo["CanProc"]:
            f = "/proc/stb/video/hdmi_colordepth_choices"
            (choices, default) = readChoices(f, choices, default)
        config.av.hdmicolordepth = ConfigSelection(choices=choices,
                                                   default=default)
        config.av.hdmicolordepth.addNotifier(setHdmiColordepth)
    else:
        config.av.hdmicolordepth = ConfigNothing()

    if SystemInfo["havehdmihdrtype"]:

        def setHdmiHdrType(configElement):
            try:
                with open(SystemInfo["havehdmihdrtype"], "w") as fd:
                    fd.write(configElement.value)
            except (IOError, OSError):
                pass

        config.av.hdmihdrtype = ConfigSelection(choices={
            "auto": _("Auto"),
            "dolby": _("dolby"),
            "none": _("sdr"),
            "hdr10": _("hdr10"),
            "hlg": _("hlg")
        },
                                                default="auto")
        config.av.hdmihdrtype.addNotifier(setHdmiHdrType)
    else:
        config.av.hdmihdrtype = ConfigNothing()

    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)

    if SystemInfo["Canaudiosource"]:

        def setAudioSource(configElement):
            try:
                with open(SystemInfo["Canaudiosource"], "w") as fd:
                    fd.write(configElement.value)
            except (IOError, OSError):
                pass

        config.av.audio_source = ConfigSelection(choices={
            "pcm": _("PCM"),
            "spdif": _("SPDIF")
        },
                                                 default="pcm")
        config.av.audio_source.addNotifier(setAudioSource)
    else:
        config.av.audio_source = ConfigNothing()

    if SystemInfo["Can3DSurround"]:

        def set3DSurround(configElement):
            open("/proc/stb/audio/3d_surround", "w").write(configElement.value)

        choices = [("none", _("off")), ("hdmi", _("HDMI")),
                   ("spdif", _("SPDIF")), ("dac", _("DAC"))]
        default = "none"
        if SystemInfo["CanProc"]:
            f = "/proc/stb/audio/3d_surround_choices"
            (choices, default) = readChoices(f, choices, default)

        config.av.surround_3d = ConfigSelection(choices=choices,
                                                default=default)
        config.av.surround_3d.addNotifier(set3DSurround)
    else:
        config.av.surround_3d = ConfigNothing()

    if SystemInfo["Can3DSpeaker"]:

        def set3DPosition(configElement):
            open("/proc/stb/audio/3d_surround_speaker_position",
                 "w").write(configElement.value)

        choices = [("center", _("center")), ("wide", _("wide")),
                   ("extrawide", _("extra wide"))]
        default = "center"
        if SystemInfo["CanProc"]:
            f = "/proc/stb/audio/3d_surround_speaker_position_choices"
            (choices, default) = readChoices(f, choices, default)
        config.av.surround_3d_speaker = ConfigSelection(choices=choices,
                                                        default=default)
        config.av.surround_3d_speaker.addNotifier(set3DPosition)
    else:
        config.av.surround_3d_speaker = ConfigNothing()

    if SystemInfo["CanAutoVolume"]:

        def setAutoVolume(configElement):
            open("/proc/stb/audio/avl", "w").write(configElement.value)

        choices = [("none", _("off")), ("hdmi", _("HDMI")),
                   ("spdif", _("SPDIF")), ("dac", _("DAC"))]
        default = "none"
        if SystemInfo["CanProc"]:
            f = "/proc/stb/audio/avl_choices"
            (choices, default) = readChoices(f, choices, default)
        config.av.autovolume = ConfigSelection(choices=choices,
                                               default=default)
        config.av.autovolume.addNotifier(setAutoVolume)
    else:
        config.av.autovolume = ConfigNothing()
    if SystemInfo["supportPcmMultichannel"]:

        def setPCMMultichannel(configElement):
            open(SystemInfo["supportPcmMultichannel"],
                 "w").write(configElement.value and "enable" or "disable")

        config.av.pcm_multichannel = ConfigYesNo(default=False)
        config.av.pcm_multichannel.addNotifier(setPCMMultichannel)

    if SystemInfo["CanDownmixAC3"]:

        def setAC3Downmix(configElement):
            open("/proc/stb/audio/ac3", "w").write(configElement.value)
            if SystemInfo.get("supportPcmMultichannel",
                              False) and configElement.value == "passthrough":
                SystemInfo["CanPcmMultichannel"] = True
            else:
                SystemInfo["CanPcmMultichannel"] = False
                if SystemInfo["supportPcmMultichannel"]:
                    config.av.pcm_multichannel.setValue(False)

        choices = [("downmix", _("Downmix")),
                   ("passthrough", _("Passthrough"))]
        default = "downmix"
        if SystemInfo["CanProc"]:
            f = "/proc/stb/audio/ac3_choices"
            (choices, default) = readChoices(f, choices, default)
        config.av.downmix_ac3 = ConfigSelection(choices=choices,
                                                default=default)
        config.av.downmix_ac3.addNotifier(setAC3Downmix)

    if SystemInfo["CanAC3Transcode"]:

        def setAC3plusTranscode(configElement):
            open("/proc/stb/audio/ac3plus", "w").write(configElement.value)

        choices = [("use_hdmi_caps", _("controlled by HDMI")),
                   ("force_ac3", _("convert to AC3"))]
        default = "force_ac3"
        if SystemInfo["CanProc"]:
            f = "/proc/stb/audio/ac3plus_choices"
            (choices, default) = readChoices(f, choices, default)
        config.av.transcodeac3plus = ConfigSelection(choices=choices,
                                                     default=default)
        config.av.transcodeac3plus.addNotifier(setAC3plusTranscode)

    if SystemInfo["CanDownmixDTS"]:

        def setDTSDownmix(configElement):
            open("/proc/stb/audio/dts", "w").write(configElement.value)

        choices = [("downmix", _("Downmix")),
                   ("passthrough", _("Passthrough"))]
        default = "downmix"
        if SystemInfo["CanProc"]:
            f = "/proc/stb/audio/dts_choices"
            (choices, default) = readChoices(f, choices, default)
        config.av.downmix_dts = ConfigSelection(choices=choices,
                                                default=default)
        config.av.downmix_dts.addNotifier(setDTSDownmix)

    if SystemInfo["CanDTSHD"]:

        def setDTSHD(configElement):
            open("/proc/stb/audio/dtshd", "w").write(configElement.value)

        choices = [("downmix", _("Downmix")),
                   ("force_dts", _("convert to DTS")),
                   ("use_hdmi_caps", _("controlled by HDMI")),
                   ("multichannel", _("convert to multi-channel PCM")),
                   ("hdmi_best", _("use best / controlled by HDMI"))]
        default = "downmix"
        if SystemInfo["CanProc"]:
            f = "/proc/stb/audio/dtshd_choices"
            (choices, default) = readChoices(f, choices, default)

        config.av.dtshd = ConfigSelection(choices=choices, default=default)
        config.av.dtshd.addNotifier(setDTSHD)

    if SystemInfo["CanDownmixAAC"]:

        def setAACDownmix(configElement):
            open("/proc/stb/audio/aac", "w").write(configElement.value)

        choices = [("downmix", _("Downmix")),
                   ("passthrough", _("Passthrough"))]
        default = "downmix"
        if SystemInfo["CanProc"]:
            f = "/proc/stb/audio/aac_choices"
            (choices, default) = readChoices(f, choices, default)

        config.av.downmix_aac = ConfigSelection(choices=choices,
                                                default=default)
        config.av.downmix_aac.addNotifier(setAACDownmix)

    if SystemInfo["CanDownmixAACPlus"]:

        def setAACDownmixPlus(configElement):
            open("/proc/stb/audio/aacplus", "w").write(configElement.value)

        choices = [("downmix", _("Downmix")),
                   ("passthrough", _("Passthrough")),
                   ("multichannel", _("convert to multi-channel PCM")),
                   ("force_ac3", _("convert to AC3")),
                   ("force_dts", _("convert to DTS")),
                   ("use_hdmi_cacenter", _("use_hdmi_cacenter")),
                   ("wide", _("wide")), ("extrawide", _("extrawide"))]
        default = "downmix"
        if SystemInfo["CanProc"]:
            f = "/proc/stb/audio/aacplus_choices"
            (choices, default) = readChoices(f, choices, default)

        config.av.downmix_aacplus = ConfigSelection(choices=choices,
                                                    default=default)
        config.av.downmix_aacplus.addNotifier(setAACDownmixPlus)

    if SystemInfo["CanAACTranscode"]:

        def setAACTranscode(configElement):
            open("/proc/stb/audio/aac_transcode",
                 "w").write(configElement.value)

        choices = [("off", _("off")), ("ac3", _("AC3")), ("dts", _("DTS"))]
        default = "off"
        if SystemInfo["CanProc"]:
            f = "/proc/stb/audio/aac_transcode_choices"
            (choices, default) = readChoices(f, choices, default)

        config.av.transcodeaac = ConfigSelection(choices=choices,
                                                 default=default)
        config.av.transcodeaac.addNotifier(setAACTranscode)
    else:
        config.av.transcodeaac = ConfigNothing()

    if SystemInfo["CanWMAPRO"]:

        def setWMAPRO(configElement):
            open("/proc/stb/audio/wmapro", "w").write(configElement.value)

        choices = [("downmix", _("Downmix")),
                   ("passthrough", _("Passthrough")),
                   ("multichannel", _("convert to multi-channel PCM")),
                   ("hdmi_best", _("use best / controlled by HDMI"))]
        default = "downmix"
        if SystemInfo["CanProc"]:
            f = "/proc/stb/audio/wmapro_choices"
            (choices, default) = readChoices(f, choices, default)

        config.av.wmapro = ConfigSelection(choices=choices, default=default)
        config.av.wmapro.addNotifier(setWMAPRO)

    if SystemInfo["CanBTAudio"]:

        def setBTAudio(configElement):
            open("/proc/stb/audio/btaudio", "w").write(configElement.value)

        choices = [("off", _("Off")), ("on", _("On"))]
        default = "off"

        if SystemInfo["CanProc"]:
            f = "/proc/stb/audio/btaudio_choices"
            (choices, default) = readChoices(f, choices, default)

        config.av.btaudio = ConfigSelection(choices=choices, default="off")
        config.av.btaudio.addNotifier(setBTAudio)
    else:
        config.av.btaudio = ConfigNothing()

    if SystemInfo["CanBTAudioDelay"]:

        def setBTAudioDelay(configElement):
            open(SystemInfo["CanBTAudioDelay"],
                 "w").write(format(configElement.value * 90, "x"))

        config.av.btaudiodelay = ConfigSelectionNumber(-1000,
                                                       1000,
                                                       5,
                                                       default=0)
        config.av.btaudiodelay.addNotifier(setBTAudioDelay)
    else:
        config.av.btaudiodelay = ConfigNothing()

    if SystemInfo["haveboxmode"]:

        def setBoxmode(configElement):
            try:
                open(SystemInfo["haveboxmode"], "w").write(configElement.value)
            except (IOError, OSError):
                pass

        config.av.boxmode = ConfigSelection(choices={
            "12":
            _("PIP enabled, no HDR"),
            "1":
            _("HDR, 12bit 4:2:0/4:2:2, no PIP")
        },
                                            default="12")
        config.av.boxmode.addNotifier(setBoxmode)
    else:
        config.av.boxmode = ConfigNothing()

    if SystemInfo["HasScaler_sharpness"]:

        def setScaler_sharpness(configElement):
            myval = int(configElement.value)
            try:
                print("[AVSwitch] setting scaler_sharpness to: %0.8X" % myval)
                open("/proc/stb/vmpeg/0/pep_scaler_sharpness",
                     "w").write("%0.8X" % myval)
                open("/proc/stb/vmpeg/0/pep_apply", "w").write("1")
            except (IOError, OSError):
                print("[AVSwitch] couldn't write pep_scaler_sharpness")

        if getBoxType() in ("gbquad", "gbquadplus"):
            config.av.scaler_sharpness = ConfigSlider(default=5,
                                                      limits=(0, 26))
        else:
            config.av.scaler_sharpness = ConfigSlider(default=13,
                                                      limits=(0, 26))
        config.av.scaler_sharpness.addNotifier(setScaler_sharpness)
    else:
        config.av.scaler_sharpness = NoSave(ConfigNothing())
    config.av.edid_override = ConfigYesNo(default=False)
    iAVSwitch.setConfiguredMode()
コード例 #23
0
ファイル: plugin.py プロジェクト: wedebe/enigma2-plugins
for i in range(10):
    config.plugins.elektro.ip[i] = ConfigIP(default=[0, 0, 0, 0])

config.plugins.elektro.name = ConfigText(default=_("Elektro Power Save"),
                                         fixed_size=False,
                                         visible_width=20)
config.plugins.elektro.description = ConfigText(
    default=_("Automatically shut down to deep standby"),
    fixed_size=False,
    visible_width=80)
config.plugins.elektro.menu = ConfigSelection(default="plugin",
                                              choices=[("plugin",
                                                        _("Plugin menu")),
                                                       ("extensions",
                                                        _("Extensions menu"))])
config.plugins.elektro.enable = ConfigEnableDisable(default=False)
config.plugins.elektro.standbyOnBoot = ConfigYesNo(default=False)
config.plugins.elektro.standbyOnManualBoot = ConfigYesNo(default=True)
config.plugins.elektro.standbyOnBootTimeout = ConfigNumber(default=60)
config.plugins.elektro.nextwakeup = ConfigNumber(default=0)
config.plugins.elektro.force = ConfigYesNo(default=False)
config.plugins.elektro.dontwakeup = ConfigEnableDisable(default=False)
config.plugins.elektro.holiday = ConfigEnableDisable(default=False)
config.plugins.elektro.hddsleep = ConfigYesNo(default=False)
config.plugins.elektro.IPenable = ConfigYesNo(default=False)

config.plugins.elektro.NASenable = ConfigSelection(choices=[
    ("false", "no"), ("true", "yes"), ("1", _("yes, Profile 1")),
    ("2", _("yes, Profile 2"))
],
                                                   default="false")
コード例 #24
0
PluginLanguagePath = "Extensions/AutoTimer/locale"
 
def localeInit():
	gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath))

def _(txt):
	if gettext.dgettext(PluginLanguageDomain, txt):
		return gettext.dgettext(PluginLanguageDomain, txt)
	else:
		print "[" + PluginLanguageDomain + "] fallback to default translation for " + txt
		return gettext.gettext(txt)

language.addCallback(localeInit())

config.plugins.autotimer = ConfigSubsection()
config.plugins.autotimer.autopoll = ConfigEnableDisable(default=True)
config.plugins.autotimer.onlyinstandby = ConfigEnableDisable(default=False)
config.plugins.autotimer.delay = ConfigNumber(default=3)
if getImageDistro() in ('openmips', 'openatv'):
	config.plugins.autotimer.interval = ConfigNumber(default=240)
else:
	config.plugins.autotimer.interval = ConfigNumber(default=30)
config.plugins.autotimer.refresh = ConfigSelection(choices=[
		("none", _("None")),
		("auto", _("Only AutoTimers created during this session")),
		("all", _("All non-repeating timers"))
	], default = "all"
)
config.plugins.autotimer.try_guessing = ConfigEnableDisable(default=True)
config.plugins.autotimer.editor = ConfigSelection(choices=[
		("plain", _("Classic")),
コード例 #25
0
elektrosleeptime = 5
elektroShutdownThreshold = 60 * 20

#Configuration
config.plugins.elektro = ConfigSubsection()
config.plugins.elektro.nextday = ConfigClock(default=((6 * 60 + 0) * 60))

config.plugins.elektro.sleep = ConfigSubDict()
for i in range(7):
    config.plugins.elektro.sleep[i] = ConfigClock(default=((1 * 60 + 0) * 60))

config.plugins.elektro.wakeup = ConfigSubDict()
for i in range(7):
    config.plugins.elektro.wakeup[i] = ConfigClock(default=((9 * 60 + 0) * 60))

config.plugins.elektro.standbyOnBoot = ConfigEnableDisable(default=False)
config.plugins.elektro.standbyOnManualBoot = ConfigEnableDisable(default=True)
config.plugins.elektro.standbyOnBootTimeout = ConfigNumber(default=60)
config.plugins.elektro.enable = ConfigEnableDisable(default=False)
config.plugins.elektro.nextwakeup = ConfigNumber(default=0)
config.plugins.elektro.force = ConfigEnableDisable(default=False)
config.plugins.elektro.dontwakeup = ConfigEnableDisable(default=False)
config.plugins.elektro.holiday = ConfigEnableDisable(default=False)
config.plugins.elektro.hddsleep = ConfigEnableDisable(default=False)

weekdays = [
    _("Monday"),
    _("Tuesday"),
    _("Wednesday"),
    _("Thursday"),
    _("Friday"),
コード例 #26
0
availableOptions = [("serviceIcons", _("MSN service icons"))]
if os.path.exists(
        os.path.dirname(
            resolveFilename(SCOPE_SKIN, config.skin.primary_skin.value)) +
        '/weather_icons/'):
    availableOptions.append(("weatherIcons", _("skin Icons")))
if os.path.exists('/usr/share/enigma2/animatedWeatherIcons'):
    availableOptions.append(("animIcons", _("animated Icons")))
config.plugins.WeatherPlugin.IconsType = ConfigSelection(
    choices=availableOptions, default="serviceIcons")
config.plugins.WeatherPlugin.ScalePicType = ConfigSelection(
    choices=[("self.instance.setScale", _("internal E2")),
             ("ePicLoad", _("ePicLoad (E.g. Vu+ org)"))],
    default="self.instance.setScale")

config.plugins.WeatherPlugin.BuildHistograms = ConfigEnableDisable(
    default=False)

config.plugins.WeatherPlugin.DebugEnabled = ConfigEnableDisable(default=False)
config.plugins.WeatherPlugin.DebugSize = ConfigSelection(choices=[
    ("10000", "10KB"),
    ("100000", "100KB"),
    ("1000000", "1MB"),
],
                                                         default="10000")

config.plugins.WeatherPlugin.DebugWeatherMSNupdater = ConfigEnableDisable(
    default=False)
config.plugins.WeatherPlugin.DebugMSNWeatherSource = ConfigEnableDisable(
    default=False)
config.plugins.WeatherPlugin.DebugMSNWeatherConverter = ConfigEnableDisable(
    default=False)
コード例 #27
0
from re import compile as re_compile, search as re_search

import os

my_global_session = None

config.plugins.CuberevoVFD = ConfigSubsection()
config.plugins.CuberevoVFD.scroll = ConfigSelection(default="once",
                                                    choices=[("never"),
                                                             ("once"),
                                                             ("always")])
config.plugins.CuberevoVFD.brightness = ConfigSelection(default="bright",
                                                        choices=[("dark"),
                                                                 ("medium"),
                                                                 ("bright")])
config.plugins.CuberevoVFD.showClock = ConfigEnableDisable(default=True)
#config.plugins.CuberevoVFD.setDaylight = ConfigEnableDisable(default = False)
config.plugins.CuberevoVFD.timeMode = ConfigSelection(default="24h",
                                                      choices=[("12h"),
                                                               ("24h")])
config.plugins.CuberevoVFD.setLed = ConfigEnableDisable(default=False)
config.plugins.CuberevoVFD.setFan = ConfigEnableDisable(default=True)


class CuberevoVFDSetup(ConfigListScreen, Screen):
    skin = """
		<screen position="100,100" size="550,400" title="CuberevoVFD Setup" >
		<widget name="config" position="20,10" size="460,350" scrollbarMode="showOnDemand" />
		<ePixmap position="140,350" size="140,40" pixmap="skin_default/buttons/green.png" alphatest="on" />
		<ePixmap position="280,350" size="140,40" pixmap="skin_default/buttons/red.png" alphatest="on" />
		<widget name="key_green" position="140,350" size="140,40" font="Regular;20" backgroundColor="#1f771f" zPosition="2" transparent="1" shadowColor="black" shadowOffset="-1,-1" />
コード例 #28
0
    + _("  (C) 2012 by betonme @ IHAD \n\n") \
    + _("  If You like this plugin and want to support it,\n") \
    + _("  or if just want to say ''thanks'',\n") \
    + _("  feel free to donate via PayPal. \n\n") \
    + _("  Thanks a lot ! \n  PayPal: ") + DONATE + "\n" \
    + _("  Support: ") + SUPPORT

# Globals
gPushService = None

# Config options
config.pushservice = ConfigSubsection()

config.pushservice.about = ConfigNothing()

config.pushservice.enable = ConfigEnableDisable(default=True)

config.pushservice.boxname = ConfigText(default="Enigma2", fixed_size=False)
config.pushservice.xmlpath = ConfigText(default="/etc/enigma2/pushservice.xml",
                                        fixed_size=False)

config.pushservice.runonboot = ConfigEnableDisable(default=True)
config.pushservice.bootdelay = ConfigSelectionNumber(5, 1000, 5, default=10)
config.pushservice.time = ConfigClock(default=0)
config.pushservice.period = ConfigSelectionNumber(0, 1000, 1, default=24)


#######################################################
# Plugin configuration
def setup(session, **kwargs):
    try:
コード例 #29
0
    def __init__(self, session, iface, plugin_path):
        self.skin = setupNfs.skin
        self.session = session
        Screen.__init__(self, session)

        self.container = eConsoleAppContainer()
        self.container.appClosed.append(self.runFinished)
        self.container.dataAvail.append(self.dataAvail)

        if isRunning('portmap') and isRunning('nfsd'):
            isEnabled = True
        else:
            isEnabled = False

        self.activeConfigEntry = NoSave(ConfigEnableDisable(default=isEnabled))

        self["nfsdLabel"] = Label()
        self["portmapLabel"] = Label()
        self["ButtonGreen"] = Pixmap()
        self["ButtonGreentext"] = Button(
            _("save and start/restart NFS-Server"))
        self["ButtonRed"] = Pixmap()
        self["ButtonRedtext"] = Label(_("Close"))
        self["ButtonYellow"] = Pixmap()
        self["ButtonYellowtext"] = Label(_("New Entry"))
        self["ButtonBlue"] = Pixmap()
        self["ButtonBluetext"] = Label(_("Remove Entry"))

        self.startingUp = False
        self.goingDown = False
        self.cmdlist = []
        self.run = 0

        self.exportlist = []
        data = self.readExports()
        if data is not None:
            for line in data:
                exportDir = line[0]
                client = line[1]
                options = line[2]
                options = options.replace('(', '')
                options = options.replace(')', '')
                self.exportlist.append((exportDir, client, options))
        else:
            self.exportlist.append(
                ('/media/hdd', '*', 'rw,no_root_squash,sync'))

        self["exportlist"] = List(self.exportlist)
        self.hideList = self["exportlist"].list

        self.createSetup()
        ConfigListScreen.__init__(self, self.list, session=session)
        self.activeConfigEntry.addNotifier(self.toggleServer)

        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions"], {
                "cancel": self.cancel,
                "ok": self.editExportEntry,
                "green": self.green,
                "red": self.cancel,
                "yellow": self.newExportEntry,
                "blue": self.deleteExportEntry
            }, -2)
コード例 #30
0
ファイル: plugin.py プロジェクト: rommalyshev/PITERKADET-DEPO
    def createSetup(self):
        self.tuneTimer.stop()
        self.list = []
        self.multiscanlist = []
        index_to_scan = int(self.scan_nims.value)

        self.tunerEntry = getConfigListEntry(_("Tuner"), self.scan_nims)
        self.list.append(self.tunerEntry)

        if self.scan_nims == []:
            return

        self.typeOfScanEntry = None
        self.systemEntry = None
        self.satelliteEntry = None
        self.modulationEntry = None
        self.scan_networkScan.value = False
        nim = nimmanager.nim_slots[index_to_scan]
        if nim.isCompatible("DVB-S"):
            self.typeOfScanEntry = getConfigListEntry(_("Type of scan"), self.scan_type)
            self.list.append(self.typeOfScanEntry)

            if self.scan_type.value == "single_transponder":
                self.updateSatList()
                sat = self.satList[index_to_scan][self.scan_satselection[index_to_scan].index]
                self.updateTranspondersList(sat[0])
                if nim.isCompatible("DVB-S2"):
                    self.systemEntry = getConfigListEntry(_("System"), self.scan_sat.system)
                    self.list.append(self.systemEntry)
                else:
                    self.scan_sat.system.value = eDVBFrontendParametersSatellite.System_DVB_S
                self.list.append(getConfigListEntry(_("Satellite"), self.scan_satselection[index_to_scan]))
                self.list.append(getConfigListEntry(_("Frequency"), self.scan_sat.frequency))
                self.list.append(getConfigListEntry(_("Inversion"), self.scan_sat.inversion))
                self.list.append(getConfigListEntry(_("Symbol Rate"), self.scan_sat.symbolrate))
                self.list.append(getConfigListEntry(_("Polarity"), self.scan_sat.polarization))
                if self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S:
                    self.list.append(getConfigListEntry(_("FEC"), self.scan_sat.fec))
                elif self.scan_sat.system.value == eDVBFrontendParametersSatellite.System_DVB_S2:
                    self.list.append(getConfigListEntry(_("FEC"), self.scan_sat.fec_s2))
                    self.modulationEntry = getConfigListEntry(_("Modulation"), self.scan_sat.modulation)
                    self.list.append(self.modulationEntry)
                    self.list.append(getConfigListEntry(_("Rolloff"), self.scan_sat.rolloff))
                    self.list.append(getConfigListEntry(_("Pilot"), self.scan_sat.pilot))
            elif self.scan_type.value == "predefined_transponder":
                self.updateSatList()
                self.satelliteEntry = getConfigListEntry(_("Satellite"), self.scan_satselection[index_to_scan])
                self.list.append(self.satelliteEntry)
                sat = self.satList[index_to_scan][self.scan_satselection[index_to_scan].index]
                self.updateTranspondersList(sat[0])
                self.list.append(getConfigListEntry(_("Transponder"), self.scan_transponders))
            elif self.scan_type.value == "single_satellite":
                self.updateSatList()
                sat = self.satList[index_to_scan][self.scan_satselection[index_to_scan].index]
                self.updateTranspondersList(sat[0])
                print self.scan_satselection[index_to_scan]
                self.list.append(getConfigListEntry(_("Satellite"), self.scan_satselection[index_to_scan]))
                self.scan_networkScan.value = True
            elif self.scan_type.value == "multisat":
                tlist = []
                SatList = nimmanager.getSatListForNim(index_to_scan)
                for x in SatList:
                    if self.Satexists(tlist, x[0]) == 0:
                        tlist.append(x[0])
                        sat = ConfigEnableDisable(default=self.scan_type.value.find("_yes") != -1 and True or False)
                        configEntry = getConfigListEntry(nimmanager.getSatDescription(x[0]), sat)
                        self.list.append(configEntry)
                        self.multiscanlist.append((x[0], sat))
                        sat.addNotifier(self.retune, initial_call=False)
                self.scan_networkScan.value = True

        self.list.append(getConfigListEntry(_("Network scan"), self.scan_networkScan))
        self.list.append(getConfigListEntry(_("Clear before scan"), self.scan_clearallservices))
        self.list.append(getConfigListEntry(_("Only Free scan"), self.scan_onlyfree))
        self["config"].list = self.list
        self["config"].l.setList(self.list)
コード例 #31
0
ファイル: plugin.py プロジェクト: vuteam/dvbapp
from Components.Sources.StaticText import StaticText
from Components.FileList import FileList
from Components.AVSwitch import AVSwitch
from Components.Sources.List import List
from Components.ConfigList import ConfigList, ConfigListScreen

from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSelection, ConfigText, ConfigEnableDisable, KEY_LEFT, KEY_RIGHT, KEY_0, getConfigListEntry

def getScale():
	return AVSwitch().getFramebufferScale()

config.pic = ConfigSubsection()
config.pic.framesize = ConfigInteger(default=30, limits=(5, 99))
config.pic.slidetime = ConfigInteger(default=10, limits=(10, 60))
config.pic.resize = ConfigSelection(default="1", choices = [("0", _("simple")), ("1", _("better"))])
config.pic.cache = ConfigEnableDisable(default=True)
config.pic.lastDir = ConfigText(default=resolveFilename(SCOPE_MEDIA))
config.pic.infoline = ConfigEnableDisable(default=True)
config.pic.loop = ConfigEnableDisable(default=True)
config.pic.bgcolor = ConfigSelection(default="#00000000", choices = [("#00000000", _("black")),("#009eb9ff", _("blue")),("#00ff5a51", _("red")), ("#00ffe875", _("yellow")), ("#0038FF48", _("green"))])
config.pic.textcolor = ConfigSelection(default="#0038FF48", choices = [("#00000000", _("black")),("#009eb9ff", _("blue")),("#00ff5a51", _("red")), ("#00ffe875", _("yellow")), ("#0038FF48", _("green"))])

class picshow(Screen):
	skin = """
		<screen name="picshow" position="center,center" size="560,440" title="PicturePlayer" >
			<ePixmap pixmap="buttons/red.png" position="0,0" size="140,40" alphatest="on" />
			<ePixmap pixmap="buttons/green.png" position="140,0" size="140,40" alphatest="on" />
			<ePixmap pixmap="buttons/yellow.png" position="280,0" size="140,40" alphatest="on" />
			<ePixmap pixmap="buttons/blue.png" position="420,0" size="140,40" alphatest="on" />
			<widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
			<widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
コード例 #32
0
	def createSetup(self, timer):
		# Name
		self.name = NoSave(ConfigText(default = timer.name, fixed_size = False))

		# Match
		self.match = NoSave(ConfigText(default = timer.match, fixed_size = False))

		# Encoding
		default = timer.encoding
		selection = ['UTF-8', 'ISO8859-15']
		if default not in selection:
			selection.append(default)
		self.encoding = NoSave(ConfigSelection(choices = selection, default = default))

		# ...
		self.searchType = NoSave(ConfigSelection(choices = [("partial", _("partial match")), ("exact", _("exact match")), ("start", _("title starts with")), ("description", _("description match"))], default = timer.searchType))
		self.searchCase = NoSave(ConfigSelection(choices = [("sensitive", _("case-sensitive search")), ("insensitive", _("case-insensitive search"))], default = timer.searchCase))

		# Alternatives override
		self.overrideAlternatives = NoSave(ConfigYesNo(default = timer.overrideAlternatives))

		# Justplay
		self.justplay = NoSave(ConfigSelection(choices = [("zap", _("zap")), ("record", _("record"))], default = {0: "record", 1: "zap"}[int(timer.justplay)]))
		self.setEndtime = NoSave(ConfigYesNo(default=timer.setEndtime))

		# Timespan
		now = [x for x in localtime()]
		if timer.hasTimespan():
			default = True
			now[3] = timer.timespan[0][0]
			now[4] = timer.timespan[0][1]
			begin = mktime(now)
			now[3] = timer.timespan[1][0]
			now[4] = timer.timespan[1][1]
			end = mktime(now)
		else:
			default = False
			now[3] = 20
			now[4] = 15
			begin = mktime(now)
			now[3] = 23
			now[4] = 15
			end = mktime(now)
		self.timespan = NoSave(ConfigEnableDisable(default = default))
		self.timespanbegin = NoSave(ConfigClock(default = begin))
		self.timespanend = NoSave(ConfigClock(default = end))

		# Timeframe
		if timer.hasTimeframe():
			default = True
			begin = timer.getTimeframeBegin()
			end = timer.getTimeframeEnd()
		else:
			default = False
			now = [x for x in localtime()]
			now[3] = 0
			now[4] = 0
			begin = mktime(now)
			end = begin + 604800 # today + 7d
		self.timeframe = NoSave(ConfigEnableDisable(default = default))
		self.timeframebegin = NoSave(ConfigDateTime(begin, _("%d.%B %Y"), increment = 86400))
		self.timeframeend = NoSave(ConfigDateTime(end, _("%d.%B %Y"), increment = 86400))

		# Services have their own Screen

		# Offset
		if timer.hasOffset():
			default = True
			begin = timer.getOffsetBegin()
			end = timer.getOffsetEnd()
		else:
			default = False
			begin = 5
			end = 5
		self.offset = NoSave(ConfigEnableDisable(default = default))
		self.offsetbegin = NoSave(ConfigNumber(default = begin))
		self.offsetend = NoSave(ConfigNumber(default = end))

		# AfterEvent
		if timer.hasAfterEvent():
			default = {
				None: "default",
				AFTEREVENT.NONE: "nothing",
				AFTEREVENT.DEEPSTANDBY: "deepstandby",
				AFTEREVENT.STANDBY: "standby",
				AFTEREVENT.AUTO: "auto"
			}[timer.afterevent[0][0]]
		else:
			default = "default"
		self.afterevent = NoSave(ConfigSelection(choices = [
			("default", _("standard")), ("nothing", _("do nothing")),
			("standby", _("go to standby")),
			("deepstandby", _("go to deep standby")),
			("auto", _("auto"))], default = default))

		# AfterEvent (Timespan)
		if timer.hasAfterEvent() and timer.afterevent[0][1][0] is not None:
			default = True
			now[3] = timer.afterevent[0][1][0][0]
			now[4] = timer.afterevent[0][1][0][1]
			begin = mktime(now)
			now[3] = timer.afterevent[0][1][1][0]
			now[4] = timer.afterevent[0][1][1][1]
			end = mktime(now)
		else:
			default = False
			now[3] = 23
			now[4] = 15
			begin = mktime(now)
			now[3] = 7
			now[4] = 0
			end = mktime(now)
		self.afterevent_timespan = NoSave(ConfigEnableDisable(default = default))
		self.afterevent_timespanbegin = NoSave(ConfigClock(default = begin))
		self.afterevent_timespanend = NoSave(ConfigClock(default = end))

		# Enabled
		self.enabled = NoSave(ConfigYesNo(default = timer.enabled))

		# Maxduration
		if timer.hasDuration():
			default = True
			duration = timer.getDuration()
		else:
			default = False
			duration =70
		self.duration = NoSave(ConfigEnableDisable(default = default))
		self.durationlength = NoSave(ConfigNumber(default = duration))

		# Counter
		if timer.hasCounter():
			default = timer.matchCount
		else:
			default = 0
		self.counter = NoSave(ConfigNumber(default = default))
		self.counterLeft = NoSave(ConfigNumber(default = timer.matchLeft))
		default = timer.getCounterFormatString()
		selection = [("", _("Never")), ("%m", _("Monthly")), ("%U", _("Weekly (Sunday)")), ("%W", _("Weekly (Monday)"))]
		if default not in ('', '%m', '%U', '%W'):
			selection.append((default, _("Custom (%s)") % (default)))
		self.counterFormatString = NoSave(ConfigSelection(selection, default = default))

		# Avoid Duplicate Description
		self.avoidDuplicateDescription = NoSave(ConfigSelection([
				("0", _("No")),
				("1", _("On same service")),
				("2", _("On any service")),
				("3", _("Any service/recording")),
			],
			default = str(timer.getAvoidDuplicateDescription())
		))

		# Search for Duplicate Desciption in...
		self.searchForDuplicateDescription = NoSave(ConfigSelection([
				("0", _("Title")),
				("1", _("Title and Short description")),
				("2", _("Title and all descriptions")),
			],
		    default = str(timer.searchForDuplicateDescription)
		))

		# Custom Location
		if timer.hasDestination():
			default = True
		else:
			default = False

		self.useDestination = NoSave(ConfigYesNo(default = default))

		default = timer.destination or Directories.resolveFilename(Directories.SCOPE_HDD)
		choices = config.movielist.videodirs.value

		if default not in choices:
			choices.append(default)
		self.destination = NoSave(ConfigSelection(default = default, choices = choices))

		# Tags
		self.timerentry_tags = timer.tags
		self.tags = NoSave(ConfigSelection(choices = [len(self.timerentry_tags) == 0 and _("None") or ' '.join(self.timerentry_tags)]))

		# Vps
		self.vps_enabled = NoSave(ConfigYesNo(default = timer.vps_enabled))
		self.vps_overwrite = NoSave(ConfigYesNo(default = timer.vps_overwrite))

		# SeriesPlugin
		self.series_labeling = NoSave(ConfigYesNo(default = timer.series_labeling))