コード例 #1
0
    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
コード例 #2
0
    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)
            #self.loader.setVisible(True)

            pos = self.control_list.getSelectedPosition()
            item = self.itemlist[pos]
            if item.action.startswith("play_"):
                play_items = navigation.get_next_items(item)
                self.loader.setVisible(False)

                media_url = play_items[0].url
                plugintools.direct_play(media_url)
            else:
                #next_items = navigation.get_next_items( item )
                self.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
コード例 #3
0
ファイル: window_menu.py プロジェクト: erral/tvalacarta
    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("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
コード例 #5
0
    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
コード例 #6
0
    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
コード例 #7
0
    def onAction(self, action):
        plugintools.log("MenuWindow.onAction action.id=" +
                        repr(action.getId()) + " action.buttonCode=" +
                        repr(action.getButtonCode()))

        pos = self.control_list.getSelectedPosition()

        try:
            item = self.itemlist[pos]
            self.setContentDetailsFields(item)
        except:
            import traceback
            plugintools.log(traceback.format_exc())
            self.close()

        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)
            #loader = self.getControl(400)
            #self.loader.setVisible(True)

            pos = self.control_list.getSelectedPosition()
            item = self.itemlist[pos]

            #next_items = navigation.get_next_items( item )
            self.loader.setVisible(False)

            if item.action == "play":
                navigation.play_item(item)
            else:
                # 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
コード例 #8
0
ファイル: window_menu.py プロジェクト: latinopr/pelisalacarta
    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
コード例 #9
0
    def onAction(self, action):
        plugintools.log("MenuWindow.onAction action.id="+repr(action.getId())+" action.buttonCode="+repr(action.getButtonCode()))

        pos = self.control_list.getSelectedPosition()

        try:
            item = self.itemlist[pos]
            self.setContentDetailsFields(item)
        except:
            import traceback
            plugintools.log(traceback.format_exc())
            self.close()

        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)
            #loader = self.getControl(400)
            #self.loader.setVisible(True)

            pos = self.control_list.getSelectedPosition()
            item = self.itemlist[pos]

            #next_items = navigation.get_next_items( item )
            self.loader.setVisible(False)

            if item.action=="play":
                navigation.play_item(item)
            else:
                # 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
コード例 #10
0
ファイル: default.py プロジェクト: nitrokr/pelisalacarta
# 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
コード例 #11
0
ファイル: default.py プロジェクト: Laserito/pelisalacarta
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