def onAction(self, action): plugintools.log("ChannelWindow.onAction action.id="+repr(action.getId())+" action.buttonCode="+repr(action.getButtonCode())) if action == ACTION_PARENT_DIR or action==ACTION_PREVIOUS_MENU or action==ACTION_PREVIOUS_MENU2: self.close() if action == ACTION_SELECT_ITEM or action == ACTION_MOUSE_LEFT_CLICK: loader_image = os.path.join( plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader.gif') loader = xbmcgui.ControlImage(1200, 19, 40, 40, loader_image) self.addControl(loader) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] if item.action.startswith("play_"): play_items = navigation.get_next_items( item ) loader.setVisible(False) media_url = play_items[0].url plugintools.direct_play(media_url) else: next_items = navigation.get_next_items( item ) loader.setVisible(False) # Si no hay nada, no muestra la pantalla vacía if len(next_items)>0: next_window = navigation.get_window_for_item( item ) next_window.setItemlist(next_items) next_window.setParentItem(item) next_window.doModal() del next_window
def onAction(self, action): plugintools.log("ChannelWindow.onAction action.id="+repr(action.getId())+" action.buttonCode="+repr(action.getButtonCode())) if action == ACTION_PARENT_DIR or action==ACTION_PREVIOUS_MENU or action==ACTION_PREVIOUS_MENU2: self.close() if action == ACTION_SELECT_ITEM: loader_image = os.path.join( plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader.gif') loader = xbmcgui.ControlImage(1200, 19, 40, 40, loader_image) self.addControl(loader) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] if item.action.startswith("play_"): play_items = navigation.get_next_items( item ) loader.setVisible(False) media_url = play_items[0].url plugintools.direct_play(media_url) else: next_items = navigation.get_next_items( item ) loader.setVisible(False) # Si no hay nada, no muestra la pantalla vacía if len(next_items)>0: next_window = navigation.get_window_for_item( item ) next_window.setItemlist(next_items) next_window.setParentItem(item) next_window.doModal() del next_window
def onAction(self, action): plugintools.log("ChannelWindow.onAction action.id=" + repr(action.getId()) + " action.buttonCode=" + repr(action.getButtonCode())) ## Botón izquierdo del ratón para las listas del inicio hasta la primera lista de menú de los canales. if action == 100: action = ACTION_SELECT_ITEM if action == ACTION_PARENT_DIR or action == ACTION_PREVIOUS_MENU or action == ACTION_PREVIOUS_MENU2: self.close() if action == ACTION_SELECT_ITEM: from core import config skin_selector = config.get_setting("skin_selector") if skin_selector == "": skin_selector = "0" if skin_selector == "0": loader_image = os.path.join(plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader.gif') if skin_selector == "1": loader_image = os.path.join(plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader-1.gif') loader = xbmcgui.ControlImage(1830, 26, 64, 64, loader_image) self.addControl(loader) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] if item.action.startswith("play_"): play_items = navigation.get_next_items(item) loader.setVisible(False) media_url = play_items[0].url plugintools.direct_play(media_url) else: next_items = navigation.get_next_items(item) loader.setVisible(False) # Si no hay nada, no muestra la pantalla vacía if len(next_items) > 0: next_window = navigation.get_window_for_item(item) next_window.setItemlist(next_items) next_window.setParentItem(item) next_window.doModal() del next_window
def onInit( self ): plugintools.log("MenuWindow.onInit") if self.first_time == True: return self.first_time = True self.control_list = self.getControl(100) if self.itemlist is None: next_items = navigation.get_next_items( self.parent_item ) self.setItemlist(next_items) if len(self.itemlist)>0: item = self.itemlist[0] self.setContentDetailsFields(item) for item in self.itemlist: list_item = xbmcgui.ListItem( item.title , iconImage=item.thumbnail, thumbnailImage=item.thumbnail) info_labels = { "Title" : item.title, "FileName" : item.title, "Plot" : item.plot } list_item.setInfo( "video", info_labels ) if item.fanart!="": list_item.setProperty('fanart_image',item.fanart) self.control_list.addItem(list_item) self.getControl(300).setLabel(self.parent_item.channel) self.setFocusId(100) self.loader = self.getControl(400) self.loader.setVisible(False)
def onInit( self ): plugintools.log("ChannelWindow.onInit") if self.first_time == True: return self.first_time = True self.control_list = self.getControl(100) if self.itemlist is None: next_items = navigation.get_next_items( self.parent_item ) self.setItemlist(next_items) for item in self.itemlist: list_item = xbmcgui.ListItem( item.title , iconImage=item.thumbnail, thumbnailImage=item.thumbnail) info_labels = { "Title" : item.title, "FileName" : item.title, "Plot" : item.plot } list_item.setInfo( "video", info_labels ) if item.fanart!="": list_item.setProperty('fanart_image',item.fanart) self.control_list.addItem(list_item) self.setFocusId(100) self.loader = self.getControl(400) self.loader.setVisible(False) self.getControl(401).setText( "pelisalacarta "+versiontools.get_current_plugin_version_tag()+"\n"+versiontools.get_current_plugin_date() )
def onAction(self, action): plugintools.log("MenuWindow.onAction action.id="+repr(action.getId())+" action.buttonCode="+repr(action.getButtonCode())) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] if item.thumbnail!="" and not "thumb_error" in item.thumbnail and not "thumb_folder" in item.thumbnail and not "thumb_nofolder" in item.thumbnail: self.getControl(301).setImage(item.thumbnail) self.getControl(302).setText(item.title) self.getControl(303).setText(item.plot) if action == ACTION_PARENT_DIR or action==ACTION_PREVIOUS_MENU or action==ACTION_PREVIOUS_MENU2: self.close() if action == ACTION_SELECT_ITEM: loader_image = os.path.join( plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader.gif') loader = xbmcgui.ControlImage(1200, 19, 40, 40, loader_image) self.addControl(loader) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] next_items = navigation.get_next_items( item ) loader.setVisible(False) # Si no hay nada, no muestra la pantalla vacía if len(next_items)>0: next_window = navigation.get_window_for_item( item ) next_window.setItemlist(next_items) next_window.setParentItem(item) next_window.doModal() del next_window
def onAction(self, action): plugintools.log("MenuWindow.onAction action.id=" + repr(action.getId()) + " action.buttonCode=" + repr(action.getButtonCode())) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] if item.thumbnail != "" and not "thumb_error" in item.thumbnail and not "thumb_folder" in item.thumbnail and not "thumb_nofolder" in item.thumbnail: self.getControl(301).setImage(item.thumbnail) self.getControl(302).setText(item.title) self.getControl(303).setText(item.plot) ## Botón izquierdo del ratón para la lista de menús de los canales y todos los sus niveles hasta el visionado o descarga. if action == 100: action = ACTION_SELECT_ITEM if action == ACTION_PARENT_DIR or action == ACTION_PREVIOUS_MENU or action == ACTION_PREVIOUS_MENU2: self.close() if action == ACTION_SELECT_ITEM: from core import config skin_selector = config.get_setting("skin_selector") if skin_selector == "": skin_selector = "0" if skin_selector == "0": loader_image = os.path.join(plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader.gif') if skin_selector == "1": loader_image = os.path.join(plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader-1.gif') loader = xbmcgui.ControlImage(1830, 26, 64, 64, loader_image) self.addControl(loader) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] next_items = navigation.get_next_items(item) loader.setVisible(False) # Si no hay nada, no muestra la pantalla vacía if len(next_items) > 0: next_window = navigation.get_window_for_item(item) next_window.setItemlist(next_items) next_window.setParentItem(item) next_window.doModal() del next_window
def onAction(self, action): plugintools.log("MenuWindow.onAction action.id="+repr(action.getId())+" action.buttonCode="+repr(action.getButtonCode())) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] if item.thumbnail!="" and not "thumb_error" in item.thumbnail and not "thumb_folder" in item.thumbnail and not "thumb_nofolder" in item.thumbnail: self.getControl(301).setImage(item.thumbnail) self.getControl(302).setText(item.title) self.getControl(303).setText(item.plot) ## Botón izquierdo del ratón para la lista de menús de los canales y todos los sus niveles hasta el visionado o descarga. if action == 100: action = ACTION_SELECT_ITEM if action == ACTION_PARENT_DIR or action==ACTION_PREVIOUS_MENU or action==ACTION_PREVIOUS_MENU2: self.close() if action == ACTION_SELECT_ITEM: from core import config skin_selector = config.get_setting("skin_selector") if skin_selector == "": skin_selector = "0" if skin_selector == "0": loader_image = os.path.join( plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader.gif') if skin_selector == "1": loader_image = os.path.join( plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader-1.gif') loader = xbmcgui.ControlImage(1200, 19, 40, 40, loader_image) self.addControl(loader) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] next_items = navigation.get_next_items( item ) loader.setVisible(False) # Si no hay nada, no muestra la pantalla vacía if len(next_items)>0: next_window = navigation.get_window_for_item( item ) next_window.setItemlist(next_items) next_window.setParentItem(item) next_window.doModal() del next_window
def onAction(self, action): plugintools.log("MenuWindow.onAction action.id=" + repr(action.getId()) + " action.buttonCode=" + repr(action.getButtonCode())) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] if item.hasContentDetails == "true": self.getControl(301).setImage(item.contentThumbnail) self.getControl(302).setText(item.contentTitle) self.getControl(303).setText(item.contentPlot) elif item.thumbnail != "" and not "thumb_error" in item.thumbnail and not "thumb_folder" in item.thumbnail and not "thumb_nofolder" in item.thumbnail: self.getControl(301).setImage(item.thumbnail) self.getControl(302).setText(item.title) self.getControl(303).setText(item.plot) if action == ACTION_PARENT_DIR or action == ACTION_PREVIOUS_MENU or action == ACTION_PREVIOUS_MENU2: self.close() if action == ACTION_SELECT_ITEM or action == ACTION_MOUSE_LEFT_CLICK: loader_image = os.path.join(plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader.gif') loader = xbmcgui.ControlImage(1200, 19, 40, 40, loader_image) self.addControl(loader) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] next_items = navigation.get_next_items(item) loader.setVisible(False) # Si no hay nada, no muestra la pantalla vacía if len(next_items) > 0: next_window = navigation.get_window_for_item(item) next_window.setItemlist(next_items) next_window.setParentItem(item) next_window.doModal() del next_window
def onInit(self): plugintools.log("MenuWindow.onInit") if self.first_time == True: return self.first_time = True self.control_list = self.getControl(100) if self.itemlist is None: next_items = navigation.get_next_items(self.parent_item) self.setItemlist(next_items) if len(self.itemlist) > 0: item = self.itemlist[0] self.setContentDetailsFields(item) for item in self.itemlist: list_item = xbmcgui.ListItem(item.title, iconImage=item.thumbnail, thumbnailImage=item.thumbnail) info_labels = { "Title": item.title, "FileName": item.title, "Plot": item.plot } list_item.setInfo("video", info_labels) if item.fanart != "": list_item.setProperty('fanart_image', item.fanart) self.control_list.addItem(list_item) self.getControl(300).setLabel(self.parent_item.channel) self.setFocusId(100) self.loader = self.getControl(400) self.loader.setVisible(False)
def onInit(self): plugintools.log("ChannelWindow.onInit") if self.first_time == True: return self.first_time = True self.control_list = self.getControl(100) if self.itemlist is None: next_items = navigation.get_next_items(self.parent_item) self.setItemlist(next_items) for item in self.itemlist: list_item = xbmcgui.ListItem(item.title, iconImage=item.thumbnail, thumbnailImage=item.thumbnail) info_labels = { "Title": item.title, "FileName": item.title, "Plot": item.plot } list_item.setInfo("video", info_labels) if item.fanart != "": list_item.setProperty('fanart_image', item.fanart) self.control_list.addItem(list_item) self.setFocusId(100) self.loader = self.getControl(400) self.loader.setVisible(False) self.getControl(401).setText( "pelisalacarta " + versiontools.get_current_plugin_version_tag() + "\n" + versiontools.get_current_plugin_date())
# along with pelisalacarta 4. If not, see <http://www.gnu.org/licenses/>. #------------------------------------------------------------ import os import plugintools import navigation from core import updater from core.item import Item plugintools.application_log_enabled = ( plugintools.get_setting("debug") == "true") plugintools.module_log_enabled = (plugintools.get_setting("debug") == "true") plugintools.http_debug_log_enabled = ( plugintools.get_setting("debug") == "true") plugintools.log("pelisalacarta 4 ui begin") updater.checkforupdates(plugin_mode=False) # Get items for main menu item = Item(channel="navigation", action="mainlist") itemlist = navigation.get_next_items(item) # Open main window window = navigation.get_window_for_item(item) window.setParentItem(item) window.setItemlist(itemlist) window.doModal() del window
import os import plugintools import navigation from core import updater from core import config from core.item import Item plugintools.application_log_enabled = (plugintools.get_setting("debug")=="true") plugintools.module_log_enabled = (plugintools.get_setting("debug")=="true") plugintools.http_debug_log_enabled = (plugintools.get_setting("debug")=="true") plugintools.log("pelisalacarta 4 ui begin") # Check if paths are on a default value, and if directories are created config.verify_directories_created() # Check for new updates updater.checkforupdates(plugin_mode=False) # Get items for main menu item = Item( channel="navigation", action="mainlist" ) itemlist = navigation.get_next_items( item ) # Open main window window = navigation.get_window_for_item( item ) window.setParentItem(item) window.setItemlist(itemlist) window.doModal() del window