def onAction(self, act): action = act.getId() utils.log('onAction ' + str(action)) self.playSFX(action) lastaction = time.time() - self.lastActTime if action in utils.ACTION_PREVIOUS_MENU: self.closeCount = self.closeCount + 1 if self.closeCount == 2: plug = self.channelLST.pluginName head = '%s / %s'%(utils.ADDON_NAME,plug) if utils.yesnoDialog(utils.LANGUAGE(30001)%plug,header=head) == True: self.closeUEPG() else: self.closeCount = 0 else: self.toggleFullscreen() else: self.closeCount = 0 if action in utils.ACTION_MOVE_DOWN: self.GoDown() elif action in utils.ACTION_MOVE_UP: self.GoUp() elif action in utils.ACTION_MOVE_LEFT: if self.infoOffset <= -2: return self.GoLeft() elif action in utils.ACTION_MOVE_RIGHT: self.GoRight() elif action in utils.ACTION_PAGEDOWN: self.GoPgDown() elif action in utils.ACTION_PAGEUP: self.GoPgUp() elif action in utils.ACTION_CONTEXT_MENU: self.buildContextMenu() elif action in utils.ACTION_SELECT_ITEM and self.getFocusId() <= 40000: self.selectAction()
#show optional load screen if channelLST.uEPGRunning == False and utils.getProperty( 'uEPGSplash') != 'True' and xbmcvfs.exists( os.path.join(channelLST.skinFolder, '%s.splash.xml' % utils.ADDON_ID)) == True: mySplash = epg.Splash('%s.splash.xml' % utils.ADDON_ID, channelLST.skinPath, 'default') mySplash.show() xbmc.sleep(100) firstHDHR = utils.REAL_SETTINGS.getSetting('FirstTime_HDHR') == "true" if utils.HDHR().hasHDHR() and firstHDHR and not channelLST.incHDHR: utils.REAL_SETTINGS.setSetting('FirstTime_HDHR', 'false') if utils.yesnoDialog( (utils.LANGUAGE(30012) % (channelLST.pluginName)), custom='Later'): utils.REAL_SETTINGS.setSetting('Enable_HDHR', 'true') channelLST.incHDHR = True if dataType == 'json': hasChannels = channelLST.prepareJson( utils.loadJson(utils.unquote(data))) elif dataType == 'property': hasChannels = channelLST.prepareJson( utils.loadJson(utils.unquote(utils.getProperty(data)))) elif dataType == 'listitem': hasChannels = channelLST.prepareListItem(utils.unquote(data)) if utils.REAL_SETTINGS.getSetting('FirstTime_Run') == "true": utils.REAL_SETTINGS.setSetting('FirstTime_Run', 'false')
def initChannels(params, data, dataType): utils.log('initChannels, params = ' + str(params)) with busy_dialog(): hasChannels = False channelLST = ChannelList() channelLST.incHDHR = ( params.get('include_hdhr', '') or utils.REAL_SETTINGS.getSetting('Enable_HDHR')) == 'true' channelLST.skinPath = (utils.unquote(params.get('skin_path', '')) or channelLST.chkSkinPath()) channelLST.mediaFolder = os.path.join(channelLST.skinPath, 'resources', 'skins', 'default', 'media') channelLST.refreshPath = (utils.unquote(params.get('refresh_path', '')) or utils.ADDON_ID) channelLST.refreshIntvl = int( params.get('refresh_interval', '') or '0') channelLST.skinFolder = os.path.join( channelLST.skinPath, 'resources', 'skins', 'default', '1080i', ) if xbmcvfs.exists( os.path.join(channelLST.skinPath, 'resources', 'skins', 'default', '1080i', '%s.guide.xml' % utils.ADDON_ID)) else os.path.join( channelLST.skinPath, 'resources', 'skins', 'default', '720p') utils.setProperty('uEPG.rowCount', (params.get('row_count', '') or '9')) channelLST.pluginName, channelLST.pluginAuthor, channelLST.pluginIcon, channelLST.pluginFanart, channelLST.pluginPath = utils.getPluginMeta( channelLST.refreshPath) utils.log('dataType = ' + str(dataType)) utils.log('skinPath = ' + str(channelLST.skinPath)) utils.log('skinFolder = ' + str(channelLST.skinFolder)) utils.log('rowCount = ' + utils.getProperty('uEPG.rowCount')) utils.log('refreshPath = ' + str(channelLST.refreshPath)) utils.log('refreshIntvl = ' + str(channelLST.refreshIntvl)) utils.setProperty('PluginName', channelLST.pluginName) utils.setProperty('PluginIcon', channelLST.pluginIcon) utils.setProperty('PluginFanart', channelLST.pluginFanart) utils.setProperty('PluginAuthor', channelLST.pluginAuthor) utils.setProperty('pluginPath', channelLST.pluginPath) #show optional load screen # if channelLST.uEPGRunning == False and utils.getProperty('uEPGSplash') != 'True' and xbmcvfs.exists(os.path.join(channelLST.skinFolder,'%s.splash.xml'%utils.ADDON_ID)) == True: # mySplash = epg.Splash('%s.splash.xml'%utils.ADDON_ID,channelLST.skinPath,'default') # mySplash.show() # xbmc.sleep(100) if utils.HDHR().hasHDHR(): if utils.REAL_SETTINGS.getSetting( 'FirstTime_HDHR') == "true" and not channelLST.incHDHR: utils.REAL_SETTINGS.setSetting('FirstTime_HDHR', 'false') if utils.yesnoDialog( (utils.LANGUAGE(30012) % (channelLST.pluginName)), custom='Later'): utils.REAL_SETTINGS.setSetting('Enable_HDHR', 'true') channelLST.incHDHR = True utils.log('incHDHR = ' + str(channelLST.incHDHR)) if dataType == 'wrap': hasChannels = channelLST.prepareJson(data) elif dataType == 'json': hasChannels = channelLST.prepareJson( utils.loadJson(utils.unquote(data))) elif dataType == 'property': hasChannels = channelLST.prepareJson( utils.loadJson(utils.unquote(utils.getProperty(data)))) elif dataType == 'listitem': hasChannels = channelLST.prepareVFS(utils.unquote(data)) if hasChannels == True: if utils.REAL_SETTINGS.getSetting('FirstTime_Run') == "true": utils.REAL_SETTINGS.setSetting('FirstTime_Run', 'false') utils.textViewer( utils.LANGUAGE(30008), '%s / %s' % (utils.ADDON_NAME, channelLST.pluginName)) # if utils.getProperty('uEPGSplash') == 'True': # mySplash.close() # del mySplash # xbmc.sleep(100) if channelLST.refreshIntvl > 0 and channelLST.refreshPath is not None: channelLST.startRefreshTimer() if channelLST.uEPGRunning == False and utils.getProperty( 'uEPGGuide') != 'True': channelLST.myEPG = epg.uEPG('%s.guide.xml' % utils.ADDON_ID, channelLST.skinPath, 'default') channelLST.myEPG.channelLST = channelLST channelLST.myEPG.doModal() del channelLST.myEPG xbmc.sleep(100) else: utils.log("invalid uEPG information", xbmc.LOGERROR) # utils.notificationDialog(utils.LANGUAGE(30002)%(channelLST.pluginName,channelLST.pluginAuthor),icon=channelLST.pluginIcon) # utils.REAL_SETTINGS.openSettings() del utils.KODI_MONITOR
utils.log('refreshIntvl = ' + str(channelLST.refreshIntvl)) utils.setProperty('PluginName', channelLST.pluginName) utils.setProperty('PluginIcon', channelLST.pluginIcon) utils.setProperty('PluginFanart', channelLST.pluginFanart) utils.setProperty('PluginAuthor', channelLST.pluginAuthor) # #show optional load screen # if channelLST.uEPGRunning == False and utils.getProperty('uEPGSplash') != 'True' and xbmcvfs.exists(os.path.join(channelLST.skinFolder,'%s.splash.xml'%utils.ADDON_ID)) == True: # mySplash = epg.Splash('%s.splash.xml'%utils.ADDON_ID,channelLST.skinPath,'default') # mySplash.show() # xbmc.sleep(100) firstHDHR = utils.REAL_SETTINGS.getSetting('FirstTime_HDHR') == "true" if utils.HDHR().hasHDHR() and firstHDHR and not channelLST.incHDHR: utils.REAL_SETTINGS.setSetting('FirstTime_HDHR', 'false') if utils.yesnoDialog( (utils.LANGUAGE(30012) % (channelLST.pluginName))): utils.REAL_SETTINGS.setSetting('Enable_HDHR', 'true') channelLST.incHDHR = True if dataType == 'json': hasChannels = channelLST.prepareJson( utils.loadJson(utils.unquote(data))) elif dataType == 'property': hasChannels = channelLST.prepareJson( utils.loadJson(utils.unquote(utils.getProperty(data)))) elif dataType == 'listitem': hasChannels = channelLST.prepareListItem(utils.unquote(data)) if utils.REAL_SETTINGS.getSetting('FirstTime_Run') == "true": utils.REAL_SETTINGS.setSetting('FirstTime_Run', 'false') utils.textViewer(