def housekeepingExtensionsmenu(configentry, force=False): if force or (epgrefresh != None and not epgrefresh.isRunning()): PlugDescriptor = None if configentry == config.plugins.epgrefresh.show_in_extensionsmenu: PlugDescriptor = extSetupDescriptor elif configentry == config.plugins.epgrefresh.show_run_in_extensionsmenu: PlugDescriptor = extRunDescriptor if PlugDescriptor != None: AdjustExtensionsmenu(configentry.value, PlugDescriptor)
def manualrefresh_menu(menuid, **kwargs): if menuid == "mainmenu" and config.plugins.epgrefresh.stop_on_mainmenu.value and epgrefresh.isRunning( ): return [(_("Stop Running EPG-refresh"), stop_Running, "stop_EPG-refresh", 99)] elif menuid == "mainmenu" and config.plugins.epgrefresh.start_on_mainmenu.value and not epgrefresh.isRunning( ): return [(_("EPG-refresh now"), start_Running, "start_EPG-refresh", 99)] return []
def __init__(self, session): if epgrefresh.isRunning(): menu = [(_("Stop running refresh"), boundFunction(self.close, self.FUNCTION_RETURN_STOPREFRESH)), (_("Pending Services"), boundFunction(self.close, self.FUNCTION_RETURN_SHOWPENDING))] else: menu = [(_("Refresh now"), boundFunction(self.close, self.FUNCTION_RETURN_FORCEREFRESH))] menu.append((_("Cancel"), self.close)) FixedMenu.__init__(self, session, _("EPGRefresh Functions"), menu) self.skinName = ["EPGRefreshConfigurationFunctionContextMenu", "Menu" ]
def start_Running(session, **kwargs): if epgrefresh.isRunning(): return True epgrefresh.forceRefresh(session, dontshutdown=True)
def stop_Running(session, **kwargs): if not epgrefresh.isRunning(): return True epgrefresh.showPendingServices(session)
def manualrefresh_menu(menuid, **kwargs): if menuid == "mainmenu" and config.plugins.epgrefresh.stop_on_mainmenu.value and epgrefresh.isRunning(): return [(_("Stop Running EPG-refresh"), stop_Running, "stop_EPG-refresh", 99)] elif menuid == "mainmenu" and config.plugins.epgrefresh.start_on_mainmenu.value and not epgrefresh.isRunning(): return [(_("EPG-refresh now"), start_Running, "start_EPG-refresh", 99)] return []
def _startAfterConfig(session): if config.plugins.epgrefresh.enabled.value: if not epgrefresh.isRunning(): epgrefresh.start(session)