Esempio n. 1
0
    def openServiceList(self):
        if pluginPresent.AdvancedProgramGuide:
            from Plugins.Extensions.AdvancedProgramGuide.plugin import AdvancedProgramGuideII, AdvancedProgramGuide
            if config.plugins.AdvancedProgramGuide.StartFirst.value and config.plugins.AdvancedProgramGuide.Columns.value:
                self.session.open(AdvancedProgramGuideII)
            else:
                if config.plugins.AdvancedProgramGuide.StartFirst.value and not config.plugins.AdvancedProgramGuide.Columns.value:
                    self.session.open(AdvancedProgramGuide)
                else:
                    if not config.plugins.AdvancedProgramGuide.StartFirst.value and config.plugins.AdvancedProgramGuide.Columns.value:
                        from Screens.InfoBar import InfoBar
                        if InfoBar.instance:
                            servicelist = InfoBar.instance.servicelist
                            self.session.open(AdvancedProgramGuideII,
                                              servicelist)
                    else:
                        if not config.plugins.AdvancedProgramGuide.StartFirst.value and not config.plugins.AdvancedProgramGuide.Columns.value:
                            from Screens.InfoBar import InfoBar
                            if InfoBar.instance:
                                servicelist = InfoBar.instance.servicelist
                                self.session.open(AdvancedProgramGuide,
                                                  servicelist)

        elif pluginPresent.MerlinEPGCenter and not pluginPresent.AdvancedProgramGuide and not pluginPresent.CoolTVGuide and not pluginPresent.MerlinEPGCenter:
            from Plugins.Extensions.MerlinEPG.plugin import Merlin_PGII, Merlin_PGd
            if config.plugins.MerlinEPG.StartFirst.value and config.plugins.MerlinEPG.Columns.value:
                self.session.open(Merlin_PGII)
            else:
                if config.plugins.MerlinEPG.StartFirst.value and not config.plugins.MerlinEPG.Columns.value:
                    self.session.open(Merlin_PGd)
                else:
                    if not config.plugins.MerlinEPG.StartFirst.value and config.plugins.MerlinEPG.Columns.value:
                        from Screens.InfoBar import InfoBar
                        if InfoBar.instance:
                            servicelist = InfoBar.instance.servicelist
                            self.session.open(Merlin_PGII, servicelist)
                    else:
                        if not config.plugins.MerlinEPG.StartFirst.value and not config.plugins.MerlinEPG.Columns.value:
                            from Screens.InfoBar import InfoBar
                            if InfoBar.instance:
                                servicelist = InfoBar.instance.servicelist
                                self.session.open(Merlin_PGd, servicelist)

        elif pluginPresent.CoolTVGuide and not pluginPresent.AdvancedProgramGuide and not pluginPresent.MerlinEPGCenter and not pluginPresent.MerlinEPGCenter:
            from Plugins.Extensions.CoolTVGuide.plugin import main as ctvmain
            ctvmain(self.session)

        elif pluginPresent.MerlinEPGCenter and not pluginPresent.CoolTVGuide and not pluginPresent.AdvancedProgramGuide and not pluginPresent.MerlinEPGCenter:
            from Plugins.Extensions.MerlinEPGCenter.plugin import MerlinEPGCenterStarter
            MerlinEPGCenterStarter.instance.openMerlinEPGCenter()
        else:
            self.session.open(
                MessageBox,
                _("Not possible!\nMerlinEPG and CoolTVGuide or/and MerlinEPGCenter present or neither installed from this three plugins."
                  ), MessageBox.TYPE_INFO)
 def openServiceList(self):
     if pluginPresent.AdvancedProgramGuide:
         from Plugins.Extensions.AdvancedProgramGuide.plugin import AdvancedProgramGuideII, AdvancedProgramGuide
         if config.plugins.AdvancedProgramGuide.StartFirst.value and config.plugins.AdvancedProgramGuide.Columns.value:
             self.session.open(AdvancedProgramGuideII)
         else:
             if config.plugins.AdvancedProgramGuide.StartFirst.value and not config.plugins.AdvancedProgramGuide.Columns.value:
                 self.session.open(AdvancedProgramGuide)
             else:
                 if not config.plugins.AdvancedProgramGuide.StartFirst.value and config.plugins.AdvancedProgramGuide.Columns.value:
                     from Screens.InfoBar import InfoBar
                     if InfoBar.instance:
                         servicelist = InfoBar.instance.servicelist
                         self.session.open(AdvancedProgramGuideII, servicelist)
                 else:
                     if not config.plugins.AdvancedProgramGuide.StartFirst.value and not config.plugins.AdvancedProgramGuide.Columns.value:
                         from Screens.InfoBar import InfoBar
                         if InfoBar.instance:
                             servicelist = InfoBar.instance.servicelist
                             self.session.open(AdvancedProgramGuide, servicelist)
     
     elif pluginPresent.MerlinEPGCenter and not pluginPresent.AdvancedProgramGuide and not pluginPresent.CoolTVGuide and not pluginPresent.MerlinEPGCenter:
         from Plugins.Extensions.MerlinEPG.plugin import Merlin_PGII, Merlin_PGd
         if config.plugins.MerlinEPG.StartFirst.value and config.plugins.MerlinEPG.Columns.value:
             self.session.open(Merlin_PGII)
         else:
             if config.plugins.MerlinEPG.StartFirst.value and not config.plugins.MerlinEPG.Columns.value:
                 self.session.open(Merlin_PGd)
             else:
                 if not config.plugins.MerlinEPG.StartFirst.value and config.plugins.MerlinEPG.Columns.value:
                     from Screens.InfoBar import InfoBar
                     if InfoBar.instance:
                         servicelist = InfoBar.instance.servicelist
                         self.session.open(Merlin_PGII, servicelist)
                 else:
                     if not config.plugins.MerlinEPG.StartFirst.value and not config.plugins.MerlinEPG.Columns.value:
                         from Screens.InfoBar import InfoBar
                         if InfoBar.instance:
                             servicelist = InfoBar.instance.servicelist
                             self.session.open(Merlin_PGd, servicelist)
     
     elif pluginPresent.CoolTVGuide and not pluginPresent.AdvancedProgramGuide and not pluginPresent.MerlinEPGCenter and not pluginPresent.MerlinEPGCenter:
         from Plugins.Extensions.CoolTVGuide.plugin import main as ctvmain
         ctvmain(self.session)
     
     elif pluginPresent.MerlinEPGCenter and not pluginPresent.CoolTVGuide and not pluginPresent.AdvancedProgramGuide and not pluginPresent.MerlinEPGCenter:
         from Plugins.Extensions.MerlinEPGCenter.plugin import MerlinEPGCenterStarter
         MerlinEPGCenterStarter.instance.openMerlinEPGCenter()
     else:
         self.session.open(MessageBox, _("Not possible!\nMerlinEPG and CoolTVGuide or/and MerlinEPGCenter present or neither installed from this three plugins."), MessageBox.TYPE_INFO)
Esempio n. 3
0
def EasyInfoCallbackFunc(answer):
	if answer is None: return
	
	if EasyInfoSession is None: return
	
	if not InfoBar_instance: return
	
	if answer == "singleepg":
		ref=InfoBar_instance.servicelist.getCurrentSelection()
		if ref:
			InfoBar_instance.servicelist.savedService = ref
			EasyInfoSession.openWithCallback(InfoBar_instance.servicelist.SingleServiceEPGClosed, EPGSelection, ref, serviceChangeCB = InfoBar_instance.servicelist.changeServiceCB)
	elif answer == "easypg":
		bouquets = InfoBar_instance.servicelist.getBouquetList()
		if bouquets is None:
			cnt = 0
		else:
			cnt = len(bouquets)
			InfoBarServices = InfoBar_instance.getBouquetServices(InfoBar_instance.servicelist.getRoot())
		if cnt > 1:
			InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, InfoBarServices, EasyInfoZapTo, None, EasyInfoChangeBouquetCB))
		elif cnt == 1:
			InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, InfoBarServices, EasyInfoZapTo, None, None))
	elif answer == "easysel":
		bouquets = InfoBar_instance.servicelist.getBouquetList()
		if bouquets is None:
			cnt = 0
		else:
			cnt = len(bouquets)
			InfoBarServices = InfoBar_instance.getBouquetServices(InfoBar_instance.servicelist.getRoot())
		if cnt > 1:
			InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasySelection, InfoBarServices, EasyInfoZapTo, None, EasyInfoChangeBouquetCB))
		elif cnt == 1:
			InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasySelection, InfoBarServices, EasyInfoZapTo, None, None))
	elif answer == "timers":
		EasyInfoSession.open(TimerEditList)
	elif answer == "multiepg":
		bouquets = InfoBar_instance.servicelist.getBouquetList()
		if bouquets is None:
			cnt = 0
		else:
			cnt = len(bouquets)
		if cnt > 1:
			InfoBar_instance.bouquetSel = EasyInfoSession.openWithCallback(InfoBar_instance.closed, BouquetSelector, bouquets, InfoBar_instance.openBouquetEPG, enableWrapAround=True)
			InfoBar_instance.dlg_stack.append(InfoBar_instance.bouquetSel)
		elif cnt == 1:
			InfoBar_instance.openBouquetEPG(bouquets[0][1], True)
	elif answer == "eventinfo":
		epglist = [ ]
		InfoBar_instance.epglist = epglist
		service = EasyInfoSession.nav.getCurrentService()
		ref = EasyInfoSession.nav.getCurrentlyPlayingServiceReference()
		info = service.info()
		ptr=info.getEvent(0)
		if ptr:
			epglist.append(ptr)
		ptr=info.getEvent(1)
		if ptr:
			epglist.append(ptr)
		if epglist:
			EasyInfoSession.open(EventViewSimple, epglist[0], ServiceReference(ref), InfoBar_instance.eventViewCallback)
	elif answer == "merlinepg":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MerlinEPG/plugin.pyo"):
			from Plugins.Extensions.MerlinEPG.plugin import Merlin_PGII, Merlin_PGd
			if config.plugins.MerlinEPG.Columns.value:
				EasyInfoSession.open(Merlin_PGII, InfoBar_instance.servicelist)
			else:
				EasyInfoSession.open(Merlin_PGd, InfoBar_instance.servicelist)
		else:
			EasyInfoSession.open(MessageBox, text = _('MerlinEPG is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "autotimer":
		try:
			from Plugins.Extensions.AutoTimer.plugin import main as AutoTimerView
			AutoTimerView(EasyInfoSession)
		except ImportError as ie:
			EasyInfoSession.open(MessageBox, text = _('Autotimer is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "epgsearch":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EPGSearch/plugin.pyo"):
			from Plugins.Extensions.EPGSearch.EPGSearch import EPGSearch
			service = EasyInfoSession.nav.getCurrentService()
			info = service.info()
			epg_event=info.getEvent(0)
			if epg_event:
				epg_name = epg_event and epg_event.getEventName() or ''
				EasyInfoSession.open(EPGSearch, epg_name, False)
		else:
			EasyInfoSession.open(MessageBox, text = _('EPGsearch is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "channelinfo":
		EasyInfoSession.open(ServiceInfo, InfoBar_instance.servicelist.getCurrentSelection())
	elif answer == "imdbinfo":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/IMDb/plugin.pyo"):
			from Plugins.Extensions.IMDb.plugin import IMDB
			service = EasyInfoSession.nav.getCurrentService()
			info = service.info()
			epg_event=info.getEvent(0)
			if epg_event:
				IeventName = epg_event.getEventName()
				EasyInfoSession.open(IMDB, IeventName)
		else:
			EasyInfoSession.open(MessageBox, text = _('IMDB is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "graphepg":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/GraphMultiEPG/plugin.pyo"):
			from Plugins.Extensions.GraphMultiEPG.plugin import main as gmepgmain
			gmepgmain(EasyInfoSession, InfoBar_instance.servicelist)
		else:
			EasyInfoSession.open(MessageBox, text = _('GraphMultiEPG is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "epgrefresh":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EPGRefresh/plugin.pyo"):
			from Plugins.Extensions.EPGRefresh.plugin import main as epgrefmain
			epgrefmain(EasyInfoSession)
		else:
			EasyInfoSession.open(MessageBox, text = _('EPGRefresh is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "cooltv":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/CoolTVGuide/plugin.pyo"):
			from Plugins.Extensions.CoolTVGuide.plugin import main as ctvmain
			ctvmain(EasyInfoSession, InfoBar_instance.servicelist)
		else:
			EasyInfoSession.open(MessageBox, text = _('CoolTVGuide is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "sleep":
		from Screens.SleepTimerEdit import SleepTimerEdit
		EasyInfoSession.open(SleepTimerEdit)
	else:
		EasyInfoSession.open(MessageBox, text = _('This function is yet not available!'), type = MessageBox.TYPE_INFO)
Esempio n. 4
0
def EINcallbackFunc(answer):
	if answer is None: return
	if EINsession is None: return
	if not InfoBar_instance: return
	if answer == "singleepg":
		ref=InfoBar_instance.servicelist.getCurrentSelection()
		if ref:
			InfoBar_instance.servicelist.savedService = ref
			EINsession.openWithCallback(InfoBar_instance.servicelist.SingleServiceEPGClosed, EPGSelection, ref, serviceChangeCB = InfoBar_instance.servicelist.changeServiceCB)
	elif answer == "easypg":
		bouquets = InfoBar_instance.servicelist.getBouquetList()
		if bouquets is None:
			cnt = 0
		else:
			cnt = len(bouquets)
			IBservices = InfoBar_instance.getBouquetServices(bouquets[0][1])
		if cnt > 1:
			InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, IBservices, EINzapTo, None, EINchangeBouquetCB))
		elif cnt == 1:
			InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, IBservices, EINzapTo, None, None))
	elif answer == "timers":
		EINsession.open(TimerEditList)
	elif answer == "multiepg":
		bouquets = InfoBar_instance.servicelist.getBouquetList()
		if bouquets is None:
			cnt = 0
		else:
			cnt = len(bouquets)
		if cnt > 1:
			InfoBar_instance.bouquetSel = EINsession.openWithCallback(InfoBar_instance.closed, BouquetSelector, bouquets, InfoBar_instance.openBouquetEPG, enableWrapAround=True)
			InfoBar_instance.dlg_stack.append(InfoBar_instance.bouquetSel)
		elif cnt == 1:
			InfoBar_instance.openBouquetEPG(bouquets[0][1], True)
	elif answer == "eventinfo":
		epglist = [ ]
		InfoBar_instance.epglist = epglist
		service = EINsession.nav.getCurrentService()
		ref = EINsession.nav.getCurrentlyPlayingServiceReference()
		info = service.info()
		ptr=info.getEvent(0)
		if ptr:
			epglist.append(ptr)
		ptr=info.getEvent(1)
		if ptr:
			epglist.append(ptr)
		if epglist:
			EINsession.open(EventViewSimple, epglist[0], ServiceReference(ref), InfoBar_instance.eventViewCallback)
	elif answer == "merlinepg":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MerlinEPG/plugin.pyo"):
			from Plugins.Extensions.MerlinEPG.plugin import Merlin_PGII, Merlin_PGd
			if config.plugins.MerlinEPG.Columns.value:
				EINsession.open(Merlin_PGII, InfoBar_instance.servicelist)
			else:
				EINsession.open(Merlin_PGd, InfoBar_instance.servicelist)
		else:
			EINsession.open(MessageBox, text = _('MerlinEPG is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "autotimer":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/AutoTimer/AutoTimerEditor.pyo"):
			from Plugins.Extensions.AutoTimer.plugin import main as AutoTimerView
			AutoTimerView(EINsession)
		else:
			EINsession.open(MessageBox, text = _('Autotimer is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "epgsearch":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EPGSearch/plugin.pyo"):
			from Plugins.Extensions.EPGSearch.EPGSearch import EPGSearch
			service = EINsession.nav.getCurrentService()
			info = service.info()
			epg_event=info.getEvent(0)
			if epg_event:
				epg_name = epg_event and epg_event.getEventName() or ''
				EINsession.open(EPGSearch, epg_name, False)
		else:
			EINsession.open(MessageBox, text = _('EPGsearch is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "channelinfo":
		EINsession.open(ServiceInfo, InfoBar_instance.servicelist.getCurrentSelection())
	elif answer == "imdbinfo":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/IMDb/plugin.pyo"):
			from Plugins.Extensions.IMDb.plugin import IMDB
			service = EINsession.nav.getCurrentService()
			info = service.info()
			epg_event=info.getEvent(0)
			if epg_event:
				IeventName = epg_event.getEventName()
				EINsession.open(IMDB, IeventName)
		else:
			EINsession.open(MessageBox, text = _('IMDB is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "graphepg":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/GraphMultiEPG/plugin.pyo"):
			from Plugins.Extensions.GraphMultiEPG.plugin import main as gmepgmain
			gmepgmain(EINsession, InfoBar_instance.servicelist)
		else:
			EINsession.open(MessageBox, text = _('GraphMultiEPG is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "primetime":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/PrimeTimeManager/plugin.pyo"):
			from Plugins.Extensions.PrimeTimeManager.plugin import main as ptmanmain
			ptmanmain(EINsession)
		else:
			EINsession.open(MessageBox, text = _('Prime Time Manager is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "epgrefresh":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EPGRefresh/plugin.pyo"):
			from Plugins.Extensions.EPGRefresh.plugin import main as epgrefmain
			epgrefmain(EINsession)
		else:
			EINsession.open(MessageBox, text = _('EPGRefresh is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "cooltv":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/CoolTVGuide/plugin.pyo"):
			from Plugins.Extensions.CoolTVGuide.plugin import main as ctvmain
			ctvmain(EINsession, InfoBar_instance.servicelist)
		else:
			EINsession.open(MessageBox, text = _('CoolTVGuide is not installed!'), type = MessageBox.TYPE_INFO)
	elif answer == "sysinfo":
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/Sherlock/plugin.pyo"):
			from Plugins.Extensions.Sherlock.plugin import SherlockII
			EINsession.open(SherlockII)
		else:
			EINsession.open(MessageBox, text = _('Sherlock is not installed!'), type = MessageBox.TYPE_INFO)
	else:
		EINsession.open(MessageBox, text = _('This function is yet not available!'), type = MessageBox.TYPE_INFO)