def Plugins(**kwargs): list = [ PluginDescriptor(where=PluginDescriptor.WHERE_SESSIONSTART, fnc=GBIpboxClientAutostart), PluginDescriptor(name="GBIpboxClient", description=_("Gigablue IPBox network client"), where=[ PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_PLUGINMENU ], fnc=GBIpboxClient), PluginDescriptor(name="GBIpboxClient", description=_("Gigablue IPBox network client"), where=PluginDescriptor.WHERE_MENU, needsRestart=False, fnc=ipboxclientStart) ] if config.ipboxclient.remotetimers.value: list.append( PluginDescriptor(where=PluginDescriptor.WHERE_RECORDTIMER, fnc=ipboxclientRecordTimer)) if not config.ipboxclient.firstconf.value and getHasTuners() == False: list.append( PluginDescriptor(name=_("IPBox wizard"), where=PluginDescriptor.WHERE_WIZARD, needsRestart=False, fnc=(30, GBIpboxWizard))) return list
def Plugins(**kwargs): list = [ PluginDescriptor( where = PluginDescriptor.WHERE_SESSIONSTART, fnc = GBIpboxClientAutostart ), PluginDescriptor( name = "GBIpboxClient", description = _("Gigablue IPBox network client"), where = [PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_PLUGINMENU], fnc = GBIpboxClient ), PluginDescriptor( name = "GBIpboxClient", description = _("Gigablue IPBox network client"), where = PluginDescriptor.WHERE_MENU, needsRestart = False, fnc = ipboxclientStart ) ] if config.ipboxclient.remotetimers.value: list.append(PluginDescriptor( where = PluginDescriptor.WHERE_RECORDTIMER, fnc = ipboxclientRecordTimer )) if not config.ipboxclient.firstconf.value: list.append(PluginDescriptor( name = _("IPBox wizard"), where = PluginDescriptor.WHERE_WIZARD, needsRestart = False, fnc=(30, GBIpboxWizard) )) return list
def ipboxclientStart(menuid, **kwargs): if getImageDistro() in ("openatv"): if menuid == "scan": return [(_("IPBOX Client"), GBIpboxClient, "ipbox_client_Start", 13)] else: return [] elif menuid == "mainmenu": return [(_("GBIpboxClient"), GBIpboxClient, "ipbox_client_Start", 13)] else: return []
def ipboxclientStart(menuid, **kwargs): if getImageDistro() in ("openatv", "openld"): if menuid == "scan": return [(_("IPBOX Client"), GBIpboxClient, "ipbox_client_Start", 13)] else: return [] elif menuid == "mainmenu": return [(_("GBIpboxClient"), GBIpboxClient, "ipbox_client_Start", 13)] else: return []
def parseScanResults(self): self.timer.stop() if len(self.scanresults) > 0: menulist = [] for result in self.scanresults: menulist.append((result[0] + ' (' + result[1] + ')', result)) menulist.append((_('Cancel'), None)) message = _("Choose your main device") self.session.openWithCallback(self.scanCallback, MessageBox, message, list=menulist) else: self.session.open(MessageBox, _("No devices found"), type = MessageBox.TYPE_ERROR)
def downloadCompleted(self): self.timer.stop() if self.remotetimer_old != config.ipboxclient.remotetimers.value: self.session.openWithCallback( self.restart, MessageBox, _("To apply new settings, you need to reboot your STB. Do you want reboot it now?" ), type=MessageBox.TYPE_YESNO) else: self.session.openWithCallback(self.close, MessageBox, _("Download completed"), type=MessageBox.TYPE_INFO)
def __init__(self, session): Screen.__init__(self, session) if getImageDistro() in ("openatv", "openld"): self.setTitle(_('IPBOX Client About')) about = "IPBOX Client 1.0" "\n" else: self.setTitle(_('GBIpbox Client About')) about = "GBIpbox Client 1.0" "\n" about += "(c) 2014 Impex-Sat Gmbh & Co.KG\n\n" about += "Written by Sandro Cavazzoni <*****@*****.**>" self['about'] = Label(about) self["actions"] = ActionMap(["SetupActions"], {"cancel": self.keyCancel})
def getScanList(self): devices = [] for result in self.scanresults: devices.append((result[0] + ' (' + result[1] + ')', result[1])) devices.append((_('Cancel'), 'cancel')) return devices
def parseScanResults(self): self.timer.stop() if len(self.scanresults) > 0: menulist = [] for result in self.scanresults: menulist.append((result[0] + ' (' + result[1] + ')', result)) menulist.append((_('Cancel'), None)) message = _("Choose your main device") self.session.openWithCallback(self.scanCallback, MessageBox, message, list=menulist) else: self.session.open(MessageBox, _("No devices found"), type=MessageBox.TYPE_ERROR)
def __init__(self, session, timerinstance): self.session = session self.list = [] self.timerinstance = timerinstance self.remotetimer_old = config.ipboxclient.remotetimers.value Screen.__init__(self, session) ConfigListScreen.__init__(self, self.list) if getImageDistro() in ("openatv"): self.setTitle(_('IPBOX Client')) else: self.setTitle(_('GBIpbox Client')) self["VKeyIcon"] = Boolean(False) self["text"] = StaticText(_('NOTE: the remote HDD feature require samba installed on server box.')) self["key_red"] = Button(_('Cancel')) self["key_green"] = Button(_('Save')) self["key_yellow"] = Button(_('Scan')) self["key_blue"] = Button(_('About')) self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], { "cancel": self.keyCancel, "red": self.keyCancel, "green": self.keySave, "yellow": self.keyScan, "blue": self.keyAbout }, -2) self.populateMenu() if not config.ipboxclient.firstconf.value: self.timer = eTimer() self.timer.callback.append(self.scanAsk) self.timer.start(100)
def keyScan(self): self.messagebox = self.session.open( MessageBox, _('Please wait while scan is in progress.\nThis operation may take a while' ), MessageBox.TYPE_INFO, enable_input=False) self.timer = eTimer() self.timer.callback.append(self.scan) self.timer.start(100)
def __init__(self, session): self.xmlfile = Directories.resolveFilename(Directories.SCOPE_PLUGINS, "Extensions/GBIpboxClient/gbipboxwizard.xml") Wizard.__init__(self, session) self.setTitle(_('GBIpbox Client')) self.skinName = ["GBIpboxWizard", "NetworkWizard"] self["wizard"] = Pixmap() self["HelpWindow"] = Pixmap() self["HelpWindow"].hide() self["VKeyIcon"] = Boolean(False)
def __init__(self, session, timerinstance): self.session = session self.list = [] self.timerinstance = timerinstance self.remotetimer_old = config.ipboxclient.remotetimers.value Screen.__init__(self, session) ConfigListScreen.__init__(self, self.list) self.setTitle(_('GBIpbox Client')) self["VKeyIcon"] = Boolean(False) self["text"] = StaticText( _('NOTE: the remote HDD feature require samba installed on server box.' )) self["key_red"] = Button(_('Cancel')) self["key_green"] = Button(_('Save')) self["key_yellow"] = Button(_('Scan')) self["key_blue"] = Button(_('About')) self["actions"] = ActionMap( ["OkCancelActions", "ColorActions"], { "cancel": self.keyCancel, "red": self.keyCancel, "green": self.keySave, "yellow": self.keyScan, "blue": self.keyAbout }, -2) self.populateMenu() if not config.ipboxclient.firstconf.value: self.timer = eTimer() self.timer.callback.append(self.scanAsk) self.timer.start(100)
def __init__(self, session): Screen.__init__(self, session) self.setTitle(_('GBIpbox Client About')) about = "GBIpbox Client 1.0""\n" about += "(c) 2014 Impex-Sat Gmbh & Co.KG\n\n" about += "Written by Sandro Cavazzoni <*****@*****.**>" self['about'] = Label(about) self["actions"] = ActionMap(["SetupActions"], { "cancel": self.keyCancel })
def keySave(self): for x in self["config"].list: x[1].save() config.ipboxclient.firstconf.value = True config.ipboxclient.firstconf.save() if self.timerinstance: self.timerinstance.refreshScheduler() mount = GBIpboxMount(self.session) mount.remount() self.messagebox = self.session.open(MessageBox, _('Please wait while download is in progress.\nNOTE: If you have parental control enabled on remote box, the local settings will be overwritten.'), MessageBox.TYPE_INFO, enable_input = False) self.timer = eTimer() self.timer.callback.append(self.download) self.timer.start(100)
def keySave(self): for x in self["config"].list: x[1].save() config.ipboxclient.firstconf.value = True config.ipboxclient.firstconf.save() if self.timerinstance: self.timerinstance.refreshScheduler() mount = GBIpboxMount(self.session) mount.remount() self.messagebox = self.session.open( MessageBox, _('Please wait while download is in progress.\nNOTE: If you have parental control enabled on remote box, the local settings will be overwritten.' ), MessageBox.TYPE_INFO, enable_input=False) self.timer = eTimer() self.timer.callback.append(self.download) self.timer.start(100)
def populateMenu(self): self.list = [] self.list.append(getConfigListEntry(_("Host"), config.ipboxclient.host)) self.list.append( getConfigListEntry(_("HTTP port"), config.ipboxclient.port)) self.list.append( getConfigListEntry(_("Streaming port"), config.ipboxclient.streamport)) self.list.append( getConfigListEntry(_("Authentication"), config.ipboxclient.auth)) if config.ipboxclient.auth.value: self.list.append( getConfigListEntry(_("Username"), config.ipboxclient.username)) self.list.append( getConfigListEntry(_("Password"), config.ipboxclient.password)) self.list.append( getConfigListEntry(_("Use remote HDD"), config.ipboxclient.mounthdd)) self.list.append( getConfigListEntry(_("Use remote timers"), config.ipboxclient.remotetimers)) self.list.append( getConfigListEntry(_("Schedule sync"), config.ipboxclient.schedule)) if config.ipboxclient.schedule.getValue(): self.list.append( getConfigListEntry(_("Time of sync to start"), config.ipboxclient.scheduletime)) self.list.append( getConfigListEntry(_("Repeat how often"), config.ipboxclient.repeattype)) self["config"].list = self.list self["config"].l.setList(self.list)
def getTranslation(self, text): return _(text)
def scanAsk(self): self.timer.stop() self.session.openWithCallback(self.scanConfirm, MessageBox, _("Do you want to scan for a server?"), MessageBox.TYPE_YESNO)
def downloadCompleted(self): self.timer.stop() if self.remotetimer_old != config.ipboxclient.remotetimers.value: self.session.openWithCallback(self.restart, MessageBox, _("To apply new settings, you need to reboot your STB. Do you want reboot it now?"), type = MessageBox.TYPE_YESNO) else: self.session.openWithCallback(self.close, MessageBox, _("Download completed"), type = MessageBox.TYPE_INFO)
def downloadError(self): self.timer.stop() self.session.open(MessageBox, _("Cannot download data. Please check your configuration"), type = MessageBox.TYPE_ERROR)
from GBIpboxLocale import _ from boxbranding import getImageDistro config.ipboxclient = ConfigSubsection() config.ipboxclient.host = ConfigText(default="", fixed_size=False) config.ipboxclient.port = ConfigInteger(default=80, limits=(1, 65535)) config.ipboxclient.streamport = ConfigInteger(default=8001, limits=(1, 65535)) config.ipboxclient.auth = ConfigYesNo(default=False) config.ipboxclient.firstconf = ConfigYesNo(default=False) config.ipboxclient.username = ConfigText(default="", fixed_size=False) config.ipboxclient.password = ConfigText(default="", fixed_size=False) config.ipboxclient.schedule = ConfigYesNo(default=False) config.ipboxclient.scheduletime = ConfigClock(default=0) # 1:00 config.ipboxclient.repeattype = ConfigSelection(default="daily", choices=[ ("daily", _("Daily")), ("weekly", _("Weekly")), ("monthly", _("30 Days")) ]) config.ipboxclient.mounthdd = ConfigYesNo(default=False) config.ipboxclient.remotetimers = ConfigYesNo(default=False) def ipboxclientRecordTimer(): return GBIpboxRemoteTimer() def ipboxclientStart(menuid, **kwargs): if getImageDistro() in ("openatv", "openld"): if menuid == "scan": return [(_("IPBOX Client"), GBIpboxClient, "ipbox_client_Start",
def ipboxclientStart(menuid, **kwargs): if menuid == "mainmenu": return [(_("GBIpboxClient"), GBIpboxClient, "ipbox_client_Start", 13)] else: return []
def populateMenu(self): self.list = [] self.list.append(getConfigListEntry(_("Host"), config.ipboxclient.host)) self.list.append(getConfigListEntry(_("HTTP port"), config.ipboxclient.port)) self.list.append(getConfigListEntry(_("Streaming port"), config.ipboxclient.streamport)) self.list.append(getConfigListEntry(_("Authentication"), config.ipboxclient.auth)) if config.ipboxclient.auth.value: self.list.append(getConfigListEntry(_("Username"), config.ipboxclient.username)) self.list.append(getConfigListEntry(_("Password"), config.ipboxclient.password)) self.list.append(getConfigListEntry(_("Use remote HDD"), config.ipboxclient.mounthdd)) self.list.append(getConfigListEntry(_("Use remote timers"), config.ipboxclient.remotetimers)) self.list.append(getConfigListEntry(_("Schedule sync"), config.ipboxclient.schedule)) if config.ipboxclient.schedule.getValue(): self.list.append(getConfigListEntry(_("Time of sync to start"), config.ipboxclient.scheduletime)) self.list.append(getConfigListEntry(_("Repeat how often"), config.ipboxclient.repeattype)) self["config"].list = self.list self["config"].l.setList(self.list)
from GBIpboxRemoteTimer import GBIpboxRemoteTimer from GBIpboxWizard import GBIpboxWizard from GBIpboxLocale import _ from boxbranding import getImageDistro config.ipboxclient = ConfigSubsection() config.ipboxclient.host = ConfigText(default = "", fixed_size = False) config.ipboxclient.port = ConfigInteger(default = 80, limits = (1, 65535)) config.ipboxclient.streamport = ConfigInteger(default = 8001, limits = (1, 65535)) config.ipboxclient.auth = ConfigYesNo(default = False) config.ipboxclient.firstconf = ConfigYesNo(default = False) config.ipboxclient.username = ConfigText(default = "", fixed_size = False) config.ipboxclient.password = ConfigText(default = "", fixed_size = False) config.ipboxclient.schedule = ConfigYesNo(default = True) config.ipboxclient.scheduletime = ConfigClock(default = 0) # 1:00 config.ipboxclient.repeattype = ConfigSelection(default = "daily", choices = [("daily", _("Daily")), ("weekly", _("Weekly")), ("monthly", _("30 Days"))]) config.ipboxclient.mounthdd = ConfigYesNo(default = True) config.ipboxclient.remotetimers = ConfigYesNo(default = True) def ipboxclientRecordTimer(): return GBIpboxRemoteTimer() def ipboxclientStart(menuid, **kwargs): if getImageDistro() in ("openatv"): if menuid == "scan": return [(_("IPBOX Client"), GBIpboxClient, "ipbox_client_Start", 13)] else: return [] elif menuid == "mainmenu": return [(_("GBIpboxClient"), GBIpboxClient, "ipbox_client_Start", 13)] else:
def keyScan(self): self.messagebox = self.session.open(MessageBox, _('Please wait while scan is in progress.\nThis operation may take a while'), MessageBox.TYPE_INFO, enable_input = False) self.timer = eTimer() self.timer.callback.append(self.scan) self.timer.start(100)
def downloadError(self): self.timer.stop() self.session.open( MessageBox, _("Cannot download data. Please check your configuration"), type=MessageBox.TYPE_ERROR)