Ejemplo n.º 1
0
    def run(self):

        item_id = None
        log.debug("ContextMonitor Thread Started")

        while not xbmc.abortRequested and not self.stop_thread:

            if xbmc.getCondVisibility(
                    "Window.IsActive(fullscreenvideo) | Window.IsActive(visualisation)"
            ):
                xbmc.sleep(1000)
            else:
                if xbmc.getCondVisibility("Window.IsVisible(contextmenu)"):
                    if item_id:
                        xbmc.executebuiltin("Dialog.Close(contextmenu,true)")
                        params = {}
                        params["item_id"] = item_id
                        show_menu(params)

                container_id = xbmc.getInfoLabel("System.CurrentControlID")
                item_id = xbmc.getInfoLabel("Container(" + str(container_id) +
                                            ").ListItem.Property(id)")

                xbmc.sleep(100)
        '''
        context_up = False
        is_jellycon_item = False
        
        while not xbmc.abortRequested and not self.stop_thread:

            if xbmc.getCondVisibility("Window.IsActive(fullscreenvideo) | Window.IsActive(visualisation)"):
                xbmc.sleep(1000)
            else:
                if xbmc.getCondVisibility("Window.IsVisible(contextmenu)"):
                    context_up = True
                    if is_jellycon_item:
                        xbmc.executebuiltin("Dialog.Close(contextmenu,true)")
                else:
                    if context_up:  # context now down, do something
                        context_up = False
                        container_id = xbmc.getInfoLabel("System.CurrentControlID")
                        log.debug("ContextMonitor Container ID: {0}", container_id)
                        item_id = xbmc.getInfoLabel("Container(" + str(container_id) + ").ListItem.Property(id)")
                        log.debug("ContextMonitor Item ID: {0}", item_id)
                        if item_id:
                            params = {}
                            params["item_id"] = item_id
                            show_menu(params)

                container_id = xbmc.getInfoLabel("System.CurrentControlID")
                condition = ("String.StartsWith(Container(" + str(container_id) +
                             ").ListItem.Path,plugin://plugin.video.jellycon) + !String.IsEmpty(Container(" +
                             str(container_id) + ").ListItem.Property(id))")
                is_jellycon_item = xbmc.getCondVisibility(condition)

                xbmc.sleep(200)
                
        '''

        log.debug("ContextMonitor Thread Exited")
Ejemplo n.º 2
0
    def run(self):

        item_id = None
        log.debug("ContextMonitor Thread Started")

        while not xbmc.Monitor().abortRequested() and not self.stop_thread:

            if xbmc.getCondVisibility("Window.IsActive(fullscreenvideo) | Window.IsActive(visualisation)"):
                xbmc.sleep(1000)
            else:
                if xbmc.getCondVisibility("Window.IsVisible(contextmenu)"):
                    if item_id:
                        xbmc.executebuiltin("Dialog.Close(contextmenu,true)")
                        params = {}
                        params["item_id"] = item_id
                        show_menu(params)

                container_id = xbmc.getInfoLabel("System.CurrentControlID")
                item_id = xbmc.getInfoLabel("Container(" + str(container_id) + ").ListItem.Property(id)")

                xbmc.sleep(100)

        log.debug("ContextMonitor Thread Exited")
Ejemplo n.º 3
0
    def run(self):

        item_id = None
        log.debug("ContextMonitor Thread Started")
        context_up = False
        is_embycon_item = False

        while not xbmc.abortRequested and not self.stop_thread:

            if xbmc.getCondVisibility("Window.IsActive(fullscreenvideo) | Window.IsActive(visualisation)"):
                xbmc.sleep(1000)
            else:
                if xbmc.getCondVisibility("Window.IsVisible(contextmenu)"):
                    context_up = True
                    if is_embycon_item:
                        xbmc.executebuiltin("Dialog.Close(contextmenu,true)")
                else:
                    if context_up:  # context now down, do something
                        context_up = False
                        container_id = xbmc.getInfoLabel("System.CurrentControlID")
                        log.debug("ContextMonitor Container ID: {0}", container_id)
                        item_id = xbmc.getInfoLabel("Container(" + str(container_id) + ").ListItem.Property(id)")
                        log.debug("ContextMonitor Item ID: {0}", item_id)
                        if item_id:
                            params = {}
                            params["item_id"] = item_id
                            show_menu(params)

                container_id = xbmc.getInfoLabel("System.CurrentControlID")
                condition = ("String.StartsWith(Container(" + str(container_id) +
                             ").ListItem.Path,plugin://plugin.video.embycon) + !String.IsEmpty(Container(" +
                             str(container_id) + ").ListItem.Property(id))")
                is_embycon_item = xbmc.getCondVisibility(condition)

                xbmc.sleep(200)

        log.debug("ContextMonitor Thread Exited")
Ejemplo n.º 4
0
# -*- coding: utf-8 -*-

#################################################################################################

import logging
import os
import sys

import xbmc
import xbmcaddon

from resources.lib.functions import show_menu
from resources.lib.simple_logging import SimpleLogging

log = SimpleLogging('contextmenu')

item_id = sys.listitem.getProperty("id")
log.debug("Context Menu Item ID: {0}", item_id)

params = {}
params["item_id"] = item_id
show_menu(params)