Пример #1
0
    def __init__(self):
        seren_dialog.Dialog.__init__(self)

        self.text_box = tools.multi_text(self.window_width / 2 + 30, self.window_height - 90,
                                         self.window_width - 60, self.window_height - 125, font='font12')
        self.addControl(self.text_box)
        self.text_box.setText(tools.lang(40133))
Пример #2
0
    def __init__(self, display_list, info):
        self.position = -1

        texture_path = os.path.join(tools.IMAGES_PATH, 'texture.png')
        self.texture = tools.imageControl(0, 0, 1280, 720, texture_path)
        self.addControl(self.texture)

        self.background = tools.imageControl(0, 0, 1280, 720, '')
        background_diffuse = '0x1FFFFFFF'
        self.background.setColorDiffuse(background_diffuse)
        self.addControl(self.background)

        if tools.getSetting('general.sourceselectlines') == 'false':
            item_height = 30
        else:
            item_height = 55

        self.source_list = tools.listControl(
            20, 130, 760, 640, 'font12', '0xFFFFFFFF', '',
            os.path.join(tools.IMAGES_PATH, 'highlight11.png'), '', 0, 0, 0, 0,
            item_height)
        self.addControl(self.source_list)
        self.source_list.addItems(display_list)

        self.boxImage = tools.imageControl(
            20, 100, 760, 680, os.path.join(tools.IMAGES_PATH, 'box2.jpg'))
        self.boxImage.setColorDiffuse('0x1FFFFFFF')
        self.addControl(self.boxImage)

        self.poster = tools.imageControl(890, 140, 280, 400, '')
        self.addControl(self.poster)

        info_label = tools.labelControl(800,
                                        555,
                                        460,
                                        180,
                                        "",
                                        font="font10",
                                        alignment=tools.XBFONT_CENTER_X)
        self.addControl(info_label)
        info_label_string = '%s: %s | %s: %s | %s: %s mins'

        if 'showInfo' in info:
            self.background.setImage(info['showInfo']['art'].get('fanart', ''))
            self.poster.setImage(info['showInfo']['art'].get('poster', ''))

            info_label_string %= (
                tools.colorString('RATING'),
                info['episodeInfo']['info']['rating'],
                tools.colorString('DATE'),
                info['episodeInfo']['info']['premiered'],
                tools.colorString('DURATION'),
                str(int(info['episodeInfo']['info']['duration']) / 60))

            season_string = tools.labelControl(810,
                                               100,
                                               430,
                                               50,
                                               "",
                                               font='font27_narrow',
                                               alignment=tools.XBFONT_CENTER_X)
            self.addControl(season_string)
            season_string.setLabel(
                '%s - %s' %
                ('Season %s' %
                 (tools.colorString(info['episodeInfo']['info']['season'])),
                 'Episode %s' %
                 (tools.colorString(info['episodeInfo']['info']['episode']))))

            plot_outline = tools.multi_text(830, 580, 430, 100, font='font12')
            self.addControl(plot_outline)
            plot_outline.setText(info['episodeInfo']['info']['plot'])

        else:

            info_label_string %= (tools.colorString('RATING'), info['rating'],
                                  tools.colorString('YEAR'), info['year'],
                                  tools.colorString('DURATION'),
                                  str(int(info['duration']) / 60))

            self.background.setImage(info['art'].get('fanart', ''))
            self.poster.setImage(info['art'].get('poster', ''))

            plot_outline = tools.multi_text(830, 580, 430, 100, font='font12')
            self.addControl(plot_outline)
            plot_outline.setText(info['plot'])

        info_label.setLabel('[B]%s[/B]' % info_label_string)

        self.panda_logo = tools.imageControl(605, 20, 70, 60,
                                             tools.PANDA_LOGO_PATH)
        self.addControl(self.panda_logo)

        self.setFocus(self.source_list)
        self.canceled = False