Esempio n. 1
0
        def set_controls(self):

            # Username label
            self.username_label = pyxbmct.Label(control.lang(30152))
            self.placeControl(self.username_label, 0, 0)
            # Username input
            self.user_input = pyxbmct.Edit(control.lang(30152))
            self.placeControl(self.user_input, 1, 0)
            # Password label
            self.password_label = pyxbmct.Label(control.lang(30153))
            self.placeControl(self.password_label, 2, 0)
            # Password input
            if control.kodi_version() >= 18.0:
                self.pass_input = pyxbmct.Edit(control.lang(30153))
                self.placeControl(self.pass_input, 3, 0)
                self.pass_input.setType(6, control.lang(30153))
            else:
                self.pass_input = pyxbmct.Edit(control.lang(30153),
                                               isPassword=True)
                self.placeControl(self.pass_input, 3, 0)
            # Submit button
            self.submit_button = pyxbmct.Button(control.lang(30154))
            self.placeControl(self.submit_button, 4, 0)
            self.connect(self.submit_button, lambda: self.submit(True))
            # Cancel button
            self.cancel_button = pyxbmct.Button(control.lang(30064))
            self.placeControl(self.cancel_button, 5, 0)
            self.connect(self.cancel_button, self.close)
Esempio n. 2
0
    def setup(self, lineups_obj):
        team1name = pyxbmct.Label(
            '[B]%s\n%s[/B]' %
            (lineups_obj['Team1']['Name'], lineups_obj['Team1']['Record']),
            alignment=pyxbmct.ALIGN_CENTER)
        self.placeControl(team1name, 0, 0, columnspan=10, rowspan=3)
        team1logo = pyxbmct.Image(lineups_obj['Team1']['Logo'], aspectRatio=1)
        self.placeControl(team1logo, 0, 11, columnspan=2, rowspan=3)

        team1formation = pyxbmct.Label(lineups_obj['Team1']['Formation'][2:],
                                       alignment=pyxbmct.ALIGN_CENTER,
                                       textColor='0xFF000000')
        self.placeControl(team1formation, 3, 11, columnspan=2)

        versus = pyxbmct.Label('[B]VS[/B]', alignment=pyxbmct.ALIGN_CENTER)
        self.placeControl(versus, 0, 14, columnspan=2, rowspan=3)

        team2logo = pyxbmct.Image(lineups_obj['Team2']['Logo'], aspectRatio=1)
        self.placeControl(team2logo, 0, 17, columnspan=2, rowspan=3)
        team2name = pyxbmct.Label(
            '[B]%s\n%s[/B]' %
            (lineups_obj['Team2']['Name'], lineups_obj['Team2']['Record']),
            alignment=pyxbmct.ALIGN_CENTER)
        self.placeControl(team2name, 0, 19, columnspan=10, rowspan=3)
        team2formation = pyxbmct.Label(lineups_obj['Team2']['Formation'][2:],
                                       alignment=pyxbmct.ALIGN_CENTER,
                                       textColor='0xFF000000')
        self.placeControl(team2formation, 3, 17, columnspan=2)

        self.progress.update(33, ' It\'ll be worth it, I promise!')
        self.setFormation(lineups_obj['Team1'])
        self.progress.update(66, ' It\'ll be worth it, I promise!')
        self.setFormation(lineups_obj['Team2'])
        self.progress.update(100, 'Done')
        self.progress.close()
Esempio n. 3
0
    def set_controls(self):
        recipient_label = pyxbmct.Label(_('recipient'), alignment=pyxbmct.ALIGN_RIGHT)
        self.placeControl(recipient_label, 0, 0)
        self._recipient_ctl = pyxbmct.Edit('recipient')
        self.placeControl(self._recipient_ctl, 0, 1)
        self._recipient_ctl.setText(self._recipient)

        subject_label = pyxbmct.Label(_('subject'), alignment=pyxbmct.ALIGN_RIGHT)
        self.placeControl(subject_label, 1, 0)
        self._subject_ctl = pyxbmct.Edit('subject')
        self.placeControl(self._subject_ctl, 1, 1)
        self._subject_ctl.setText(self._subject)

        body_label = pyxbmct.Label(_('body'), alignment=pyxbmct.ALIGN_RIGHT)
        self.placeControl(body_label, 2, 0)
        self._body_ctl = pyxbmct.Edit('body')
        self.placeControl(self._body_ctl, 2, 1)

        self._view_body_ctl = pyxbmct.TextBox('view_body')
        self.placeControl(self._view_body_ctl, 3, 0, 6, 2)

        self._ok_button = pyxbmct.Button(_('ok'), alignment=pyxbmct.ALIGN_CENTER)
        self.placeControl(self._ok_button, 9, 1)

        self._cancel_button = pyxbmct.Button(_('cancel'), alignment=pyxbmct.ALIGN_CENTER)
        self.placeControl(self._cancel_button, 9, 0)
Esempio n. 4
0
    def __init__(self, title='[B]NHL[/B]'):
        super(Score, self).__init__(title)
        #Geometry(Width, Height, Rows, Columns)
        #New Addon Windows always have 1280x720 grid
        self.setGeometry(450, 175, 4, 8)

        main_bg = pyxbmct.Image(red)
        self.placeControl(main_bg,
                          0,
                          0,
                          rowspan=4,
                          columnspan=8,
                          pad_x=-3,
                          pad_y=-3)
        bottom_bg = pyxbmct.Image(blue)
        self.placeControl(bottom_bg, 3, 0, columnspan=5, pad_x=-3, pad_y=-3)

        p1header = pyxbmct.Label('[B]1[/B]', alignment=pyxbmct.ALIGN_CENTER)
        self.placeControl(p1header, 0, 1)
        p2header = pyxbmct.Label('[B]2[/B]', alignment=pyxbmct.ALIGN_CENTER)
        self.placeControl(p2header, 0, 2)
        p3header = pyxbmct.Label('[B]3[/B]', alignment=pyxbmct.ALIGN_CENTER)
        self.placeControl(p3header, 0, 3)
        theader = pyxbmct.Label('[B]T[/B]', alignment=pyxbmct.ALIGN_CENTER)
        self.placeControl(theader, 0, 4)

        # Connect a key action (Backspace) to close the window.
        self.connect(pyxbmct.ACTION_NAV_BACK, self.close)
Esempio n. 5
0
 def set_controls(self):
     self.placeControl(self.tb_head, 0, 0, columnspan=2, rowspan=3)
     self.placeControl(
         pyxbmct.Label(getString(30002),
                       alignment=pyxbmct.ALIGN_CENTER_Y
                       | pyxbmct.ALIGN_CENTER), 2, 0)
     self.placeControl(
         pyxbmct.Label(getString(30003),
                       alignment=pyxbmct.ALIGN_CENTER_Y
                       | pyxbmct.ALIGN_CENTER), 3, 0)
     self.placeControl(self.username, 2, 1, pad_y=8)
     self.placeControl(self.password, 3, 1, pad_y=8)
     self.placeControl(self.image, 4, 0, rowspan=2, columnspan=2)
     self.placeControl(self.fl_title, 6, 0, columnspan=2)
     self.placeControl(self.captcha, 7, 0, columnspan=2, pad_y=8)
     self.placeControl(self.btn_submit, 8, 0)
     self.placeControl(self.btn_cancel, 8, 1)
     self.connect(self.btn_cancel, self.close)
     self.connect(self.btn_submit, self.submit)
     self.connect(pyxbmct.ACTION_NAV_BACK, self.close)
     self.username.setText(self.email)
     self.username.setEnabled(False)
     self.tb_head.setText(self.head)
     self.fl_title.addLabel(self.title)
     self.image.setImage(self.picurl, False)
Esempio n. 6
0
    def __init__(self, title='[B]Play-By-Play[/B]'):
        super(Plays, self).__init__('[B]Play-By-Play - %s[/B]' % title)
        #Geometry(Width, Height, Rows, Columns)
        #New Addon Windows always have 1280x720 grid
        #self.setGeometry(1280, 720, 27, 4)
        self.setGeometry(1280, 720, 27, 15)

        teamheader = pyxbmct.Label('[B]Team[/B]',
                                   alignment=pyxbmct.ALIGN_CENTER)
        self.placeControl(teamheader, 0, 0)
        timeheader = pyxbmct.Label('[B]Time[/B]',
                                   alignment=pyxbmct.ALIGN_CENTER)
        self.placeControl(timeheader, 0, 1)
        scoreheader = pyxbmct.Label('   [B]Score[/B]',
                                    alignment=pyxbmct.ALIGN_CENTER)
        self.placeControl(scoreheader, 0, 2)
        playheader = pyxbmct.Label('[B]Play[/B]',
                                   alignment=pyxbmct.ALIGN_CENTER)
        self.placeControl(playheader, 0, 3, columnspan=12)

        self.listing = pyxbmct.List(_imageWidth=35, _imageHeight=35)
        self.placeControl(self.listing, 1, 0, rowspan=26, columnspan=15)

        # Connect a key action (Backspace) to close the window.
        self.connect(pyxbmct.ACTION_NAV_BACK, self.close)
Esempio n. 7
0
    def test_remove_controls(self):
        """
        Tests pyxbmct.AddonFullWindow.removeControls. Ensures that only the correct controls are removed and the only
        the removed callbacks that are called are the ones for those controls, and that they are called with the correct
        parameters.
        """

        self._window.setGeometry(1000, 500, 7, 8)

        control = pyxbmct.Label(None, None, None, None, None, None)
        control._removedCallback = mock.MagicMock()

        control2 = pyxbmct.Label(None, None, None, None, None, None)

        control3 = pyxbmct.Label(None, None, None, None, None, None)
        control3._removedCallback = mock.MagicMock()

        control4 = pyxbmct.Label(None, None, None, None, None, None)
        control4._removedCallback = mock.MagicMock()

        self._window.placeControl(control, 0, 0)
        self._window.placeControl(control2, 1, 0)
        self._window.placeControl(control3, 1, 1)
        self._window.placeControl(control4, 2, 1)

        # Added later so it they be called when the control is placed
        control2._placedCallback = mock.MagicMock()
        control3._placedCallback = mock.MagicMock()

        with self.subTest("Removed callback not called (before removal)"):
            control._removedCallback.assert_not_called()

        with self.subTest("Removed callback not called (before removal)"):
            control4._removedCallback.assert_not_called()

        with mock.patch('xbmcgui.Window.removeControl') as xbmcgui_window_remove_control:
            self._window.removeControls((control, control2, control4))

            with self.subTest("Control removed"):
                xbmcgui_window_remove_control.assert_any_call(self._window, control)
                xbmcgui_window_remove_control.assert_any_call(self._window, control2)
                xbmcgui_window_remove_control.assert_any_call(self._window, control4)
                self.assertEqual(xbmcgui_window_remove_control.call_count, 3)

        with self.subTest("Removed callback called once on control that is removed (after removal)"):
            control._removedCallback.assert_called_once_with(self._window)

        with self.subTest("Removed callback called once on control that is removed (after removal)"):
            control4._removedCallback.assert_called_once_with(self._window)

        with self.subTest("Placed callback not called (control that is removed)"):
            control2._placedCallback.assert_not_called()

        with self.subTest("Placed callback not called (control that is not removed)"):
            control3._placedCallback.assert_not_called()

        with self.subTest("Removed callback not called (control that is not removed)"):
            control3._removedCallback.assert_not_called()
Esempio n. 8
0
    def test_remove_controls(self):
        """
        Tests Group.removeControls. Ensures that controls are actually removed from the window when they are removed
        from the Group. Ensures that only the correct controls are removed and the only the removed callbacks that are
        called are the ones for those controls, and that they are called with the correct parameters.
        """

        group = pyxbmct.Group(2, 4)

        control = pyxbmct.Label(None, None, None, None, None, None)
        control._removedCallback = mock.MagicMock()

        control2 = pyxbmct.Label(None, None, None, None, None, None)

        control3 = pyxbmct.Label(None, None, None, None, None, None)
        control3._removedCallback = mock.MagicMock()

        control4 = pyxbmct.Label(None, None, None, None, None, None)
        control4._removedCallback = mock.MagicMock()

        self._window.placeControl(group, 0, 0)
        group.placeControl(control, 0, 0)
        group.placeControl(control2, 1, 0)
        group.placeControl(control3, 1, 1)
        group.placeControl(control4, 2, 1)

        # Added later so it they be called when the control is placed
        control2._placedCallback = mock.MagicMock()
        control3._placedCallback = mock.MagicMock()

        with self.subTest("Removed callback not called (before removal)"):
            control._removedCallback.assert_not_called()

        with self.subTest("Removed callback not called (before removal)"):
            control4._removedCallback.assert_not_called()

        group.removeControls((control, control2, control4))

        with self.subTest("Control removed"):
            self._window.removeControl.assert_any_call(control)
            self._window.removeControl.assert_any_call(control2)
            self._window.removeControl.assert_any_call(control4)
            self.assertEqual(self._window.removeControl.call_count, 3)

        with self.subTest("Removed callback called once on control that is removed (after removal)"):
            control._removedCallback.assert_called_once_with(self._window)

        with self.subTest("Removed callback called once on control that is removed (after removal)"):
            control4._removedCallback.assert_called_once_with(self._window)

        with self.subTest("Placed callback not called (control that is removed)"):
            control2._placedCallback.assert_not_called()

        with self.subTest("Placed callback not called (control that is not removed)"):
            control3._placedCallback.assert_not_called()

        with self.subTest("Removed callback not called (control that is not removed)"):
            control3._removedCallback.assert_not_called()
Esempio n. 9
0
    def set_controls(self):
        '''
        Header Text Placement
        '''
        self.header_text = '[B]Theme Selection[/B]'
        self.Header = pyxbmct.Label(self.header_text,
                                    alignment=pyxbmct.ALIGN_CENTER,
                                    textColor=self.colors.dh_color)
        self.placeControl(self.Header, 3, 0, rowspan=2, columnspan=60)
        '''
        58 characters per line
        '''
        msg = 'Please select the artwork that you would like to use.\nThis is pulled from the selected Artwork Module. You can\nchange the Artwork Module used from the Tools\nMenu by selecting Artwork Module and typing the ID\nof the new module.'
        self.Description = pyxbmct.Label(msg)
        self.placeControl(self.Description, 6, 4, rowspan=12, columnspan=53)

        self.menu = pyxbmct.List(textColor=self.colors.mt_color)
        self.placeControl(self.menu, 24, 21, rowspan=30, columnspan=17)
        items = []
        self.aModule_base = xbmcaddon.Addon(
            'script.atreides.artwork').getSetting('artwork_module')
        self.aModule = os.path.join(
            xbmcaddon.Addon(self.aModule_base).getAddonInfo('path'),
            'resources', 'media')
        for folder in glob.glob("%s/*" % (self.aModule)):
            folder = os.path.split(folder)[1].capitalize()
            items.append(folder)
        self.menu.addItems(items)
        self.connect(self.menu, self.menu_handler)

        self.Preview = pyxbmct.Image('%s/%s/tools.png' %
                                     (self.aModule, items[0]))
        self.placeControl(self.Preview, 24, 3, rowspan=17, columnspan=17)

        self.module_text = 'Current Module: %s' % (self.aModule_base)
        self.Module = pyxbmct.Label(self.module_text,
                                    alignment=pyxbmct.ALIGN_CENTER,
                                    textColor=self.colors.dh_color)
        self.placeControl(self.Module, 50, 0, rowspan=2, columnspan=60)

        self.OKButton = pyxbmct.Button('OK',
                                       textColor='0xFFFFFFFF',
                                       shadowColor='0xFF000000',
                                       focusedColor='0xFFbababa',
                                       focusTexture=themecontrol.btn_focus,
                                       noFocusTexture=themecontrol.btn_nofocus)
        self.placeControl(self.OKButton, 53, 35, rowspan=4, columnspan=10)
        self.connect(self.OKButton, self.save_theme)

        self.CancelButton = pyxbmct.Button(
            'Cancel',
            textColor='0xFFFFFFFF',
            shadowColor='0xFF000000',
            focusedColor='0xFFbababa',
            focusTexture=themecontrol.btn_focus,
            noFocusTexture=themecontrol.btn_nofocus)
        self.placeControl(self.CancelButton, 53, 46, rowspan=4, columnspan=10)
        self.connect(self.CancelButton, self.close)
Esempio n. 10
0
    def set_controls(self):
        '''
        Left Side Menu Top Section
        '''
        self.MenuSection = pyxbmct.Label(
            '[B]Tool Menu[/B]', alignment=pyxbmct.ALIGN_LEFT, textColor=self.colors.mh_color)
        self.placeControl(self.MenuSection, 3, 1, columnspan=17)
        self.menu = pyxbmct.List(textColor=self.colors.mt_color)
        self.placeControl(self.menu, 4, 1, rowspan=8, columnspan=17)
        self.menu.addItems(['Pairing', 'Authorize'])

        '''
        Primary buttons in left menu
        '''
        self.CloseButton = pyxbmct.Button(
            'Close', textColor='0xFFFFFFFF', shadowColor='0xFF000000', focusedColor='0xFFbababa',
            focusTexture=themecontrol.btn_focus, noFocusTexture=themecontrol.btn_nofocus)
        self.placeControl(self.CloseButton, 17, 10, rowspan=2, columnspan=8)
        self.connect(self.CloseButton, self.close)

        self.OpenButton = pyxbmct.RadioButton(
            'Open in Browser', textColor='0xFFFFFFFF', shadowColor='0xFF000000', focusedColor='0xFFbababa')
        self.placeControl(self.OpenButton, 12, 1, rowspan=2, columnspan=17)
        self.OpenButton.setSelected(self.open_browser)
        self.connect(self.OpenButton, self.toggle)

        '''
        Right Side, to display stuff for the above menu items
        '''
        self.pairingheader = '[B]Pairing Tool[/B]'
        self.Header = pyxbmct.Label(self.pairingheader, alignment=pyxbmct.ALIGN_CENTER, textColor=self.colors.dh_color)
        self.placeControl(self.Header, 2, 20, rowspan=1, columnspan=40)
        self.pairMenu = pyxbmct.List(textColor=self.colors.mt_color, _imageWidth=50, _imageHeight=50)
        self.placeControl(self.pairMenu, 3, 21, rowspan=20, columnspan=30)
        pairItems = []
        for item in PAIR_LIST:
            the_title = 'Pair for %s' % (item[0].replace('_', ' ').capitalize())
            the_item = control.item(label=the_title)
            the_icon = item[2].decode('base64')
            the_item.setArt({'icon': the_icon, 'thumb': the_icon})
            pairItems.append(the_item)
        self.pairMenu.addItems(pairItems)
        self.connect(self.pairMenu, self.pairHandler)

        self.authMenu = pyxbmct.List(textColor=self.colors.mt_color, _imageWidth=50, _imageHeight=50)
        self.placeControl(self.authMenu, 3, 21, rowspan=20, columnspan=30)
        self.authMenu.setVisible(False)
        authItems = []
        for item in AUTH_LIST:
            the_title = 'Authorize %s' % (item[0].replace('_', ' ').capitalize())
            the_item = control.item(label=the_title)
            the_icon = item[2].decode('base64')
            the_item.setArt({'icon': the_icon, 'thumb': the_icon})
            authItems.append(the_item)
        self.authMenu.addItems(authItems)
        self.connect(self.authMenu, self.authHandler)
Esempio n. 11
0
    def __init__(self,
                 file_created_callback=None,
                 default_filename=None,
                 *args,
                 **kwargs):
        # type (Callable, str, Any, Any) -> None
        super(SavePreset, self).__init__("Save Flubber-X Preset", *args,
                                         **kwargs)
        if file_created_callback:
            self._file_created_callback = file_created_callback

        default_dir = "Select Directory"
        if default_filename:
            if os.path.isfile(default_filename):
                default_dir, default_filename = os.path.split(default_filename)
                if not default_dir:
                    default_dir = "Select Directory"
            else:
                if os.path.isdir(default_filename):
                    default_dir = default_filename
                    default_filename = "Filename"
        else:
            default_filename = "Filename"

        num_rows = 3
        height = num_rows * 60
        self.setGeometry(600, height, num_rows, 4)

        self.placeControl(pyxbmct.Label("Directory"), 0, 0)
        self._dir_input = controls.FileSelector(
            default=default_dir,
            update_label_on_select=True,
            type=3,
            heading="Select Directory",
        )
        self.placeControl(self._dir_input, 0, 1, columnspan=3)

        self.placeControl(pyxbmct.Label("Filename"), 1, 0)
        self._filename_input = controls.FakeEdit(default=default_filename,
                                                 heading="Filename")
        self.placeControl(self._filename_input, 1, 1, columnspan=3)

        ok_button = controls.ButtonWithIcon("Save Preset",
                                            "file_arrow_down.png")
        self.placeControl(ok_button, 2, 0, columnspan=2)
        self.connect(ok_button, self._ok_clicked)

        cancel_button = controls.ButtonWithIcon("Cancel", "close.png")
        self.placeControl(cancel_button, 2, 2, columnspan=2)
        self.connect(cancel_button, self.close)

        self.setFocus(ok_button)
        self.autoNavigation()

        self.connect(pyxbmct.ACTION_NAV_BACK, self.close)
Esempio n. 12
0
 def setup(self, boxscore_obj):
     self.row_number = 3 + 4
     # + 2 for the header & team total rows
     team1total =  len(boxscore_obj['Team1']['Stats']['Hitting']['Players']) + 2
     team1total += len(boxscore_obj['Team1']['Stats']['Hitting']['Extras'].keys())
     # + 1 for the header row
     team1total += len(boxscore_obj['Team1']['Stats']['Fielding'].keys()) + 1
     
     # + 2 for the header & team total rows
     team2total =  len(boxscore_obj['Team2']['Stats']['Hitting']['Players']) + 2
     team2total += len(boxscore_obj['Team2']['Stats']['Hitting']['Extras'].keys())
     # + 1 for the header row
     team2total += len(boxscore_obj['Team2']['Stats']['Fielding'].keys()) + 1
     
     if team1total > team2total:
         self.row_number += team1total
     else:
         self.row_number += team2total
     
     self.setGeometry(1280, 720, self.row_number, 24)
     #3 rows for top head-to-head banner
     #4 rows for team stats - team1, team1 percentages, team2, team2 percentages
     #Now add 1 row for each player on each team
     
     self.boxscore_obj = boxscore_obj
     
     hittingbtn  = pyxbmct.Button('[B]Hitting[/B]', alignment=pyxbmct.ALIGN_CENTER)
     self.placeControl(hittingbtn, 0, 0, columnspan=3, rowspan=3)
     self.connect(hittingbtn, lambda: self.switch_stats('Hitting'))
     pitchingbtn  = pyxbmct.Button('[B]Pitching[/B]', alignment=pyxbmct.ALIGN_CENTER)
     self.placeControl(pitchingbtn, 3, 0, columnspan=3, rowspan=3)
     self.connect(pitchingbtn, lambda: self.switch_stats('Pitching'))
     
     pitchingbtn.controlUp(hittingbtn)
     pitchingbtn.controlDown(hittingbtn)
     hittingbtn.controlUp(pitchingbtn)
     hittingbtn.controlDown(pitchingbtn)
     self.setFocus(hittingbtn)
     
     team1name   = pyxbmct.Label('[B]%s\n%s[/B]' % (boxscore_obj['Team1']['Name'], 
                                                    boxscore_obj['Team1']['Record']), alignment=pyxbmct.ALIGN_CENTER)
     self.placeControl(team1name, 0, 3, columnspan=6, rowspan=6)
     team1logo   = pyxbmct.Image(boxscore_obj['Team1']['Logo'])
     self.placeControl(team1logo, 0, 9, columnspan=2, rowspan=6)
     
     versus      = pyxbmct.Label('[B]VS[/B]', alignment=pyxbmct.ALIGN_CENTER)
     self.placeControl(versus, 0, 11, columnspan=3, rowspan=6)
     
     team2logo   = pyxbmct.Image(boxscore_obj['Team2']['Logo'])
     self.placeControl(team2logo, 0, 14, columnspan=2, rowspan=6)
     team2name   = pyxbmct.Label('[B]%s\n%s[/B]' % (boxscore_obj['Team2']['Name'], 
                                                    boxscore_obj['Team2']['Record']), alignment=pyxbmct.ALIGN_CENTER)
     self.placeControl(team2name, 0, 16, columnspan=5, rowspan=6)
     self.init_stats()
Esempio n. 13
0
 def set_controls(self):
     self.placeControl(pyxbmct.Label(getString(30220), alignment=pyxbmct.ALIGN_CENTER_Y), 1, 0)
     self.placeControl(self.pin, 1, 1)
     self.placeControl(pyxbmct.Label(getString(30221), alignment=pyxbmct.ALIGN_CENTER_Y), 2, 0)
     self.placeControl(self.btn_ages, 2, 1)
     self.placeControl(self.btn_save, 4, 0)
     self.placeControl(self.btn_close, 4, 1)
     self.connect(self.btn_close, self.close)
     self.connect(self.btn_ages, self.select_age)
     self.connect(self.btn_save, self.save_settings)
     self.connect(pyxbmct.ACTION_NAV_BACK, self.close)
     self.pin.setText(AgePin)
Esempio n. 14
0
 def createInfoLabels(self):
     #Artist Infos
     self.artistName = pyxbmct.Label('')
     self.placeControl(self.artistName, 0, 2, 1, 4)
     #Track Infos
     self.trackName = pyxbmct.Label('')
     self.placeControl(self.trackName, 1, 2, 1, 4)
     #Album Infos
     self.albumName = pyxbmct.Label('')
     self.placeControl(self.albumName, 2, 2, 1, 4)
     #Error
     self.errorLabel = pyxbmct.Label('')
     self.placeControl(self.errorLabel, 0, 0, 1, 4)
Esempio n. 15
0
    def setup(self, standings):
        progress = xbmcgui.DialogProgressBG()
        progress.create("This might take a minute")
        percentage = 0

        h = standings.pop('Headers')
        lname = standings.pop('League Name')

        rows_needed = 2 + len(standings.keys()[0]) + len(standings.keys()[1])
        self.setGeometry(1280, 720, rows_needed, 16)
        startingrow = 0
        for key, conf in sorted(standings.iteritems(),
                                key=lambda (k, v): (v, k)):
            confname = pyxbmct.Label('[B]%s[/B]' % key,
                                     alignment=pyxbmct.ALIGN_CENTER)
            self.placeControl(confname, startingrow, 0, columnspan=4)
            offset = 0
            for i, header in enumerate(h):
                tmpheader = pyxbmct.Label('[B]%s[/B]' % header,
                                          alignment=pyxbmct.ALIGN_CENTER)
                if header in ['HOME', 'ROAD']:
                    self.placeControl(tmpheader,
                                      startingrow,
                                      4 + i + offset,
                                      columnspan=2)
                    offset += 1
                else:
                    self.placeControl(tmpheader, startingrow, 4 + i + offset)
            startingrow += 1
            for t, team in enumerate(conf):
                tname = pyxbmct.Label(team['Name'],
                                      alignment=pyxbmct.ALIGN_CENTER)
                self.placeControl(tname, startingrow + t, 0, columnspan=4)
                offset = 0
                for i, header in enumerate(h):
                    tval = pyxbmct.Label(team[header].strip(),
                                         alignment=pyxbmct.ALIGN_CENTER)
                    if header in ['HOME', 'ROAD']:
                        self.placeControl(tval,
                                          startingrow + t,
                                          4 + i + offset,
                                          columnspan=2)
                        offset += 1
                    else:
                        self.placeControl(tval, startingrow + t,
                                          4 + i + offset)
            startingrow += t + 1
            percentage += 50
            progress.update(percentage, ' It\'ll be worth it, I promise!')
        progress.update(100, 'Done')
        progress.close()
Esempio n. 16
0
    def set_controls(self):
        '''
        Left Side Menu Top Section
        '''
        self.Section1 = pyxbmct.Label('[B]Addon Information[/B]',
                                      alignment=pyxbmct.ALIGN_LEFT, textColor=self.colors.mh_color)
        self.placeControl(self.Section1, 3, 1, columnspan=17)
        self.menu = pyxbmct.List(textColor=self.colors.mt_color)
        self.placeControl(self.menu, 4, 1, rowspan=8, columnspan=17)
        self.menu.addItems(['News',
                            'Changes',
                            'Builds',
                            'Paypal'])
        '''
        Left Side Menu Bottom Section, currently unused
        '''
        self.Section2 = pyxbmct.Label('[B]Tips and Tricks[/B]',
                                      alignment=pyxbmct.ALIGN_LEFT, textColor=self.colors.mh_color)
        self.placeControl(self.Section2, 11, 1, rowspan=4, columnspan=17)
        self.menu2 = pyxbmct.List(textColor=self.colors.mt_color)
        self.placeControl(self.menu2, 12, 1, rowspan=12, columnspan=17)
        self.menu2.addItems(['Scraper Tips',
                             'Real Debrid',
                             'Torrents'])

        self.CloseButton = pyxbmct.Button(
            'Close', textColor='0xFFFFFFFF', shadowColor='0xFF000000', focusedColor='0xFFbababa',
            focusTexture=themecontrol.btn_focus, noFocusTexture=themecontrol.btn_nofocus)
        self.placeControl(self.CloseButton, 17, 10, rowspan=2, columnspan=8)
        self.connect(self.CloseButton, self.close)
        '''
        Right Side, to display stuff for the above menu items
        '''
        self.newsheader = '[B]Latest News[/B]'
        self.Header = pyxbmct.Label(self.newsheader, alignment=pyxbmct.ALIGN_CENTER, textColor=self.colors.dh_color)
        self.placeControl(self.Header, 2, 20, rowspan=1, columnspan=40)
        self.Description = pyxbmct.TextBox(self.news)
        self.placeControl(self.Description, 3, 21, rowspan=16, columnspan=40)
        self.Description.setText(self.news)

        self.RDLink = pyxbmct.Label('Referral Debrid Link: ' + str(get_rd_link()))
        self.placeControl(self.RDLink, 17, 21, rowspan=2, columnspan=32)
        self.RDLink.setVisible(False)

        self.WatchButton = pyxbmct.Button(
            'Watch', textColor='0xFFFFFFFF', shadowColor='0xFF000000', focusedColor='0xFFbababa',
            focusTexture=themecontrol.btn_focus, noFocusTexture=themecontrol.btn_nofocus)
        self.placeControl(self.WatchButton, 15, 36, rowspan=2, columnspan=8)
        self.WatchButton.setVisible(False)
        self.connect(self.WatchButton, self.watchVideo)
Esempio n. 17
0
    def test_set_enabled(self):
        """
        Ensures that setEnabled is called for every child of a Group when it is called for the Group
        """
        group = pyxbmct.Group(2, 4)

        control = pyxbmct.Label(None, None, None, None, None, None)
        control.setEnabled = mock.MagicMock()

        control2 = pyxbmct.Label(None, None, None, None, None, None)
        control2.setEnabled = mock.MagicMock()

        control3 = pyxbmct.Label(None, None, None, None, None, None)
        control3.setEnabled = mock.MagicMock()

        self._window.placeControl(group, 0, 0)
        group.placeControl(control, 0, 0)
        group.placeControl(control2, 1, 0)
        group.placeControl(control3, 1, 1)

        group.setEnabled(False)

        with self.subTest("control1 setVisible called with False"):
            control.setEnabled.assert_called_once_with(False)

        with self.subTest("control2 setVisible called with False"):
            control2.setEnabled.assert_called_once_with(False)

        with self.subTest("control3 setVisible called with False"):
            control3.setEnabled.assert_called_once_with(False)

        group.setEnabled(True)

        with self.subTest("control1 setVisible called with True"):
            control.setEnabled.assert_called_with(True)

        with self.subTest("control2 setVisible called with True"):
            control2.setEnabled.assert_called_with(True)

        with self.subTest("control3 setVisible called with True"):
            control3.setEnabled.assert_called_with(True)

        with self.subTest("control1 setVisible called exactly twice"):
            self.assertEqual(control.setEnabled.call_count, 2)

        with self.subTest("control2 setVisible called exactly twice"):
            self.assertEqual(control2.setEnabled.call_count, 2)

        with self.subTest("control3 setVisible called exactly twice"):
            self.assertEqual(control3.setEnabled.call_count, 2)
Esempio n. 18
0
    def setup(self, standings):
        progress = xbmcgui.DialogProgressBG()
        progress.create("This might take a minute")
        percentage = 0
        h = standings.pop('Headers')

        rows_needed = len(list(standings.keys())[0]) + len(
            list(standings.keys())[1])
        self.setGeometry(1280, 720, rows_needed, 21)
        startingrow = 0
        for key, conf in standings.items():
            confname = pyxbmct.Label('[B]%s[/B]' % key,
                                     alignment=pyxbmct.ALIGN_CENTER)
            self.placeControl(confname, startingrow, 0, columnspan=4)
            offset = 0
            for i, header in enumerate(h):
                tmpheader = pyxbmct.Label('[B]%s[/B]' % header,
                                          alignment=pyxbmct.ALIGN_CENTER)
                if header in ['HOME', 'AWAY', 'CONF', 'OPP PPG']:
                    self.placeControl(tmpheader,
                                      startingrow,
                                      4 + i + offset,
                                      columnspan=2)
                    offset += 1
                else:
                    self.placeControl(tmpheader, startingrow, 4 + i + offset)
            startingrow += 1
            for t, team in enumerate(conf):
                tname = pyxbmct.Label(team['Name'],
                                      alignment=pyxbmct.ALIGN_CENTER)
                self.placeControl(tname, startingrow + t, 0, columnspan=4)
                offset = 0
                for i, header in enumerate(h):
                    tval = pyxbmct.Label(team[header].strip(),
                                         alignment=pyxbmct.ALIGN_CENTER)
                    if header in ['HOME', 'AWAY', 'CONF', 'OPP PPG']:
                        self.placeControl(tval,
                                          startingrow + t,
                                          4 + i + offset,
                                          columnspan=2)
                        offset += 1
                    else:
                        self.placeControl(tval, startingrow + t,
                                          4 + i + offset)
            startingrow += t + 1
            percentage += 50
            progress.update(percentage, 'Half-way there!')
        progress.update(100, 'Done')
        progress.close()
Esempio n. 19
0
    def add_labels(self):
        self.source_label = pyxbmct.Label("Source path:")
        self.placeControl(self.source_label, 0, 0, columnspan=2)

        self.customRe_label = pyxbmct.Label("Custom regular expression:")
        self.placeControl(self.customRe_label, 0, 2, columnspan=2)

        self.files_label = pyxbmct.Label("Files to select:")
        self.placeControl(self.files_label, 3, 0, columnspan=2)

        self.help_label = pyxbmct.Label("Help")
        self.placeControl(self.help_label, 2, 2, columnspan=2)

        self.destination_label = pyxbmct.Label("Destination:")
        self.placeControl(self.destination_label, 7, 0, columnspan=2)
Esempio n. 20
0
 def checkupdate(self, path):
     url_version = '%s%s%s' % ("https://addons.tnds82.xyz/addon/tvhwizard/update/channels/", path, "version")
     check = urllib2.urlopen(url_version)
     check1 = open(channelver, "r")
     for line1 in check:
         for line2 in check1:
             if line1==line2:
                 label = pyxbmct.Label('Updated', textColor='0xFF61B86A')
                 self.placeControl(label, 18, 13, columnspan=4)
             else:
                 label = pyxbmct.Label('Not Updated', textColor='0xFFFF4A4A')
                 self.placeControl(label, 18, 13, columnspan=4)
                 self.update_button = pyxbmct.Button('Update')
                 self.placeControl(self.update_button, 19, 15, rowspan=1, columnspan=3)
                 self.connect(self.update_button, lambda: self.update())
Esempio n. 21
0
    def set_controls(self):

        image = pyxbmct.Image(control.fanart(), aspectRatio=2)
        self.placeControl(image, 0, 0, 5, 3)
        # Note
        self.description = pyxbmct.Label(control.lang(30328), alignment=2)
        self.placeControl(self.description, 5, 0, 2, 3)
        # Click to open label
        # self.external_label = pyxbmct.Label(control.lang(30131), alignment=pyxbmct.ALIGN_CENTER_Y | pyxbmct.ALIGN_CENTER_X)
        # self.placeControl(self.external_label, 6, 0, 1, 1)
        # Twitter button
        self.twitter_button = pyxbmct.Button('Twitter')
        self.placeControl(self.twitter_button, 6, 0)
        self.connect(self.twitter_button, lambda: control.open_web_browser(TWITTER))
        # Website
        self.website_button = pyxbmct.Button(control.lang(30333))
        self.placeControl(self.website_button, 6, 1)
        self.connect(self.website_button, lambda: control.open_web_browser(WEBSITE))
        # Facebook button
        self.facebook_button = pyxbmct.Button('Facebook')
        self.placeControl(self.facebook_button, 6, 2)
        self.connect(self.facebook_button, lambda: control.open_web_browser(FACEBOOK))
        # Close button
        self.close_button = pyxbmct.Button(control.lang(30329))
        self.placeControl(self.close_button, 7, 1)
        self.connect(self.close_button, self.close)
        # Changelog button
        self.changelog_button = pyxbmct.Button(control.lang(30110))
        self.placeControl(self.changelog_button, 7, 0)
        self.connect(self.changelog_button, lambda: changelog())
        # Disclaimer button
        self.disclaimer_button = pyxbmct.Button(control.lang(30129))
        self.placeControl(self.disclaimer_button, 7, 2)
        self.connect(self.disclaimer_button, lambda: disclaimer())
 def set_sliderG(self):
     # Slider value label
     SLIDER_INIT_VALUE = self.active_RGB[1]
     self.slider_valueG = pyxbmct.Label('[COLOR FF00FF00]' +
                                        str(SLIDER_INIT_VALUE) + '[/COLOR]',
                                        alignment=pyxbmct.ALIGN_CENTER)
     self.placeControl(self.slider_valueG, 1, 1)
     #
     slider_caption = pyxbmct.Label(translate(30008),
                                    alignment=pyxbmct.ALIGN_CENTER)
     self.placeControl(slider_caption, 1, 0)
     # Slider
     self.sliderG = pyxbmct.Slider()
     self.placeControl(self.sliderG, 1, 2, pad_y=10, columnspan=2)
     # self.slider.setPercent(SLIDER_INIT_VALUE)
     self.sliderG.setInt(SLIDER_INIT_VALUE, -10, 5, 255)
Esempio n. 23
0
 def radio(self):
     self.prev_button = pyxbmct.Button('Prev', alignment=pyxbmct.ALIGN_CENTER, font='button34_title')
     self.placeControl(self.prev_button, 4, 1)
     
     freq_type_lable = pyxbmct.Label('FM', alignment=pyxbmct.ALIGN_CENTER, font='header34_title')
     self.placeControl(freq_type_lable, 4, 4, 1, 1)
     
     self.next_button = pyxbmct.Button('Next', alignment=pyxbmct.ALIGN_CENTER, font='button34_title')
     self.placeControl(self.next_button, 4, 5)
     self.connect(self.next_button, lambda: dab.nextDAB(0,0))
     
     # List
     self.station_fm_list = pyxbmct.List(font='font30_title', _itemHeight=40)
     #self.list(Row Location (Where pos) , column Location (where Pos) , No Items, text Span over column no)
     self.placeControl(self.station_fm_list, 2, 0, 10, 1)
     # Add items to the list
     items = ['Items {0}'.format(i) for i in range(1, 11)]
     self.station_fm_list.addItems(items)
     
     # Connect the list to a function to display which list item is selected.
     self.connect(self.station_fm_list, lambda: xbmc.executebuiltin('Notification(Note!,{0} selected.)'.format(
     self.station_fm_list.getListItem(self.station_fm_list.getSelectedPosition()).getLabel())))
     
     self.mw_button = pyxbmct.Button('MW', alignment=pyxbmct.ALIGN_CENTER, font='button34_title')
     self.placeControl(self.mw_button, 7, 3)
     
     self.fm_button = pyxbmct.Button('FM', alignment=pyxbmct.ALIGN_CENTER, font='button34_title')
     self.placeControl(self.fm_button, 7, 4)
     
     self.dab_button = pyxbmct.Button('DAB', alignment=pyxbmct.ALIGN_CENTER, font='button34_title')
     self.placeControl(self.dab_button, 7, 5)
Esempio n. 24
0
 def set_base_layout(self):
     #Time Lable
     time_label = pyxbmct.Label(xbmc.getInfoLabel('system.time'), alignment=pyxbmct.ALIGN_CENTER, font='header50_title')
     self.placeControl(time_label, 0, 0, 1, 2)
     
     self.volume_button = pyxbmct.Button('Volume', alignment=pyxbmct.ALIGN_CENTER, font='button34_title')
     self.placeControl(self.volume_button, 0, 4, pad_x=0, pad_y=5)
     
     self.home_button = pyxbmct.Button('Home', alignment=pyxbmct.ALIGN_CENTER, font='button34_title')
     self.placeControl(self.home_button, 0, 5, pad_x=0, pad_y=5)
     
     self.radio_button = pyxbmct.Button('Radio', alignment=pyxbmct.ALIGN_CENTER, font='button34_title')
     self.placeControl(self.radio_button, 1, 0, pad_x=0, pad_y=5)
     self.connect(self.radio_button, self.radio)
     
     self.mp3_button = pyxbmct.Button('Mp3', alignment=pyxbmct.ALIGN_CENTER, font='button34_title')
     self.placeControl(self.mp3_button, 1, 1, pad_x=0, pad_y=5)
     
     self.bluetooth_button = pyxbmct.Button('Bluetooth', alignment=pyxbmct.ALIGN_CENTER, font='button34_title')
     self.placeControl(self.bluetooth_button, 1, 2, pad_x=0, pad_y=5)
     
     self.aux_button = pyxbmct.Button('AUX', alignment=pyxbmct.ALIGN_CENTER, font='button34_title')
     self.placeControl(self.aux_button, 1, 3, pad_x=0, pad_y=5)
     
     self.spotify_button = pyxbmct.Button('Spotify', alignment=pyxbmct.ALIGN_CENTER, font='button34_title')
     self.placeControl(self.spotify_button, 1, 4, pad_x=0, pad_y=5)
     
     self.spare_button = pyxbmct.Button('Spare', alignment=pyxbmct.ALIGN_CENTER, font='button34_title')
     self.placeControl(self.spare_button, 1, 5, pad_x=0, pad_y=5)
    def _placedCallback(self, window, *args, **kwargs):
        super(ColourPickerFull, self)._placedCallback(window, *args, **kwargs)

        self._colour_square = _ColourSquare(self._current_colour)
        self.placeControl(self._colour_square,
                          0,
                          5,
                          rowspan=self._num_rows,
                          columnspan=2)

        button_labels = ["Red", "Green", "Blue"]
        if self._alpha_selector:
            button_labels.insert(0, "Alpha")
        modify_colour_position = 2 if self._current_colour[0:2] == "0x" else 0

        for i, label_text in enumerate(button_labels):
            label_control = pyxbmct.Label(label_text)
            self.placeControl(label_control, i, 0)
            initial_value = int(
                self.
                _current_colour[modify_colour_position:modify_colour_position +
                                2],
                16,
            )
            callback = lambda value, pos=modify_colour_position: self._modify_colour(
                pos, value)
            slider = FakeSlider(default_value=initial_value,
                                keyboard_title=label_text)
            window.connect(slider, callback)
            self.placeControl(slider, i, 1, columnspan=4, pad_y=10)
            modify_colour_position += 2
Esempio n. 26
0
    def test_place_and_remove_control_callbacks(self):
        """
        Ensure that controls place and remove callbacks are called (only) when they are placed or removed
        """
        group = pyxbmct.Group(2, 4)

        control = pyxbmct.Label(None, None, None, None, None, None)
        control._placedCallback = mock.MagicMock()
        control._removedCallback = mock.MagicMock()

        self._window.placeControl(group, 0, 0)
        group.placeControl(control, 0, 0)

        with self.subTest("Removed callback not called (before removal)"):
            control._removedCallback.assert_not_called()

        group.removeControl(control)

        # Exact values and the fact that is called on placement are tested elsewhere
        with self.subTest("Placed callback called"):
            control._placedCallback.assert_called_once()

        with self.subTest("Control removed"):
            self._window.removeControl.assert_called_once_with(control)

        with self.subTest("Removed callback called once (after removal)"):
            control._removedCallback.assert_called_once_with(self._window)
Esempio n. 27
0
    def set_controls(self):
        """
            Set up UI controls
        """
        # __ Movie title
        self.labelTitle = pyxbmct.Label(self.title,
                                        alignment=pyxbmct.ALIGN_CENTER)
        self.placeControl(self.labelTitle, 0, 0, 1, 2)
        # ___ Movie thumbnail
        self.thumnailImg = pyxbmct.Image(self.thumbnail, aspectRatio=2)
        self.placeControl(self.thumnailImg, 1, 0, 8, 2)

        # ___ OK button
        self.ok_button = pyxbmct.Button('OK')
        self.placeControl(self.ok_button, 9, 0)
        # Connect OK button
        self.connect(self.ok_button, self.closePopup)

        # ___ Search again button
        self.search_button = pyxbmct.Button(
            constant.__addon__.getLocalizedString(80021))
        self.placeControl(self.search_button, 9, 1)
        # Connect Search again
        self.connect(self.search_button, self.searchAgain)

        # ___ Set initial focus.
        self.setFocus(self.ok_button)
Esempio n. 28
0
    def setup(self, stats_obj):
        progress = xbmcgui.DialogProgressBG()
        progress.create("This might take a minute")
        c1title = pyxbmct.Label('[B]Matchup[/B]')
        self.placeControl(c1title, 0, 0, columnspan=10, rowspan=2)
        team1name   = pyxbmct.Label('[B]%s[/B]' % (stats_obj['Team1']['Name']), alignment=pyxbmct.ALIGN_RIGHT)
        self.placeControl(team1name, 0, 10, columnspan=3, rowspan=2)

        team2name   = pyxbmct.Label('[B]%s[/B]' % (stats_obj['Team2']['Name']), alignment=pyxbmct.ALIGN_RIGHT)
        self.placeControl(team2name, 0, 13, columnspan=3, rowspan=2)

        teamstatslist = ['FG Made-Attempted', 'Field Goal %', '3PT Made-Attempted', 'Three Point %', 'FT Made-Attempted',
                         'Free Throw %', 'Total Rebounds', 'Offensive Rebounds', 'Defensive Rebounds', 'Assists', 'Steals',
                         'Blocks', 'Total Turnovers', 'Points Off Turnovers', 'Fast Break Points', 'Points in Paint',
                         'Personal Fouls', 'Technical Fouls', 'Flagrant Fouls']
        over = ['Offensive Rebounds', 'Defensive Rebounds', 'Points Off Turnovers', 'Technical Fouls', 'Flagrant Fouls']
        for i, ts in enumerate(teamstatslist):
            if ts in over:
                statName = pyxbmct.Label(ts)
                self.placeControl(statName, 2+i, 1, columnspan=9)
            else:
                statName = pyxbmct.Label('[B]%s[/B]' % ts)
                self.placeControl(statName, 2+i, 0, columnspan=10)

            t1val = pyxbmct.Label(stats_obj['Team1']['Stats'][ts], alignment=pyxbmct.ALIGN_RIGHT)
            t2val = pyxbmct.Label(stats_obj['Team2']['Stats'][ts], alignment=pyxbmct.ALIGN_RIGHT)
            self.placeControl(t1val, 2+i, 10, columnspan=3)
            self.placeControl(t2val, 2+i, 13, columnspan=3)
        progress.close()
Esempio n. 29
0
 def set_controls(self):
     ###Left Side###
     ###Section 1###
     ###  Money  ###
     ###Donations###
     self.Section1 = pyxbmct.Label('[B]If you have money to\nspare[/B]',
                                   alignment=pyxbmct.ALIGN_CENTER)
     self.placeControl(self.Section1, 0, 0, columnspan=10)
     self.menu = pyxbmct.List()
     self.placeControl(self.menu, 1, 0, rowspan=6, columnspan=10)
     self.menu.addItems([
         'Paypal', 'Bitcoin (BTC)', 'Bitcoin Cash (BCH)', 'Ethereum (ETH)',
         'Litecoin (LTC)'
     ])
     ###Section 2###
     ###Referral ###
     ###Donations###
     self.Section2 = pyxbmct.Label(
         '[B]You can donate for free\nif you own an android\ndevice[/B]',
         alignment=pyxbmct.ALIGN_CENTER)
     self.placeControl(self.Section2, 5, 0, rowspan=2, columnspan=10)
     self.menu2 = pyxbmct.List()
     self.placeControl(self.menu2, 7, 0, rowspan=10, columnspan=10)
     self.menu2.addItems(
         ['Bitcoin Spinner', 'Ethereum Spinner', 'Litecoin Spinner'])
     ###Right Side###
     ###   Main   ###
     ###  Detail  ###
     self.QRcode = pyxbmct.Image(paypal, aspectRatio=2)
     self.placeControl(self.QRcode, 0, 16, rowspan=3, columnspan=10)
     self.Addr = pyxbmct.Label(self.paypalAddr,
                               alignment=pyxbmct.ALIGN_CENTER)
     self.placeControl(self.Addr, 3, 11, columnspan=20)
     self.Balance = pyxbmct.Label('Total Donated:\n%s' % self.paypalValue,
                                  alignment=pyxbmct.ALIGN_CENTER)
     self.placeControl(self.Balance, 4, 16, rowspan=3, columnspan=10)
     self.Download = pyxbmct.Button('Download',
                                    alignment=pyxbmct.ALIGN_CENTER)
     self.placeControl(self.Download, 4, 16, rowspan=2, columnspan=10)
     self.connect(self.Download, self.downloadApp)
     self.Download.setVisible(False)
     self.Description = pyxbmct.Label('')
     self.placeControl(self.Description, 7, 11, rowspan=4, columnspan=20)
        def set_controls(self):

            # Username label
            self.username_label = pyxbmct.Label(control.lang(30152))
            self.placeControl(self.username_label, 0, 0)
            # Username input
            self.user_input = pyxbmct.Edit(control.lang(30152))
            self.placeControl(self.user_input, 1, 0)
            # Password label
            self.password_label = pyxbmct.Label(control.lang(30153))
            self.placeControl(self.password_label, 2, 0)
            # Password input
            self.pass_input = pyxbmct.Edit(control.lang(30153),
                                           isPassword=True)
            self.placeControl(self.pass_input, 3, 0)
            # Close button
            self.submit_button = pyxbmct.Button(control.lang(30154))
            self.placeControl(self.submit_button, 4, 0)
            self.connect(self.submit_button, lambda: self.submit(True))