Esempio n. 1
0
    def __init__(self, settings=[]):
        x = 100
        y = 100
        h = 350
        w = 400
        hCnt = 30
        self.settings = settings
        self.saved = False
        mediaDir = os.path.join(os.getcwd().replace(";", ""),
                                'skin/Boxee Skin NG/media')
        rw = 1280
        rh = 720
        x = 640 - 200  #=440
        y = 360 - 175  #=185

        #y = 0
        #x = 0

        # Background
        self.imgBg = xbmcgui.ControlImage(
            0 + x - 30, 0 + y - 30, w + 60, h + 60,
            os.path.join(mediaDir, 'gs-bg-menu.png'))
        self.addControl(self.imgBg)

        # Settings
        self.labelSettings = xbmcgui.ControlLabel(0 + x,
                                                  0 + y,
                                                  w,
                                                  hCnt,
                                                  'Settings',
                                                  'font14',
                                                  '0xFFFFFFFF',
                                                  alignment=2)
        self.addControl(self.labelSettings)

        # Search
        self.labelSearch = xbmcgui.ControlLabel(5 + x,
                                                40 + y,
                                                w - 5,
                                                hCnt,
                                                'Search:',
                                                'font13',
                                                '0xFFFFFFFF',
                                                alignment=0)
        self.addControl(self.labelSearch)
        self.radioAlbums = xbmcgui.ControlRadioButton(
            20 + x,
            70 + y,
            w - 40,
            hCnt,
            'Only verified albums (disabled in API)',
            'button_focus.png',
            '',
            font='font12',
            textColor='0xFFFFFFFF')
        self.addControl(self.radioAlbums)
        self.radioSongs = xbmcgui.ControlRadioButton(
            20 + x,
            100 + y,
            w - 40,
            hCnt,
            'Exact match for songs (unimplemented)',
            'button_focus.png',
            '',
            font='font12',
            textColor='0xFFFFFFFF')
        self.addControl(self.radioSongs)

        # Login
        self.labelLogin = xbmcgui.ControlLabel(5 + x,
                                               140 + y,
                                               w,
                                               hCnt,
                                               'Login:'******'font13',
                                               '0xFFFFFFFF',
                                               alignment=0)
        self.addControl(self.labelLogin)
        self.btnUsername = xbmcgui.ControlButton(20 + x,
                                                 170 + y,
                                                 w - 40,
                                                 hCnt,
                                                 '',
                                                 'button_focus.png',
                                                 '',
                                                 font='font12',
                                                 textColor='0xFFFFFFFF')
        self.addControl(self.btnUsername)
        self.btnPassword = xbmcgui.ControlButton(20 + x,
                                                 200 + y,
                                                 w - 40,
                                                 hCnt,
                                                 '',
                                                 'button_focus.png',
                                                 '',
                                                 font='font12',
                                                 textColor='0xFFFFFFFF')
        self.addControl(self.btnPassword)

        # Debug
        self.labelDebug = xbmcgui.ControlLabel(5 + x,
                                               240 + y,
                                               w - 5,
                                               hCnt,
                                               'Debug:',
                                               'font13',
                                               '0xFFFFFFFF',
                                               alignment=0)
        self.addControl(self.labelDebug)
        self.radioDebug = xbmcgui.ControlRadioButton(
            20 + x,
            270 + y,
            w - 40,
            hCnt,
            'Turn on debugging (restart script)',
            'button_focus.png',
            '',
            font='font12',
            textColor='0xFFFFFFFF')
        self.addControl(self.radioDebug)

        # Buttons
        self.btnSave = xbmcgui.ControlButton(150 + x,
                                             310 + y,
                                             100,
                                             hCnt,
                                             'Save',
                                             'button_focus.png',
                                             '',
                                             font='font12',
                                             textColor='0xFFFFFFFF',
                                             alignment=2)
        self.addControl(self.btnSave)

        self.setControls(self.settings)

        self.setFocus(self.radioAlbums)
Esempio n. 2
0
        def onInit(self, *args, **kwargs):
            try:
                # listado temporada / episodios
                pos_y = self.controls_bg.getY() + 10

                # eliminamos los componentes al repintar la ventana
                for linea in self.controls:
                    self.removeControls(linea.list_elements())

                # mostramos el scroll si hay más de 5 elementos
                if len(self.data) > 5:
                    self.controls_bg.setWidth(545)
                    self.scroll_bg.setVisible(True)
                    self.scroll2_bg.setVisible(True)
                else:
                    self.controls_bg.setWidth(562)
                    self.scroll_bg.setVisible(False)
                    self.scroll2_bg.setVisible(False)

                self.controls = []
                # cambiamos el orden para que se vea en orden ascendente
                self.data.sort(key=lambda el: int(el[0]), reverse=False)

                for index, e in enumerate(self.data):
                    pos_x = self.controls_bg.getX() + 15
                    label_season_w = 100
                    label_season = xbmcgui.ControlLabel(
                        pos_x,
                        pos_y + 3,
                        label_season_w,
                        34,
                        config.get_localized_string(60385),
                        font=self.font,
                        textColor="0xFF2E64FE")
                    self.addControl(label_season)
                    label_season.setVisible(False)

                    pos_x += label_season_w + 5

                    # TODO mirar retro-compatilibidad
                    # if xbmcgui.ControlEdit == ControlEdit:
                    #       edit_season = xbmcgui.ControlEdit(0, 0, 0, 0, '', font=self.font, isPassword=False,
                    #                                         textColor='',
                    #                                         focusTexture=os.path.join(self.mediapath, 'Controls',
                    #                                                                   'MenuItemFO.png'),
                    #                                         noFocusTexture=os.path.join(self.mediapath, 'Controls',
                    #                                                                     'MenuItemNF.png'), window=self)
                    # else:

                    # control bugeado se tiene que usar metodos sets para que se cree correctamente.
                    edit_season = xbmcgui.ControlEdit(
                        0,
                        0,
                        0,
                        0,
                        "",
                        self.font,
                        "",
                        '',
                        4,
                        isPassword=False,
                        focusTexture=os.path.join(self.mediapath, 'Controls',
                                                  'MenuItemFO.png'),
                        noFocusTexture=os.path.join(self.mediapath, 'Controls',
                                                    'MenuItemNF.png'))
                    self.addControl(edit_season)
                    edit_season.setText(str(e[0]))
                    # edit_season.setLabel("Temporada:", font=self.font, textColor="0xFF2E64FE")
                    edit_season.setPosition(pos_x, pos_y - 2)
                    edit_season.setWidth(25)
                    edit_season.setHeight(35)
                    edit_season.setVisible(False)

                    label_episode_w = 90
                    pos_x += edit_season.getWidth() + 60
                    label_episode = xbmcgui.ControlLabel(
                        pos_x,
                        pos_y + 3,
                        label_episode_w,
                        34,
                        config.get_localized_string(70598),
                        font=self.font,
                        textColor="0xFF2E64FE")
                    self.addControl(label_episode)
                    label_episode.setVisible(False)

                    pos_x += label_episode_w + 5
                    # control bugeado se tiene que usar metodos sets para que se cree correctamente.
                    edit_episode = xbmcgui.ControlEdit(
                        0,
                        0,
                        0,
                        0,
                        "",
                        self.font,
                        "",
                        '',
                        4,
                        isPassword=False,
                        focusTexture=os.path.join(self.mediapath, 'Controls',
                                                  'MenuItemFO.png'),
                        noFocusTexture=os.path.join(self.mediapath, 'Controls',
                                                    'MenuItemNF.png'))
                    self.addControl(edit_episode)
                    edit_episode.setText(str(e[1]))
                    # edit_episode.setLabel("Episodios:", font=self.font, textColor="0xFF2E64FE")
                    edit_episode.setPosition(pos_x, pos_y - 2)
                    edit_episode.setWidth(40)
                    edit_episode.setHeight(35)
                    edit_episode.setVisible(False)

                    btn_delete_season_w = 120
                    btn_delete_season = xbmcgui.ControlButton(
                        self.controls_bg.getX() + self.controls_bg.getWidth() -
                        btn_delete_season_w - 14,
                        pos_y,
                        btn_delete_season_w,
                        30,
                        config.get_localized_string(70599),
                        font=self.font,
                        focusTexture=os.path.join(self.mediapath, 'Controls',
                                                  'KeyboardKey.png'),
                        noFocusTexture=os.path.join(self.mediapath, 'Controls',
                                                    'KeyboardKeyNF.png'),
                        alignment=ALIGN_CENTER)
                    self.addControl(btn_delete_season)
                    btn_delete_season.setVisible(False)

                    hb_bg = xbmcgui.ControlImage(
                        self.controls_bg.getX() + 10, pos_y + 40,
                        self.controls_bg.getWidth() - 20, 2,
                        os.path.join(self.mediapath, 'Controls',
                                     'ScrollBack.png'))
                    self.addControl(hb_bg)
                    hb_bg.setVisible(False)

                    group = ControlGroup(label_season=label_season,
                                         edit_season=edit_season,
                                         label_episode=label_episode,
                                         edit_episode=edit_episode,
                                         btn_delete_season=btn_delete_season,
                                         hb=hb_bg)

                    pos_y += 50

                    if index < 5:
                        group.set_visible(True)

                    self.controls.append(group)

                if len(self.data) > 5:
                    self.move_scroll()

            except Exception as Ex:
                logger.error("HA HABIDO UNA HOSTIA %s" % Ex)
Esempio n. 3
0
    def get_n(self, name, name2):
        #from metahandler import metahandlers
        #mg = metahandlers.MetaData()
        nume, an = xbmc.getCleanMovieTitle(name)
        #nume = nume.replace(" ", "+")
        nume = nume.replace('ț', 't').replace('ă', 'a')
        nume = urllib.quote_plus(nume)
        info_url = 'http://www.omdbapi.com/?t=%s&y=%s&plot=full&r=json' % (
            nume, an)
        met = self.get_data(info_url)
        meta = json.loads(met)
        data = [
            'Poster', 'Title', 'Plot', 'Genre', 'imdbRating', 'Year',
            'Director', 'Writer', 'Actors', 'Country', 'Language'
        ]
        if ('Error' in meta) and not (name2 == ' filme online'):
            nume, an = xbmc.getCleanMovieTitle(name2)
            nume = urllib.quote_plus(nume)
            info_url = 'http://www.omdbapi.com/?t=%s&y=%s&plot=full&r=json' % (
                nume, an)
            met = self.get_data(info_url)
            meta = json.loads(met)

        for dat in data:
            if not dat in meta:
                meta[dat] = 'Not Found'
        fundal = os.path.join(__cwd__, 'resources', 'media',
                              'ContentPanel.png')
        self.background = xbmcgui.ControlImage(180, 0, 1120, 720, fundal)
        self.addControl(self.background)

        self.fanart = xbmcgui.ControlImage(200,
                                           100,
                                           270,
                                           380,
                                           meta['Poster'],
                                           aspectRatio=2)
        self.addControl(self.fanart)

        #self.glassoverlay = xbmcgui.ControlImage(204, 104, 200, 230, 'GlassOverlay.png', aspectRatio=2)
        #self.addControl(self.glassoverlay)

        self.title = xbmcgui.ControlLabel(500, 40, 1030, 30,
                                          ('Titlu: %s' % meta['Title']))
        self.addControl(self.title)

        self.title = xbmcgui.ControlTextBox(210, 527, 1030, 120)
        self.addControl(self.title)
        self.title.setText('Plot: %s' % meta['Plot'])

        self.list = xbmcgui.ControlList(500, 90, 740, 390)
        self.addControl(self.list)

        self.list.addItem("genre: %s" % meta['Genre'])
        self.list.addItem("rating: %s" % meta['imdbRating'])
        self.list.addItem("year: %s" % meta['Year'])
        self.list.addItem("director: %s" % meta['Director'])
        self.list.addItem("writer: %s" % meta['Writer'])
        self.list.addItem("cast: %s" % meta['Actors'])
        self.list.addItem("country: %s" % meta['Country'])
        self.list.addItem("language: %s" % meta['Language'])
Esempio n. 4
0
    def __init__(self):
        # Go to a new window to see animations from Home
        # TODO: - Create a new empty window instead of using Programs
        #       - Add text with "You don't have the radio module or the radio server was not
        #         started"
        xbmc.executebuiltin("XBMC.ActivateWindow(Programs)")
        self.retval = 0
        self.clientScript = os.path.join(addon.getAddonInfo('path'),
                                         'resources', 'radio_client.py')
        self.stations = os.path.join(addon.getAddonInfo('path'), 'resources',
                                     'stations')
        self.mediaPath = os.path.join(addon.getAddonInfo('path'), 'resources',
                                      'media') + '/'

        # Background
        #self.w = self.getWidth()
        #self.h = self.getHeight()
        self.w = 1280
        self.h = 720
        self.background = xbmcgui.ControlImage(0,
                                               0,
                                               self.w,
                                               self.h,
                                               self.mediaPath +
                                               'background.jpg',
                                               colorDiffuse='0xffffffff')
        self.addControl(self.background)

        self.calibrationFile = "/home/pi/touchscreen_calibration_log"
        self.touchAxesCalib = "/home/pi/touchscreen_axes_calib"

        # Target
        self.targetW = 50
        self.targetH = 50
        self.x1 = 0
        self.y1 = 0
        self.x2 = self.w - self.targetW
        self.y2 = 0
        self.x3 = self.w - self.targetW
        self.y3 = self.h - self.targetH
        self.x4 = 0
        self.y4 = self.h - self.targetH
        self.targetImagePath = self.mediaPath + 'target.png'
        self.currentTarget = 1  # initial target index
        # Values used for calibration
        self.p1x = 0
        self.p1y = 0
        self.p2x = 0
        self.p2y = 0
        self.p3x = 0
        self.p3y = 0
        self.p4x = 0
        self.p4y = 0

        # First target
        self.targetImage = xbmcgui.ControlImage(self.x1,
                                                self.y1,
                                                self.targetW,
                                                self.targetH,
                                                self.targetImagePath,
                                                colorDiffuse='0xffffffff')
        self.addControl(self.targetImage)

        # Menu button
        #self.home_button=xbmcgui.ControlImage(0,0,70,70,
        #										self.mediaPath + 'textures/icon_home.png',
        #										colorDiffuse='0xffffffff')
        #self.button_menu=xbmcgui.ControlButton(0,0,70,70,
        #										"",
        #										self.mediaPath + 'textures/floor_buttonfo.png',
        #										self.mediaPath + 'textures/floor_button.png',
        #										0,
        #										0)
        #self.addControl(self.button_menu)
        #self.setFocus(self.button_menu)
        #self.addControl(self.home_button)

        # Mouse Position label
        self.mouse_pos = xbmcgui.ControlLabel(10,
                                              self.h / 2 - 70,
                                              500,
                                              40,
                                              "",
                                              textColor='0xffffffff',
                                              font='font30',
                                              alignment=TEXT_ALIGN_LEFT)
        self.addControl(self.mouse_pos)
        #self.mouse_pos.setLabel(str(self.w) + "x" + str(self.h))

        # Informational text label
        self.info = xbmcgui.ControlLabel(10,
                                         self.h / 2 - 40,
                                         1000,
                                         400,
                                         "",
                                         textColor='0xffffffff',
                                         font='font30',
                                         alignment=TEXT_ALIGN_LEFT)
        self.addControl(self.info)
        self.info.setLabel("Touch the top left point and then press ENTER")
Esempio n. 5
0
 def setupFIELDS(self):
     self.PercBarA = []
     self.PercBarB = []
     self.ItemLab_Filename = []
     self.ItemBtn_Stop = []
     self.ItemUrl_Stop = [
         '', '', '', '', '', '', '', '', '', '', '', '', '', ''
     ]
     self.ItemUrl_File = [
         '', '', '', '', '', '', '', '', '', '', '', '', '', ''
     ]
     for N in range(1, 14):
         itemH = ((N - 1) * 50) + self.itemStart
         ##Percent: Red Bar.
         self.PercBarA.append(
             xbmcgui.ControlImage(100,
                                  itemH + 30,
                                  self.itemW,
                                  20,
                                  imgPercentBar,
                                  aspectRatio=0,
                                  colorDiffuse='0xFFB22222'))
         self.addControl(self.PercBarA[N - 1])
         self.PercBarA[N - 1].setVisible(False)
         ##Percent: Green Bar.
         self.PercBarB.append(
             xbmcgui.ControlImage(100,
                                  itemH + 30,
                                  0,
                                  20,
                                  imgPercentBar,
                                  aspectRatio=0,
                                  colorDiffuse='0xFF008000'))
         self.addControl(self.PercBarB[N - 1])
         self.PercBarB[N - 1].setVisible(False)
         ##Percent: [Percent%] and Filename.
         self.ItemLab_Filename.append(
             xbmcgui.ControlLabel(100,
                                  itemH,
                                  self.itemW,
                                  30,
                                  '',
                                  'font13',
                                  textColor='0xFFFFFFFF',
                                  alignment=XBFONT_LEFT))
         self.addControl(self.ItemLab_Filename[N - 1])
         self.ItemLab_Filename[N - 1].setVisible(False)
         ##Stop Button
         self.ItemBtn_Stop.append(
             xbmcgui.ControlButton(45,
                                   itemH + 25,
                                   50,
                                   25,
                                   "Stop",
                                   font='font10',
                                   textColor="0xFFB22222",
                                   focusedColor="0xFF008000",
                                   alignment=XBFONT_CENTER_X,
                                   focusTexture=imgPercentBar,
                                   noFocusTexture=imgPercentBar))
         self.addControl(self.ItemBtn_Stop[N - 1])
         self.ItemBtn_Stop[N - 1].setVisible(False)
         try:
             self.ItemBtn_Stop[N - 1].controlUp(self.ItemBtn_Stop[N - 2])
         except:
             pass
         try:
             self.ItemBtn_Stop[N - 2].controlDown(self.ItemBtn_Stop[N - 1])
         except:
             pass
         ##
     self.BtnRefresh.controlUp(self.ItemBtn_Stop[-1])
     self.BtnExit.controlUp(self.ItemBtn_Stop[-1])
     self.BtnBrowse.controlUp(self.ItemBtn_Stop[-1])
     self.BtnRefresh.controlDown(self.ItemBtn_Stop[0])
     self.BtnExit.controlDown(self.ItemBtn_Stop[0])
     self.BtnBrowse.controlDown(self.ItemBtn_Stop[0])
     self.ItemBtn_Stop[0].controlUp(self.BtnRefresh)
     self.ItemBtn_Stop[-1].controlDown(self.BtnRefresh)
Esempio n. 6
0
    def __init__(self):

        self.lang = self._language()

        self.is_show = False
        self.window = xbmcgui.Window(12005)

        # get resolution
        # https://github.com/steeve/xbmctorrent/blob/master/resources/site-packages/xbmctorrent/player.py#L90
        import xml.etree.ElementTree as ET
        res = ET.parse(
            os.path.join(xbmc.translatePath('special://skin/'),
                         'addon.xml')).findall('./extension/res')[0]
        self._width = int(res.attrib['width'])
        self._height = int(res.attrib['height'])

        black = os.path.normpath(
            os.path.join(os.path.dirname(__file__),
                         '../resources/media/black.jpg'))
        white = os.path.normpath(
            os.path.join(os.path.dirname(__file__),
                         '../resources/media/white.jpg'))

        self.label = xbmcgui.ControlLabel(self.width(40),
                                          self.height(23) + 4,
                                          self.width(55),
                                          self.height(6),
                                          ' ',
                                          textColor='0xAAFFFFFF',
                                          alignment=5)

        self.controls = [
            xbmcgui.ControlImage(0,
                                 self.height(20),
                                 self.width(100),
                                 self.height(37),
                                 black,
                                 colorDiffuse='0xDD000000'),
            xbmcgui.ControlImage(0,
                                 self.height(31),
                                 self.width(100),
                                 1,
                                 white,
                                 colorDiffuse='0x22FFFFFF'),
            xbmcgui.ControlLabel(self.width(5),
                                 self.height(23),
                                 self.width(25),
                                 self.height(6),
                                 '[B]LibTorrent Player[/B]',
                                 font='font16',
                                 textColor='0xAAFFFFFF'), self.label
        ]

        self.progress = {}
        self.percent = {}
        self.bytes = {}

        for i, tag in enumerate(('file', 'total')):
            self.controls.append(
                xbmcgui.ControlLabel(self.width(5),
                                     self.height(34) + self.height(11) * i,
                                     self.width(25),
                                     self.height(6),
                                     self.lang['label_' + tag],
                                     textColor='0xAAFFFFFF',
                                     alignment=4))
            self.controls.append(
                xbmcgui.ControlImage(self.width(5),
                                     self.height(40) + self.height(11) * i,
                                     self.width(90),
                                     self.height(2),
                                     white,
                                     colorDiffuse='0x22FFFFFF'))

            self.bytes[tag] = xbmcgui.ControlLabel(self.width(37),
                                                   self.height(34) +
                                                   self.height(11) * i,
                                                   self.width(50),
                                                   self.height(6),
                                                   ' ',
                                                   textColor='0xAAFFFFFF',
                                                   alignment=5)
            self.controls.append(self.bytes[tag])

            self.percent[tag] = xbmcgui.ControlLabel(self.width(88),
                                                     self.height(34) +
                                                     self.height(11) * i,
                                                     self.width(7),
                                                     self.height(6),
                                                     '[B]0%[/B]',
                                                     font='font16',
                                                     textColor='0xAAFFFFFF',
                                                     alignment=5)
            self.controls.append(self.percent[tag])

            self.progress[tag] = xbmcgui.ControlImage(
                self.width(5),
                self.height(40) + self.height(11) * i,
                0,
                self.height(2),
                white,
                colorDiffuse='0x77FFFFFF')
            self.controls.append(self.progress[tag])
Esempio n. 7
0
    def __init__(self, *args, **kwargs):
        bg_image = os.path.join(__addon__.getAddonInfo('path'),
                                'Images/') + "background.png"
        check_image = os.path.join(__addon__.getAddonInfo('path'),
                                   'Images/') + "trans_checked.png"
        uncheck_image = os.path.join(__addon__.getAddonInfo('path'),
                                     'Images/') + "trans_unchecked1.png"
        self.cancelled = False
        self.chk = [0] * 9
        self.chkbutton = [0] * 9
        self.chkstate = [False] * 9

        imgX, imgY, imgw, imgh = 436, 210, 408, 300
        ph, pw = imgh / 3, imgw / 3
        x_gap = 70
        y_gap = 70
        button_gap = 40
        button_h = 40
        button_y = imgY + imgh + button_gap
        middle = imgX + (imgw / 2)
        win_x = imgX - x_gap
        win_y = imgY - y_gap
        win_h = imgh + 2 * y_gap + button_h + button_gap
        win_w = imgw + 2 * x_gap

        ctrlBackgound = xbmcgui.ControlImage(win_x, win_y, win_w, win_h,
                                             bg_image)
        self.addControl(ctrlBackgound)
        self.msg = '[COLOR red]%s[/COLOR]' % (kwargs.get('msg'))
        self.strActionInfo = xbmcgui.ControlLabel(imgX, imgY - 30, imgw, 20,
                                                  self.msg, 'font13')
        self.addControl(self.strActionInfo)
        img = xbmcgui.ControlImage(imgX, imgY, imgw, imgh,
                                   kwargs.get('captcha'))
        self.addControl(img)
        self.iteration = kwargs.get('iteration')
        self.strActionInfo = xbmcgui.ControlLabel(
            imgX, imgY + imgh, imgw, 20,
            'Captcha Round: %s [I](2 Rounds is typical)[/I]' %
            (str(self.iteration)), 'font40')
        self.addControl(self.strActionInfo)
        self.cancelbutton = xbmcgui.ControlButton(middle - 110,
                                                  button_y,
                                                  100,
                                                  button_h,
                                                  'Cancel',
                                                  alignment=2)
        self.okbutton = xbmcgui.ControlButton(middle + 10,
                                              button_y,
                                              100,
                                              button_h,
                                              'OK',
                                              alignment=2)
        self.addControl(self.okbutton)
        self.addControl(self.cancelbutton)

        for i in xrange(9):
            row = i / 3
            col = i % 3
            x_pos = imgX + (pw * col)
            y_pos = imgY + (ph * row)
            self.chk[i] = xbmcgui.ControlImage(x_pos, y_pos, pw, ph,
                                               check_image)
            self.addControl(self.chk[i])
            self.chk[i].setVisible(False)
            self.chkbutton[i] = xbmcgui.ControlButton(x_pos,
                                                      y_pos,
                                                      pw,
                                                      ph,
                                                      str(i + 1),
                                                      font='font1')
            self.addControl(self.chkbutton[i])

        for i in xrange(9):
            row_start = (i / 3) * 3
            right = row_start + (i + 1) % 3
            left = row_start + (i - 1) % 3
            up = (i - 3) % 9
            down = (i + 3) % 9
            self.chkbutton[i].controlRight(self.chkbutton[right])
            self.chkbutton[i].controlLeft(self.chkbutton[left])
            if i <= 2:
                self.chkbutton[i].controlUp(self.okbutton)
            else:
                self.chkbutton[i].controlUp(self.chkbutton[up])

            if i >= 6:
                self.chkbutton[i].controlDown(self.okbutton)
            else:
                self.chkbutton[i].controlDown(self.chkbutton[down])

        self.okbutton.controlLeft(self.cancelbutton)
        self.okbutton.controlRight(self.cancelbutton)
        self.cancelbutton.controlLeft(self.okbutton)
        self.cancelbutton.controlRight(self.okbutton)
        self.okbutton.controlDown(self.chkbutton[2])
        self.okbutton.controlUp(self.chkbutton[8])
        self.cancelbutton.controlDown(self.chkbutton[0])
        self.cancelbutton.controlUp(self.chkbutton[6])
        self.setFocus(self.okbutton)
    def makePageItems(self):
        self.background = self.Fanart
        #self.background=artj("backdrop_temp");
        focus = artp("button-focus_lightblue")
        nofocus = artp("button-focus_seagreen")
        ## ### ## Background
        self.BG = xbmcgui.ControlImage(self.scr['L'],
                                       self.scr['T'],
                                       self.scr['W'],
                                       self.scr['H'],
                                       self.background,
                                       aspectRatio=0)
        self.addControl(self.BG)
        self.BG.setAnimations([('WindowOpen',
                                'effect=fade ' + self.AniTime + ' start=0')])
        ## ### ## Exit
        w = 135
        h = 32
        l = 20
        t = 70
        t = 170
        self.button[0] = xbmcgui.ControlButton(l,
                                               t,
                                               w,
                                               h,
                                               "Exit",
                                               textColor="0xFF000000",
                                               focusedColor="0xFF00BFFF",
                                               alignment=2,
                                               focusTexture=focus,
                                               noFocusTexture=nofocus)
        self.addControl(self.button[0])
        zz = [self.button[0]]  #,self.button[1],self.button[2]]
        for z in zz:
            z.setAnimations([
                ('WindowOpen', 'effect=rotate delay=0 time=1 center=' +
                 str(l) + ',' + str(t) + ' end=90')
            ])
        ## ### ## Hands

        w = 260
        h = 373
        t = self.scr['H'] - h
        msg = ""
        l = (self.scr['W'] / 3) - ((w * 1) + 50)
        #msg=""+self.Hands[0];
        aniHands = 'effect=rotate delay=500 time=2000 start=180 '
        self.button[1] = xbmcgui.ControlButton(
            l,
            t,
            w,
            h,
            "" + msg,
            textColor="0xFFB22222",
            focusedColor="0xFF00BFFF",
            alignment=2,
            focusTexture=self.iHandsF[self.Hands[0]],
            noFocusTexture=self.iHands[self.Hands[0]])
        self.addControl(self.button[1])
        self.button[1].setAnimations([
            ('WindowOpen',
             aniHands + ' center=' + str(l + w) + ',' + str(t + h))
        ])
        l = (self.scr['W'] / 2) - ((int(w * 0.5)) + 40)
        #msg=""+self.Hands[1];
        self.button[2] = xbmcgui.ControlButton(
            l,
            t,
            w,
            h,
            "" + msg,
            textColor="0xFFB22222",
            focusedColor="0xFF00BFFF",
            alignment=2,
            focusTexture=self.iHandsF[self.Hands[1]],
            noFocusTexture=self.iHands[self.Hands[1]])
        self.addControl(self.button[2])
        self.button[2].setAnimations([
            ('WindowOpen',
             aniHands + ' center=' + str(l + w) + ',' + str(t + h))
        ])
        l = (self.scr['W'] / 2) + ((int(w * 0.5)) + 100)
        #msg=""+self.Hands[2];
        self.button[3] = xbmcgui.ControlButton(
            l,
            t,
            w,
            h,
            "" + msg,
            textColor="0xFFB22222",
            focusedColor="0xFF00BFFF",
            alignment=2,
            focusTexture=self.iHandsF[self.Hands[2]],
            noFocusTexture=self.iHands[self.Hands[2]])
        self.addControl(self.button[3])
        self.button[3].setAnimations([
            ('WindowOpen',
             aniHands + ' center=' + str(l + w) + ',' + str(t + h))
        ])

        ## ### ## Addon Title
        zz = ["XBMCHUB", "Your", "HUB-HUG"]
        w = 1000
        h = 50
        l = 15
        t = 700
        self.LabTitleText = Config.name
        self.LabTitle = xbmcgui.ControlLabel(l,
                                             t,
                                             w,
                                             h,
                                             '',
                                             'font30',
                                             '0xFFFF0000',
                                             angle=90)
        self.addControl(self.LabTitle)
        for z in zz:
            if z + " " in self.LabTitleText:
                self.LabTitleText = self.LabTitleText.replace(
                    z + " ",
                    "[COLOR deepskyblue][B][I]" + z + "[/I][/B][/COLOR]  ")
        if "Highway" in self.LabTitleText:
            self.LabTitleText = self.LabTitleText.replace(
                "Highway", "[COLOR tan]Highway[/COLOR]")
        self.LabTitle.setAnimations([
            ('WindowOpen', 'effect=slide delay=1000 time=1000 start=-100')
        ])
        self.LabTitle.setLabel(self.LabTitleText)
        ## ### ## Movements
        self.button[0].controlUp(self.button[3])
        self.button[0].controlDown(self.button[1])
        self.button[1].controlUp(self.button[0])
        self.button[1].controlDown(self.button[2])
        self.button[2].controlUp(self.button[1])
        self.button[2].controlDown(self.button[3])
        self.button[3].controlUp(self.button[2])
        self.button[3].controlDown(self.button[0])
        self.button[0].controlLeft(self.button[3])
        self.button[0].controlRight(self.button[1])
        self.button[1].controlLeft(self.button[0])
        self.button[1].controlRight(self.button[2])
        self.button[2].controlLeft(self.button[1])
        self.button[2].controlRight(self.button[3])
        self.button[3].controlLeft(self.button[2])
        self.button[3].controlRight(self.button[0])
        ## ### ## Focus
        self.setFocus(self.button[0])
Esempio n. 9
0
        
        try:
            self.mainConfig = readScriptConfig()                      
        except Exception, ex:
            outPrint('Unable to init the config, use the default', ex)
            self.mainConfig  = UserConfig(None,None,None,None)

        try:
            self.channels, self.categories, self.mediaVersion = readMediaElementTree(MEDIA_CONF, ENCODING_OUT)            
        except Exception, ex:
            outPrint('Unable to init the channel list', ex)
            return
        
        self.addControl(xbmcgui.ControlImage(0, 0, self.getScX(SIZE_WIDTH), self.getScY(SIZE_HEIGHT), BACKGROUND))
    
        self.strVersionInfo = xbmcgui.ControlLabel(self.getScX(315), self.getScY(110), self.getScX(200), self.getScY(200), "", "font12", "0xCCCCCCFF") 
        self.addControl(self.strVersionInfo)
        
        self.strVersionInfo.setLabel('Version %s'%(VERSION) ) 
    
        self.list = xbmcgui.ControlList(self.getScX(83), self.getScY(140), self.getScX(548), self.getScY(400),
                                        buttonTexture=LIST_SELECT_BG,
                                        buttonFocusTexture=LIST_SELECT_BG_FOCUS,
                                        textColor='0xFFFFFFFF',
                                        itemHeight=self.getScY(70),
                                        space=5,
                                        itemTextXOffset=self.getScX(40),
                                        imageWidth=self.getScX(74),
                                        imageHeight=self.getScY(50)
                                        )        
        self.addControl(self.list)
Esempio n. 10
0
 def onInit(self):
     source = trailer['source']
     info=getInfo(trailer['title'],trailer['year'])
     self.getControl(30001).setImage(trailer["thumbnail"])
     self.getControl(30003).setImage(trailer["fanart"])
     title_font=getTitleFont()
     title_string =trailer["title"] + ' - ' + trailer['source'] + ' ' + trailer['type'] + ' - ' + str(trailer["year"])
     title=xbmcgui.ControlLabel(10,40,800,40,title_string,title_font)
     title=self.addControl(title)
     title=self.getControl(3001)
     title.setAnimations([('windowclose', 'effect=fade end=0 time=1000')])          
     movieDirector=''
     movieWriter=''
     if source=='iTunes':
         writers = info['writer']
         directors = info['director']
         actors = info['cast']
         plot = info['plot']
         movieActor=''
         actorcount=0        
         for actor in actors:
             actorcount=actorcount+1
             movieActor = movieActor + actor + ", "
             if actorcount == 8: break
         if not movieActor == '':
             movieActor = movieActor[:-2]    
     else:
         plot=trailer["plot"]
         writers = trailer["writer"]
         directors = trailer["director"]
         actors = trailer["cast"]
         movieActor=''
         actorcount=0
         if source=='library':
             for actor in actors:
                 actorcount=actorcount+1
                 movieActor = movieActor + actor['name'] + ", "
                 if actorcount == 8: break
             if not movieActor == '':
                 movieActor = movieActor[:-2] 
         else:
             movieActor=''
             actorcount=0        
             for actor in actors:
                 actorcount=actorcount+1
                 movieActor = movieActor + actor + ", "
                 if actorcount == 8: break
             if not movieActor == '':
                 movieActor = movieActor[:-2]    
     for director in directors:
         movieDirector = movieDirector + director + ", "
     if not movieDirector =='':
         movieDirector = movieDirector[:-2]
     for writer in writers:
         movieWriter = movieWriter + writer + ", "
     if not movieWriter =='':
         movieWriter = movieWriter[:-2]                
     self.getControl(30005).setLabel(movieDirector)
     self.getControl(30006).setLabel(movieActor)
     self.getControl(30005).setLabel(movieDirector)
     self.getControl(30007).setLabel(movieWriter)
     self.getControl(30009).setText(plot)
     movieStudio=''
     if source == 'iTunes':
         studios=trailer["studio"]        
         movieStudio=studios
     if source =='library' or source == 'tmdb':
         studios=trailer["studio"]
         for studio in studios:
             movieStudio = movieStudio + studio + ", "
             if not movieStudio =='':
                 movieStudio = movieStudio[:-2]
     self.getControl(30010).setLabel(movieStudio)
     movieGenre=''
     if source =='iTunes':
         genres = info['genre']
     if source =='library' or source == 'tmdb':
         genres = trailer["genre"]
     for genre in genres:
         movieGenre = movieGenre + genre + " / "
     if not movieGenre =='':
         movieGenre = movieGenre[:-3]
     runtime=''
     if source == 'iTunes':runtime=''
     if source == 'library':runtime=str(trailer["runtime"] / 60)
     if runtime != '':runtime=runtime + ' Minutes - '
     self.getControl(30011).setLabel(runtime + movieGenre)
     imgRating='ratings/notrated.png'
     if trailer["mpaa"].startswith('G'): imgRating='ratings/g.png'
     if trailer["mpaa"] == ('G'): imgRating='ratings/g.png'
     if trailer["mpaa"].startswith('Rated G'): imgRating='ratings/g.png'
     if trailer["mpaa"].startswith('PG '): imgRating='ratings/pg.png'
     if trailer["mpaa"] == ('PG'): imgRating='ratings/pg.png'
     if trailer["mpaa"].startswith('Rated PG'): imgRating='ratings/pg.png'
     if trailer["mpaa"].startswith('PG-13 '): imgRating='ratings/pg13.png'
     if trailer["mpaa"] == ('PG-13'): imgRating='ratings/pg13.png'
     if trailer["mpaa"].startswith('Rated PG-13'): imgRating='ratings/pg13.png'
     if trailer["mpaa"].startswith('R '): imgRating='ratings/r.png'
     if trailer["mpaa"] == ('R'): imgRating='ratings/r.png'
     if trailer["mpaa"].startswith('Rated R'): imgRating='ratings/r.png'
     if trailer["mpaa"].startswith('NC17'): imgRating='ratings/nc17.png'
     if trailer["mpaa"].startswith('Rated NC17'): imgRating='ratings/nc1.png'
     self.getControl(30013).setImage(imgRating)
     if do_timeout:
         xbmc.sleep(6000)
         self.close()
Esempio n. 11
0
    def __init__(self, owner, bgArt, MyHand, TheirHand):
        self.background = bgArt
        self.ow = owner
        self.scr = {}
        self.scr['L'] = 0
        self.scr['T'] = 0
        self.scr['W'] = 1280
        self.scr['H'] = 720
        self.BG = xbmcgui.ControlImage(self.scr['L'],
                                       self.scr['T'],
                                       self.scr['W'],
                                       self.scr['H'],
                                       self.background,
                                       aspectRatio=0)
        self.addControl(self.BG)
        #t='3000'; self.BG.setAnimations([('WindowOpen','effect=fade time='+t+' start=0 end=100'),('WindowClose','effect=fade time='+t+' end=0')])
        focus = artp("button-focus_lightblue")
        nofocus = artp("button-focus_seagreen")
        ## ### ## Results
        w = 400
        h = 60
        l = (self.scr['W'] / 2) - (w / 2)
        t = (self.scr['H'] / 2) - (h + 50)
        t = 80
        l = l - 50
        self.txtResultBGL = xbmcgui.ControlImage(l,
                                                 t,
                                                 w,
                                                 h,
                                                 nofocus,
                                                 aspectRatio=0)
        self.txtResultL = xbmcgui.ControlLabel(l,
                                               t,
                                               w,
                                               h,
                                               "",
                                               'font14',
                                               '0xFF000000',
                                               alignment=2)
        for z in [self.txtResultBGL, self.txtResultL]:
            self.addControl(z)
            z.setAnimations([('WindowOpen',
                              'effect=fade delay=1500 time=1000 start=0')])
        ## ### ## Hands
        w = 260
        h = 373
        t = (self.scr['H'] / 2) - (w / 1)
        l = (0) - ((w * 1) + 0)
        self.iMyHand = xbmcgui.ControlImage(l,
                                            t,
                                            w,
                                            h,
                                            self.ow.iHands[MyHand],
                                            aspectRatio=0)
        self.addControl(self.iMyHand)
        self.iMyHand.setAnimations([
            ('WindowOpen',
             'effect=rotate delay=500 time=1000 start=0 end=-90 center=' +
             str(l + w) + ',' + str(t + h))
        ])
        t = (self.scr['H'] / 2) - (w / 1)
        l = (self.scr['W'])
        #-((w*1)+100); #l=(self.scr['W']/2)+((w*0)+100);
        self.iTheirHand = xbmcgui.ControlImage(l,
                                               t,
                                               w,
                                               h,
                                               self.ow.iLHands[TheirHand],
                                               aspectRatio=0)
        self.addControl(self.iTheirHand)
        self.iTheirHand.setAnimations([
            ('WindowOpen',
             'effect=rotate delay=500 time=1000 start=0 end=90 center=' +
             str(l) + ',' + str(t + h))
        ])

        #t=self.scr['H']-h; l=(self.scr['W']/2)-((w*1)+100);
        #self.iMyHand=xbmcgui.ControlImage(l,t,w,h,self.ow.iHands[MyHand],aspectRatio=0); self.addControl(self.iMyHand)
        #self.iMyHand.setAnimations([('WindowOpen','effect=rotate delay=500 time=1000 start=180 center='+str(l+w)+','+str(t+h))]);
        ##self.iMyHand.setAnimations([('WindowOpen','effect=slide delay=500 time=1000 start='+str(0-self.scr['W'])+','+str(0))]);
        #t=self.scr['H']-h; l=(self.scr['W']/2)+((w*0)+100);
        #self.iTheirHand=xbmcgui.ControlImage(l,t,w,h,self.ow.iLHands[TheirHand],aspectRatio=0); self.addControl(self.iTheirHand)
        #self.iTheirHand.setAnimations([('WindowOpen','effect=rotate delay=500 time=1000 start=180 center='+str(l+w)+','+str(t+h))]);
        ##self.iTheirHand.setAnimations([('WindowOpen','effect=slide delay=500 time=1000 start='+str(0+self.scr['W'])+','+str(0))]);
        ## ### ##
        Hands = self.ow.Hands
        self.beats = " " + "beats" + " "
        self.loser = "LOSER"
        self.winner = "WINNER"
        self.draw = "DRAW"
        self.noonewins = "NO ONE WINS"
        self.beats = " " + SettingG("txt-beats") + " "
        self.loser = SettingG("txt-loser")
        self.winner = SettingG("txt-winner")
        self.draw = SettingG("txt-draw")
        self.noonewins = SettingG("txt-noonewins")
        if MyHand == TheirHand:
            tResult1 = self.draw
            tResult2 = self.noonewins
        elif (MyHand, TheirHand) == (Hands[0], Hands[1]):
            tResult1 = self.loser
            tResult2 = TheirHand + self.beats + MyHand
        elif (MyHand, TheirHand) == (Hands[0], Hands[2]):
            tResult1 = self.winner
            tResult2 = MyHand + self.beats + TheirHand
        elif (MyHand, TheirHand) == (Hands[1], Hands[0]):
            tResult1 = self.winner
            tResult2 = MyHand + self.beats + TheirHand
        elif (MyHand, TheirHand) == (Hands[1], Hands[2]):
            tResult1 = self.loser
            tResult2 = TheirHand + self.beats + MyHand
        elif (MyHand, TheirHand) == (Hands[2], Hands[0]):
            tResult1 = self.loser
            tResult2 = TheirHand + self.beats + MyHand
        elif (MyHand, TheirHand) == (Hands[2], Hands[1]):
            tResult1 = self.winner
            tResult2 = MyHand + self.beats + TheirHand
        self.tResult1 = tResult1
        self.tResult2 = tResult2

        #"WINNER[CR]Rock beats Scissors"
        self.txtResultL.setLabel("" + tResult1 + "[CR]" + tResult2 + "")
        #if self.tResult1 == self.winner: xbmc.playSFX(art('snd_winner','.mp3'))
        ## ### ## Exit
        w = 135
        h = 32
        l = 20
        t = 70
        t = 170
        self.button[0] = xbmcgui.ControlButton(l,
                                               t,
                                               w,
                                               h,
                                               "Back",
                                               textColor="0xFF000000",
                                               focusedColor="0xFF00BFFF",
                                               alignment=2,
                                               focusTexture=focus,
                                               noFocusTexture=nofocus)
        self.addControl(self.button[0])
        zz = [self.button[0]]
        #,self.button[1],self.button[2]]
        for z in zz:
            z.setAnimations([
                ('WindowOpen', 'effect=rotate delay=0 time=1 center=' +
                 str(l) + ',' + str(t) + ' end=90')
            ])
        ## ### ## Focus
        self.setFocus(self.button[0])
        ## ### ##
        self.DoClose()
Esempio n. 12
0
        def __init__(self,
                     msg='',
                     L=0,
                     T=0,
                     W=1280,
                     H=720,
                     TxtColor='0xFFFFFFFF',
                     Font='font12',
                     BorderWidth=10):
            buttonfocus, buttonnofocus = artwork('button')
            radiobgfocus, radiobgnofocus, radiofocus, radionofocus = artwork(
                'radio')
            slidernibfocus, slidernibnofocus, sliderfocus, slidernofocus = artwork(
                'slider')
            image_path = os.path.join(ART, 'ContentPanel.png')
            boxbg = os.path.join(ART, 'bgg2.png')
            self.border = xbmcgui.ControlImage(L, T, W, H, image_path)
            self.addControl(self.border)
            self.BG = xbmcgui.ControlImage(L + BorderWidth,
                                           T + BorderWidth,
                                           W - (BorderWidth * 2),
                                           H - (BorderWidth * 2),
                                           FANART,
                                           aspectRatio=0,
                                           colorDiffuse='0x5FFFFFFF')
            self.addControl(self.BG)
            top = T + BorderWidth
            leftside = L + BorderWidth
            rightside = L + (W / 2) - (BorderWidth * 2)
            firstrow = top + 30
            secondrow = firstrow + 275 + (BorderWidth / 2)
            currentwidth = ((W / 2) - (BorderWidth * 4)) / 2

            header = '[COLOR %s]Advanced Settings Configuracion[/COLOR]' % (
                COLOR2)
            self.Header = xbmcgui.ControlLabel(L,
                                               top,
                                               W,
                                               30,
                                               header,
                                               font='font13',
                                               textColor=TxtColor,
                                               alignment=0x00000002)
            self.addControl(self.Header)
            top += 30 + BorderWidth
            self.bgarea = xbmcgui.ControlImage(leftside,
                                               firstrow,
                                               rightside - L,
                                               275,
                                               boxbg,
                                               aspectRatio=0,
                                               colorDiffuse='0x5FFFFFFF')
            self.addControl(self.bgarea)
            self.bgarea2 = xbmcgui.ControlImage(rightside + BorderWidth +
                                                BorderWidth,
                                                firstrow,
                                                rightside - L,
                                                275,
                                                boxbg,
                                                aspectRatio=0,
                                                colorDiffuse='0x5FFFFFFF')
            self.addControl(self.bgarea2)
            self.bgarea3 = xbmcgui.ControlImage(leftside,
                                                secondrow,
                                                rightside - L,
                                                275,
                                                boxbg,
                                                aspectRatio=0,
                                                colorDiffuse='0x5FFFFFFF')
            self.addControl(self.bgarea3)
            self.bgarea4 = xbmcgui.ControlImage(rightside + BorderWidth +
                                                BorderWidth,
                                                secondrow,
                                                rightside - L,
                                                275,
                                                boxbg,
                                                aspectRatio=0,
                                                colorDiffuse='0x5FFFFFFF')
            self.addControl(self.bgarea4)

            header = '[COLOR %s]Video Cache[/COLOR]' % (COLOR2)
            self.Header2 = xbmcgui.ControlLabel(leftside + BorderWidth,
                                                firstrow + 5,
                                                (W / 2) - (BorderWidth * 2),
                                                20,
                                                header,
                                                font='font13',
                                                textColor=TxtColor,
                                                alignment=0x00000002)
            self.addControl(self.Header2)
            freeMemory = int(
                float(wiz.getInfo('System.Memory(free)')[:-2]) * .33)
            recMemory = int(
                float(wiz.getInfo('System.Memory(free)')[:-2]) * .23)
            msg3 = "[COLOR %s]Numero de bytes utilizados para almacenar secuencias en la memoria. Cuando se establece en [COLOR %s]0[/COLOR] a cache se escribira en el disco en lugar de la RAM. Nota: Kodi requerira 3 veces la cantidad de RAM para ser libre. Establecer esto demasiado alto podria hacer que Kodi se bloquee si no puede obtener suficiente RAM (1/3 de memoria libre: [COLOR %s]%s[/COLOR])[/COLOR]" % (
                COLOR2, COLOR1, COLOR1, freeMemory)
            self.Support3 = xbmcgui.ControlTextBox(
                leftside + int(BorderWidth * 1.5),
                firstrow + 30 + BorderWidth, (W / 2) - (BorderWidth * 4),
                150,
                font='font10',
                textColor=TxtColor)
            self.addControl(self.Support3)
            self.Support3.setText(msg3)
            try:
                self.videoCacheSize = xbmcgui.ControlSlider(
                    leftside + int(BorderWidth * 1.5),
                    firstrow + 210, (W / 2) - (BorderWidth * 5),
                    20,
                    textureback=sliderfocus,
                    texture=slidernibnofocus,
                    texturefocus=slidernibfocus,
                    orientation=xbmcgui.HORIZONTAL)
            except:
                self.videoCacheSize = xbmcgui.ControlSlider(
                    leftside + int(BorderWidth * 1.5),
                    firstrow + 210, (W / 2) - (BorderWidth * 5),
                    20,
                    textureback=sliderfocus,
                    texture=slidernibnofocus,
                    texturefocus=slidernibfocus)
            self.addControl(self.videoCacheSize)
            self.videomin = 0
            self.videomax = freeMemory if freeMemory < 2000 else 2000
            self.recommendedVideo = recMemory if recMemory < 500 else 500
            self.currentVideo = self.recommendedVideo
            videopos = wiz.percentage(self.currentVideo, self.videomax)
            self.videoCacheSize.setPercent(videopos)
            current1 = '[COLOR %s]Presente:[/COLOR] [COLOR %s]%s MB[/COLOR]' % (
                COLOR1, COLOR2, self.currentVideo)
            recommended1 = '[COLOR %s]Recomendado:[/COLOR] [COLOR %s]%s MB[/COLOR]' % (
                COLOR1, COLOR2, self.recommendedVideo)
            self.currentVideo1 = xbmcgui.ControlTextBox(leftside + BorderWidth,
                                                        firstrow + 235,
                                                        currentwidth,
                                                        20,
                                                        font=Font,
                                                        textColor=TxtColor)
            self.addControl(self.currentVideo1)
            self.currentVideo1.setText(current1)
            self.recommendedVideo1 = xbmcgui.ControlTextBox(
                leftside + BorderWidth + currentwidth,
                firstrow + 235,
                currentwidth,
                20,
                font=Font,
                textColor=TxtColor)
            self.addControl(self.recommendedVideo1)
            self.recommendedVideo1.setText(recommended1)

            header = '[COLOR %s]CURL Tiempo de espera / CURL baja velocidad[/COLOR]' % (
                COLOR2)
            self.Header3 = xbmcgui.ControlLabel(rightside + BorderWidth,
                                                firstrow + 5,
                                                (W / 2) - (BorderWidth * 2),
                                                20,
                                                header,
                                                font='font13',
                                                textColor=TxtColor,
                                                alignment=0x00000002)
            self.addControl(self.Header3)
            msg3 = "[COLOR %s][B]tiempo de espera del cliente curl[/B] es el tiempo en segundos de cuanto tiempo tarda la conexion de libcurl en agotar el tiempo y [B]Tiempo de velocidad actual[/B] es el tiempo en segundos que libcurl considera una conexion a velocidad baja. Para conexiones mas lentas, configurelo en 20.[/COLOR]" % COLOR2
            self.Support3 = xbmcgui.ControlTextBox(
                rightside + int(BorderWidth * 3.5),
                firstrow + 30 + BorderWidth, (W / 2) - (BorderWidth * 4),
                150,
                font='font10',
                textColor=TxtColor)
            self.addControl(self.Support3)
            self.Support3.setText(msg3)
            try:
                self.CURLTimeout = xbmcgui.ControlSlider(
                    rightside + int(BorderWidth * 3.5),
                    firstrow + 210, (W / 2) - (BorderWidth * 5),
                    20,
                    textureback=sliderfocus,
                    texture=slidernibnofocus,
                    texturefocus=slidernibfocus,
                    orientation=xbmcgui.HORIZONTAL)
            except:
                self.CURLTimeout = xbmcgui.ControlSlider(
                    rightside + int(BorderWidth * 3.5),
                    firstrow + 210, (W / 2) - (BorderWidth * 5),
                    20,
                    textureback=sliderfocus,
                    texture=slidernibnofocus,
                    texturefocus=slidernibfocus)
            self.addControl(self.CURLTimeout)
            self.curlmin = 0
            self.curlmax = 20
            self.recommendedCurl = 10
            self.currentCurl = self.recommendedCurl
            curlpos = wiz.percentage(self.currentCurl, self.curlmax)
            self.CURLTimeout.setPercent(curlpos)
            current2 = '[COLOR %s]Presente:[/COLOR] [COLOR %s]%ss[/COLOR]' % (
                COLOR1, COLOR2, self.currentCurl)
            recommended2 = '[COLOR %s]Recomendado:[/COLOR] [COLOR %s]%ss[/COLOR]' % (
                COLOR1, COLOR2, self.recommendedCurl)
            self.currentCurl2 = xbmcgui.ControlTextBox(rightside +
                                                       (BorderWidth * 3),
                                                       firstrow + 235,
                                                       currentwidth,
                                                       20,
                                                       font=Font,
                                                       textColor=TxtColor)
            self.addControl(self.currentCurl2)
            self.currentCurl2.setText(current2)
            self.recommendedCurl2 = xbmcgui.ControlTextBox(
                rightside + (BorderWidth * 3) + currentwidth,
                firstrow + 235,
                currentwidth,
                20,
                font=Font,
                textColor=TxtColor)
            self.addControl(self.recommendedCurl2)
            self.recommendedCurl2.setText(recommended2)

            header = '[COLOR %s]Leer Factor de Buffer[/COLOR]' % (COLOR2)
            self.Header4 = xbmcgui.ControlLabel(leftside,
                                                secondrow + 5,
                                                (W / 2) - (BorderWidth * 2),
                                                20,
                                                header,
                                                font='font13',
                                                textColor=TxtColor,
                                                alignment=0x00000002)
            self.addControl(self.Header4)
            msg3 = "[COLOR %s]El valor de esta configuracion es un multiplicador del limite predeterminado. Si Kodi esta cargando un archivo raw bluray tipico a 36 Mbit / s, entonces un valor de 2 necesitara al menos 72 Mbit / s de ancho de banda de red. Sin embargo, a diferencia de la configuracion de la RAM, puede aumentar este valor de manera segura por alto que desee, y Kodi no se bloqueara.[/COLOR]" % COLOR2
            self.Support3 = xbmcgui.ControlTextBox(
                leftside + int(BorderWidth * 1.5),
                secondrow + 30 + BorderWidth, (W / 2) - (BorderWidth * 4),
                150,
                font='font10',
                textColor=TxtColor)
            self.addControl(self.Support3)
            self.Support3.setText(msg3)
            try:
                self.readBufferFactor = xbmcgui.ControlSlider(
                    leftside + int(BorderWidth * 1.5),
                    secondrow + 210, (W / 2) - (BorderWidth * 5),
                    20,
                    textureback=sliderfocus,
                    texture=slidernibnofocus,
                    texturefocus=slidernibfocus,
                    orientation=xbmcgui.HORIZONTAL)
            except:
                self.readBufferFactor = xbmcgui.ControlSlider(
                    leftside + int(BorderWidth * 1.5),
                    secondrow + 210, (W / 2) - (BorderWidth * 5),
                    20,
                    textureback=sliderfocus,
                    texture=slidernibnofocus,
                    texturefocus=slidernibfocus)
            self.addControl(self.readBufferFactor)
            self.readmin = 0
            self.readmax = 10
            self.recommendedRead = 5
            self.currentRead = self.recommendedRead
            readpos = wiz.percentage(self.currentRead, self.readmax)
            self.readBufferFactor.setPercent(readpos)
            current3 = '[COLOR %s]presente:[/COLOR] [COLOR %s]%s[/COLOR]' % (
                COLOR1, COLOR2, self.currentRead)
            recommended3 = '[COLOR %s]Recomendado:[/COLOR] [COLOR %s]%s[/COLOR]' % (
                COLOR1, COLOR2, self.recommendedRead)
            self.currentRead3 = xbmcgui.ControlTextBox(leftside + BorderWidth,
                                                       secondrow + 235,
                                                       currentwidth,
                                                       20,
                                                       font=Font,
                                                       textColor=TxtColor)
            self.addControl(self.currentRead3)
            self.currentRead3.setText(current3)
            self.recommendedRead3 = xbmcgui.ControlTextBox(
                leftside + BorderWidth + currentwidth,
                secondrow + 235,
                currentwidth,
                20,
                font=Font,
                textColor=TxtColor)
            self.addControl(self.recommendedRead3)
            self.recommendedRead3.setText(recommended3)

            header = '[COLOR %s]Modo Buffer[/COLOR]' % (COLOR2)
            self.Header4 = xbmcgui.ControlLabel(rightside + BorderWidth,
                                                secondrow + 5,
                                                (W / 2) - (BorderWidth * 2),
                                                20,
                                                header,
                                                font='font10',
                                                textColor=TxtColor,
                                                alignment=0x00000002)
            self.addControl(self.Header4)
            msg4 = "[COLOR %s]Esta configuracion obligara a Kodi a usar un cache para todos los archivos de video, incluida la red local, Internet e incluso el disco duro local. El valor predeterminado es 0 y solo almacenara en cache videos que usen rutas / fuentes de archivos de Internet.[/COLOR]" % COLOR2
            self.Support4 = xbmcgui.ControlTextBox(
                rightside + int(BorderWidth * 3.5),
                secondrow + 30 + BorderWidth, (W / 2) - (BorderWidth * 4),
                110,
                font='font10',
                textColor=TxtColor)
            self.addControl(self.Support4)
            self.Support4.setText(msg4)
            B1 = secondrow + 130 + BorderWidth
            B2 = B1 + 30
            B3 = B2 + 30
            B4 = B3 + 30
            self.Button0 = xbmcgui.ControlRadioButton(
                rightside + (BorderWidth * 3),
                B1, (W / 2) - (BorderWidth * 4),
                30,
                '0: Buffer todos los sistemas de archivos de internet',
                font='font12',
                focusTexture=radiobgfocus,
                noFocusTexture=radiobgnofocus,
                focusOnTexture=radiofocus,
                noFocusOnTexture=radiofocus,
                focusOffTexture=radionofocus,
                noFocusOffTexture=radionofocus)
            self.Button1 = xbmcgui.ControlRadioButton(
                rightside + (BorderWidth * 3),
                B2, (W / 2) - (BorderWidth * 4),
                30,
                '1: Buffer todos los sistemas de archivos',
                font='font12',
                focusTexture=radiobgfocus,
                noFocusTexture=radiobgnofocus,
                focusOnTexture=radiofocus,
                noFocusOnTexture=radiofocus,
                focusOffTexture=radionofocus,
                noFocusOffTexture=radionofocus)
            self.Button2 = xbmcgui.ControlRadioButton(
                rightside + (BorderWidth * 3),
                B3, (W / 2) - (BorderWidth * 4),
                30,
                '2: Solo almacenar en buffer los verdaderos sistemas de archivos de Internet',
                font='font12',
                focusTexture=radiobgfocus,
                noFocusTexture=radiobgnofocus,
                focusOnTexture=radiofocus,
                noFocusOnTexture=radiofocus,
                focusOffTexture=radionofocus,
                noFocusOffTexture=radionofocus)
            self.Button3 = xbmcgui.ControlRadioButton(
                rightside + (BorderWidth * 3),
                B4, (W / 2) - (BorderWidth * 4),
                30,
                '3: Sin configuracion del Buffer',
                font='font10',
                focusTexture=radiobgfocus,
                noFocusTexture=radiobgnofocus,
                focusOnTexture=radiofocus,
                noFocusOnTexture=radiofocus,
                focusOffTexture=radionofocus,
                noFocusOffTexture=radionofocus)
            self.addControl(self.Button0)
            self.addControl(self.Button1)
            self.addControl(self.Button2)
            self.addControl(self.Button3)
            self.Button0.setSelected(False)
            self.Button1.setSelected(False)
            self.Button2.setSelected(True)
            self.Button3.setSelected(False)

            self.buttonWrite = xbmcgui.ControlButton(
                leftside,
                T + H - 40 - BorderWidth, (W / 2) - (BorderWidth * 2),
                35,
                "Escribir archivo",
                textColor="0xFF000000",
                focusedColor="0xFF000000",
                alignment=2,
                focusTexture=buttonfocus,
                noFocusTexture=buttonnofocus)
            self.buttonCancel = xbmcgui.ControlButton(
                rightside + BorderWidth * 2,
                T + H - 40 - BorderWidth, (W / 2) - (BorderWidth * 2),
                35,
                "Cancelar",
                textColor="0xFF000000",
                focusedColor="0xFF000000",
                alignment=2,
                focusTexture=buttonfocus,
                noFocusTexture=buttonnofocus)
            self.addControl(self.buttonWrite)
            self.addControl(self.buttonCancel)

            self.buttonWrite.controlLeft(self.buttonCancel)
            self.buttonWrite.controlRight(self.buttonCancel)
            self.buttonWrite.controlUp(self.Button3)
            self.buttonWrite.controlDown(self.videoCacheSize)
            self.buttonCancel.controlLeft(self.buttonWrite)
            self.buttonCancel.controlRight(self.buttonWrite)
            self.buttonCancel.controlUp(self.Button3)
            self.buttonCancel.controlDown(self.videoCacheSize)
            self.videoCacheSize.controlUp(self.buttonWrite)
            self.videoCacheSize.controlDown(self.CURLTimeout)
            self.CURLTimeout.controlUp(self.videoCacheSize)
            self.CURLTimeout.controlDown(self.readBufferFactor)
            self.readBufferFactor.controlUp(self.CURLTimeout)
            self.readBufferFactor.controlDown(self.Button0)
            self.Button0.controlUp(self.CURLTimeout)
            self.Button0.controlDown(self.Button1)
            self.Button0.controlLeft(self.readBufferFactor)
            self.Button0.controlRight(self.readBufferFactor)
            self.Button1.controlUp(self.Button0)
            self.Button1.controlDown(self.Button2)
            self.Button1.controlLeft(self.readBufferFactor)
            self.Button1.controlRight(self.readBufferFactor)
            self.Button2.controlUp(self.Button1)
            self.Button2.controlDown(self.Button3)
            self.Button2.controlLeft(self.readBufferFactor)
            self.Button2.controlRight(self.readBufferFactor)
            self.Button3.controlUp(self.Button2)
            self.Button3.controlDown(self.buttonWrite)
            self.Button3.controlLeft(self.readBufferFactor)
            self.Button3.controlRight(self.readBufferFactor)
            self.setFocus(self.videoCacheSize)
Esempio n. 13
0
def load_skin(window):
    #background image
    window.bg = xbmcgui.ControlImage(0, 0, 720, 576,
                                     imageDir + "background.png")
    window.addControl(window.bg)

    window.bg1 = xbmcgui.ControlImage(0, 0, 720, 576,
                                      imageDir + "background.png")
    window.addControl(window.bg1)

    #Navi-X logo at top-right position
    window.logo = xbmcgui.ControlImage(620, 20, 80, 80, imageDir + "logo.png")
    window.addControl(window.logo)

    #user logo above the buttons
    window.user_logo = xbmcgui.ControlImage(32, 120, 210, 172,
                                            imageDir + "logo.png")
    window.addControl(window.user_logo)
    window.user_logo.setVisible(0)

    #user thumb above the buttons (overlaps with the user logo)
    window.user_thumb = xbmcgui.ControlImage(32, 120, 210, 172,
                                             imageDir + "logo.png")
    window.addControl(window.user_thumb)
    window.user_thumb.setVisible(0)

    #downloading state at the bottom of screen
    window.download_logo = xbmcgui.ControlImage(40, 480, 30, 30,
                                                imageDir + "icon_download.png")
    window.addControl(window.download_logo)
    window.download_logo.setVisible(0)

    #URL label at top-center position
    window.urllbl = xbmcgui.ControlLabel(40, 80, 350, 40, "", "font14")
    window.addControl(window.urllbl)

    #Navi-X Version label at top-left position
    window.version = xbmcgui.ControlLabel(
        40, 20, 155, 40, 'version: ' + Version + '.' + SubVersion, "font14")
    window.addControl(window.version)

    #"Loading..." text at down-left side
    window.infotekst = xbmcgui.ControlLabel(60, 520, 250, 30, "Loading...")
    window.addControl(window.infotekst)
    window.infotekst.setVisible(0)

    #"Download progress information..." text at down-left side
    window.dlinfotekst = xbmcgui.ControlLabel(80, 490, 250, 30, "")
    window.addControl(window.dlinfotekst)
    window.dlinfotekst.setVisible(0)

    #"Please wait..." text displayed on top of the main list
    window.loading = xbmcgui.ControlLabel(280, 130, 250, 30, "Please wait...")
    window.addControl(window.loading)
    window.loading.setVisible(0)

    #Main lists displaying playlist entries.
    #Large list 10 entries without text box on top.
    window.list1 = xbmcgui.ControlList(260,
                                       120,
                                       450,
                                       435,
                                       'font14',
                                       '0xFFDDDDDD',
                                       buttonFocusTexture=RootDir +
                                       'images\\list-focus.png',
                                       imageWidth=32,
                                       imageHeight=32,
                                       itemHeight=38)
    window.addControl(window.list1)
    window.list1.setPageControlVisible(False)

    #Small list 8 entries with text box on top.
    window.list2 = xbmcgui.ControlList(260,
                                       210,
                                       450,
                                       345,
                                       'font14',
                                       '0xFFDDDDDD',
                                       buttonFocusTexture=RootDir +
                                       'images\\list-focus.png',
                                       imageWidth=32,
                                       imageHeight=32,
                                       itemHeight=38)
    window.addControl(window.list2)
    window.list2.setPageControlVisible(False)

    #the text box above main list 2
    window.list2tb = xbmcgui.ControlTextBox(270, 115, 420, 85)
    window.addControl(window.list2tb)
    window.list2tb.setVisible(0)

    #set the large list as default
    window.list = window.list1

    #list cursor position label displayed at the bottom right of the screen
    window.listpos = xbmcgui.ControlLabel(640, 540, 250, 30, "")
    window.addControl(window.listpos)

    #buttons creation
    x = 50
    y = 303
    window.button_home = xbmcgui.ControlButton(
        x, y, 120, 32, '      Home', RootDir + "images\\button-focus1.png",
        RootDir + "images\\button-nofocus1.png")
    window.addControl(window.button_home)
    window.button_favorites = xbmcgui.ControlButton(
        x, y + 32, 120, 32, '      Favorites',
        RootDir + "images\\button-focus1.png",
        RootDir + "images\\button-nofocus1.png")
    window.addControl(window.button_favorites)
    window.button_downloads = xbmcgui.ControlButton(
        x, y + 64, 120, 32, '      View',
        RootDir + "images\\button-focus1.png",
        RootDir + "images\\button-nofocus1.png")
    window.addControl(window.button_downloads)
    window.button_url = xbmcgui.ControlButton(
        x, y + 96, 120, 32, '      Browse',
        RootDir + "images\\button-focus1.png",
        RootDir + "images\\button-nofocus1.png")
    window.addControl(window.button_url)
    window.button_about = xbmcgui.ControlButton(
        x, y + 128, 120, 32, '      About',
        RootDir + "images\\button-focus1.png",
        RootDir + "images\\button-nofocus1.png")
    window.addControl(window.button_about)

    #button behaviour
    window.list2tb.controlDown(window.list1)
    window.button_home.controlDown(window.button_favorites)
    window.button_favorites.controlDown(window.button_downloads)
    window.button_downloads.controlDown(window.button_url)
    window.button_url.controlDown(window.button_about)
    window.button_about.controlUp(window.button_url)
    window.button_url.controlUp(window.button_downloads)
    window.button_downloads.controlUp(window.button_favorites)
    window.button_favorites.controlUp(window.button_home)
    window.button_home.controlUp(window.list2tb)

    #window.button_home.controlRight(window.list1)
    #window.button_favorites.controlRight(window.list1)
    #window.button_downloads.controlRight(window.list1)
    #window.button_url.controlRight(window.list1)
    #window.button_about.controlRight(window.list1)
    window.list1.controlLeft(window.button_home)
    window.list2.controlLeft(window.button_home)
    window.list2tb.controlLeft(window.button_home)
Esempio n. 14
0
    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", "lateral-fundo.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",
                         "lateral-separador.png"))
        self._botseparator = xbmcgui.ControlImage(
            origin_x, origin_y + window_h - 30, window_w - 10, 1,
            os.path.join(addonpath, "resources", "art",
                         "lateral-separador.png"))
        self._title = xbmcgui.ControlLabel(origin_x +
                                           int(float(window_w) / 3.4),
                                           origin_y + text_h,
                                           window_w - 140,
                                           text_h,
                                           str(translate(50000)),
                                           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(50005)),
            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(50001)) + '  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(50002)) + '  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(50003)) + '  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(50004)) + '  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(50006)) + '  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(50007)) + '  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)
Esempio n. 15
0
    def __init__(self):
        self.setCoordinateResolution(6)

        self.addControl(xbmcgui.ControlImage(0,0,0,0,BG_00))

        self.addControl(xbmcgui.ControlLabel(200,63,0,0,"xbmc media center",'special12',alignment=0x00000001))
        self.addControl(xbmcgui.ControlLabel(207,63,0,0,__script__+" - Bonus($)",'special13'))

        self.addControl(xbmcgui.ControlImage(157,115,200,30,BG_V9))
        self.addControl(xbmcgui.ControlLabel(147,115,0,0,"x 100 +(Jp$)",'font13',alignment=0x00000001))

        self.addControl(xbmcgui.ControlImage(157,150,200,30,BG_V6))
        self.addControl(xbmcgui.ControlLabel(147,150,0,0,"x 15",'font13',alignment=0x00000001))

        self.addControl(xbmcgui.ControlImage(157,185,200,30,BG_V3))
        self.addControl(xbmcgui.ControlLabel(147,185,0,0,"x 5",'font13',alignment=0x00000001))

        self.addControl(xbmcgui.ControlImage(157,220,200,30,BG_V7))
        self.addControl(xbmcgui.ControlLabel(147,220,0,0,"x 50",'font13',alignment=0x00000001))

        self.addControl(xbmcgui.ControlImage(157,255,200,30,BG_V4))
        self.addControl(xbmcgui.ControlLabel(147,255,0,0,"x 25",'font13',alignment=0x00000001))

        self.addControl(xbmcgui.ControlImage(157,290,200,30,BG_V1))
        self.addControl(xbmcgui.ControlLabel(147,290,0,0,"x 20",'font13',alignment=0x00000001))

        self.addControl(xbmcgui.ControlImage(157,325,200,30,BG_V10))
        self.addControl(xbmcgui.ControlLabel(147,325,0,0,"x 8",'font13',alignment=0x00000001))

        self.addControl(xbmcgui.ControlImage(363,115,200,30,BG_V12))
        self.addControl(xbmcgui.ControlLabel(573,115,0,0,"x 20",'font13'))

        self.addControl(xbmcgui.ControlImage(363,150,200,30,BG_V11))
        self.addControl(xbmcgui.ControlLabel(573,150,0,0,"x 15",'font13'))

        self.addControl(xbmcgui.ControlImage(363,185,200,30,BG_V14))
        self.addControl(xbmcgui.ControlLabel(573,185,0,0,"x 10",'font13'))

        self.addControl(xbmcgui.ControlImage(363,220,200,30,BG_V13))
        self.addControl(xbmcgui.ControlLabel(573,220,0,0,"x 5",'font13'))

        self.addControl(xbmcgui.ControlImage(363,255,200,30,BG_V8))
        self.addControl(xbmcgui.ControlLabel(573,255,0,0,"x 10",'font13'))

        self.addControl(xbmcgui.ControlImage(363,290,200,30,BG_V5))
        self.addControl(xbmcgui.ControlLabel(573,290,0,0,"x 5",'font13'))

        self.addControl(xbmcgui.ControlImage(363,325,200,30,BG_V2))
        self.addControl(xbmcgui.ControlLabel(573,325,0,0,"x 1",'font13'))


        self.addControl(xbmcgui.ControlImage(150,360,410,190,BG_07))
        self.addControl(xbmcgui.ControlImage(310,400,100,100,BG_06))
        self.addControl(xbmcgui.ControlImage(310,400,100,100,"black.png"))

        self.addControl(xbmcgui.ControlLabel(170,368,0,0,"Keys Help!","special13","0xDDced8da"))

        self.addControl(xbmcgui.ControlImage(170,400,20,21,BG_K1))
        self.addControl(xbmcgui.ControlLabel(200,400,0,0,"Select ???","font12"))

        self.addControl(xbmcgui.ControlImage(170,430,20,20,BG_K2))
        self.addControl(xbmcgui.ControlLabel(200,430,0,0,"Bet -","font12"))

        self.addControl(xbmcgui.ControlImage(170,460,21,21,BG_K7))
        self.addControl(xbmcgui.ControlLabel(200,460,0,0,"Bet +","font12"))

        self.addControl(xbmcgui.ControlImage(170,490,20,20,BG_K8))
        self.addControl(xbmcgui.ControlLabel(200,490,0,0,"Start Spin","font12"))

        self.addControl(xbmcgui.ControlImage(365,400,18,18,BG_K6))
        self.addControl(xbmcgui.ControlLabel(390,400,0,0,"Infos Bonus($)\nand keys Help!","font12"))

        #self.addControl(xbmcgui.ControlImage(365,430,18,18,BG_K4))
        #self.addControl(xbmcgui.ControlLabel(390,430,0,0,"","font12"))

        self.addControl(xbmcgui.ControlImage(360,460,26,22,BG_K3))
        self.addControl(xbmcgui.ControlLabel(390,460,0,0,"Slots is spin: Stop Spin\nor not spin: Close Lucky7.","font12"))

        #self.addControl(xbmcgui.ControlImage(360,490,26,22,BG_K5))
        #self.addControl(xbmcgui.ControlLabel(390,490,0,0,"","font12"))

        self.addControl(xbmcgui.ControlLabel(0,510,720,0,"Jackpot($) is cumulative. Max: 25000","font12",alignment=0x00000002))
Esempio n. 16
0
    def create(self):
        """
            internal:
            creates the control and adds it to the page
            assumes width/height etc are already set
            does not do navigation
        """

        # get generic stuff, position, type, etc
        id = string.lower(self.getoption("id"))
        t = string.lower(self.getoption("type"))
        
        x = int(self.getvalue(self.getoption("posx")))
        y = int(self.getvalue(self.getoption("posy")))
        c=None

        # 0 means auto (afaik)
        w = 0  
        h = 0  
        t1 = self.getoption("width")
        if t1 != "":
            w = int(self.getvalue(t1))
        t1 = self.getoption("height")
        if t1 != "":
            h = int(self.getvalue(t1))
        l = self.getoption("label")
        try:
            t1 = int(l)
            l = self.translator.get(t1)
        except:
            pass
        
        help = self.getoption("help")
        try:
            t1 = int(help)
            help = self.translator.get(t1)
        except:
            pass
        self.options['help'] = help
        
        tx = self.getoption("texture")
        if tx != "":
            tx = util.findMediaFile( tx )
            # if it didn't find the script skin file then use the xbmc skin file
            if tx == None:
                tx = self.getoption("texture")
                
        tx1 = self.getoption("texturefocus")
        if tx1 != "":
            tx1 = util.findMediaFile( tx1 )
        tx2 = self.getoption("texturenofocus")
        if tx2 != "":
            tx2 = util.findMediaFile( tx2 )
            
        ck = self.getoption("colorkey")
        aspectRatio = self.getoption("aspectratio")
        fnt = self.getvalue(self.getoption("font"))
        tcol = self.getoption("textcolor")

        log.debug( "id=[%s] x=[%d] y=[%d] w=[%d] h=[%d] font=[%s]"%(id,x,y,w,h,fnt) )
        c = None
        if t == "image":
            try:
                if ck == "" and aspectRatio == "":
                    c = xbmcgui.ControlImage(x,y,w,h,tx)
                elif aspectRatio != "":
                    c = xbmcgui.ControlImage(x,y,w,h,tx, aspectRatio=int(aspectRatio))
                else: 
                    c = xbmcgui.ControlImage(x,y,w,h,tx,ck)
            except Exception:
                log.exception("Unable to load image id:%s filename:%s" %(id, tx))

        elif t == "button":
            try:
                tox = int(self.getvalue(self.getoption("offsetx")))
            except:
                tox = 17
            try:
                toy = int(self.getvalue(self.getoption("offsety")))
            except:
                toy = 2
            try:
                align = int(self.getvalue(self.getoption("alignment")))
            except:
                align = 0   # left
            log.debug( "font=[%s] tox=[%d] toy=[%d] align=[%d]"%(fnt,tox,toy,align) )

            if tx1 == "":
                if fnt == "":
                    c = xbmcgui.ControlButton(
                        x,y,w,h,l,
                        textXOffset=int(tox),textYOffset=int(toy),
                        alignment=align)
                else:
                    c = xbmcgui.ControlButton(
                        x,y,w,h,l,font=str(fnt),
                        textXOffset=int(tox),textYOffset=int(toy),
                        alignment=align)
            elif tx2 == "":
                if fnt == "":
                    c = xbmcgui.ControlButton(
                        x,y,w,h,l,tx1,
                        textXOffset=int(tox),textYOffset=int(toy),
                        alignment=align)
                else:
                    c = xbmcgui.ControlButton(
                        x,y,w,h,l,tx1,font=fnt,
                        textXOffset=int(tox),textYOffset=int(toy),
                        alignment=align)
            else:

                if fnt == "":
                    c = xbmcgui.ControlButton(
                        x, y, w, h, l, tx1, tx2,
                        textXOffset=int(tox), textYOffset=int(toy),
                        alignment=align)
                else:
                    c = xbmcgui.ControlButton(
                        x, y, w, h, l, tx1, tx2, font=fnt,
                        textXOffset=int(tox), textYOffset=int(toy),
                        alignment=align)
        elif t == "fadelabel":
            try:
                align = int(self.getvalue(self.getoption("alignment")))
            except Exception:
##                traceback.print_exc()
##                print ( "XBMCMYTHTV: %s " % str(ex) )
                align = 6   # left
            c = xbmcgui.ControlFadeLabel(x,y,w,h,str(fnt),tcol,alignment=align)
        
        elif t == "label":
            try:
                align = int(self.getvalue(self.getoption("alignment")))
            except:
                align = 0   # left
            c = xbmcgui.ControlLabel(x,y,w,h,l,str(fnt),tcol,alignment=align)

        elif t == "listcontrol":
            try:
                tox = int(self.getvalue(self.getoption("offsetx")))
            except:
                tox = 17
            try:
                spc = int(self.getvalue(self.getoption("space")))
            except:
                spc = 1
            try:
                ih = int(self.getvalue(self.getoption( "itemheight" )))
            except:
                ih = 20

            #    ALIGN_LEFT                          = 0
            #    ALIGN_RIGHT                         = 1
            #    ALIGN_CENTER_X                      = 2
            #    ALIGN_CENTER_Y                      = 4
            #    ALIGN_TRUNCATED                     = 8

            bt = util.findMediaFile('button-focus.png')
            aly = ui.ALIGN_TRUNCATED | ui.ALIGN_CENTER_Y
            
            log.debug( "font=[%s] tox=[%d] ih=[%d]"%(fnt,tox,ih) )

            if tx1 == "":
                if fnt == "":
                    c = xbmcgui.ControlList(x,y,w,h,itemTextXOffset=int(tox),space=int(spc),itemHeight=int(ih), 
                                            alignmentY = aly, buttonFocusTexture=bt)
                else:
                    c = xbmcgui.ControlList(x,y,w,h,font=fnt,itemTextXOffset=int(tox),space=int(spc),itemHeight=int(ih), 
                                            alignmentY = aly, buttonFocusTexture=bt)
                log.debug( "xbmcgui.ControlList(x,y,w,h)" )
            elif tx2 == "":
                if fnt == "":
                    c = xbmcgui.ControlList(x,y,w,h,tx1,itemTextXOffset=int(tox),space=int(spc),itemHeight=int(ih), 
                                            alignmentY = aly, buttonFocusTexture=bt)
                else:
                    c = xbmcgui.ControlList(x, y, w, h, tx1, font=fnt, itemTextXOffset=int(tox), space=int(spc), itemHeight=int(ih), 
                                            alignmentY = aly, buttonFocusTexture=bt)
                log.debug( "xbmcgui.ControlList(x,y,w,h,tx1)" )
            else:
                if fnt == "":
                    c = xbmcgui.ControlList(x,y,w,h,tx1,tx2,itemTextXOffset=int(tox),space=int(spc),itemHeight=int(ih), 
                                            alignmentY = aly, buttonFocusTexture=bt)
                else:
                    c = xbmcgui.ControlList(x,y,w,h,tx1,tx2,font=fnt,itemTextXOffset=int(tox),space=int(spc),itemHeight=int(ih), 
                                            alignmentY = aly, buttonFocusTexture=bt)
                log.debug( "xbmcgui.ControlList(x,y,w,h,tx1,tx2)" )
        elif t == "textbox":
            c = xbmcgui.ControlTextBox(x,y,w,h,fnt,tcol)
            # c.setText()
        elif t == "checkmark":
            try:
                cw = int(self.getoption( "checkwidth" ))
            except:
                cw = 30
            try:
                ch = int(self.getoption( "checkheight" ))
            except:
                ch = 30
            try:
                align = int(self.getvalue(self.getoption("alignment")))
            except:
                align = 1   # right
            if tx1 == "":
                c = xbmcgui.ControlCheckMark(
                    x,y,w,h,l, checkWidth=cw, checkHeight=ch, alignment=align,
                    textColor=tcol)
            elif tx2 == "":
                c = xbmcgui.ControlCheckMark(
                    x,y,w,h,l,tx1, checkWidth=cw, checkHeight=ch,
                    alignment=align, textColor=tcol)
            else:
                c = xbmcgui.ControlCheckMark(
                    x,y,w,h,l,tx1,tx2,cw,ch,align,textColor=tcol)
        log.debug( "created '%s' control"%t )

        # TODO: Remove OS specific checks
        if c != None:
            if os.name != "nt":
                self.owner.addControl(c)
            else:
                # lists are acting funny. trying remove instead of hide
                t1 = self.owner.getoption("defaultgroup")
                if t1 == self.getoption("group") or \
                        self.getoption("group") == "":
                    self.owner.addControl(c)
                
        self.control = c
Esempio n. 17
0
    def __init__(self):
        self.setCoordinateResolution(6)

        self.startNewGame()

        self.addControl(xbmcgui.ControlImage(0, 0, 720, 576, BG00))
        self.addControl(xbmcgui.ControlImage(-100, 95, 920, 360, BG01))
        self.addControl(
            xbmcgui.ControlLabel(200,
                                 63,
                                 0,
                                 0,
                                 "xbox media center",
                                 'special12',
                                 alignment=0x00000001))
        self.addControl(
            xbmcgui.ControlLabel(207, 63, 0, 0, __script__, 'special13'))
        self.logo = xbmcgui.ControlImage(550, 40, 74, 74, BG04)
        self.addControl(self.logo)

        self.countMaxRolling = xbmcgui.ControlLabel(115,
                                                    472,
                                                    90,
                                                    0,
                                                    "",
                                                    'special12',
                                                    alignment=0x00000002 +
                                                    0x00000004)
        self.addControl(self.countMaxRolling)
        self.countMaxRolling.setLabel(
            str(self.score.maxRolling) + "[CR]/[CR]16")

        # EXTRA BUTTON DICE
        self.addControl(
            xbmcgui.ControlLabel(50,
                                 415,
                                 90,
                                 0,
                                 ROLL,
                                 'special13',
                                 '0xeeFF0000',
                                 alignment=0x00000002 + 0x00000004))
        self.btn_dice_ex = xbmcgui.ControlButton(50,
                                                 430,
                                                 90,
                                                 90,
                                                 "",
                                                 font="font13",
                                                 textColor='0xeeFF0000',
                                                 focusTexture=BG02,
                                                 noFocusTexture=BG03,
                                                 alignment=0x00000002 +
                                                 0x00000004)
        self.addControl(self.btn_dice_ex)
        self.dummy = xbmcgui.ControlButton(50,
                                           430,
                                           90,
                                           90,
                                           "",
                                           focusTexture="",
                                           noFocusTexture="")
        self.addControl(self.dummy)

        # GROUP OF RADIO BUTTON ROLL (EXTRA BUTTON DICE)
        self.roll_1 = xbmcgui.ControlImage(59, 520, 22, 22, BGRADIO)
        self.addControl(self.roll_1)
        self.roll_2 = xbmcgui.ControlImage(84, 520, 22, 22, BGRADIO)
        self.addControl(self.roll_2)
        self.roll_3 = xbmcgui.ControlImage(109, 520, 22, 22, BGRADIO)
        self.addControl(self.roll_3)

        # GROUP OF BUTTON DICE
        self.btn_dice_1 = xbmcgui.ControlButton(180,
                                                430,
                                                90,
                                                90,
                                                "",
                                                font="font13",
                                                focusTexture=BG02,
                                                noFocusTexture=BG03,
                                                alignment=0x00000002 +
                                                0x00000004)
        self.addControl(self.btn_dice_1)
        self.btn_dice_2 = xbmcgui.ControlButton(275,
                                                430,
                                                90,
                                                90,
                                                "",
                                                font="font13",
                                                focusTexture=BG02,
                                                noFocusTexture=BG03,
                                                alignment=0x00000002 +
                                                0x00000004)
        self.addControl(self.btn_dice_2)
        self.btn_dice_3 = xbmcgui.ControlButton(370,
                                                430,
                                                90,
                                                90,
                                                "",
                                                font="font13",
                                                focusTexture=BG02,
                                                noFocusTexture=BG03,
                                                alignment=0x00000002 +
                                                0x00000004)
        self.addControl(self.btn_dice_3)
        self.btn_dice_4 = xbmcgui.ControlButton(465,
                                                430,
                                                90,
                                                90,
                                                "",
                                                font="font13",
                                                focusTexture=BG02,
                                                noFocusTexture=BG03,
                                                alignment=0x00000002 +
                                                0x00000004)
        self.addControl(self.btn_dice_4)
        self.btn_dice_5 = xbmcgui.ControlButton(560,
                                                430,
                                                90,
                                                90,
                                                "",
                                                font="font13",
                                                focusTexture=BG02,
                                                noFocusTexture=BG03,
                                                alignment=0x00000002 +
                                                0x00000004)
        self.addControl(self.btn_dice_5)

        # GROUP OF RADIO BUTTON DICE
        self.dice_1Hold = xbmcgui.ControlImage(214, 520, 22, 22, BGNORADIO)
        self.addControl(self.dice_1Hold)
        self.dice_2Hold = xbmcgui.ControlImage(309, 520, 22, 22, BGNORADIO)
        self.addControl(self.dice_2Hold)
        self.dice_3Hold = xbmcgui.ControlImage(404, 520, 22, 22, BGNORADIO)
        self.addControl(self.dice_3Hold)
        self.dice_4Hold = xbmcgui.ControlImage(499, 520, 22, 22, BGNORADIO)
        self.addControl(self.dice_4Hold)
        self.dice_5Hold = xbmcgui.ControlImage(594, 520, 22, 22, BGNORADIO)
        self.addControl(self.dice_5Hold)

        # GROUP OF BUTTON SCORE
        self.upperScore = xbmcgui.ControlList(87,
                                              120,
                                              270,
                                              350,
                                              font="font13",
                                              textColor="0xFFFFFFFF",
                                              selectedColor="0xFFFF9600",
                                              buttonFocusTexture=BG05,
                                              buttonTexture=BG06,
                                              itemTextXOffset=-10,
                                              itemHeight=28)
        self.addControl(self.upperScore)

        self.lowerScore = xbmcgui.ControlList(363,
                                              120,
                                              270,
                                              350,
                                              font="font13",
                                              textColor="0xFFFFFFFF",
                                              selectedColor="0xFFFF9600",
                                              buttonFocusTexture=BG05,
                                              buttonTexture=BG06,
                                              itemTextXOffset=-10,
                                              itemHeight=28)
        self.addControl(self.lowerScore)

        # EXTRA DICE
        self.dice_ex = xbmcgui.ControlImage(CHEXDICE[0], CHEXDICE[1],
                                            CHEXDICE[2], CHEXDICE[3],
                                            DICEBG % self.dice.ex)
        self.addControl(self.dice_ex)
        # GROUP OF DICE
        self.dice_1 = xbmcgui.ControlImage(CH01DICE[0], CH01DICE[1],
                                           CH01DICE[2], CH01DICE[3],
                                           DICEBG % self.dice.d1)
        self.addControl(self.dice_1)
        self.dice_2 = xbmcgui.ControlImage(CH02DICE[0], CH02DICE[1],
                                           CH02DICE[2], CH02DICE[3],
                                           DICEBG % self.dice.d2)
        self.addControl(self.dice_2)
        self.dice_3 = xbmcgui.ControlImage(CH03DICE[0], CH03DICE[1],
                                           CH03DICE[2], CH03DICE[3],
                                           DICEBG % self.dice.d3)
        self.addControl(self.dice_3)
        self.dice_4 = xbmcgui.ControlImage(CH04DICE[0], CH04DICE[1],
                                           CH04DICE[2], CH04DICE[3],
                                           DICEBG % self.dice.d4)
        self.addControl(self.dice_4)
        self.dice_5 = xbmcgui.ControlImage(CH05DICE[0], CH05DICE[1],
                                           CH05DICE[2], CH05DICE[3],
                                           DICEBG % self.dice.d5)
        self.addControl(self.dice_5)

        self.setNavigationOnDice()
        self.setHoldForNewGame()
        self.setScoreSection()
        self.setColorDice()
Esempio n. 18
0
    def __init__(self):

        # self.setResolution(0)
        # seems to be depreceated

        self.ADDON = xbmcaddon.Addon(id='script.web.browser')
        self.FPATH = xbmcvfs.translatePath(self.ADDON.getAddonInfo('path'))
        self.PHANTOMJS = xbmcvfs.translatePath(self.ADDON.getSetting('file'))

        self.CACHE = xbmcvfs.translatePath('special://temp')
        self.WEB = os.path.join(self.CACHE, 'web')
        self.FAV = os.path.join(self.CACHE, 'fav')

        # create dir
        if not os.path.exists(self.WEB):
            os.makedirs(self.WEB)
        # create dir
        if not os.path.exists(self.FAV):
            os.makedirs(self.FAV)

        # reload thumbs
        if (self.ADDON.getSetting('reload') == 'true'):
            self.deleteFavorites()
            self.ADDON.setSetting('reload', 'false')

        # load picture to avoid caching
        BACKG = os.path.join(self.FPATH, 'background.png')

        xSize = 1280
        ySize = 720

        self.image = xbmcgui.ControlImage(0, 70, xSize, ySize, filename=BACKG)
        self.addControl(self.image)

        # top bar
        BACKTOP = os.path.join(self.FPATH, 'webviewer-title-background.png')
        self.backTop = xbmcgui.ControlImage(0, 0, xSize, 70, BACKTOP)
        self.addControl(self.backTop)

        # link
        self.strLink = xbmcgui.ControlLabel(10, 16, 900, 70, '', 'font14',
                                            '0xFF000000')
        self.addControl(self.strLink)
        self.strLink.setLabel('about:blank')

        # id
        self.strID = xbmcgui.ControlLabel(1000, 16, 80, 70, '', 'font16',
                                          '0xFF000000')
        self.addControl(self.strID)
        self.strID.setLabel('')
        self.select = ''

        # zoom
        self.strZoom = xbmcgui.ControlLabel(1100, 16, 80, 70, '', 'font16',
                                            '0xFF000000')
        self.addControl(self.strZoom)
        self.strZoom.setLabel('100%')

        # play symbol
        self.play = xbmcgui.ControlImage(1200,
                                         10,
                                         50,
                                         50,
                                         filename=os.path.join(
                                             self.FPATH, 'OSDPlay.png'),
                                         aspectRatio=0)
        self.addControl(self.play)
        self.play.setVisible(False)

        # get favorites
        self.LINKS = [
            self.ADDON.getSetting('fav01'),
            self.ADDON.getSetting('fav02'),
            self.ADDON.getSetting('fav03'),
            self.ADDON.getSetting('fav04'),
            self.ADDON.getSetting('fav05'),
            self.ADDON.getSetting('fav06'),
            self.ADDON.getSetting('fav07'),
            self.ADDON.getSetting('fav08'),
            self.ADDON.getSetting('fav09')
        ]

        for i in range(0, 9):
            if (self.LINKS[i] != ''):
                self.doCache(self.LINKS[i], f'fav0{str(i+1)}.jpg')

        # make homepage
        self.makeHTML()

        # load homepage
        if (self.ADDON.getSetting('show') == "true"):
            homepage = f'file:///{self.FPATH}/home.html'
        else:
            homepage = self.ADDON.getSetting('home')
            xbmc.executebuiltin(
                f'Notification(Load Homepage, {homepage}, 5000)')

        # get zoom
        self.ZOOM = float(self.ADDON.getSetting('zoom'))

        # init history
        self.HISTORY = []
        self.HISTORY.append(homepage)

        # show homepage
        self.loadPage(homepage)
        self.showPage()
Esempio n. 19
0
		def __init__(self,msg='',L=0,T=0,W=1280,H=720,TxtColor='0xFFFFFFFF',Font='font12',BorderWidth=10):
			buttonfocus, buttonnofocus = artwork('button')
			radiobgfocus, radiobgnofocus, radiofocus, radionofocus = artwork('radio')
			slidernibfocus, slidernibnofocus, sliderfocus, slidernofocus = artwork('slider')
			image_path = os.path.join(ART, 'ContentPanel.png')
			boxbg = os.path.join(ART, 'bgg2.png')
			self.border = xbmcgui.ControlImage(L,T,W,H, image_path)
			self.addControl(self.border); 
			self.BG=xbmcgui.ControlImage(L+BorderWidth,T+BorderWidth,W-(BorderWidth*2),H-(BorderWidth*2), FANART, aspectRatio=0, colorDiffuse='0x5FFFFFFF')
			self.addControl(self.BG)
			top = T+BorderWidth
			leftside = L+BorderWidth
			rightside = L+(W/2)-(BorderWidth*2)
			firstrow = top+30
			secondrow = firstrow+275+(BorderWidth/2)
			currentwidth = ((W/2)-(BorderWidth*4))/2
			
			header = '[COLOR %s]Advanced Settings Configurator[/COLOR]' % (COLOR2)
			self.Header=xbmcgui.ControlLabel(L, top, W, 30, header, font='font13', textColor=TxtColor, alignment=0x00000002)
			self.addControl(self.Header)
			top += 30+BorderWidth
			self.bgarea = xbmcgui.ControlImage(leftside, firstrow, rightside-L, 275, boxbg, aspectRatio=0, colorDiffuse='0x5FFFFFFF')
			self.addControl(self.bgarea)
			self.bgarea2 = xbmcgui.ControlImage(rightside+BorderWidth+BorderWidth, firstrow, rightside-L, 275, boxbg, aspectRatio=0, colorDiffuse='0x5FFFFFFF')
			self.addControl(self.bgarea2)
			self.bgarea3 = xbmcgui.ControlImage(leftside, secondrow, rightside-L, 275, boxbg, aspectRatio=0, colorDiffuse='0x5FFFFFFF')
			self.addControl(self.bgarea3)
			self.bgarea4 = xbmcgui.ControlImage(rightside+BorderWidth+BorderWidth, secondrow, rightside-L, 275, boxbg, aspectRatio=0, colorDiffuse='0x5FFFFFFF')
			self.addControl(self.bgarea4)
			
			header = '[COLOR %s]Video Cache Size[/COLOR]' % (COLOR2)
			self.Header2=xbmcgui.ControlLabel(leftside+BorderWidth, firstrow+5, (W/2)-(BorderWidth*2), 20, header, font='font13', textColor=TxtColor, alignment=0x00000002)
			self.addControl(self.Header2)
			freeMemory = int(float(wiz.getInfo('System.Memory(free)')[:-2])*.33)
			recMemory = int(float(wiz.getInfo('System.Memory(free)')[:-2])*.23)
			msg3 = "[COLOR %s]Number of bytes used for buffering streams in memory.  When set to [COLOR %s]0[/COLOR] the cache will be written to disk instead of RAM.  Note: For the memory size set here, Kodi will require 3x the amount of RAM to be free. Setting this too high might cause Kodi to crash if it can't get enough RAM(1/3 of Free Memory: [COLOR %s]%s[/COLOR])[/COLOR]" % (COLOR2, COLOR1, COLOR1, freeMemory)
			self.Support3=xbmcgui.ControlTextBox(leftside+int(BorderWidth*1.5), firstrow+30+BorderWidth, (W/2)-(BorderWidth*4), 150, font='font12', textColor=TxtColor)
			self.addControl(self.Support3)
			self.Support3.setText(msg3)
			self.videoCacheSize=xbmcgui.ControlSlider(leftside+int(BorderWidth*1.5), firstrow+210,(W/2)-(BorderWidth*5),20, textureback=sliderfocus, texture=slidernibnofocus, texturefocus=slidernibfocus)
			self.addControl(self.videoCacheSize)
			self.videomin = 0; self.videomax = freeMemory if freeMemory < 2000 else 2000
			self.recommendedVideo = recMemory if recMemory < 500 else 500; self.currentVideo = self.recommendedVideo
			videopos = wiz.percentage(self.currentVideo, self.videomax)
			self.videoCacheSize.setPercent(videopos)
			current1 = '[COLOR %s]Current:[/COLOR] [COLOR %s]%s MB[/COLOR]' % (COLOR1, COLOR2, self.currentVideo)
			recommended1 = '[COLOR %s]Recommended:[/COLOR] [COLOR %s]%s MB[/COLOR]' % (COLOR1, COLOR2, self.recommendedVideo)
			self.currentVideo1=xbmcgui.ControlTextBox(leftside+BorderWidth,firstrow+235,currentwidth,20,font=Font,textColor=TxtColor)
			self.addControl(self.currentVideo1)
			self.currentVideo1.setText(current1)
			self.recommendedVideo1=xbmcgui.ControlTextBox(leftside+BorderWidth+currentwidth,firstrow+235,currentwidth,20,font=Font,textColor=TxtColor)
			self.addControl(self.recommendedVideo1)
			self.recommendedVideo1.setText(recommended1)
			
			header = '[COLOR %s]CURL Timeout/CURL Low Speed[/COLOR]' % (COLOR2)
			self.Header3=xbmcgui.ControlLabel(rightside+BorderWidth, firstrow+5, (W/2)-(BorderWidth*2), 20, header, font='font13', textColor=TxtColor, alignment=0x00000002)
			self.addControl(self.Header3)
			msg3 = "[COLOR %s][B]curlclienttimeout[/B] is the time in seconds for how long it takes for libcurl connection will timeout and [B]curllowspeedtime[/B] is the time in seconds for libcurl to consider a connection lowspeed.  For slower connections set it to 20.[/COLOR]" % COLOR2
			self.Support3=xbmcgui.ControlTextBox(rightside+int(BorderWidth*3.5), firstrow+30+BorderWidth, (W/2)-(BorderWidth*4), 150, font='font12', textColor=TxtColor)
			self.addControl(self.Support3)
			self.Support3.setText(msg3)
			self.CURLTimeout=xbmcgui.ControlSlider(rightside+int(BorderWidth*3.5),firstrow+210,(W/2)-(BorderWidth*5),20, textureback=sliderfocus, texture=slidernibnofocus, texturefocus=slidernibfocus)
			self.addControl(self.CURLTimeout)
			self.curlmin = 0; self.curlmax = 20
			self.recommendedCurl = 10; self.currentCurl = self.recommendedCurl
			curlpos = wiz.percentage(self.currentCurl, self.curlmax)
			self.CURLTimeout.setPercent(curlpos)
			current2 = '[COLOR %s]Current:[/COLOR] [COLOR %s]%ss[/COLOR]' % (COLOR1, COLOR2, self.currentCurl)
			recommended2 = '[COLOR %s]Recommended:[/COLOR] [COLOR %s]%ss[/COLOR]' % (COLOR1, COLOR2, self.recommendedCurl)
			self.currentCurl2=xbmcgui.ControlTextBox(rightside+(BorderWidth*3),firstrow+235,currentwidth,20,font=Font,textColor=TxtColor)
			self.addControl(self.currentCurl2)
			self.currentCurl2.setText(current2)
			self.recommendedCurl2=xbmcgui.ControlTextBox(rightside+(BorderWidth*3)+currentwidth,firstrow+235,currentwidth,20,font=Font,textColor=TxtColor)
			self.addControl(self.recommendedCurl2)
			self.recommendedCurl2.setText(recommended2)
			
			header = '[COLOR %s]Read Buffer Factor[/COLOR]' % (COLOR2)
			self.Header4=xbmcgui.ControlLabel(leftside, secondrow+5, (W/2)-(BorderWidth*2), 20, header, font='font13', textColor=TxtColor, alignment=0x00000002)
			self.addControl(self.Header4)
			msg3 = "[COLOR %s]The value of this setting is a multiplier of the default limit. If Kodi is loading a typical bluray raw file at 36 Mbit/s, then a value of 2 will need at least 72 Mbit/s of network bandwidth. However, unlike with the RAM setting, you can safely increase this value however high you want, and Kodi won't crash.[/COLOR]" % COLOR2
			self.Support3=xbmcgui.ControlTextBox(leftside+int(BorderWidth*1.5), secondrow+30+BorderWidth, (W/2)-(BorderWidth*4), 150, font='font12', textColor=TxtColor)
			self.addControl(self.Support3)
			self.Support3.setText(msg3)
			self.readBufferFactor=xbmcgui.ControlSlider(leftside+int(BorderWidth*1.5), secondrow+210,(W/2)-(BorderWidth*5),20, textureback=sliderfocus, texture=slidernibnofocus, texturefocus=slidernibfocus)
			self.addControl(self.readBufferFactor)
			self.readmin = 0; self.readmax = 10
			self.recommendedRead = 5; self.currentRead = self.recommendedRead
			readpos = wiz.percentage(self.currentRead, self.readmax)
			self.readBufferFactor.setPercent(readpos)
			current3 = '[COLOR %s]Current:[/COLOR] [COLOR %s]%s[/COLOR]' % (COLOR1, COLOR2, self.currentRead)
			recommended3 = '[COLOR %s]Recommended:[/COLOR] [COLOR %s]%s[/COLOR]' % (COLOR1, COLOR2, self.recommendedRead)
			self.currentRead3=xbmcgui.ControlTextBox(leftside+BorderWidth,secondrow+235,currentwidth,20,font=Font,textColor=TxtColor)
			self.addControl(self.currentRead3)
			self.currentRead3.setText(current3)
			self.recommendedRead3=xbmcgui.ControlTextBox(leftside+BorderWidth+currentwidth,secondrow+235,currentwidth,20,font=Font,textColor=TxtColor)
			self.addControl(self.recommendedRead3)
			self.recommendedRead3.setText(recommended3)
			
			header = '[COLOR %s]Buffer Mode[/COLOR]' % (COLOR2)
			self.Header4=xbmcgui.ControlLabel(rightside+BorderWidth, secondrow+5, (W/2)-(BorderWidth*2), 20, header, font='font13', textColor=TxtColor, alignment=0x00000002)
			self.addControl(self.Header4)
			msg4 = "[COLOR %s]This setting will force Kodi to use a cache for all video files, including local network, internet, and even the local hard drive. Default value is 0 and will only cache videos that use internet file paths/sources.[/COLOR]" % COLOR2
			self.Support4=xbmcgui.ControlTextBox(rightside+int(BorderWidth*3.5), secondrow+30+BorderWidth, (W/2)-(BorderWidth*4), 110, font='font12', textColor=TxtColor)
			self.addControl(self.Support4)
			self.Support4.setText(msg4)
			B1 = secondrow+130+BorderWidth; B2 = B1+30; B3 = B2+30; B4 = B3+30;
			self.Button0 = xbmcgui.ControlRadioButton(rightside+(BorderWidth*3), B1, (W/2)-(BorderWidth*4), 30, '0: Buffer all internet filesystems', font='font12', focusTexture=radiobgfocus, noFocusTexture=radiobgnofocus, focusOnTexture=radiofocus, noFocusOnTexture=radiofocus, focusOffTexture=radionofocus, noFocusOffTexture=radionofocus)
			self.Button1 = xbmcgui.ControlRadioButton(rightside+(BorderWidth*3), B2, (W/2)-(BorderWidth*4), 30, '1: Buffer all filesystems', font='font12', focusTexture=radiobgfocus, noFocusTexture=radiobgnofocus, focusOnTexture=radiofocus, noFocusOnTexture=radiofocus, focusOffTexture=radionofocus, noFocusOffTexture=radionofocus)
			self.Button2 = xbmcgui.ControlRadioButton(rightside+(BorderWidth*3), B3, (W/2)-(BorderWidth*4), 30, '2: Only buffer true internet filesystems', font='font12', focusTexture=radiobgfocus, noFocusTexture=radiobgnofocus, focusOnTexture=radiofocus, noFocusOnTexture=radiofocus, focusOffTexture=radionofocus, noFocusOffTexture=radionofocus)
			self.Button3 = xbmcgui.ControlRadioButton(rightside+(BorderWidth*3), B4, (W/2)-(BorderWidth*4), 30, '3: No Buffer', font='font12', focusTexture=radiobgfocus, noFocusTexture=radiobgnofocus, focusOnTexture=radiofocus, noFocusOnTexture=radiofocus, focusOffTexture=radionofocus, noFocusOffTexture=radionofocus)
			self.addControl(self.Button0)
			self.addControl(self.Button1)
			self.addControl(self.Button2)
			self.addControl(self.Button3)
			self.Button0.setSelected(False)
			self.Button1.setSelected(False)
			self.Button2.setSelected(True)
			self.Button3.setSelected(False)
			
			self.buttonWrite=xbmcgui.ControlButton(leftside,T+H-40-BorderWidth,(W/2)-(BorderWidth*2),35,"Write File",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=buttonfocus,noFocusTexture=buttonnofocus)
			self.buttonCancel=xbmcgui.ControlButton(rightside+BorderWidth*2,T+H-40-BorderWidth,(W/2)-(BorderWidth*2),35,"Cancel",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=buttonfocus,noFocusTexture=buttonnofocus)
			self.addControl(self.buttonWrite); self.addControl(self.buttonCancel)
			
			self.buttonWrite.controlLeft(self.buttonCancel); self.buttonWrite.controlRight(self.buttonCancel); self.buttonWrite.controlUp(self.Button3); self.buttonWrite.controlDown(self.videoCacheSize)
			self.buttonCancel.controlLeft(self.buttonWrite); self.buttonCancel.controlRight(self.buttonWrite); self.buttonCancel.controlUp(self.Button3); self.buttonCancel.controlDown(self.videoCacheSize)
			self.videoCacheSize.controlUp(self.buttonWrite); self.videoCacheSize.controlDown(self.CURLTimeout)
			self.CURLTimeout.controlUp(self.videoCacheSize); self.CURLTimeout.controlDown(self.readBufferFactor)
			self.readBufferFactor.controlUp(self.CURLTimeout); self.readBufferFactor.controlDown(self.Button0)
			self.Button0.controlUp(self.CURLTimeout); self.Button0.controlDown(self.Button1); self.Button0.controlLeft(self.readBufferFactor); self.Button0.controlRight(self.readBufferFactor);
			self.Button1.controlUp(self.Button0); self.Button1.controlDown(self.Button2); self.Button1.controlLeft(self.readBufferFactor); self.Button1.controlRight(self.readBufferFactor);
			self.Button2.controlUp(self.Button1); self.Button2.controlDown(self.Button3); self.Button2.controlLeft(self.readBufferFactor); self.Button2.controlRight(self.readBufferFactor);
			self.Button3.controlUp(self.Button2); self.Button3.controlDown(self.buttonWrite); self.Button3.controlLeft(self.readBufferFactor); self.Button3.controlRight(self.readBufferFactor);
			self.setFocus(self.videoCacheSize)
Esempio n. 20
0
		def __init__(self,msg='',L=0,T=0,W=1280,H=720,TxtColor='0xFFFFFFFF',Font='font12',BorderWidth=10):
			buttonfocus, buttonnofocus = artwork('button')
			radiobgfocus, radiobgnofocus, radiofocus, radionofocus = artwork('radio')
			slidernibfocus, slidernibnofocus, sliderfocus, slidernofocus = artwork('slider')
			image_path = os.path.join(ART, 'ContentPanel.png')
			boxbg = os.path.join(ART, 'bgg2.png')
			self.border = xbmcgui.ControlImage(L,T,W,H, image_path)
			self.addControl(self.border); 
			self.BG=xbmcgui.ControlImage(L+BorderWidth,T+BorderWidth,W-(BorderWidth*2),H-(BorderWidth*2), FANART, aspectRatio=0, colorDiffuse='0x5FFFFFFF')
			self.addControl(self.BG)
			top = T+BorderWidth
			leftside = L+BorderWidth
			rightside = L+(W/2)-(BorderWidth*2)
			firstrow = top+30
			secondrow = firstrow+275+(BorderWidth/2)
			currentwidth = ((W/2)-(BorderWidth*4))/2
			
			header = '[COLOR %s]Configurador de Advanced Settings[/COLOR]' % (COLOR2)
			self.Header=xbmcgui.ControlLabel(L, top, W, 30, header, font='font13', textColor=TxtColor, alignment=0x00000002)
			self.addControl(self.Header)
			top += 30+BorderWidth
			self.bgarea = xbmcgui.ControlImage(leftside, firstrow, rightside-L, 275, boxbg, aspectRatio=0, colorDiffuse='0x5FFFFFFF')
			self.addControl(self.bgarea)
			self.bgarea2 = xbmcgui.ControlImage(rightside+BorderWidth+BorderWidth, firstrow, rightside-L, 275, boxbg, aspectRatio=0, colorDiffuse='0x5FFFFFFF')
			self.addControl(self.bgarea2)
			self.bgarea3 = xbmcgui.ControlImage(leftside, secondrow, rightside-L, 275, boxbg, aspectRatio=0, colorDiffuse='0x5FFFFFFF')
			self.addControl(self.bgarea3)
			self.bgarea4 = xbmcgui.ControlImage(rightside+BorderWidth+BorderWidth, secondrow, rightside-L, 275, boxbg, aspectRatio=0, colorDiffuse='0x5FFFFFFF')
			self.addControl(self.bgarea4)
			
			header = '[COLOR %s]Tamano de Video Cache[/COLOR]' % (COLOR2)
			self.Header2=xbmcgui.ControlLabel(leftside+BorderWidth, firstrow+5, (W/2)-(BorderWidth*2), 20, header, font='font13', textColor=TxtColor, alignment=0x00000002)
			self.addControl(self.Header2)
			freeMemory = int(float(wiz.getInfo('System.Memory(free)')[:-2])*.33)
			recMemory = int(float(wiz.getInfo('System.Memory(free)')[:-2])*.23)
			msg3 = "[COLOR %s]Numero de bytes usados en el buffer.  Cuando esta puesto a [COLOR %s]0[/COLOR] la cache usa todo el disco en lugar de la RAM.  Nota: Normalmente Kodi requiere 1/3 veces la cantidad de RAM del equipo como cache. Poner este valor demasiado alto puede causar un crasheo de Kodi (1/3 de Memoria RAM libre: [COLOR %s]%s[/COLOR])[/COLOR]" % (COLOR2, COLOR1, COLOR1, freeMemory)
			self.Support3=xbmcgui.ControlTextBox(leftside+int(BorderWidth*1.5), firstrow+30+BorderWidth, (W/2)-(BorderWidth*4), 150, font='font12', textColor=TxtColor)
			self.addControl(self.Support3)
			self.Support3.setText(msg3)
			try: self.videoCacheSize=xbmcgui.ControlSlider(leftside+int(BorderWidth*1.5), firstrow+210,(W/2)-(BorderWidth*5),20, textureback=sliderfocus, texture=slidernibnofocus, texturefocus=slidernibfocus, orientation=xbmcgui.HORIZONTAL)
			except: self.videoCacheSize=xbmcgui.ControlSlider(leftside+int(BorderWidth*1.5), firstrow+210,(W/2)-(BorderWidth*5),20, textureback=sliderfocus, texture=slidernibnofocus, texturefocus=slidernibfocus)
			self.addControl(self.videoCacheSize)
			self.videomin = 0; self.videomax = freeMemory if freeMemory < 2000 else 2000
			self.recommendedVideo = recMemory if recMemory < 500 else 500; self.currentVideo = self.recommendedVideo
			videopos = wiz.percentage(self.currentVideo, self.videomax)
			self.videoCacheSize.setPercent(videopos)
			current1 = '[COLOR %s]Actual:[/COLOR] [COLOR %s]%s MB[/COLOR]' % (COLOR1, COLOR2, self.currentVideo)
			recommended1 = '[COLOR %s]Recomendado:[/COLOR] [COLOR %s]%s MB[/COLOR]' % (COLOR1, COLOR2, self.recommendedVideo)
			self.currentVideo1=xbmcgui.ControlTextBox(leftside+BorderWidth,firstrow+235,currentwidth,20,font=Font,textColor=TxtColor)
			self.addControl(self.currentVideo1)
			self.currentVideo1.setText(current1)
			self.recommendedVideo1=xbmcgui.ControlTextBox(leftside+BorderWidth+currentwidth,firstrow+235,currentwidth,20,font=Font,textColor=TxtColor)
			self.addControl(self.recommendedVideo1)
			self.recommendedVideo1.setText(recommended1)
			
			header = '[COLOR %s]CURL Timeout/CURL Velocidad baja[/COLOR]' % (COLOR2)
			self.Header3=xbmcgui.ControlLabel(rightside+BorderWidth, firstrow+5, (W/2)-(BorderWidth*2), 20, header, font='font13', textColor=TxtColor, alignment=0x00000002)
			self.addControl(self.Header3)
			msg3 = "[COLOR %s][B]curlclienttimeout[/B] tiempo en segundos que  libcurl tarda en dar un timeout, [B]curllowspeedtime[/B] es el tiempo que considera para dar conexion baja.  Valor recomendado en equipos poco potentes: 20.[/COLOR]" % COLOR2
			self.Support3=xbmcgui.ControlTextBox(rightside+int(BorderWidth*3.5), firstrow+30+BorderWidth, (W/2)-(BorderWidth*4), 150, font='font12', textColor=TxtColor)
			self.addControl(self.Support3)
			self.Support3.setText(msg3)
			try: self.CURLTimeout=xbmcgui.ControlSlider(rightside+int(BorderWidth*3.5),firstrow+210,(W/2)-(BorderWidth*5),20, textureback=sliderfocus, texture=slidernibnofocus, texturefocus=slidernibfocus, orientation=xbmcgui.HORIZONTAL)
			except: self.CURLTimeout=xbmcgui.ControlSlider(rightside+int(BorderWidth*3.5),firstrow+210,(W/2)-(BorderWidth*5),20, textureback=sliderfocus, texture=slidernibnofocus, texturefocus=slidernibfocus)
			self.addControl(self.CURLTimeout)
			self.curlmin = 0; self.curlmax = 20
			self.recommendedCurl = 10; self.currentCurl = self.recommendedCurl
			curlpos = wiz.percentage(self.currentCurl, self.curlmax)
			self.CURLTimeout.setPercent(curlpos)
			current2 = '[COLOR %s]Actual:[/COLOR] [COLOR %s]%ss[/COLOR]' % (COLOR1, COLOR2, self.currentCurl)
			recommended2 = '[COLOR %s]Recommendado:[/COLOR] [COLOR %s]%ss[/COLOR]' % (COLOR1, COLOR2, self.recommendedCurl)
			self.currentCurl2=xbmcgui.ControlTextBox(rightside+(BorderWidth*3),firstrow+235,currentwidth,20,font=Font,textColor=TxtColor)
			self.addControl(self.currentCurl2)
			self.currentCurl2.setText(current2)
			self.recommendedCurl2=xbmcgui.ControlTextBox(rightside+(BorderWidth*3)+currentwidth,firstrow+235,currentwidth,20,font=Font,textColor=TxtColor)
			self.addControl(self.recommendedCurl2)
			self.recommendedCurl2.setText(recommended2)
			
			header = '[COLOR %s]Read Buffer Factor[/COLOR]' % (COLOR2)
			self.Header4=xbmcgui.ControlLabel(leftside, secondrow+5, (W/2)-(BorderWidth*2), 20, header, font='font13', textColor=TxtColor, alignment=0x00000002)
			self.addControl(self.Header4)
			msg3 = "[COLOR %s]Es un valor que multiplica el de serie. Si Kodi esta cargando un archivo de 36 Mbit/s, entonces un valor de 2 hara necesario al menos 72 Mbit/s de banda ancha.[/COLOR]" % COLOR2
			self.Support3=xbmcgui.ControlTextBox(leftside+int(BorderWidth*1.5), secondrow+30+BorderWidth, (W/2)-(BorderWidth*4), 150, font='font12', textColor=TxtColor)
			self.addControl(self.Support3)
			self.Support3.setText(msg3)
			try: self.readBufferFactor=xbmcgui.ControlSlider(leftside+int(BorderWidth*1.5), secondrow+210,(W/2)-(BorderWidth*5),20, textureback=sliderfocus, texture=slidernibnofocus, texturefocus=slidernibfocus, orientation=xbmcgui.HORIZONTAL)
			except: self.readBufferFactor=xbmcgui.ControlSlider(leftside+int(BorderWidth*1.5), secondrow+210,(W/2)-(BorderWidth*5),20, textureback=sliderfocus, texture=slidernibnofocus, texturefocus=slidernibfocus)
			self.addControl(self.readBufferFactor)
			self.readmin = 0; self.readmax = 10
			self.recommendedRead = 5; self.currentRead = self.recommendedRead
			readpos = wiz.percentage(self.currentRead, self.readmax)
			self.readBufferFactor.setPercent(readpos)
			current3 = '[COLOR %s]Actual:[/COLOR] [COLOR %s]%s[/COLOR]' % (COLOR1, COLOR2, self.currentRead)
			recommended3 = '[COLOR %s]Recommendado:[/COLOR] [COLOR %s]%s[/COLOR]' % (COLOR1, COLOR2, self.recommendedRead)
			self.currentRead3=xbmcgui.ControlTextBox(leftside+BorderWidth,secondrow+235,currentwidth,20,font=Font,textColor=TxtColor)
			self.addControl(self.currentRead3)
			self.currentRead3.setText(current3)
			self.recommendedRead3=xbmcgui.ControlTextBox(leftside+BorderWidth+currentwidth,secondrow+235,currentwidth,20,font=Font,textColor=TxtColor)
			self.addControl(self.recommendedRead3)
			self.recommendedRead3.setText(recommended3)
			
			header = '[COLOR %s]Buffer Mode[/COLOR]' % (COLOR2)
			self.Header4=xbmcgui.ControlLabel(rightside+BorderWidth, secondrow+5, (W/2)-(BorderWidth*2), 20, header, font='font13', textColor=TxtColor, alignment=0x00000002)
			self.addControl(self.Header4)
			msg4 = "[COLOR %s]Este valor obliga a Kodi usar la cache para todos los videos, locales y online. Un valor de 0 hara que Kodi solo use la cache para los archivos online, no los locales[/COLOR]" % COLOR2
			self.Support4=xbmcgui.ControlTextBox(rightside+int(BorderWidth*3.5), secondrow+30+BorderWidth, (W/2)-(BorderWidth*4), 110, font='font12', textColor=TxtColor)
			self.addControl(self.Support4)
			self.Support4.setText(msg4)
			B1 = secondrow+130+BorderWidth; B2 = B1+30; B3 = B2+30; B4 = B3+30;
			self.Button0 = xbmcgui.ControlRadioButton(rightside+(BorderWidth*3), B1, (W/2)-(BorderWidth*4), 30, '0: Buffer todos los archivos de internet', font='font12', focusTexture=radiobgfocus, noFocusTexture=radiobgnofocus, focusOnTexture=radiofocus, noFocusOnTexture=radiofocus, focusOffTexture=radionofocus, noFocusOffTexture=radionofocus)
			self.Button1 = xbmcgui.ControlRadioButton(rightside+(BorderWidth*3), B2, (W/2)-(BorderWidth*4), 30, '1: Buffer todos los archivos', font='font12', focusTexture=radiobgfocus, noFocusTexture=radiobgnofocus, focusOnTexture=radiofocus, noFocusOnTexture=radiofocus, focusOffTexture=radionofocus, noFocusOffTexture=radionofocus)
			self.Button2 = xbmcgui.ControlRadioButton(rightside+(BorderWidth*3), B3, (W/2)-(BorderWidth*4), 30, '2: Buffer solo para los archivos de internet reales', font='font12', focusTexture=radiobgfocus, noFocusTexture=radiobgnofocus, focusOnTexture=radiofocus, noFocusOnTexture=radiofocus, focusOffTexture=radionofocus, noFocusOffTexture=radionofocus)
			self.Button3 = xbmcgui.ControlRadioButton(rightside+(BorderWidth*3), B4, (W/2)-(BorderWidth*4), 30, '3: Sin Buffer', font='font12', focusTexture=radiobgfocus, noFocusTexture=radiobgnofocus, focusOnTexture=radiofocus, noFocusOnTexture=radiofocus, focusOffTexture=radionofocus, noFocusOffTexture=radionofocus)
			self.addControl(self.Button0)
			self.addControl(self.Button1)
			self.addControl(self.Button2)
			self.addControl(self.Button3)
			self.Button0.setSelected(False)
			self.Button1.setSelected(False)
			self.Button2.setSelected(True)
			self.Button3.setSelected(False)
			
			self.buttonWrite=xbmcgui.ControlButton(leftside,T+H-40-BorderWidth,(W/2)-(BorderWidth*2),35,"Escritura de archivo",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=buttonfocus,noFocusTexture=buttonnofocus)
			self.buttonCancel=xbmcgui.ControlButton(rightside+BorderWidth*2,T+H-40-BorderWidth,(W/2)-(BorderWidth*2),35,"Cancelar",textColor="0xFF000000",focusedColor="0xFF000000",alignment=2,focusTexture=buttonfocus,noFocusTexture=buttonnofocus)
			self.addControl(self.buttonWrite); self.addControl(self.buttonCancel)
			
			self.buttonWrite.controlLeft(self.buttonCancel); self.buttonWrite.controlRight(self.buttonCancel); self.buttonWrite.controlUp(self.Button3); self.buttonWrite.controlDown(self.videoCacheSize)
			self.buttonCancel.controlLeft(self.buttonWrite); self.buttonCancel.controlRight(self.buttonWrite); self.buttonCancel.controlUp(self.Button3); self.buttonCancel.controlDown(self.videoCacheSize)
			self.videoCacheSize.controlUp(self.buttonWrite); self.videoCacheSize.controlDown(self.CURLTimeout)
			self.CURLTimeout.controlUp(self.videoCacheSize); self.CURLTimeout.controlDown(self.readBufferFactor)
			self.readBufferFactor.controlUp(self.CURLTimeout); self.readBufferFactor.controlDown(self.Button0)
			self.Button0.controlUp(self.CURLTimeout); self.Button0.controlDown(self.Button1); self.Button0.controlLeft(self.readBufferFactor); self.Button0.controlRight(self.readBufferFactor);
			self.Button1.controlUp(self.Button0); self.Button1.controlDown(self.Button2); self.Button1.controlLeft(self.readBufferFactor); self.Button1.controlRight(self.readBufferFactor);
			self.Button2.controlUp(self.Button1); self.Button2.controlDown(self.Button3); self.Button2.controlLeft(self.readBufferFactor); self.Button2.controlRight(self.readBufferFactor);
			self.Button3.controlUp(self.Button2); self.Button3.controlDown(self.buttonWrite); self.Button3.controlLeft(self.readBufferFactor); self.Button3.controlRight(self.readBufferFactor);
			self.setFocus(self.videoCacheSize)
Esempio n. 21
0
def load_skin(window):
    #background image

    window.bg = xbmcgui.ControlImage(0,0,720,576, imageDir + "background.png")
    window.addControl(window.bg)

    window.bg1 = xbmcgui.ControlImage(0,0,720,576, imageDir + "background.png")
    window.addControl(window.bg1)
    
    #Navi-X logo at top-right position
    window.logo = xbmcgui.ControlImage(610,20,80,80, imageDir + "logo.png")
    window.addControl(window.logo)

    #user logo below the buttons
    window.user_logo = xbmcgui.ControlImage(32,120,210,172, imageDir + "logo.png")
    window.addControl(window.user_logo)
    window.user_logo.setVisible(0)
            
    #user thumb below the buttons (overlaps with the user logo)
    window.user_thumb = xbmcgui.ControlImage(32,120,210,172, imageDir + "logo.png")
    window.addControl(window.user_thumb)
    window.user_thumb.setVisible(0)
    
    #URL label at top-center position
    window.urllbl = xbmcgui.ControlLabel(40,80,350,40, "", "font14")
    window.addControl(window.urllbl)

    #Navi-X Version label at top-left position
    window.version = xbmcgui.ControlLabel(40,20,155,40, 'version: '+ Version+ '.' + SubVersion, "font14")
    window.addControl(window.version)      
    
    #"Loading..." text at down-left side
    window.infotekst = xbmcgui.ControlLabel(80,500,250,30, "Loading...")
    window.addControl(window.infotekst)
    window.infotekst.setVisible(0)

    #"Please wait..." text displayed on top of the main list
    window.loading = xbmcgui.ControlLabel(280, 130, 250, 30, "Please wait...")
    window.addControl(window.loading)
    window.loading.setVisible(0)
    
    #main list displaying playlist entries
    window.list = xbmcgui.ControlList(260,120,450,440,'font14','0xFFDDDDDD', buttonFocusTexture=RootDir+'images\\list-focus.png', imageWidth=32, imageHeight=32, itemHeight=38)
    window.addControl(window.list)
    window.list.setPageControlVisible(False)

    #list cursor position label displayed at the bottom right of the screen
    window.listpos = xbmcgui.ControlLabel(640,540,250,30, "")
    window.addControl(window.listpos)
    
    #buttons creation
    x=50
    y=303
    window.button_home = xbmcgui.ControlButton(x,y,120,32,'      Home', RootDir + "images\\button-focus1.png", RootDir + "images\\button-nofocus1.png")
    window.addControl(window.button_home)
    window.button_favorites = xbmcgui.ControlButton(x,y+32,120,32,'      Favorites', RootDir + "images\\button-focus1.png", RootDir + "images\\button-nofocus1.png")            
    window.addControl(window.button_favorites)            
    window.button_downloads = xbmcgui.ControlButton(x,y+64,120,32,'      Downloads', RootDir + "images\\button-focus1.png", RootDir + "images\\button-nofocus1.png")            
    window.addControl(window.button_downloads)            
    window.button_url = xbmcgui.ControlButton(x,y+96,120,32,'      Browse', RootDir + "images\\button-focus1.png", RootDir + "images\\button-nofocus1.png")
    window.addControl(window.button_url)
    window.button_about = xbmcgui.ControlButton(x,y+128,120,32,'      About', RootDir + "images\\button-focus1.png", RootDir + "images\\button-nofocus1.png")
    window.addControl(window.button_about)

    #button behaviour
    window.button_home.controlDown(window.button_favorites)
    window.button_favorites.controlDown(window.button_downloads)
    window.button_downloads.controlDown(window.button_url)
    window.button_url.controlDown(window.button_about)
    window.button_about.controlUp(window.button_url)
    window.button_url.controlUp(window.button_downloads)
    window.button_downloads.controlUp(window.button_favorites)
    window.button_favorites.controlUp(window.button_home)

    window.button_home.controlRight(window.list)
    window.button_favorites.controlRight(window.list)
    window.button_downloads.controlRight(window.list)
    window.button_url.controlRight(window.list)
    window.button_about.controlRight(window.list)
    window.list.controlLeft(window.button_home)
Esempio n. 22
0
    def __init__(self, *args, **kwargs):

        self.cptloc = kwargs.get('captcha')
        self.img = xbmcgui.ControlImage(335, 200, 624, 400, "")
        xbmc.sleep(500)
        self.img = xbmcgui.ControlImage(335, 200, 624, 400, self.cptloc)
        xbmc.sleep(500)

        bg_image = os.path.join(__addon__.getAddonInfo('path'),
                                'resources/art/') + "background.png"
        check_image = os.path.join(__addon__.getAddonInfo('path'),
                                   'resources/art/') + "trans_checked.png"
        uncheck_image = os.path.join(__addon__.getAddonInfo('path'),
                                     'resources/art/') + "trans_unchecked1.png"

        self.ctrlBackgound = xbmcgui.ControlImage(0, 0, 1280, 720, bg_image)
        self.cancelled = False
        self.addControl(self.ctrlBackgound)
        self.msg = kwargs.get(
            'msg'
        ) + '\nNormally there are 3-4 selections and 2 rounds of pictures'
        self.roundnum = kwargs.get('roundnum')
        self.strActionInfo = xbmcgui.ControlLabel(335, 120, 700, 300, self.msg,
                                                  'font13', '0xFFFF00FF')
        self.addControl(self.strActionInfo)

        self.strActionInfo = xbmcgui.ControlLabel(
            335, 20, 724, 400, 'Captcha round %s' % (str(self.roundnum)),
            'font40', '0xFFFF00FF')
        self.addControl(self.strActionInfo)

        self.addControl(self.img)

        self.chk = [0] * 9
        self.chkbutton = [0] * 9
        self.chkstate = [False] * 9

        #self.chk[0] = xbmcgui.ControlCheckMark(335,200,200,200,'select',checkWidth=30, checkHeight=30)
        if 1 == 2:
            self.chk[0] = xbmcgui.ControlCheckMark(
                335,
                190,
                220,
                150,
                '1',
                font='font14',
                focusTexture=check_image,
                noFocusTexture=uncheck_image,
                checkWidth=220,
                checkHeight=150)
            self.chk[1] = xbmcgui.ControlCheckMark(
                335 + 200,
                190,
                220,
                150,
                '2',
                font='font14',
                focusTexture=check_image,
                noFocusTexture=uncheck_image,
                checkWidth=220,
                checkHeight=150)
            self.chk[2] = xbmcgui.ControlCheckMark(
                335 + 400,
                190,
                220,
                150,
                '3',
                font='font14',
                focusTexture=check_image,
                noFocusTexture=uncheck_image,
                checkWidth=220,
                checkHeight=150)

            self.chk[3] = xbmcgui.ControlCheckMark(
                335,
                190 + 130,
                220,
                150,
                '4',
                font='font14',
                focusTexture=check_image,
                noFocusTexture=uncheck_image,
                checkWidth=220,
                checkHeight=150)
            self.chk[4] = xbmcgui.ControlCheckMark(
                335 + 200,
                190 + 130,
                220,
                150,
                '5',
                font='font14',
                focusTexture=check_image,
                noFocusTexture=uncheck_image,
                checkWidth=220,
                checkHeight=150)
            self.chk[5] = xbmcgui.ControlCheckMark(
                335 + 400,
                190 + 130,
                220,
                150,
                '6',
                font='font14',
                focusTexture=check_image,
                noFocusTexture=uncheck_image,
                checkWidth=220,
                checkHeight=150)

            self.chk[6] = xbmcgui.ControlCheckMark(
                335,
                190 + 260,
                220,
                150,
                '7',
                font='font14',
                focusTexture=check_image,
                noFocusTexture=uncheck_image,
                checkWidth=220,
                checkHeight=150)
            self.chk[7] = xbmcgui.ControlCheckMark(
                335 + 200,
                190 + 260,
                220,
                150,
                '8',
                font='font14',
                focusTexture=check_image,
                noFocusTexture=uncheck_image,
                checkWidth=220,
                checkHeight=150)
            self.chk[8] = xbmcgui.ControlCheckMark(
                335 + 400,
                190 + 260,
                220,
                150,
                '9',
                font='font14',
                focusTexture=check_image,
                noFocusTexture=uncheck_image,
                checkWidth=220,
                checkHeight=150)
        else:

            self.chk[0] = xbmcgui.ControlImage(
                335, 190, 220, 150, check_image
            )  # '', font='font1',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
            self.chk[1] = xbmcgui.ControlImage(
                335 + 200, 190, 220, 150, check_image
            )  # '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
            self.chk[2] = xbmcgui.ControlImage(
                335 + 400, 190, 220, 150, check_image
            )  # '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)

            self.chk[3] = xbmcgui.ControlImage(
                335, 190 + 130, 220, 150, check_image
            )  # '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
            self.chk[4] = xbmcgui.ControlImage(
                335 + 200, 190 + 130, 220, 150, check_image
            )  # '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
            self.chk[5] = xbmcgui.ControlImage(
                335 + 400, 190 + 130, 220, 150, check_image
            )  # '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)

            self.chk[6] = xbmcgui.ControlImage(
                335, 190 + 260, 220, 150, check_image
            )  #, '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
            self.chk[7] = xbmcgui.ControlImage(
                335 + 200, 190 + 260, 220, 150, check_image
            )  # '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
            self.chk[8] = xbmcgui.ControlImage(
                335 + 400, 190 + 260, 220, 150, check_image
            )  # '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)

            self.chkbutton[0] = xbmcgui.ControlButton(335,
                                                      190,
                                                      210,
                                                      150,
                                                      '1',
                                                      font='font1')
            #,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
            self.chkbutton[1] = xbmcgui.ControlButton(335 + 200,
                                                      190,
                                                      220,
                                                      150,
                                                      '2',
                                                      font='font1')
            #,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
            self.chkbutton[2] = xbmcgui.ControlButton(335 + 400,
                                                      190,
                                                      220,
                                                      150,
                                                      '3',
                                                      font='font1')
            #,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)

            self.chkbutton[3] = xbmcgui.ControlButton(335,
                                                      190 + 130,
                                                      210,
                                                      150,
                                                      '4',
                                                      font='font1')
            #,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
            self.chkbutton[4] = xbmcgui.ControlButton(335 + 200,
                                                      190 + 130,
                                                      220,
                                                      150,
                                                      '5',
                                                      font='font1')
            #,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
            self.chkbutton[5] = xbmcgui.ControlButton(335 + 400,
                                                      190 + 130,
                                                      220,
                                                      150,
                                                      '6',
                                                      font='font1')
            #,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)

            self.chkbutton[6] = xbmcgui.ControlButton(335,
                                                      190 + 260,
                                                      210,
                                                      150,
                                                      '7',
                                                      font='font1')
            #,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
            self.chkbutton[7] = xbmcgui.ControlButton(335 + 200,
                                                      190 + 260,
                                                      220,
                                                      150,
                                                      '8',
                                                      font='font1')
            #,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
            self.chkbutton[8] = xbmcgui.ControlButton(335 + 400,
                                                      190 + 260,
                                                      220,
                                                      150,
                                                      '9',
                                                      font='font1')
            #,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)

        for obj in self.chk:
            self.addControl(obj)
            obj.setVisible(False)
        for obj in self.chkbutton:
            self.addControl(obj)

        #self.chk[0].setSelected(False)

        self.cancelbutton = xbmcgui.ControlButton(335 + 312 - 100,
                                                  610,
                                                  100,
                                                  40,
                                                  'Cancel',
                                                  alignment=2)
        self.okbutton = xbmcgui.ControlButton(335 + 312 + 50,
                                              610,
                                              100,
                                              40,
                                              'OK',
                                              alignment=2)
        self.addControl(self.okbutton)
        self.addControl(self.cancelbutton)

        self.chkbutton[6].controlDown(self.cancelbutton)
        self.chkbutton[6].controlUp(self.chkbutton[3])
        self.chkbutton[7].controlDown(self.cancelbutton)
        self.chkbutton[7].controlUp(self.chkbutton[4])
        self.chkbutton[8].controlDown(self.okbutton)
        self.chkbutton[8].controlUp(self.chkbutton[5])

        self.chkbutton[6].controlLeft(self.chkbutton[8])
        self.chkbutton[6].controlRight(self.chkbutton[7])
        self.chkbutton[7].controlLeft(self.chkbutton[6])
        self.chkbutton[7].controlRight(self.chkbutton[8])
        self.chkbutton[8].controlLeft(self.chkbutton[7])
        self.chkbutton[8].controlRight(self.chkbutton[6])

        self.chkbutton[3].controlDown(self.chkbutton[6])
        self.chkbutton[3].controlUp(self.chkbutton[0])
        self.chkbutton[4].controlDown(self.chkbutton[7])
        self.chkbutton[4].controlUp(self.chkbutton[1])
        self.chkbutton[5].controlDown(self.chkbutton[8])
        self.chkbutton[5].controlUp(self.chkbutton[2])

        self.chkbutton[3].controlLeft(self.chkbutton[5])
        self.chkbutton[3].controlRight(self.chkbutton[4])
        self.chkbutton[4].controlLeft(self.chkbutton[3])
        self.chkbutton[4].controlRight(self.chkbutton[5])
        self.chkbutton[5].controlLeft(self.chkbutton[4])
        self.chkbutton[5].controlRight(self.chkbutton[3])

        self.chkbutton[0].controlDown(self.chkbutton[3])
        self.chkbutton[0].controlUp(self.cancelbutton)
        self.chkbutton[1].controlDown(self.chkbutton[4])
        self.chkbutton[1].controlUp(self.cancelbutton)
        self.chkbutton[2].controlDown(self.chkbutton[5])
        self.chkbutton[2].controlUp(self.okbutton)

        self.chkbutton[0].controlLeft(self.chkbutton[2])
        self.chkbutton[0].controlRight(self.chkbutton[1])
        self.chkbutton[1].controlLeft(self.chkbutton[0])
        self.chkbutton[1].controlRight(self.chkbutton[2])
        self.chkbutton[2].controlLeft(self.chkbutton[1])
        self.chkbutton[2].controlRight(self.chkbutton[0])

        self.cancelled = False
        self.setFocus(self.okbutton)
        self.okbutton.controlLeft(self.cancelbutton)
        self.okbutton.controlRight(self.cancelbutton)
        self.cancelbutton.controlLeft(self.okbutton)
        self.cancelbutton.controlRight(self.okbutton)
        self.okbutton.controlDown(self.chkbutton[2])
        self.okbutton.controlUp(self.chkbutton[8])
        self.cancelbutton.controlDown(self.chkbutton[0])
        self.cancelbutton.controlUp(self.chkbutton[6])
Esempio n. 23
0
 def __init__(self):
     self.btnStartL = 5
     self.btnStartT = 5
     self.itemStart = 60
     itemH = self.itemStart
     self.itemW = 1040
     self.Results = []
     self.htmlS = ''
     ## \/ Can change background color by adjusting self.BG's colorDiffuse.
     self.BG = xbmcgui.ControlImage(0,
                                    0,
                                    MAX_WIDTH,
                                    MAX_HEIGHT,
                                    imgPercentBar,
                                    aspectRatio=0,
                                    colorDiffuse='0xFF101010')
     self.addControl(self.BG)
     ## Top Labels
     self.labAddress = xbmcgui.ControlLabel(10,
                                            5,
                                            MAX_WIDTH - 20,
                                            30,
                                            '',
                                            'font13',
                                            textColor='0xFF008000',
                                            alignment=XBFONT_RIGHT)
     self.addControl(self.labAddress)
     self.labAddress.setLabel(STATUS_ADDRESS)
     self.labStatus = xbmcgui.ControlLabel(100,
                                           25,
                                           self.itemW,
                                           30,
                                           '',
                                           'font13',
                                           textColor='0xFFFF0000',
                                           alignment=XBFONT_CENTER_X)
     self.addControl(self.labStatus)
     ## Buttons
     self.BtnExit = xbmcgui.ControlButton(self.btnStartL,
                                          self.btnStartT,
                                          50,
                                          25,
                                          "Exit",
                                          font='font10',
                                          textColor="0xFFB22222",
                                          focusedColor="0xFF008000",
                                          alignment=XBFONT_CENTER_X,
                                          focusTexture=imgPercentBar,
                                          noFocusTexture=imgPercentBar)
     self.addControl(self.BtnExit)
     self.BtnRefresh = xbmcgui.ControlButton(self.BtnExit.getX() +
                                             self.BtnExit.getWidth() + 5,
                                             self.btnStartT,
                                             75,
                                             25,
                                             "Refresh",
                                             font='font10',
                                             textColor="0xFFB22222",
                                             focusedColor="0xFF008000",
                                             alignment=XBFONT_CENTER_X,
                                             focusTexture=imgPercentBar,
                                             noFocusTexture=imgPercentBar)
     self.addControl(self.BtnRefresh)
     self.BtnBrowse = xbmcgui.ControlButton(self.BtnRefresh.getX() +
                                            self.BtnRefresh.getWidth() + 5,
                                            self.btnStartT,
                                            75,
                                            25,
                                            "Browser",
                                            font='font10',
                                            textColor="0xFFB22222",
                                            focusedColor="0xFF008000",
                                            alignment=XBFONT_CENTER_X,
                                            focusTexture=imgPercentBar,
                                            noFocusTexture=imgPercentBar)
     self.addControl(self.BtnBrowse)
     self.setFocus(self.BtnExit)
     ## Movement setup.
     self.BtnExit.controlLeft(self.BtnBrowse)
     self.BtnExit.controlRight(self.BtnRefresh)
     self.BtnRefresh.controlLeft(self.BtnExit)
     self.BtnRefresh.controlRight(self.BtnBrowse)
     self.BtnBrowse.controlLeft(self.BtnRefresh)
     self.BtnBrowse.controlRight(self.BtnExit)
     ## WORKING THE PROCESS.
     self.updateHTML(
     )  #Updates the contents of self.html with the status page url.
     self.updateSTATUS()  #Updates the status message of the page url.
     self.setupFIELDS()  #Only used on initial setup, never when refreshing.
     self.hideFIELDS()  #Hides all fields.
     self.updateFIELDS()  #Updates fields, showing only the ones used.
Esempio n. 24
0
    def __init__(self, *args, **kwargs):
        bg_image = os.path.join(common.addon_path, 'resources', 'images',
                                'DialogBack2.png')
        check_image = os.path.join(common.addon_path, 'resources', 'images',
                                   'checked.png')
        button_fo = os.path.join(common.kodi.get_path(), 'resources', 'skins',
                                 'Default', 'media', 'button-fo.png')
        button_nofo = os.path.join(common.kodi.get_path(), 'resources',
                                   'skins', 'Default', 'media',
                                   'button-nofo.png')
        self.cancelled = False
        self.chk = [0] * 9
        self.chkbutton = [0] * 9
        self.chkstate = [False] * 9

        imgX, imgY, imgw, imgh = 436, 210, 408, 300
        ph, pw = imgh / 3, imgw / 3
        x_gap = 70
        y_gap = 70
        button_gap = 40
        button_h = 40
        button_y = imgY + imgh + button_gap
        middle = imgX + (imgw / 2)
        win_x = imgX - x_gap
        win_y = imgY - y_gap
        win_h = imgh + 2 * y_gap + button_h + button_gap
        win_w = imgw + 2 * x_gap

        ctrlBackgound = xbmcgui.ControlImage(win_x, win_y, win_w, win_h,
                                             bg_image)
        self.addControl(ctrlBackgound)
        self.msg = '[COLOR red]%s[/COLOR]' % (kwargs.get('msg'))
        self.strActionInfo = xbmcgui.ControlLabel(imgX, imgY - 30, imgw, 20,
                                                  self.msg, 'font13')
        self.addControl(self.strActionInfo)
        img = xbmcgui.ControlImage(imgX, imgY, imgw, imgh,
                                   kwargs.get('captcha'))
        self.addControl(img)
        self.iteration = kwargs.get('iteration')
        self.strActionInfo = xbmcgui.ControlLabel(
            imgX, imgY + imgh, imgw, 20,
            common.i18n('captcha_round') % (str(self.iteration)), 'font40')
        self.addControl(self.strActionInfo)
        self.cancelbutton = xbmcgui.ControlButton(middle - 110,
                                                  button_y,
                                                  100,
                                                  button_h,
                                                  common.i18n('cancel'),
                                                  focusTexture=button_fo,
                                                  noFocusTexture=button_nofo,
                                                  alignment=2)
        self.okbutton = xbmcgui.ControlButton(middle + 10,
                                              button_y,
                                              100,
                                              button_h,
                                              common.i18n('ok'),
                                              focusTexture=button_fo,
                                              noFocusTexture=button_nofo,
                                              alignment=2)
        self.addControl(self.okbutton)
        self.addControl(self.cancelbutton)

        for i in xrange(9):
            row = i / 3
            col = i % 3
            x_pos = imgX + (pw * col)
            y_pos = imgY + (ph * row)
            self.chk[i] = xbmcgui.ControlImage(x_pos, y_pos, pw, ph,
                                               check_image)
            self.addControl(self.chk[i])
            self.chk[i].setVisible(False)
            self.chkbutton[i] = xbmcgui.ControlButton(
                x_pos,
                y_pos,
                pw,
                ph,
                str(i + 1),
                font='font1',
                focusTexture=button_fo,
                noFocusTexture=button_nofo)
            self.addControl(self.chkbutton[i])

        for i in xrange(9):
            row_start = (i / 3) * 3
            right = row_start + (i + 1) % 3
            left = row_start + (i - 1) % 3
            up = (i - 3) % 9
            down = (i + 3) % 9
            self.chkbutton[i].controlRight(self.chkbutton[right])
            self.chkbutton[i].controlLeft(self.chkbutton[left])
            if i <= 2:
                self.chkbutton[i].controlUp(self.okbutton)
            else:
                self.chkbutton[i].controlUp(self.chkbutton[up])

            if i >= 6:
                self.chkbutton[i].controlDown(self.okbutton)
            else:
                self.chkbutton[i].controlDown(self.chkbutton[down])

        self.okbutton.controlLeft(self.cancelbutton)
        self.okbutton.controlRight(self.cancelbutton)
        self.cancelbutton.controlLeft(self.okbutton)
        self.cancelbutton.controlRight(self.okbutton)
        self.okbutton.controlDown(self.chkbutton[2])
        self.okbutton.controlUp(self.chkbutton[8])
        self.cancelbutton.controlDown(self.chkbutton[0])
        self.cancelbutton.controlUp(self.chkbutton[6])
        self.setFocus(self.okbutton)
Esempio n. 25
0
    def __init__(self, *args, **kwargs):
        
        bg_image =  os.path.join( __addon__.getAddonInfo('path'), 'Images/' ) + "background.png"
        check_image =  os.path.join( __addon__.getAddonInfo('path'), 'Images/' ) + "trans_checked.png"
        uncheck_image =  os.path.join( __addon__.getAddonInfo('path'), 'Images/' ) + "trans_unchecked1.png"
        self.ctrlBackgound = xbmcgui.ControlImage(
            0,0, 
            1280, 720, 
            bg_image
        )
        self.cancelled=False
        self.addControl (self.ctrlBackgound)
        self.msg = kwargs.get('msg')+'\nNormally there are 3-4 selections and 2 rounds of pictures'
        self.round=kwargs.get('round')
        self.strActionInfo = xbmcgui.ControlLabel(335, 120, 700, 300, self.msg, 'font13', '0xFFFF00FF')
        self.addControl(self.strActionInfo)
        
        self.strActionInfo = xbmcgui.ControlLabel(335, 20, 724, 400, 'Captcha round %s'%(str(self.round)), 'font40', '0xFFFF00FF')
        self.addControl(self.strActionInfo)
        
        self.cptloc = kwargs.get('captcha')
        #self.img = xbmcgui.ControlImage(335,200,624,400,self.cptloc)
        imgw=400
        imgh=300
        imgX=335
        imgY=200
        pw=imgw/3
        ph=imgh/3
        self.img = xbmcgui.ControlImage(imgX,imgY,imgw,imgh,self.cptloc)
        self.addControl(self.img)
        
        self.chk=[0]*9
        self.chkbutton=[0]*9
        self.chkstate=[False]*9
        
        #self.chk[0] = xbmcgui.ControlCheckMark(335,200,200,200,'select',checkWidth=30, checkHeight=30)
        
        self.chk[0]= xbmcgui.ControlImage(imgX,imgY, pw, ph,check_image)# '', font='font1',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
        self.chk[1]= xbmcgui.ControlImage(imgX+pw,imgY, pw, ph,check_image)# '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
        self.chk[2]= xbmcgui.ControlImage(imgX+pw+pw,imgY, pw, ph,check_image)# '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
        
        self.chk[3]= xbmcgui.ControlImage(imgX,imgY+ph, pw, ph,check_image)# '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
        self.chk[4]= xbmcgui.ControlImage(imgX+pw,imgY+ph, pw, ph,check_image)# '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
        self.chk[5]= xbmcgui.ControlImage(imgX+pw+pw,imgY+ph, pw, ph,check_image)# '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
      
        
        self.chk[6]= xbmcgui.ControlImage(imgX,imgY+ph+ph, pw, ph,check_image)#, '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
        self.chk[7]= xbmcgui.ControlImage(imgX+pw,imgY+ph+ph, pw, ph,check_image)# '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
        self.chk[8]= xbmcgui.ControlImage(imgX+pw+pw,imgY+ph+ph, pw, ph,check_image)# '', font='font14',focusTexture=check_image ,noFocusTexture=uncheck_image,checkWidth=220,checkHeight=150)
    
    
        self.chkbutton[0]= xbmcgui.ControlButton(imgX,imgY, pw, ph, '1', font='font1');#,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
        self.chkbutton[1]= xbmcgui.ControlButton(imgX+pw,imgY, pw, ph, '2', font='font1');#,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
        self.chkbutton[2]= xbmcgui.ControlButton(imgX+pw+pw,imgY, pw, ph, '3', font='font1');#,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
        
        self.chkbutton[3]= xbmcgui.ControlButton(imgX,imgY+ph, pw, ph, '4', font='font1');#,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
        self.chkbutton[4]= xbmcgui.ControlButton(imgX+pw,imgY+ph, pw, ph, '5', font='font1');#,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
        self.chkbutton[5]= xbmcgui.ControlButton(imgX+pw+pw,imgY+ph, pw, ph, '6', font='font1');#,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
      
        
        self.chkbutton[6]= xbmcgui.ControlButton(imgX,imgY+ph+ph, pw, ph, '7', font='font1');#,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
        self.chkbutton[7]= xbmcgui.ControlButton(imgX+pw,imgY+ph+ph, pw, ph, '8', font='font1');#,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
        self.chkbutton[8]= xbmcgui.ControlButton(imgX+pw+pw,imgY+ph+ph, pw, ph, '9', font='font1');#,focusTexture=check_image ,noFocusTexture=uncheck_image);#,checkWidth=220,checkHeight=150)
            
        

        
        for obj in self.chk:
            self.addControl(obj )
            obj.setVisible(False)
        for obj in self.chkbutton:
            self.addControl(obj )
        
        
        
        #self.chk[0].setSelected(False)
        
        self.cancelbutton = xbmcgui.ControlButton(imgX+(imgw/2)-110,imgY+imgh+10,100,40,'Cancel',alignment=2)
        self.okbutton = xbmcgui.ControlButton(imgX+(imgw/2)+10,imgY+imgh+10,100,40,'OK',alignment=2)
        self.addControl(self.okbutton)
        self.addControl(self.cancelbutton)

        self.chkbutton[6].controlDown(self.cancelbutton);  self.chkbutton[6].controlUp(self.chkbutton[3])
        self.chkbutton[7].controlDown(self.cancelbutton);  self.chkbutton[7].controlUp(self.chkbutton[4])
        self.chkbutton[8].controlDown(self.okbutton);      self.chkbutton[8].controlUp(self.chkbutton[5])
        
        
        self.chkbutton[6].controlLeft(self.chkbutton[8]);self.chkbutton[6].controlRight(self.chkbutton[7]);
        self.chkbutton[7].controlLeft(self.chkbutton[6]);self.chkbutton[7].controlRight(self.chkbutton[8]);
        self.chkbutton[8].controlLeft(self.chkbutton[7]);self.chkbutton[8].controlRight(self.chkbutton[6]);
        
        self.chkbutton[3].controlDown(self.chkbutton[6]);  self.chkbutton[3].controlUp(self.chkbutton[0])
        self.chkbutton[4].controlDown(self.chkbutton[7]);  self.chkbutton[4].controlUp(self.chkbutton[1])
        self.chkbutton[5].controlDown(self.chkbutton[8]);  self.chkbutton[5].controlUp(self.chkbutton[2])
        
        self.chkbutton[3].controlLeft(self.chkbutton[5]);self.chkbutton[3].controlRight(self.chkbutton[4]);
        self.chkbutton[4].controlLeft(self.chkbutton[3]);self.chkbutton[4].controlRight(self.chkbutton[5]);
        self.chkbutton[5].controlLeft(self.chkbutton[4]);self.chkbutton[5].controlRight(self.chkbutton[3]);

        self.chkbutton[0].controlDown(self.chkbutton[3]);  self.chkbutton[0].controlUp(self.cancelbutton)
        self.chkbutton[1].controlDown(self.chkbutton[4]);  self.chkbutton[1].controlUp(self.cancelbutton)
        self.chkbutton[2].controlDown(self.chkbutton[5]);  self.chkbutton[2].controlUp(self.okbutton)
        
        self.chkbutton[0].controlLeft(self.chkbutton[2]);self.chkbutton[0].controlRight(self.chkbutton[1]);
        self.chkbutton[1].controlLeft(self.chkbutton[0]);self.chkbutton[1].controlRight(self.chkbutton[2]);
        self.chkbutton[2].controlLeft(self.chkbutton[1]);self.chkbutton[2].controlRight(self.chkbutton[0]);
        
        self.cancelled=False
        self.setFocus(self.okbutton)
        self.okbutton.controlLeft(self.cancelbutton);self.okbutton.controlRight(self.cancelbutton); 
        self.cancelbutton.controlLeft(self.okbutton); self.cancelbutton.controlRight(self.okbutton);
        self.okbutton.controlDown(self.chkbutton[2]);self.okbutton.controlUp(self.chkbutton[8]); 
        self.cancelbutton.controlDown(self.chkbutton[0]); self.cancelbutton.controlUp(self.chkbutton[6]);         
    def displayChannels(self):
        self.reset(clear_grid=True)
        EPG_page = self.__getGridPortion()

        gridControls = []
        idx = 0
        for channel in EPG_page:
            y = self.top + self.cellHeight * idx + int((self.cellHeight / 14))

            if not settings.useXMLTVSourceLogos():
                pchannel = xbmcgui.ControlLabel(
                    16, y + 2, 180, self.cellHeight - 8,
                    "[B]" + channel["display_name"] + "[/B]")
            else:
                logo = channel["logo"]

                if logo != "" and logo is not None:
                    logo = join(settings.getChannelsLogoPath(), logo)
                    if exists(logo):
                        pchannel = xbmcgui.ControlImage(16,
                                                        y + 2,
                                                        170,
                                                        self.cellHeight - 8,
                                                        logo,
                                                        aspectRatio=2)
                    else:
                        pchannel = xbmcgui.ControlLabel(
                            16, y + 2, 180, self.cellHeight - 8,
                            "[B]" + channel["display_name"] + "[/B]")
                else:
                    pchannel = xbmcgui.ControlLabel(
                        16, y + 2, 180, self.cellHeight - 8,
                        "[B]" + channel["display_name"] + "[/B]")

            gridControls.append(pchannel)
            self.labelControls.append(pchannel)

            # Program details.
            controls_x_grid = []
            programs = channel["programs"]

            if len(programs) == 0:

                pbutton = xbmcgui.ControlButton(
                    self.left, self.top + self.cellHeight * idx,
                    self.right - self.left - 2, self.cellHeight - 2,
                    PROGRAM_NO_INFOS, settings.getFocusTexture(),
                    settings.getNoFocusTexture())

                gridControls.append(pbutton)
                controls_x_grid.append({
                    "db_id": None,
                    "desc": PROGRAM_NO_INFOS,
                    "title": PROGRAM_NO_INFOS,
                    "start": None,
                    "stop": None,
                    "control": pbutton,
                    "cdisplay_name": channel["display_name"],
                    "cdb_id": channel["db_id"],
                    "logo": channel["logo"]
                })
            for program in programs:

                program_start = strToDatetime(program["start"])
                program_end = strToDatetime(program["end"])

                deltaStart = program_start - self.start_time
                deltaStop = program_end - self.start_time

                y = self.top + self.cellHeight * idx
                x = self.secondsToX(deltaStart.seconds)

                if deltaStart.days < 0:
                    x = self.left

                width = self.secondsToX(deltaStop.seconds) - x

                if x + width > self.right:
                    width = self.right - x

                width -= 2

                if width < 28:
                    program["title"] = ""

                if not settings.useProgramsReminder():
                    focusTexture = settings.getFocusTexture()
                    noFocusTexture = settings.getNoFocusTexture()
                else:
                    # Checking if program is to be reminded.
                    database, cursor = connectEpgDB()
                    epgDb = EpgDb(database, cursor)
                    remind = epgDb.hasReminder(int(program["db_id"]))
                    epgDb.close()
                    del database
                    del cursor
                    del epgDb

                    if remind:
                        focusTexture = settings.getReminderFocusTexture()
                        noFocusTexture = settings.getReminderNoFocusTexture()
                    else:
                        focusTexture = settings.getFocusTexture()
                        noFocusTexture = settings.getNoFocusTexture()

                pbutton = xbmcgui.ControlButton(x,
                                                y,
                                                width,
                                                self.cellHeight - 2,
                                                program["title"],
                                                noFocusTexture=noFocusTexture,
                                                focusTexture=focusTexture)

                gridControls.append(pbutton)
                controls_x_grid.append({
                    "db_id": program["db_id"],
                    "desc": program["desc"],
                    "title": program["title"],
                    "start": program_start,
                    "stop": program_end,
                    "control": pbutton,
                    "cdisplay_name": channel["display_name"],
                    "cdb_id": channel["db_id"],
                    "logo": channel["logo"]
                })
            self.append(controls_x_grid)
            idx += 1

        self.window.addControls(gridControls)
Esempio n. 27
0
    def __init__( self, control, coords=( 0, 0 ), anim=[], **kwargs ):
        self.controlXML = control
        self.id = self.controlXML.getId()
        self.label = xbmc.getInfoLabel( "Control.GetLabel(%i)" % self.id )
        self.anim = anim

        try: extra = dict( [ k.split( "=" ) for k in self.label.split( "," ) ] )
        except: extra = {}
        option = {}
        x, y, w, h = self.getCoords( coords )
        
        # ATTENTION: in Frodo from Oct. 26th 2012 type(self.controlXML) is always xbmcgui.Control!!!
        # Therefore the test for the ID of the control.
        
        if type( self.controlXML ) == xbmcgui.ControlImage or self.controlXML.getId() in [2001]:
            # http://passion-xbmc.org/gros_fichiers/XBMC%20Python%20Doc/xbmc_svn/xbmcgui.html#ControlImage
            texture = self.label
            valideOption = "colorKey, aspectRatio, colorDiffuse".split( ", " )
            for key, value in extra.items():
                key, value = key.strip(), value.strip()
                if key == "texture": texture = value
                if key not in valideOption: continue
                option[ key ] = value
                if "color" in key.lower():
                    option[ key ] = '0x' + value
                elif key == "aspectRatio" and value.isdigit():
                    option[ key ] = int( value )
            texture = getTexture( texture )
            # ControlImage( x, y, width, height, filename[, colorKey, aspectRatio, colorDiffuse] )
            self.control = xbmcgui.ControlImage( x, y, w, h, texture, **option )

        elif type( self.controlXML ) == xbmcgui.ControlLabel or self.controlXML.getId() in [1999, 2002, 2003, 2045]:
            # http://passion-xbmc.org/gros_fichiers/XBMC%20Python%20Doc/xbmc_svn/xbmcgui.html#ControlLabel
            valideOption = "font, textColor, disabledColor, alignment, hasPath, angle".split( ", " )
            for key, value in extra.items():
                key, value = key.strip(), value.strip()
                if key not in valideOption: continue
                option[ key ] = value
                if "color" in key.lower():
                    option[ key ] = '0x' + value
                elif key == "alignment":
                    option[ key ] = self.getAlignment( value )
                elif key == "hasPath" and value == "true":
                    option[ key ] = True
                elif key == "angle" and value.isdigit():
                    option[ key ] = int( value )
            # ControlLabel(x, y, width, height, label[, font, textColor, disabledColor, alignment, hasPath, angle])
            self.control = xbmcgui.ControlLabel( x, y, w, h, "", **option )

        elif type( self.controlXML ) == xbmcgui.ControlProgress or self.controlXML.getId() in [2004, 2005 ]:
            # http://passion-xbmc.org/gros_fichiers/XBMC%20Python%20Doc/xbmc_svn/xbmcgui.html#ControlProgress
            valideOption = "texturebg, textureleft, texturemid, textureright, textureoverlay".split( ", " )
            for key, value in kwargs.items():
                key, value = key.strip(), value.strip()
                if key not in valideOption: continue
                option[ key ] = getTexture( value )
            # ControlProgress(x, y, width, height[, texturebg, textureleft, texturemid, textureright, textureoverlay])
            self.control = xbmcgui.ControlProgress( x, y, w, h, **option )

        elif type( self.controlXML ) in [ xbmcgui.ControlButton, xbmcgui.ControlRadioButton ] or self.controlXML.getId() == 2006:
            # http://passion-xbmc.org/gros_fichiers/XBMC%20Python%20Doc/xbmc_svn/xbmcgui.html#ControlRadioButton
            # ControlRadioButton(x, y, width, height, label[, focusTexture, noFocusTexture, textOffsetX, textOffsetY, alignment, font, textColor, disabledColor, angle, shadowColor, focusedColor, TextureRadioFocus, TextureRadioNoFocus])
            option = { "TextureRadioFocus": "", "TextureRadioNoFocus": "" }
            # http://passion-xbmc.org/gros_fichiers/XBMC%20Python%20Doc/xbmc_svn/xbmcgui.html#ControlButton
            # ControlButton(x, y, width, height, label[, focusTexture, noFocusTexture, textOffsetX, textOffsetY, alignment, font, textColor, disabledColor, angle, shadowColor, focusedColor])
            valideOption = "focusTexture, noFocusTexture, textOffsetX, textOffsetY, alignment, font, textColor, disabledColor, angle, shadowColor, focusedColor, TextureRadioFocus, TextureRadioNoFocus".split( ", " )
            for key, value in extra.items():
                key, value = key.strip(), value.strip()
                if key not in valideOption: continue
                option[ key ] = value
                if "color" in key.lower():
                    option[ key ] = '0x' + value
                elif key == "alignment":
                    option[ key ] = self.getAlignment( value )
                elif key in "focusTexture,noFocusTexture,TextureRadioFocus,TextureRadioNoFocus".split( "," ):
                    option[ key ] = getTexture( value )
                elif key in "angle,textOffsetX,textOffsetY".split( "," ) and value.isdigit():
                    option[ key ] = int( value )
            self.control = xbmcgui.ControlRadioButton( x, y, w, h, "", **option )
            # used for cancel scan ( iscanceled = self.control.isSelected() )
            self.control.setSelected( False )
Esempio n. 28
0
    def __init__(self):
        self.setCoordinateResolution(6)
        #xbmc.executebuiltin("XBMC.Notification(Lucky $even,Welcome,800,%s)" % choice(slotchoices))

        self.tmp_file = os.path.join(CWD,"Jack.pot")
        self.Load_Jackpot()
        self.Jackpot    = self.pot["Jackpot"]

        self.is_started = False
        self.winner_pot  = False
        self.x2           = False
        self.max_is_betted = False

        self.display1   = ""
        self.display2   = ""
        self.display3   = ""
        self.display    = 0

        self.gain       = 0
        self.bet        = 0
        self.max_bet    = 25
        self.cash       = 250
        self.max_cash   = 7e+7

        self.align = 0x00000002+0x00000004

        self.addControl(xbmcgui.ControlImage(0,0,0,0,BG_00))

        self.addControl(xbmcgui.ControlLabel(200,63,0,0,"xbmc media center",'special12',alignment=0x00000001))
        self.addControl(xbmcgui.ControlLabel(207,63,0,0,__script__,'special13'))

        self.addControl(xbmcgui.ControlImage(135,130,150,150,BG_01))
        self.addControl(xbmcgui.ControlImage(285,130,150,150,BG_01))
        self.addControl(xbmcgui.ControlImage(435,130,150,150,BG_01))

        self.win_slot1 = xbmcgui.ControlImage(135,130,150,150,BG_08)
        self.addControl(self.win_slot1)
        self.win_slot2 = xbmcgui.ControlImage(285,130,150,150,BG_08)
        self.addControl(self.win_slot2)
        self.win_slot3 = xbmcgui.ControlImage(435,130,150,150,BG_08)
        self.addControl(self.win_slot3)

        self.slot1 = xbmcgui.ControlImage(155,140,120,120,"")
        self.addControl(self.slot1)
        self.slot2 = xbmcgui.ControlImage(305,140,120,120,"")
        self.addControl(self.slot2)
        self.slot3 = xbmcgui.ControlImage(455,140,120,120,"")
        self.addControl(self.slot3)

        self.addControl(xbmcgui.ControlImage(135,130,150,150,BG_02))
        self.addControl(xbmcgui.ControlImage(285,130,150,150,BG_02))
        self.addControl(xbmcgui.ControlImage(435,130,150,150,BG_02))

        self.default_focus_slot()
        self.default_start_slot()

        self.info_Jackpot = xbmcgui.ControlLabel(550,63,0,0,"Jackpot($): "+str(self.Jackpot),'special12','0xFFFF9600')
        self.addControl(self.info_Jackpot)

        self.info_Win = xbmcgui.ControlLabel(0,450,720,0,"","font13",'0xFFFF9600',alignment=self.align)
        self.addControl(self.info_Win)

        self.info_Bet = xbmcgui.ControlLabel(510,375,0,0,"Mi$e\n"+str(self.bet),"font13",'0xffD2FF00',alignment=0x00000002)
        self.addControl(self.info_Bet)

        self.info_cash = xbmcgui.ControlLabel(200,375,0,0,"Ca$h\n"+str(self.cash),"font13",'0xffD2FF00',alignment=0x00000002)
        self.addControl(self.info_cash)

        self.btn_betm = xbmcgui.ControlButton(
            250,370,60,60,"Bet\n-",font="special13",
            focusTexture=BG_11,
            noFocusTexture=BG_12,
            alignment=self.align)
        self.addControl(self.btn_betm)

        self.btn_betmax = xbmcgui.ControlButton(
            330,370,60,60,"Bet\nMax.",font="special13",
            focusTexture=BG_11,
            noFocusTexture=BG_12,
            alignment=self.align)
        self.addControl(self.btn_betmax)

        self.btn_betp = xbmcgui.ControlButton(
            410,370,60,60,"Bet\n+",font="special13",
            focusTexture=BG_11,
            noFocusTexture=BG_12,
            alignment=self.align)
        self.addControl(self.btn_betp)

        self.btn_start = xbmcgui.ControlButton(
            150,300,200,50,"Start Spin",font="special13",
            focusTexture=BG_09,
            noFocusTexture=BG_10,
            alignment=self.align)
        self.addControl(self.btn_start)

        self.btn_stop_all = xbmcgui.ControlButton(
            370,300,200,50,"Stop Spin",font="special13",
            focusTexture=BG_09,
            noFocusTexture=BG_10,
            alignment=self.align)
        self.addControl(self.btn_stop_all)

        self.btn_bonus = xbmcgui.ControlButton(
            260,470,200,50,"Bonus($)",font="special13",
            focusTexture=BG_09,
            noFocusTexture=BG_10,
            alignment=self.align)
        self.addControl(self.btn_bonus)

        self.btn_start.controlUp(self.btn_bonus)
        self.btn_start.controlLeft(self.btn_stop_all)
        self.btn_start.controlRight(self.btn_stop_all)
        self.btn_start.controlDown(self.btn_betm)

        self.btn_stop_all.controlUp(self.btn_bonus)
        self.btn_stop_all.controlLeft(self.btn_start)
        self.btn_stop_all.controlRight(self.btn_start)
        self.btn_stop_all.controlDown(self.btn_betp)

        self.btn_betm.controlUp(self.btn_start)
        self.btn_betm.controlLeft(self.btn_betp)
        self.btn_betm.controlRight(self.btn_betmax)
        self.btn_betm.controlDown(self.btn_bonus)

        self.btn_betmax.controlUp(self.btn_start)
        self.btn_betmax.controlLeft(self.btn_betm)
        self.btn_betmax.controlRight(self.btn_betp)
        self.btn_betmax.controlDown(self.btn_bonus)

        self.btn_betp.controlUp(self.btn_stop_all)
        self.btn_betp.controlLeft(self.btn_betmax)
        self.btn_betp.controlRight(self.btn_betm)
        self.btn_betp.controlDown(self.btn_bonus)

        self.btn_bonus.controlUp(self.btn_betmax)
        self.btn_bonus.controlLeft(self.btn_bonus)
        self.btn_bonus.controlRight(self.btn_bonus)
        self.btn_bonus.controlDown(self.btn_start)

        self.setFocus(self.btn_bonus)
Esempio n. 29
0
    def add_control_list(self, c):
        control = xbmcgui.ControlButton(0,
                                        -100,
                                        self.controls_width + 20,
                                        self.height_control,
                                        c["label"],
                                        os.path.join(self.mediapath,
                                                     'Controls',
                                                     'MenuItemFO.png'),
                                        os.path.join(self.mediapath,
                                                     'Controls',
                                                     'MenuItemNF.png'),
                                        10,
                                        textColor=c["color"],
                                        font=self.font)

        label = xbmcgui.ControlLabel(0,
                                     -100,
                                     self.controls_width - 80,
                                     self.height_control,
                                     "",
                                     font=self.font,
                                     textColor=c["color"],
                                     alignment=1 | 4)

        upBtn = xbmcgui.ControlButton(
            0,
            -100,
            15,
            7,
            "",
            focusTexture=os.path.join(self.mediapath, 'Controls',
                                      'spinUp-Focus.png'),
            noFocusTexture=os.path.join(self.mediapath, 'Controls',
                                        'spinUp-noFocus.png'))

        downBtn = xbmcgui.ControlButton(
            0,
            -100 + 15,
            15,
            7,
            "",
            focusTexture=os.path.join(self.mediapath, 'Controls',
                                      'spinDown-Focus.png'),
            noFocusTexture=os.path.join(self.mediapath, 'Controls',
                                        'spinDown-noFocus.png'))

        self.addControl(control)
        self.addControl(label)
        self.addControl(upBtn)
        self.addControl(downBtn)

        control.setVisible(False)
        label.setVisible(False)
        upBtn.setVisible(False)
        downBtn.setVisible(False)
        label.setLabel(c["lvalues"][self.values[c["id"]]])

        c["control"] = control
        c["label"] = label
        c["downBtn"] = downBtn
        c["upBtn"] = upBtn
    def createPreview(self, fav):
        imgW = 256
        imgH = 150
        # collect all controls and add them in one call to save time
        allControls = []
        # create preview images first so they are behind highlight image
        images = []

        for nr in range(0, 16):
            pos = self.getControlPos(nr)
            image = xbmcgui.ControlImage(pos['x'], pos['y'] + 1, imgW - 2,
                                         imgH, '')
            allControls.append(image)
            images.append(image)

        self.highlightImage = xbmcgui.ControlImage(0, 0, imgW, 178, '')
        allControls.append(self.highlightImage)
        self.highLabel = ''

        #add a scroll label for highlighted item
        self.scrollLabel = xbmcgui.ControlFadeLabel(0, 0, 240, 30, 'font13',
                                                    '0xFF000000')
        allControls.append(self.scrollLabel)

        #preloadImage is buffer for image update
        self.preloadImage = xbmcgui.ControlImage(0, -200, 256, 150, '')
        allControls.append(self.preloadImage)

        for nr in range(0, 16):
            pos = self.getControlPos(nr)
            logo = xbmcgui.ControlImage(pos['x'] + 5, pos['y'] + 100, 84, 48,
                                        '')
            label = xbmcgui.ControlLabel(pos['x'] + 6, pos['y'] + imgH - 1,
                                         250, 30, 'font13')
            channelNr = xbmcgui.ControlLabel(pos['x'] + 200,
                                             pos['y'] + 5,
                                             50,
                                             20,
                                             'font13',
                                             alignment=1)

            allControls.append(logo)
            allControls.append(label)
            allControls.append(channelNr)

            self.controls.append({
                'image': images[nr],
                'logo': logo,
                'label': label,
                'channelNr': channelNr,
                'program': '',
                'visible': True
            })

        addonPath = xbmcaddon.Addon().getAddonInfo('path')

        #add info controls
        posX = 768
        #bg = xbmcgui.ControlImage(posX-10, -10, 530, 376, 'recentaddedback.png')
        #bg = xbmcgui.ControlImage(posX, 0, 512, 360, 'ContentPanel.png')
        #bg = xbmcgui.ControlImage(posX, 0, 512, 360, 'episodematte.png', colorDiffuse='0xFF333333')
        bg = xbmcgui.ControlImage(posX, 0, 512, 360,
                                  addonPath + '/resources/previewInfo.png')

        self.infoLogo = xbmcgui.ControlImage(
            74 + posX, 5, 140, 70, (xbmcaddon.Addon().getAddonInfo('path') +
                                    '/resources/channel-highlight.png'))
        self.infoChannelTitle = xbmcgui.ControlLabel(0 + posX,
                                                     85,
                                                     287,
                                                     30,
                                                     'TITLE',
                                                     alignment=2)
        self.infoImg = xbmcgui.ControlImage(
            284 + posX, 3, 225, 146, (xbmcaddon.Addon().getAddonInfo('path') +
                                      '/resources/channel-highlight.png'))

        self.infoTitle = xbmcgui.ControlFadeLabel(5 + posX, 150, 500, 20,
                                                  'font16', '0xFFFFFFFF', 2)
        self.infoDesc = xbmcgui.ControlFadeLabel(5 + posX, 180, 500, 20,
                                                 'font13', '0xFFFFFFFF', 2)
        self.infoPlot = xbmcgui.ControlTextBox(8 + posX, 205, 500, 148,
                                               'font13')

        allControls.append(bg)
        allControls.append(self.infoLogo)
        allControls.append(self.infoChannelTitle)
        allControls.append(self.infoImg)
        allControls.append(self.infoTitle)
        allControls.append(self.infoDesc)
        allControls.append(self.infoPlot)

        self.addControls(allControls)
        self.highlightImage.setImage(addonPath +
                                     '/resources/channel-highlight.png')
        self.infoPlot.autoScroll(5000, 1800, 5000)

        self.db = ZattooDB()
        if fav == 'popular': self.channels = self.db.getPopularList()
        else: self.channels = self.db.getChannelList(fav)