Beispiel #1
0
    def __init__(self, session):
        Screen.__init__(self, session)

        self.setup_title = _("Softcam setup")
        self.setTitle(self.setup_title)

        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions", "CiSelectionActions"], {
                "cancel": self.cancel,
                "green": self.save,
                "red": self.cancel,
                "blue": self.ppanelShortcut,
            }, -1)

        self.list = []
        ConfigListScreen.__init__(self,
                                  self.list,
                                  session=session,
                                  on_change=self.changedEntry)

        self.softcam = CamControl('softcam')
        self.cardserver = CamControl('cardserver')

        self.ecminfo = GetEcmInfo()
        (newEcmFound, ecmInfo) = self.ecminfo.getEcm()
        self["info"] = ScrollLabel("".join(ecmInfo))
        self.EcmInfoPollTimer = eTimer()
        self.EcmInfoPollTimer.callback.append(self.setEcmInfo)
        self.EcmInfoPollTimer.start(1000)

        softcams = self.softcam.getList()
        cardservers = self.cardserver.getList()

        self.softcams = ConfigSelection(choices=softcams)
        self.softcams.value = self.softcam.current()

        self.softcams_text = _("Select Softcam")
        self.list.append(getConfigListEntry(self.softcams_text, self.softcams))
        if cardservers:
            self.cardservers = ConfigSelection(choices=cardservers)
            self.cardservers.value = self.cardserver.current()
            self.list.append(
                getConfigListEntry(_("Select Card Server"), self.cardservers))

        self.list.append(
            getConfigListEntry(_("Restart softcam"),
                               ConfigAction(self.restart, "s")))
        if cardservers:
            self.list.append(
                getConfigListEntry(_("Restart cardserver"),
                                   ConfigAction(self.restart, "c")))
            self.list.append(
                getConfigListEntry(_("Restart both"),
                                   ConfigAction(self.restart, "sc")))

        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("OK"))
        self["key_blue"] = StaticText()
        self.onShown.append(self.blueButton)
    def __init__(self, session):
        Screen.__init__(self, session)

        self.setup_title = _("Softcam setup")
        self.setTitle(self.setup_title)

        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions", "CiSelectionActions"], {
                "cancel": self.cancel,
                "green": self.save,
                "red": self.cancel,
                "blue": self.ppanelShortcut,
            }, -1)

        self.list = []
        ConfigListScreen.__init__(self,
                                  self.list,
                                  session=session,
                                  on_change=self.changedEntry)

        self.softcam = CamControl('softcam')
        self.cardserver = CamControl('cardserver')

        self.ecminfo = GetEcmInfo()
        (newEcmFound, ecmInfo) = self.ecminfo.getEcm()
        self["info"] = ScrollLabel("".join(ecmInfo))
        self.EcmInfoPollTimer = eTimer()
        self.EcmInfoPollTimer.callback.append(self.setEcmInfo)
        self.EcmInfoPollTimer.start(1000)

        softcams = self.softcam.getList()
        cardservers = self.cardserver.getList()

        self.softcams = ConfigSelection(choices=softcams)
        self.softcams.value = self.softcam.current()

        self.softcams_text = _("Select Softcam")
        self.list.append(getConfigListEntry(self.softcams_text, self.softcams))
        if cardservers:
            self.cardservers = ConfigSelection(choices=cardservers)
            self.cardservers.value = self.cardserver.current()
            self.list.append(
                getConfigListEntry(_("Select Card Server"), self.cardservers))

        self.list.append(
            getConfigListEntry(_("Restart softcam"),
                               ConfigAction(self.restart, "s")))
        if cardservers:
            self.list.append(
                getConfigListEntry(_("Restart cardserver"),
                                   ConfigAction(self.restart, "c")))
            self.list.append(
                getConfigListEntry(_("Restart both"),
                                   ConfigAction(self.restart, "sc")))

        softcams = listdir('/usr/bin/')
        for softcam in softcams:
            if softcam.startswith('CCcam') or softcam.startswith('cccam'):
                config.plugins.softcam.cccaminfo.value = True
            elif softcam.startswith('OScam') or softcam.startswith('oscam'):
                config.plugins.softcam.oscaminfo.value = True
            elif softcam.startswith('Ncam') or softcam.startswith('ncam'):
                config.plugins.softcam.ncaminfo.value = True

        if config.plugins.softcam.cccaminfo.value:
            self.list.append(
                getConfigListEntry(_("Show CCcamInfo in extensions menu?"),
                                   config.cccaminfo.showInExtensions, None,
                                   None))
        if config.plugins.softcam.oscaminfo.value:
            self.list.append(
                getConfigListEntry(_("Show OScamInfo in extensions menu?"),
                                   config.oscaminfo.showInExtensions, None,
                                   None))
        if config.plugins.softcam.ncaminfo.value:
            self.list.append(
                getConfigListEntry(_("Show NcamInfo in extensions menu?"),
                                   config.ncaminfo.showInExtensions, None,
                                   None))

        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("OK"))
        self["key_blue"] = StaticText()
        self.onShown.append(self.blueButton)