Python xbmcgui.ControlImage() Examples

The following are 30 code examples of xbmcgui.ControlImage(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module xbmcgui , or try the search function .
Example #1
Source File: get_auth.py    From plugin.video.bdyun with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, cookie, tokens, vcodetype, codeString, vcode_path):
        self.cookie = cookie
        self.tokens = tokens
        self.vcodetype = vcodetype
        self.codeString = codeString
        self.vcode_path = vcode_path

        # windowItems
        self.image = xbmcgui.ControlImage(80, 100, 500, 200, self.vcode_path)
        self.buttonInput = xbmcgui.ControlButton(
            100, 330, 220, 50, label=u'输入验证码', alignment=6, font='font13', textColor='0xFFFFFFFF'
        )
        self.buttonRefresh = xbmcgui.ControlButton(
            290, 330, 220, 50, label=u'刷新验证码', alignment=6, font='font13', textColor='0xFFFFFFFF'
        )
        self.addControls([self.image, self.buttonInput, self.buttonRefresh])
        self.buttonInput.controlRight(self.buttonRefresh)
        self.buttonRefresh.controlLeft(self.buttonInput)
        self.setFocus(self.buttonInput) 
Example #2
Source File: overlay.py    From addon with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, w=OVERLAY_WIDTH, h=OVERLAY_HEIGHT, *args, **kwargs):
        self.window = xbmcgui.Window(WINDOW_FULLSCREEN_VIDEO)
        viewport_w, viewport_h = self._get_skin_resolution()
        # Adjust size based on viewport, we are using 1080p coordinates
        w = int(old_div(w * viewport_w, VIEWPORT_WIDTH))
        h = int(old_div(h * viewport_h, VIEWPORT_HEIGHT))
        x = old_div((viewport_w - w), 2)
        y = old_div((viewport_h - h), 2) + int(ADDON.getSetting(id="overlay_status_offset"))
        self._shown = False
        self._text = ""
        self._label = xbmcgui.ControlLabel(x, y, w, h, self._text,
                                           alignment=XBFONT_CENTER_X | XBFONT_CENTER_Y, *args, **kwargs)
        self._shadow = xbmcgui.ControlLabel(x + 1, y + 1, w, h, self._text,
                                            textColor='0xD0000000',
                                            alignment=XBFONT_CENTER_X | XBFONT_CENTER_Y, *args, **kwargs)
        if not PY3:
            self._background = xbmcgui.ControlImage(x, y, w, h, os.path.join(ADDON_PATH, "resources", "img", "black.png").encode('utf-8'))
        else:
            self._background = xbmcgui.ControlImage(x, y, w, h, os.path.join(ADDON_PATH, "resources", "img", "black.png"))
            if isinstance(self._background, bytes):
                self._background = self._background.decode("utf8")
        self._background.setColorDiffuse("0xD0000000") 
Example #3
Source File: get_auth.py    From xbmc-addons-chinese with GNU General Public License v2.0 6 votes vote down vote up
def __init__(self, cookie, tokens, vcodetype, codeString, vcode_path):
        self.cookie = cookie
        self.tokens = tokens
        self.vcodetype = vcodetype
        self.codeString = codeString
        self.vcode_path = vcode_path

        # windowItems
        self.image = xbmcgui.ControlImage(80, 100, 500, 200, self.vcode_path)
        self.buttonInput = xbmcgui.ControlButton(
            100, 330, 220, 50, label=u'输入验证码', alignment=6, font='font13', textColor='0xFFFFFFFF'
        )
        self.buttonRefresh = xbmcgui.ControlButton(
            290, 330, 220, 50, label=u'刷新验证码', alignment=6, font='font13', textColor='0xFFFFFFFF'
        )
        self.addControls([self.image, self.buttonInput, self.buttonRefresh])
        self.buttonInput.controlRight(self.buttonRefresh)
        self.buttonRefresh.controlLeft(self.buttonInput)
        self.setFocus(self.buttonInput) 
Example #4
Source File: peliscon.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
def __init__( self, *args, **kwargs):
            self.getTitle = kwargs.get('title')
            self.getPlot = kwargs.get('plot')
            self.getThumbnail = kwargs.get('thumbnail')
            self.getFanart = kwargs.get('fanart')
            self.getRating = kwargs.get('rating')
            
            self.background = xbmcgui.ControlImage( 70, 20, 1150, 630, 'http://imgur.com/aj4qzTr.jpg')
            self.title = xbmcgui.ControlTextBox(120, 60, 430, 50)
            self.rating = xbmcgui.ControlTextBox(145, 112, 1030, 45)
            self.plot = xbmcgui.ControlTextBox( 120, 150, 1056, 100 )
            self.thumbnail = xbmcgui.ControlImage( 120, 300, 1056, 300, self.getThumbnail )
            self.fanart = xbmcgui.ControlImage( 780, 43, 390, 100, self.getFanart )

            self.addControl(self.background)
            self.background.setAnimations([('conditional', 'effect=slide start=1000% end=0% time=1500 condition=true tween=bounce', ),('WindowClose','effect=slide delay=800 start=0% end=1000%  time=800 condition=true',)])
            self.addControl(self.thumbnail)
            self.thumbnail.setAnimations([('conditional', 'effect=zoom  start=0% end=100% delay=2700 time=1500 condition=true tween=elastic easing=inout', ),('WindowClose','effect=slide end=0,700%   time=300 condition=true',)])
            self.addControl(self.plot)
            self.plot.setAnimations([('conditional','effect=zoom delay=2000 center=auto start=0 end=100  time=800  condition=true  ',),('conditional','effect=rotate  delay=2000 center=auto aceleration=6000 start=0% end=360%  time=800  condition=true',),('WindowClose','effect=zoom center=auto start=100% end=-0%  time=600 condition=true',)])
            self.addControl(self.fanart)
            self.fanart.setAnimations([('WindowOpen','effect=slide start=0,-700 delay=1000 time=2500 tween=bounce condition=true',), ('conditional','effect=rotate center=auto  start=0% end=360% delay=3000 time=2500 tween=bounce condition=true',),('WindowClose','effect=slide end=0,-700%  time=1000 condition=true',)])
            self.addControl(self.title)
            self.title.setText( self.getTitle )
            self.title.setAnimations([('conditional', 'effect=slide start=-1500% end=0%  delay=1000 time=2000 condition=true tween=elastic', ),('WindowClose','effect=slide start=0% end=-1500%  time=800 condition=true',)])
            self.addControl(self.rating)
            self.rating.setText( self.getRating )
            self.rating.setAnimations([('conditional','effect=fade start=0% end=100% delay=3000 time=1500 condition=true', ),('WindowClose','effect=slide end=0,-700%  time=600 condition=true',)])
            xbmc.sleep(200)
            
            
            

            try:
                self.plot.autoScroll(7000,6000,30000)
            except:
                
                xbmc.executebuiltin('Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
            self.plot.setText(  self.getPlot ) 
Example #5
Source File: cuelgame.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
def __init__( self, *args, **kwargs):
            self.getTitle = kwargs.get('title')
            self.getPlot = kwargs.get('plot')
            self.getThumbnail = kwargs.get('thumbnail')
            self.getFanart = kwargs.get('fanart')
            self.getRating = kwargs.get('rating')
            
            self.background = xbmcgui.ControlImage( 70, 20, 1150, 630, 'http://imgur.com/btby9SG.jpg')
            self.title = xbmcgui.ControlTextBox(120, 60, 430, 50)
            self.rating = xbmcgui.ControlTextBox(145, 112, 1030, 45)
            self.plot = xbmcgui.ControlTextBox( 120, 150, 1056, 100 )
            self.thumbnail = xbmcgui.ControlImage( 120, 300, 1056, 300, self.getThumbnail )
            self.fanart = xbmcgui.ControlImage( 780, 43, 390, 100, self.getFanart )

            self.addControl(self.background)
            self.background.setAnimations([('conditional', 'effect=slide start=1000% end=0% time=1500 condition=true tween=bounce', ),('WindowClose','effect=slide delay=800 start=0% end=1000%  time=800 condition=true',)])
            self.addControl(self.thumbnail)
            self.thumbnail.setAnimations([('conditional', 'effect=zoom  start=0% end=100% delay=2700 time=1500 condition=true tween=elastic easing=inout', ),('WindowClose','effect=slide end=0,700%   time=300 condition=true',)])
            self.addControl(self.plot)
            self.plot.setAnimations([('conditional','effect=zoom delay=2000 center=auto start=0 end=100  time=800  condition=true  ',),('conditional','effect=rotate  delay=2000 center=auto aceleration=6000 start=0% end=360%  time=800  condition=true',),('WindowClose','effect=zoom center=auto start=100% end=-0%  time=600 condition=true',)])
            self.addControl(self.fanart)
            self.fanart.setAnimations([('WindowOpen','effect=slide start=0,-700 delay=1000 time=2500 tween=bounce condition=true',), ('conditional','effect=rotate center=auto  start=0% end=360% delay=3000 time=2500 tween=bounce condition=true',),('WindowClose','effect=slide end=0,-700%  time=1000 condition=true',)])
            self.addControl(self.title)
            self.title.setText( self.getTitle )
            self.title.setAnimations([('conditional', 'effect=slide start=-1500% end=0%  delay=1000 time=2000 condition=true tween=elastic', ),('WindowClose','effect=slide start=0% end=-1500%  time=800 condition=true',)])
            self.addControl(self.rating)
            self.rating.setText( self.getRating )
            self.rating.setAnimations([('conditional','effect=fade start=0% end=100% delay=3000 time=1500 condition=true', ),('WindowClose','effect=slide end=0,-700%  time=600 condition=true',)])
            xbmc.sleep(200)
            
            
            

            try:
                self.plot.autoScroll(7000,6000,30000)
            except:
                
                xbmc.executebuiltin('Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
            self.plot.setText(  self.getPlot ) 
Example #6
Source File: peliculasgratis.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
def __init__( self, *args, **kwargs):
            self.getTitle = kwargs.get('title')
            self.getPlot = kwargs.get('plot')
            self.getThumbnail = kwargs.get('thumbnail')
            self.getFanart = kwargs.get('fanart')
            self.getRating = kwargs.get('rating')
            
            self.background = xbmcgui.ControlImage( 70, 20, 1150, 630, 'http://imgur.com/oWUdNFg.jpg')
            self.title = xbmcgui.ControlTextBox(120, 60, 430, 50)
            self.rating = xbmcgui.ControlTextBox(145, 112, 1030, 45)
            self.plot = xbmcgui.ControlTextBox( 120, 150, 1056, 100 )
            self.thumbnail = xbmcgui.ControlImage( 120, 300, 1056, 300, self.getThumbnail )
            self.fanart = xbmcgui.ControlImage( 780, 43, 390, 100, self.getFanart )

            self.addControl(self.background)
            self.background.setAnimations([('conditional', 'effect=slide start=1000% end=0% time=1500 condition=true tween=bounce', ),('WindowClose','effect=slide delay=800 start=0% end=1000%  time=800 condition=true',)])
            self.addControl(self.thumbnail)
            self.thumbnail.setAnimations([('conditional', 'effect=zoom  start=0% end=100% delay=2700 time=1500 condition=true tween=elastic easing=inout', ),('WindowClose','effect=slide end=0,700%   time=300 condition=true',)])
            self.addControl(self.plot)
            self.plot.setAnimations([('conditional','effect=zoom delay=2000 center=auto start=0 end=100  time=800  condition=true  ',),('conditional','effect=rotate  delay=2000 center=auto aceleration=6000 start=0% end=360%  time=800  condition=true',),('WindowClose','effect=zoom center=auto start=100% end=-0%  time=600 condition=true',)])
            self.addControl(self.fanart)
            self.fanart.setAnimations([('WindowOpen','effect=slide start=0,-700 delay=1000 time=2500 tween=bounce condition=true',), ('conditional','effect=rotate center=auto  start=0% end=360% delay=3000 time=2500 tween=bounce condition=true',),('WindowClose','effect=slide end=0,-700%  time=1000 condition=true',)])
            self.addControl(self.title)
            self.title.setText( self.getTitle )
            self.title.setAnimations([('conditional', 'effect=slide start=-1500% end=0%  delay=1000 time=2000 condition=true tween=elastic', ),('WindowClose','effect=slide start=0% end=-1500%  time=800 condition=true',)])
            self.addControl(self.rating)
            self.rating.setText( self.getRating )
            self.rating.setAnimations([('conditional','effect=fade start=0% end=100% delay=3000 time=1500 condition=true', ),('WindowClose','effect=slide end=0,-700%  time=600 condition=true',)])
            xbmc.sleep(200)
            
            
            

            try:
                self.plot.autoScroll(7000,6000,30000)
            except:
                
                xbmc.executebuiltin('Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
            self.plot.setText(  self.getPlot ) 
Example #7
Source File: pasateatorrent.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
def __init__( self, *args, **kwargs):
            self.getTitle = kwargs.get('title')
            self.getPlot = kwargs.get('plot')
            self.getThumbnail = kwargs.get('thumbnail')
            self.getFanart = kwargs.get('fanart')
            self.getRating = kwargs.get('rating')
            
            self.background = xbmcgui.ControlImage( 70, 20, 1150, 630, 'http://imgur.com/gh1GShA.jpg')
            self.title = xbmcgui.ControlTextBox(120, 60, 430, 50)
            self.rating = xbmcgui.ControlTextBox(145, 112, 1030, 45)
            self.plot = xbmcgui.ControlTextBox( 120, 150, 1056, 100 )
            self.thumbnail = xbmcgui.ControlImage( 120, 300, 1056, 300, self.getThumbnail )
            self.fanart = xbmcgui.ControlImage( 780, 43, 390, 100, self.getFanart )

            self.addControl(self.background)
            self.background.setAnimations([('conditional', 'effect=slide start=1000% end=0% time=1500 condition=true tween=bounce', ),('WindowClose','effect=slide delay=800 start=0% end=1000%  time=800 condition=true',)])
            self.addControl(self.thumbnail)
            self.thumbnail.setAnimations([('conditional', 'effect=zoom  start=0% end=100% delay=2700 time=1500 condition=true tween=elastic easing=inout', ),('WindowClose','effect=slide end=0,700%   time=300 condition=true',)])
            self.addControl(self.plot)
            self.plot.setAnimations([('conditional','effect=zoom delay=2000 center=auto start=0 end=100  time=800  condition=true  ',),('conditional','effect=rotate  delay=2000 center=auto aceleration=6000 start=0% end=360%  time=800  condition=true',),('WindowClose','effect=zoom center=auto start=100% end=-0%  time=600 condition=true',)])
            self.addControl(self.fanart)
            self.fanart.setAnimations([('WindowOpen','effect=slide start=0,-700 delay=1000 time=2500 tween=bounce condition=true',), ('conditional','effect=rotate center=auto  start=0% end=360% delay=3000 time=2500 tween=bounce condition=true',),('WindowClose','effect=slide end=0,-700%  time=1000 condition=true',)])
            self.addControl(self.title)
            self.title.setText( self.getTitle )
            self.title.setAnimations([('conditional', 'effect=slide start=-1500% end=0%  delay=1000 time=2000 condition=true tween=elastic', ),('WindowClose','effect=slide start=0% end=-1500%  time=800 condition=true',)])
            self.addControl(self.rating)
            self.rating.setText( self.getRating )
            self.rating.setAnimations([('conditional','effect=fade start=0% end=100% delay=3000 time=1500 condition=true', ),('WindowClose','effect=slide end=0,-700%  time=600 condition=true',)])
            xbmc.sleep(200)
            
            
            

            try:
                self.plot.autoScroll(7000,6000,30000)
            except:
                
                xbmc.executebuiltin('Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
            self.plot.setText(  self.getPlot ) 
Example #8
Source File: torrentlocura.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
def __init__( self, *args, **kwargs):
            self.getTitle = kwargs.get('title')
            self.getPlot = kwargs.get('plot')
            self.getThumbnail = kwargs.get('thumbnail')
            self.getFanart = kwargs.get('fanart')
            self.getRating = kwargs.get('rating')
            
            self.background = xbmcgui.ControlImage( 70, 20, 1150, 630, 'http://imgur.com/sDp4M2R.jpg')
            self.title = xbmcgui.ControlTextBox(120, 60, 430, 50)
            self.rating = xbmcgui.ControlTextBox(145, 112, 1030, 45)
            self.plot = xbmcgui.ControlTextBox( 120, 150, 1056, 100 )
            self.thumbnail = xbmcgui.ControlImage( 120, 300, 1056, 300, self.getThumbnail )
            self.fanart = xbmcgui.ControlImage( 780, 43, 390, 100, self.getFanart )

            self.addControl(self.background)
            self.background.setAnimations([('conditional', 'effect=slide start=1000% end=0% time=1500 condition=true tween=bounce', ),('WindowClose','effect=slide delay=800 start=0% end=1000%  time=800 condition=true',)])
            self.addControl(self.thumbnail)
            self.thumbnail.setAnimations([('conditional', 'effect=zoom  start=0% end=100% delay=2700 time=1500 condition=true tween=elastic easing=inout', ),('WindowClose','effect=slide end=0,700%   time=300 condition=true',)])
            self.addControl(self.plot)
            self.plot.setAnimations([('conditional','effect=zoom delay=2000 center=auto start=0 end=100  time=800  condition=true  ',),('conditional','effect=rotate  delay=2000 center=auto aceleration=6000 start=0% end=360%  time=800  condition=true',),('WindowClose','effect=zoom center=auto start=100% end=-0%  time=600 condition=true',)])
            self.addControl(self.fanart)
            self.fanart.setAnimations([('WindowOpen','effect=slide start=0,-700 delay=1000 time=2500 tween=bounce condition=true',), ('conditional','effect=rotate center=auto  start=0% end=360% delay=3000 time=2500 tween=bounce condition=true',),('WindowClose','effect=slide end=0,-700%  time=1000 condition=true',)])
            self.addControl(self.title)
            self.title.setText( self.getTitle )
            self.title.setAnimations([('conditional', 'effect=slide start=-1500% end=0%  delay=1000 time=2000 condition=true tween=elastic', ),('WindowClose','effect=slide start=0% end=-1500%  time=800 condition=true',)])
            self.addControl(self.rating)
            self.rating.setText( self.getRating )
            self.rating.setAnimations([('conditional','effect=fade start=0% end=100% delay=3000 time=1500 condition=true', ),('WindowClose','effect=slide end=0,-700%  time=600 condition=true',)])
            xbmc.sleep(200)
            
            
            

            try:
                self.plot.autoScroll(7000,6000,30000)
            except:
                
                xbmc.executebuiltin('Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
            self.plot.setText(  self.getPlot ) 
Example #9
Source File: bricocine.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
def __init__( self, *args, **kwargs):
            
            self.getTitle = kwargs.get('title')
            self.getPlot = kwargs.get('plot')
            self.getInfo = kwargs.get('info')
            self.getThumbnail = kwargs.get('thumbnail')
            self.getFanart = kwargs.get('fanart')
            self.getQuit = kwargs.get('quit')
        
            self.background = xbmcgui.ControlImage( 70, 20, 1150, 630, 'http://s6.postimg.org/58jknrvtd/backgroundventana5.png')
            self.title = xbmcgui.ControlTextBox(140, 60, 1130, 50)
            self.quit = xbmcgui.ControlTextBox(145, 90, 1030, 45)
            self.plot = xbmcgui.ControlTextBox( 120, 150, 1056, 140 )
            self.info = xbmcgui.ControlFadeLabel(120, 310, 1056, 100)
            self.thumbnail = xbmcgui.ControlImage( 813, 43, 390, 100, self.getThumbnail )
            self.fanart = xbmcgui.ControlImage( 120, 365, 1060, 250, self.getFanart )
        
            self.addControl(self.background)
            self.addControl(self.title)
            self.addControl(self.quit)
            self.addControl(self.plot)
            self.addControl(self.thumbnail)
            self.addControl(self.fanart)
            self.addControl(self.info)
            
            self.title.setText( self.getTitle )
            self.quit.setText( self.getQuit )
            try:
               self.plot.autoScroll(7000,6000,30000)
            except:
               ###Información de incompatibilidd autoscroll con versiones inferiores a isengrd
               print "Actualice a la ultima version de kodi para mejor info"
               import xbmc
               xbmc.executebuiltin('Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
            self.plot.setText(  self.getPlot )
            self.info.addLabel(self.getInfo) 
Example #10
Source File: bricocine.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
def __init__( self, *args, **kwargs):
            self.getTitle = kwargs.get('title')
            self.getPlot = kwargs.get('plot')
            self.getThumbnail = kwargs.get('thumbnail')
            self.getFanart = kwargs.get('fanart')
            self.getQuit = kwargs.get('quit')
            
            self.background = xbmcgui.ControlImage( 70, 20, 1150, 630, 'http://s6.postimg.org/n3ph1uxn5/ventana.png')
            self.title = xbmcgui.ControlTextBox(120, 60, 430, 50)
            self.quit = xbmcgui.ControlTextBox(145, 110, 1030, 45)
            self.plot = xbmcgui.ControlTextBox( 120, 150, 1056, 100 )
            self.thumbnail = xbmcgui.ControlImage( 120, 300, 1056, 300, self.getThumbnail )
            self.fanart = xbmcgui.ControlImage( 780, 43, 390, 100, self.getFanart )
                
            self.addControl(self.background)
            self.addControl(self.title)
            self.addControl(self.quit)
            self.addControl(self.plot)
            self.addControl(self.thumbnail)
            self.addControl(self.fanart)
                
            self.title.setText( self.getTitle )
            self.quit.setText( self.getQuit )
            try:
                self.plot.autoScroll(7000,6000,30000)
            except:
                print "Actualice a la ultima version de kodi para mejor info"
                import xbmc
                xbmc.executebuiltin('Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
            self.plot.setText(  self.getPlot ) 
Example #11
Source File: borrachodetorrent.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
def __init__( self, *args, **kwargs):
            self.getTitle = kwargs.get('title')
            self.getPlot = kwargs.get('plot')
            self.getThumbnail = kwargs.get('thumbnail')
            self.getFanart = kwargs.get('fanart')
            self.getRating = kwargs.get('rating')
            
            self.background = xbmcgui.ControlImage( 70, 20, 1150, 630, 'http://imgur.com/PKOYIzX.jpg')
            self.title = xbmcgui.ControlTextBox(120, 60, 430, 50)
            self.rating = xbmcgui.ControlTextBox(145, 112, 1030, 45)
            self.plot = xbmcgui.ControlTextBox( 120, 150, 1056, 100 )
            self.thumbnail = xbmcgui.ControlImage( 120, 300, 1056, 300, self.getThumbnail )
            self.fanart = xbmcgui.ControlImage( 780, 43, 390, 100, self.getFanart )

            self.addControl(self.background)
            self.background.setAnimations([('conditional', 'effect=slide start=1000% end=0% time=1500 condition=true tween=bounce', ),('WindowClose','effect=slide delay=800 start=0% end=1000%  time=800 condition=true',)])
            self.addControl(self.thumbnail)
            self.thumbnail.setAnimations([('conditional', 'effect=zoom  start=0% end=100% delay=2700 time=1500 condition=true tween=elastic easing=inout', ),('WindowClose','effect=slide end=0,700%   time=300 condition=true',)])
            self.addControl(self.plot)
            self.plot.setAnimations([('conditional','effect=zoom delay=2000 center=auto start=0 end=100  time=800  condition=true  ',),('conditional','effect=rotate  delay=2000 center=auto aceleration=6000 start=0% end=360%  time=800  condition=true',),('WindowClose','effect=zoom center=auto start=100% end=-0%  time=600 condition=true',)])
            self.addControl(self.fanart)
            self.fanart.setAnimations([('WindowOpen','effect=slide start=0,-700 delay=1000 time=2500 tween=bounce condition=true',), ('conditional','effect=rotate center=auto  start=0% end=360% delay=3000 time=2500 tween=bounce condition=true',),('WindowClose','effect=slide end=0,-700%  time=1000 condition=true',)])
            self.addControl(self.title)
            self.title.setText( self.getTitle )
            self.title.setAnimations([('conditional', 'effect=slide start=-1500% end=0%  delay=1000 time=2000 condition=true tween=elastic', ),('WindowClose','effect=slide start=0% end=-1500%  time=800 condition=true',)])
            self.addControl(self.rating)
            self.rating.setText( self.getRating )
            self.rating.setAnimations([('conditional','effect=fade start=0% end=100% delay=3000 time=1500 condition=true', ),('WindowClose','effect=slide end=0,-700%  time=600 condition=true',)])
            xbmc.sleep(200)
            
            
            

            try:
                self.plot.autoScroll(7000,6000,30000)
            except:
                
                xbmc.executebuiltin('Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
            self.plot.setText(  self.getPlot ) 
Example #12
Source File: divxtotal.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
def __init__( self, *args, **kwargs):
            self.getTitle = kwargs.get('title')
            self.getPlot = kwargs.get('plot')
            self.getThumbnail = kwargs.get('thumbnail')
            self.getFanart = kwargs.get('fanart')
            self.getRating = kwargs.get('rating')
            
            self.background = xbmcgui.ControlImage( 70, 20, 1150, 630, 'http://imgur.com/K6wduMe.png')
            self.title = xbmcgui.ControlTextBox(120, 60, 430, 50)
            self.rating = xbmcgui.ControlTextBox(145, 112, 1030, 45)
            self.plot = xbmcgui.ControlTextBox( 120, 150, 1056, 100 )
            self.thumbnail = xbmcgui.ControlImage( 120, 300, 1056, 300, self.getThumbnail )
            self.fanart = xbmcgui.ControlImage( 780, 43, 390, 100, self.getFanart )

            self.addControl(self.background)
            self.background.setAnimations([('conditional', 'effect=slide start=1000% end=0% time=1500 condition=true tween=bounce', ),('WindowClose','effect=slide delay=800 start=0% end=1000%  time=800 condition=true',)])
            self.addControl(self.thumbnail)
            self.thumbnail.setAnimations([('conditional', 'effect=zoom  start=0% end=100% delay=2700 time=1500 condition=true tween=elastic easing=inout', ),('WindowClose','effect=slide end=0,700%   time=300 condition=true',)])
            self.addControl(self.plot)
            self.plot.setAnimations([('conditional','effect=zoom delay=2000 center=auto start=0 end=100  time=800  condition=true  ',),('conditional','effect=rotate  delay=2000 center=auto aceleration=6000 start=0% end=360%  time=800  condition=true',),('WindowClose','effect=zoom center=auto start=100% end=-0%  time=600 condition=true',)])
            self.addControl(self.fanart)
            self.fanart.setAnimations([('WindowOpen','effect=slide start=0,-700 delay=1000 time=2500 tween=bounce condition=true',), ('conditional','effect=rotate center=auto  start=0% end=360% delay=3000 time=2500 tween=bounce condition=true',),('WindowClose','effect=slide end=0,-700%  time=1000 condition=true',)])
            self.addControl(self.title)
            self.title.setText( self.getTitle )
            self.title.setAnimations([('conditional', 'effect=slide start=-1500% end=0%  delay=1000 time=2000 condition=true tween=elastic', ),('WindowClose','effect=slide start=0% end=-1500%  time=800 condition=true',)])
            self.addControl(self.rating)
            self.rating.setText( self.getRating )
            self.rating.setAnimations([('conditional','effect=fade start=0% end=100% delay=3000 time=1500 condition=true', ),('WindowClose','effect=slide end=0,-700%  time=600 condition=true',)])
            xbmc.sleep(200)
            
            
            

            try:
                self.plot.autoScroll(7000,6000,30000)
            except:
                
                xbmc.executebuiltin('Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
            self.plot.setText(  self.getPlot ) 
Example #13
Source File: bityouth.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
def __init__( self, *args, **kwargs):
            
            self.getTitle = kwargs.get('title')
            self.getPlot = kwargs.get('plot')
            self.getInfo = kwargs.get('info')
            self.getThumbnail = kwargs.get('thumbnail')
            self.getFanart = kwargs.get('fanart')
            self.getQuit = kwargs.get('quit')
                            
            self.background = xbmcgui.ControlImage( 70, 20, 1150, 630, 'http://s6.postimg.org/58jknrvtd/backgroundventana5.png')
            self.title = xbmcgui.ControlTextBox(140, 60, 1130, 50)
            self.quit = xbmcgui.ControlTextBox(145, 90, 1030, 45)
            self.plot = xbmcgui.ControlTextBox( 120, 150, 1056, 140 )
            self.info = xbmcgui.ControlFadeLabel(120, 310, 1056, 100)
            self.thumbnail = xbmcgui.ControlImage( 813, 43, 390, 100, self.getThumbnail )
            self.fanart = xbmcgui.ControlImage( 120, 365, 1060, 250, self.getFanart )
                                                
            self.addControl(self.background)
            self.addControl(self.title)
            self.addControl(self.quit)
            self.addControl(self.plot)
            self.addControl(self.thumbnail)
            self.addControl(self.fanart)
            self.addControl(self.info)
                
            self.title.setText( self.getTitle )
            self.quit.setText( self.getQuit )
            try:
                self.plot.autoScroll(7000,6000,30000)
            except:
                print "Actualice a la ultima version de kodi para mejor info"
                import xbmc
                xbmc.executebuiltin('Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
            self.plot.setText(  self.getPlot )
            self.info.addLabel(self.getInfo) 
Example #14
Source File: bityouth.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
def __init__( self, *args, **kwargs):
            self.getTitle = kwargs.get('title')
            self.getPlot = kwargs.get('plot')
            self.getThumbnail = kwargs.get('thumbnail')
            self.getFanart = kwargs.get('fanart')
            self.getQuit = kwargs.get('quit')
            
            self.background = xbmcgui.ControlImage( 70, 20, 1150, 630, 'http://s6.postimg.org/n3ph1uxn5/ventana.png')
            self.title = xbmcgui.ControlTextBox(120, 60, 430, 50)
            self.quit = xbmcgui.ControlTextBox(145, 90, 1030, 45)
            self.plot = xbmcgui.ControlTextBox( 120, 150, 1056, 100 )
            self.thumbnail = xbmcgui.ControlImage( 120, 300, 1056, 300, self.getThumbnail )
            self.fanart = xbmcgui.ControlImage( 780, 43, 390, 100, self.getFanart )
            
            self.addControl(self.background)
            self.addControl(self.title)
            self.addControl(self.quit)
            self.addControl(self.plot)
            self.addControl(self.thumbnail)
            self.addControl(self.fanart)
            
            self.title.setText( self.getTitle )
            self.quit.setText( self.getQuit )
            try:
                self.plot.autoScroll(7000,6000,30000)
            except:
                print "Actualice a la ultima version de kodi para mejor info"
                import xbmc
                xbmc.executebuiltin('Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
            self.plot.setText(  self.getPlot ) 
Example #15
Source File: txibitsoft.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
def __init__( self, *args, **kwargs):
            self.getTitle = kwargs.get('title')
            self.getPlot = kwargs.get('plot')
            self.getThumbnail = kwargs.get('thumbnail')
            self.getFanart = kwargs.get('fanart')
            self.getRating = kwargs.get('rating')
            
            self.background = xbmcgui.ControlImage( 70, 20, 1150, 630, 'http://imgur.com/H2hMPTP.jpg')
            self.title = xbmcgui.ControlTextBox(120, 60, 430, 50)
            self.rating = xbmcgui.ControlTextBox(145, 112, 1030, 45)
            self.plot = xbmcgui.ControlTextBox( 120, 150, 1056, 100 )
            self.thumbnail = xbmcgui.ControlImage( 120, 300, 1056, 300, self.getThumbnail )
            self.fanart = xbmcgui.ControlImage( 780, 43, 390, 100, self.getFanart )

            self.addControl(self.background)
            self.background.setAnimations([('conditional', 'effect=slide start=1000% end=0% time=1500 condition=true tween=bounce', ),('WindowClose','effect=slide delay=800 start=0% end=1000%  time=800 condition=true',)])
            self.addControl(self.thumbnail)
            self.thumbnail.setAnimations([('conditional', 'effect=zoom  start=0% end=100% delay=2700 time=1500 condition=true tween=elastic easing=inout', ),('WindowClose','effect=slide end=0,700%   time=300 condition=true',)])
            self.addControl(self.plot)
            self.plot.setAnimations([('conditional','effect=zoom delay=2000 center=auto start=0 end=100  time=800  condition=true  ',),('conditional','effect=rotate  delay=2000 center=auto aceleration=6000 start=0% end=360%  time=800  condition=true',),('WindowClose','effect=zoom center=auto start=100% end=-0%  time=600 condition=true',)])
            self.addControl(self.fanart)
            self.fanart.setAnimations([('WindowOpen','effect=slide start=0,-700 delay=1000 time=2500 tween=bounce condition=true',), ('conditional','effect=rotate center=auto  start=0% end=360% delay=3000 time=2500 tween=bounce condition=true',),('WindowClose','effect=slide end=0,-700%  time=1000 condition=true',)])
            self.addControl(self.title)
            self.title.setText( self.getTitle )
            self.title.setAnimations([('conditional', 'effect=slide start=-1500% end=0%  delay=1000 time=2000 condition=true tween=elastic', ),('WindowClose','effect=slide start=0% end=-1500%  time=800 condition=true',)])
            self.addControl(self.rating)
            self.rating.setText( self.getRating )
            self.rating.setAnimations([('conditional','effect=fade start=0% end=100% delay=3000 time=1500 condition=true', ),('WindowClose','effect=slide end=0,-700%  time=600 condition=true',)])
            xbmc.sleep(200)
            
            
            

            try:
                self.plot.autoScroll(7000,6000,30000)
            except:
                
                xbmc.executebuiltin('Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000,"https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/kodi-icon.png")')
            self.plot.setText(  self.getPlot ) 
Example #16
Source File: window_channels.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #17
Source File: window_menu.py    From pelisalacarta-ce with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #18
Source File: captcha_lib.py    From filmkodi with Apache License 2.0 5 votes vote down vote up
def get_response(img):
    try:
        img = xbmcgui.ControlImage(450, 0, 400, 130, img)
        wdlg = xbmcgui.WindowDialog()
        wdlg.addControl(img)
        wdlg.show()
        common.kodi.sleep(3000)
        solution = common.kodi.get_keyboard(common.i18n('letters_image'))
        if not solution:
            raise Exception('captcha_error')
    finally:
        wdlg.close() 
Example #19
Source File: camerasettings.py    From plugin.video.surveillanceroom with GNU General Public License v3.0 5 votes vote down vote up
def _place_window(self, width, height, title):
        """ Main window drawing """

        X_MARGIN = 5    # Horisontal adjustment for a header background if the main background has transparent edges. 
        Y_MARGIN = 5    # Vertical adjustment for a header background if the main background has transparent edges  
        Y_SHIFT = 4     # Header position adjustment if the main backround has visible borders.
        HEADER_HEIGHT = 35  # The height of a window header (for the title background and the title label).


        background_img = os.path.join(_images, 'AddonWindow', 'ContentPanel.png')
        background = xbmcgui.ControlImage(self.x, self.y, width, height, background_img)
        
        title_background_img = os.path.join(_images, 'AddonWindow', 'dialogheader.png')
        title_background = xbmcgui.ControlImage(self.x + X_MARGIN, self.y + Y_MARGIN, width - 2 * X_MARGIN, HEADER_HEIGHT, title_background_img)
        
        title_bar = xbmcgui.ControlLabel(self.x + X_MARGIN, self.y + Y_MARGIN + Y_SHIFT, width - 2 * X_MARGIN, HEADER_HEIGHT,
                                         title, alignment=ALIGN_CENTER, textColor='0xFFFFA500', font='font13_title')
        
        self.window_close_button = xbmcgui.ControlButton(self.x + width - 70, self.y + Y_MARGIN + Y_SHIFT, 60, 30, '',
                        focusTexture=os.path.join(_images, 'AddonWindow', 'DialogCloseButton-focus.png'),
                        noFocusTexture=os.path.join(_images, 'AddonWindow', 'DialogCloseButton.png'))
        
        self.addControl(background)
        self.addControl(title_background)
        self.addControl(title_bar)
        self.addControl(self.window_close_button) 
Example #20
Source File: window_menu.py    From tvalacarta with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #21
Source File: context.py    From plugin.video.emby with GNU General Public License v3.0 5 votes vote down vote up
def _add_editcontrol(self, x, y, height, width, password=0):

        media = os.path.join(xbmcaddon.Addon(addon_id()).getAddonInfo('path'), 'resources', 'skins', 'default', 'media')
        control = xbmcgui.ControlImage(0, 0, 0, 0,
                                       filename=os.path.join(media, "white.png"),
                                       aspectRatio=0,
                                       colorDiffuse="ff111111")
        control.setPosition(x, y)
        control.setHeight(height)
        control.setWidth(width)

        self.addControl(control)
        return control 
Example #22
Source File: acecore.py    From program.plexus with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self):
        self.showing = False
        self.window = xbmcgui.Window(12005)
        viewport_w, viewport_h = self._get_skin_resolution()
        font_max = 'font13'
        font_min = 'font10'
        origin_x = int(float(viewport_w)/1.3913)
        origin_y = int(float(viewport_h)/8.0)
        window_w = int(float(viewport_w)/3.7647)
        window_h = int(float(viewport_h)/2.5714)
        acelogo_w = int(float(window_w)/8.5)
        acelogo_h = int(float(window_w)/11.0)
        text_lat = int(float(window_w)/15)
        text_w = int(float(window_w)/1.7)
        text_h = int(float(window_h)/14)
        fst_setting = int(float(window_h)/3.5)
        fst_stat_setting = int(float(window_h)/1.4)

        #main window
        self._background = xbmcgui.ControlImage(origin_x, origin_y, window_w, window_h, os.path.join(addonpath,"resources","art","background.png"))
        self._acestreamlogo = xbmcgui.ControlImage(origin_x + int(float(window_w)/11.3), origin_y + int(float(window_h)/14), acelogo_w, acelogo_h, os.path.join(addonpath,"resources","art","acestreamlogo.png"))
        self._supseparator = xbmcgui.ControlImage(origin_x, origin_y + int(float(viewport_h)/12.176), window_w-10, 1, os.path.join(addonpath,"resources","art","separator.png"))
        self._botseparator = xbmcgui.ControlImage(origin_x, origin_y + window_h - 30, window_w-10, 1, os.path.join(addonpath,"resources","art","separator.png"))
        self._title = xbmcgui.ControlLabel(origin_x+int(float(window_w)/3.4), origin_y + text_h, window_w - 140, text_h, str(translate(30062)), font=font_max, textColor='0xFFEB9E17')
        self._total_stats_label = xbmcgui.ControlLabel(origin_x+int(float(window_h)/1.72), origin_y + int(float(window_h)/1.6), int(float(window_w)/1.7), 20, str(translate(30063)), font=font_min, textColor='0xFFEB9E17')
        #labels
        self._action = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_setting, int(float(text_w)*1.6), text_h, str(translate(30064)) + '  N/A', font=font_min)
        self._download = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_setting + text_h, int(float(text_w)*1.6), text_h, str(translate(30065)) + '  N/A', font=font_min)
        self._upload = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_setting + 2*text_h, text_w, text_h, str(translate(30066)) + '  N/A', font=font_min)
        self._seeds = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_setting + 3*text_h, text_w, text_h, str(translate(30067)) + '  N/A', font=font_min)
        self._total_download = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_stat_setting, text_w, text_h, str(translate(30068)) + '  N/A', font=font_min)
        self._total_upload = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_stat_setting + text_h, text_w, text_h, str(translate(30069)) + '  N/A', font=font_min)
        self._percent_value = xbmcgui.ControlLabel(origin_x+int(float(window_h)/1.05), origin_y + fst_setting, text_w, text_h,'N/A', font=font_min) 
Example #23
Source File: acecore.py    From program.plexus with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self):
        self.showing = False
        self.window = xbmcgui.Window(12005)
        viewport_w, viewport_h = self._get_skin_resolution()
        font_max = 'font13'
        font_min = 'font10'
        origin_x = int(float(viewport_w)/1.3913)
        origin_y = int(float(viewport_h)/8.0)
        window_w = int(float(viewport_w)/3.7647)
        window_h = int(float(viewport_h)/2.5714)
        acelogo_w = int(float(window_w)/8.5)
        acelogo_h = int(float(window_w)/11.0)
        text_lat = int(float(window_w)/15)
        text_w = int(float(window_w)/1.7)
        text_h = int(float(window_h)/14)
        fst_setting = int(float(window_h)/3.5)
        fst_stat_setting = int(float(window_h)/1.4)

        #main window
        self._background = xbmcgui.ControlImage(origin_x, origin_y, window_w, window_h, os.path.join(addonpath,"resources","art","background.png"))
        self._acestreamlogo = xbmcgui.ControlImage(origin_x + int(float(window_w)/11.3), origin_y + int(float(window_h)/14), acelogo_w, acelogo_h, os.path.join(addonpath,"resources","art","acestreamlogo.png"))
        self._supseparator = xbmcgui.ControlImage(origin_x, origin_y + int(float(viewport_h)/12.176), window_w-10, 1, os.path.join(addonpath,"resources","art","separator.png"))
        self._botseparator = xbmcgui.ControlImage(origin_x, origin_y + window_h - 30, window_w-10, 1, os.path.join(addonpath,"resources","art","separator.png"))
        self._title = xbmcgui.ControlLabel(origin_x+int(float(window_w)/3.4), origin_y + text_h, window_w - 140, text_h, str(translate(30062)), font=font_max, textColor='0xFFEB9E17')
        self._total_stats_label = xbmcgui.ControlLabel(origin_x+int(float(window_h)/1.72), origin_y + int(float(window_h)/1.6), int(float(window_w)/1.7), 20, str(translate(30063)), font=font_min, textColor='0xFFEB9E17')
        #labels
        self._action = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_setting, int(float(text_w)*1.6), text_h, str(translate(30064)) + '  N/A', font=font_min)
        self._download = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_setting + text_h, int(float(text_w)*1.6), text_h, str(translate(30065)) + '  N/A', font=font_min)
        self._upload = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_setting + 2*text_h, text_w, text_h, str(translate(30066)) + '  N/A', font=font_min)
        self._seeds = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_setting + 3*text_h, text_w, text_h, str(translate(30067)) + '  N/A', font=font_min)
        self._total_download = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_stat_setting, text_w, text_h, str(translate(30068)) + '  N/A', font=font_min)
        self._total_upload = xbmcgui.ControlLabel(origin_x + text_lat, origin_y + fst_stat_setting + text_h, text_w, text_h, str(translate(30069)) + '  N/A', font=font_min)
        self._percent_value = xbmcgui.ControlLabel(origin_x+int(float(window_h)/1.05), origin_y + fst_setting, text_w, text_h,'N/A', font=font_min) 
Example #24
Source File: captcha_lib.py    From script.module.urlresolver with GNU General Public License v2.0 5 votes vote down vote up
def get_response(img):
    try:
        img = xbmcgui.ControlImage(450, 0, 400, 130, img)
        wdlg = xbmcgui.WindowDialog()
        wdlg.addControl(img)
        wdlg.show()
        common.kodi.sleep(3000)
        solution = common.kodi.get_keyboard(common.i18n('letters_image'))
        if not solution:
            raise Exception('captcha_error')
    finally:
        wdlg.close()
        return solution 
Example #25
Source File: window_channels.py    From tvalacarta with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #26
Source File: player.py    From plugin.video.kmediatorrent with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, w, h, *args, **kwargs):
        self.window = xbmcgui.Window(WINDOW_FULLSCREEN_VIDEO)
        viewport_w, viewport_h = self._get_skin_resolution()
        # Adjust size based on viewport, we are using 1080p coordinates
        w = int(w * viewport_w / VIEWPORT_WIDTH)
        h = int(h * viewport_h / VIEWPORT_HEIGHT)
        x = (viewport_w - w) / 2
        y = (viewport_h - h) / 2
        self._shown = False
        self._text = ""
        self._label = xbmcgui.ControlLabel(x, y, w, h, self._text, *args, **kwargs)
        self._background = xbmcgui.ControlImage(x, y, w, h, os.path.join(RESOURCES_PATH, "images", "black.png"))
        self._background.setColorDiffuse("0xD0000000") 
Example #27
Source File: get_auth.py    From xbmc-addons-chinese with GNU General Public License v2.0 5 votes vote down vote up
def onControl(self, event):
        if event == self.buttonInput:
            self.close()
        elif event == self.buttonRefresh:
            (self.codeString, self.vcode_path) = auth.refresh_vcode(self.cookie, self.tokens, self.vcodetype)
            if self.codeString and self.vcode_path:
                self.removeControl(self.image)
                self.image = xbmcgui.ControlImage(80, 100, 500, 200, self.vcode_path)
                self.addControl(self.image)
            else:
                dialog.ok('Error', u'无法刷新验证码,请重试')



# Authorisation Process 
Example #28
Source File: captcha_lib.py    From script.module.resolveurl with GNU General Public License v2.0 5 votes vote down vote up
def get_response(img):
    try:
        img = xbmcgui.ControlImage(450, 0, 400, 130, img)
        wdlg = xbmcgui.WindowDialog()
        wdlg.addControl(img)
        wdlg.show()
        common.kodi.sleep(3000)
        solution = common.kodi.get_keyboard(common.i18n('letters_image'))
        if not solution:
            raise Exception('captcha_error')
    finally:
        wdlg.close()
        return solution 
Example #29
Source File: addonwindow.py    From ru with GNU General Public License v2.0 5 votes vote down vote up
def setFrame(self, title):
        """
        Define paths to images for window background and title background textures,
        and set control position adjustment constants used in setGrid.
        This is a helper method not to be called directly.
        """
        # Window background image
        self.background_img = os.path.join(_images, 'AddonWindow', 'ContentPanel.png')
        # Background for a window header
        self.title_background_img = os.path.join(_images, 'AddonWindow', 'dialogheader.png')
        # Horisontal adjustment for a header background if the main background has transparent edges.
        self.X_MARGIN = 5
        # Vertical adjustment for a header background if the main background has transparent edges
        self.Y_MARGIN = 5
        # Header position adjustment if the main backround has visible borders.
        self.Y_SHIFT = 4
        # The height of a window header (for the title background and the title label).
        self.HEADER_HEIGHT = 35
        self.background = xbmcgui.ControlImage(-10, -10, 1, 1, self.background_img)
        self.addControl(self.background)
        self.setAnimation(self.background)
        self.title_background = xbmcgui.ControlImage(-10, -10, 1, 1, self.title_background_img)
        self.addControl(self.title_background)
        self.setAnimation(self.title_background)
        self.title_bar = xbmcgui.ControlLabel(-10, -10, 1, 1, title, alignment=ALIGN_CENTER, textColor='0xFFFFA500',
                                                                        font='font13_title')
        self.addControl(self.title_bar)
        self.setAnimation(self.title_bar)
        self.window_close_button = xbmcgui.ControlButton(-100, -100, 60, 30, '',
                        focusTexture=os.path.join(_images, 'AddonWindow', 'DialogCloseButton-focus.png'),
                        noFocusTexture=os.path.join(_images, 'AddonWindow', 'DialogCloseButton.png'))
        self.addControl(self.window_close_button)
        self.setAnimation(self.window_close_button) 
Example #30
Source File: addonwindow.py    From ru with GNU General Public License v2.0 5 votes vote down vote up
def setFrame(self, title):
        """
        Set the image for for the fullscreen background.
        """
        # Image for the fullscreen background.
        self.main_bg_img = os.path.join(_images, 'AddonWindow', 'SKINDEFAULT.jpg')
        # Fullscreen background image control.
        self.main_bg = xbmcgui.ControlImage(1, 1, 1280, 720, self.main_bg_img)
        self.addControl(self.main_bg)
        super(AddonFullWindow, self).setFrame(title)