def __init__(self, session, entry, index): self.skin = OscamServerEntryConfigScreen.skin self.session = session Screen.__init__(self, session) if entry == None: entry = oscamServer() self.index = index # Server address IP format or TextFormat? serverIP = self.isIPaddress(entry.serverIP) if serverIP and config.plugins.OscamStatus.useIP.value: self.isIP = True else: self.isIP = False serverPort = int(entry.serverPort) self.serverNameConfigEntry = NoSave( ConfigText(default=entry.serverName, fixed_size=False, visible_width=20)) if self.isIP: self.serverIPConfigEntry = NoSave( ConfigIP(default=serverIP, auto_jump=True)) else: self.serverIPConfigEntry = NoSave( ConfigText(default=entry.serverIP, fixed_size=False, visible_width=20)) self.serverIPConfigEntry.setUseableChars( u'1234567890aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ.-_' ) self.portConfigEntry = NoSave( ConfigInteger(default=serverPort, limits=(0, 65536))) self.usernameConfigEntry = NoSave( ConfigText(default=entry.username, fixed_size=False, visible_width=20)) self.passwordConfigEntry = NoSave( ConfigPassword(default=entry.password, fixed_size=False)) self.useSSLConfigEntry = NoSave(ConfigYesNo(entry.useSSL)) ConfigListScreen.__init__(self, [], session=session) self.createSetup() self["title"] = StaticText(_("Oscam Server Setup")) self["ButtonRedtext"] = StaticText(_("return")) self["ButtonGreentext"] = StaticText(_("save")) self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], { "red": self.Close, "green": self.Save, "cancel": self.Close }, -1) self.onLayoutFinish.append(self.LayoutFinished)
def __init__(self, session): self.skin = globalsConfigScreen.skin self.session = session Screen.__init__(self, session) list = [] list.append( getConfigListEntry(_("Show Plugin in Extensions Menu"), config.plugins.OscamStatus.extMenu)) list.append( getConfigListEntry(_("X-Offset (move left)"), config.plugins.OscamStatus.xOffset)) list.append( getConfigListEntry(_("ECM Time in \"connected\" Dialog"), config.plugins.OscamStatus.useECM)) list.append( getConfigListEntry(_("Server address always in IP Format"), config.plugins.OscamStatus.useIP)) list.append( getConfigListEntry(_("Use Picons"), config.plugins.OscamStatus.usePicons)) # list.append(getConfigListEntry(_("Picons Path"), config.plugins.OscamStatus.PiconPath)) ConfigListScreen.__init__(self, list, session=session) self["title"] = StaticText(_("Oscam Status globals Setup")) self["ButtonRedtext"] = StaticText(_("return")) self["ButtonGreentext"] = StaticText(_("save")) self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], { "red": self.Exit, "green": self.Save, "cancel": self.Exit }, -1) self.onLayoutFinish.append(self.LayoutFinished)
def keyDelete(self): try: self.index = self["list"].getSelectionIndex() except: self.index = -1 if self.index > -1: if self.index == config.plugins.OscamStatus.lastServer.value: print("[OscamStatus] you can not delete the active entry...") return message = _("Do you really want to delete this entry?") msg = self.session.openWithCallback(self.Confirmed, MessageBox, message) msg.setTitle("Oscam Status")
def __init__(self, session): self.skin = OscamServerEntriesListConfigScreen.skin self.session = session Screen.__init__(self, session) self["list"] = OscamServerEntryList([]) self["list"].makeList(config.plugins.OscamStatus.lastServer.value) self["title"] = StaticText(_("Oscam Servers")) self["ButtonGreentext"] = StaticText(_("new")) self["ButtonYellowtext"] = StaticText(_("edit")) self["ButtonBluetext"] = StaticText(_("delete")) self["actions"] = ActionMap( ["OkCancelActions", "ColorActions"], { "green": self.keyNew, "yellow": self.keyEdit, "blue": self.keyDelete, "ok": self.keyOk, "cancel": self.keyClose }, -1) self.onLayoutFinish.append(self.LayoutFinished)
def createSetup(self): self.list = [] self.list.append( getConfigListEntry(_("Oscam Server Name"), self.serverNameConfigEntry)) self.list.append( getConfigListEntry(_("Oscam Server Address"), self.serverIPConfigEntry)) self.list.append(getConfigListEntry(_("Port"), self.portConfigEntry)) self.list.append( getConfigListEntry(_("Username (httpuser)"), self.usernameConfigEntry)) self.list.append( getConfigListEntry(_("Password (httppwd)"), self.passwordConfigEntry)) self.list.append( getConfigListEntry(_("use SSL"), self.useSSLConfigEntry)) self["config"].setList(self.list)