Esempio n. 1
0
    def createConfig(self):
        TimerEntryBase.createConfig(self)
        afterevent = {
            AFTEREVENT.NONE: "nothing",
            AFTEREVENT.WAKEUPTOSTANDBY: "wakeuptostandby",
            AFTEREVENT.STANDBY: "standby",
            AFTEREVENT.DEEPSTANDBY: "deepstandby"
        }[self.timer.afterEvent]

        timertype = {
            TIMERTYPE.WAKEUP: "wakeup",
            TIMERTYPE.WAKEUPTOSTANDBY: "wakeuptostandby",
            TIMERTYPE.AUTOSTANDBY: "autostandby",
            TIMERTYPE.AUTODEEPSTANDBY: "autodeepstandby",
            TIMERTYPE.STANDBY: "standby",
            TIMERTYPE.DEEPSTANDBY: "deepstandby",
            TIMERTYPE.REBOOT: "reboot",
            TIMERTYPE.RESTART: "restart"
        }[self.timer.timerType]

        autosleepinstandbyonly = self.timer.autosleepinstandbyonly
        autosleepdelay = self.timer.autosleepdelay
        autosleeprepeat = self.timer.autosleeprepeat

        if SystemInfo["DeepstandbySupport"]:
            shutdownString = _("go to deep standby")
        else:
            shutdownString = _("shut down")
        self.timerentry_timertype = ConfigSelection(choices=[
            ("wakeup", _("wakeup")),
            ("wakeuptostandby", _("wakeup to standby")),
            ("autostandby", _("auto standby")),
            ("autodeepstandby", _("auto deepstandby")),
            ("standby", _("go to standby")), ("deepstandby", shutdownString),
            ("reboot", _("reboot system")), ("restart", _("restart GUI"))
        ],
                                                    default=timertype)
        self.timerentry_afterevent = ConfigSelection(choices=[
            ("nothing", _("do nothing")),
            ("wakeuptostandby", _("wakeup to standby")),
            ("standby", _("go to standby")), ("deepstandby", shutdownString),
            ("nothing", _("do nothing"))
        ],
                                                     default=afterevent)

        self.timerentry_autosleepdelay = ConfigInteger(default=autosleepdelay,
                                                       limits=(10, 300))
        self.timerentry_autosleeprepeat = ConfigSelection(
            choices=[("once", _("once")), ("repeated", _("repeated"))],
            default=autosleeprepeat)
        self.timerentry_autosleepinstandbyonly = ConfigSelection(
            choices=[("yes", _("Yes")), ("no", _("No"))],
            default=autosleepinstandbyonly)

        self.timerentry_showendtime = ConfigYesNo(
            default=(((self.timer.end - self.timer.begin) / 60) > 1))
Esempio n. 2
0
    def createConfig(self):
        TimerEntryBase.createConfig(self)
        justplay = self.timer.justplay
        always_zap = self.timer.always_zap
        pipzap = self.timer.pipzap
        rename_repeat = self.timer.rename_repeat
        conflict_detection = self.timer.conflict_detection

        afterevent = {
            AFTEREVENT.NONE: "nothing",
            AFTEREVENT.DEEPSTANDBY: "deepstandby",
            AFTEREVENT.STANDBY: "standby",
            AFTEREVENT.AUTO: "auto"
        }[self.timer.afterEvent]

        if self.timer.record_ecm and self.timer.descramble:
            recordingtype = "descrambled+ecm"
        elif self.timer.record_ecm:
            recordingtype = "scrambled+ecm"
        elif self.timer.descramble:
            recordingtype = "normal"

        self.timerentry_justplay = ConfigSelection(
            choices=[("zap", _("zap")), ("record", _("record")),
                     ("zap+record", _("zap and record"))],
            default={
                0: "record",
                1: "zap",
                2: "zap+record"
            }[justplay + 2 * always_zap])
        if SystemInfo["DeepstandbySupport"]:
            shutdownString = _("go to deep standby")
        else:
            shutdownString = _("shut down")
        self.timerentry_afterevent = ConfigSelection(choices=[
            ("nothing", _("do nothing")), ("standby", _("go to standby")),
            ("deepstandby", shutdownString), ("auto", _("auto"))
        ],
                                                     default=afterevent)
        self.timerentry_recordingtype = ConfigSelection(choices=[
            ("normal", _("normal")),
            ("descrambled+ecm", _("descramble and record ecm")),
            ("scrambled+ecm", _("don't descramble, record ecm"))
        ],
                                                        default=recordingtype)
        self.timerentry_name = ConfigText(default=self.timer.name.replace(
            '\x86', '').replace('\x87', ''),
                                          visible_width=50,
                                          fixed_size=False)
        self.timerentry_description = ConfigText(
            default=self.timer.description, visible_width=50, fixed_size=False)
        self.timerentry_tags = self.timer.tags[:]
        # if no tags found, make name of event default tag set.
        if not self.timerentry_tags:
            tagname = self.timer.name.strip()
            if tagname:
                tagname = tagname[0].upper() + tagname[1:].replace(" ", "_")
                self.timerentry_tags.append(tagname)

        self.timerentry_tagsset = ConfigSelection(choices=[
            not self.timerentry_tags and "None"
            or " ".join(self.timerentry_tags)
        ])

        self.timerentry_renamerepeat = ConfigYesNo(default=rename_repeat)

        self.timerentry_pipzap = ConfigYesNo(default=pipzap)
        self.timerentry_conflictdetection = ConfigYesNo(
            default=conflict_detection)

        self.timerentry_showendtime = ConfigSelection(default=False,
                                                      choices=[
                                                          (True, _("yes")),
                                                          (False, _("no"))
                                                      ])

        default = self.timer.dirname or defaultMoviePath()
        tmp = config.movielist.videodirs.value
        if default not in tmp:
            tmp.append(default)
        self.timerentry_dirname = ConfigSelection(default=default, choices=tmp)

        # FIXME some service-chooser needed here
        servicename = "N/A"
        try:  # no current service available?
            servicename = str(self.timer.service_ref.getServiceName())
        except:
            pass
        self.timerentry_service_ref = self.timer.service_ref
        self.timerentry_service = ConfigSelection([servicename])