Python xbmcgui.WindowXMLDialog() Examples

The following are 30 code examples of xbmcgui.WindowXMLDialog(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module xbmcgui , or try the search function .
Example #1
Source File: zhcnkbd.py    From plugin.video.xunleicloud with GNU General Public License v2.0 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        self.totalpage = 0
        self.nowpage = 0
        self.words = ''
        self.py = ''
        self.bg = 0
        self.ed = 20
        self.wordpgs = []   # word page metadata
        self.inputString = kwargs.get("default") or ""
        self.heading = kwargs.get("heading") or ""
        self.conn = httplib.HTTPConnection('olime.baidu.com')
        self.headers = {
            'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) {0}{1}'.format(
                'AppleWebKit/537.36 (KHTML, like Gecko) ',
                'Chrome/28.0.1500.71 Safari/537.36'),
        }
        xbmcgui.WindowXMLDialog.__init__(self) 
Example #2
Source File: xmldialogs.py    From plugin.video.netflix with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        self.skip_to = kwargs['skip_to']
        self.label = kwargs['label']

        self.action_exitkeys_id = [ACTION_PREVIOUS_MENU,
                                   ACTION_PLAYER_STOP,
                                   ACTION_NAV_BACK,
                                   ACTION_NOOP]

        if get_machine()[0:5] == 'armv7':
            xbmcgui.WindowXMLDialog.__init__(self)
        else:
            try:
                xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
            except Exception:  # pylint: disable=broad-except
                xbmcgui.WindowXMLDialog.__init__(self) 
Example #3
Source File: xmldialogs.py    From plugin.video.netflix with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        # Keep pin option, there is still some reference in the netflix code
        # self.current_pin = kwargs.get('pin')
        self.data = kwargs['data']
        self.rating_levels = kwargs['rating_levels']
        self.current_maturity = self.data['maturity']
        self.current_level_index = kwargs['current_level_index']
        self.profile_info = self.data['profileInfo']
        self.levels_count = len(self.rating_levels)
        self.status_base_desc = g.ADDON.getLocalizedString(30233)
        self.action_exitkeys_id = [ACTION_PREVIOUS_MENU,
                                   ACTION_PLAYER_STOP,
                                   ACTION_NAV_BACK]
        if get_machine()[0:5] == 'armv7':
            xbmcgui.WindowXMLDialog.__init__(self)
        else:
            try:
                xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
            except Exception:  # pylint: disable=broad-except
                xbmcgui.WindowXMLDialog.__init__(self) 
Example #4
Source File: xmldialogs.py    From plugin.video.netflix with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        self.videoid = kwargs['videoid']
        self.track_id_jaw = kwargs['track_id_jaw']
        self.title = kwargs.get('title', '--')
        self.user_rating = kwargs.get('user_rating', 0)
        # Netflix user rating thumb values
        # 0 = No rated
        # 1 = thumb down
        # 2 = thumb up
        self.action_exitkeys_id = [ACTION_PREVIOUS_MENU,
                                   ACTION_PLAYER_STOP,
                                   ACTION_NAV_BACK]
        if get_machine()[0:5] == 'armv7':
            xbmcgui.WindowXMLDialog.__init__(self)
        else:
            try:
                xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
            except Exception:  # pylint: disable=broad-except
                xbmcgui.WindowXMLDialog.__init__(self) 
Example #5
Source File: xmldialogs.py    From plugin.video.netflix with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        self.ctrl_list = None
        self.return_value = None
        self.title = kwargs['title']
        self.list_data = kwargs['list_data']
        self.preselect_guid = kwargs.get('preselect_guid')
        self.action_exitkeys_id = [ACTION_PREVIOUS_MENU,
                                   ACTION_PLAYER_STOP,
                                   ACTION_NAV_BACK]
        if get_machine()[0:5] == 'armv7':
            xbmcgui.WindowXMLDialog.__init__(self)
        else:
            try:
                xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
            except Exception:  # pylint: disable=broad-except
                xbmcgui.WindowXMLDialog.__init__(self) 
Example #6
Source File: window.py    From plugin.program.openwizard with GNU General Public License v3.0 6 votes vote down vote up
def show_speed_test(img):
    class SpeedTest(xbmcgui.WindowXMLDialog):

        def __init__(self, *args, **kwargs):
            self.imgfile = kwargs['img']

        def onInit(self):
            self.imagespeed = 101
            self.button = 201
            self.show_dialog()

        def show_dialog(self):
            self.setFocus(self.getControl(self.button))
            self.getControl(self.imagespeed).setImage(self.imgfile)

        def onClick(self, controlid):
            self.close()

        def onAction(self, action):
            if action.getId() in BACK_ACTIONS:
                self.close()

    popup = SpeedTest('SpeedTest.xml', CONFIG.ADDON_PATH, 'Default', img=img)
    popup.doModal()
    del popup 
Example #7
Source File: window.py    From plugin.program.openwizard with GNU General Public License v3.0 6 votes vote down vote up
def show_apk_warning(apk):
    class APKInstaller(xbmcgui.WindowXMLDialog):

        def __init__(self, *args, **kwargs):
            self.shut = kwargs['close_time']
            xbmc.executebuiltin("Skin.Reset(AnimeWindowXMLDialogClose)")
            xbmc.executebuiltin("Skin.SetBool(AnimeWindowXMLDialogClose)")

        def onClick(self, controlid):
            self.close_window()

        def onAction(self, action):
            if action.getId() in BACK_ACTIONS:
                self.close_window()

        def close_window(self):
            xbmc.executebuiltin("Skin.Reset(AnimeWindowXMLDialogClose)")
            xbmc.sleep(400)
            self.close()

    xbmc.executebuiltin('Skin.SetString(apkinstaller, Now that {0} has been downloaded[CR]Click install on the next window!)'.format(apk))
    popup = APKInstaller('APK.xml', CONFIG.ADDON_PATH, 'Default', close_time=34)
    popup.doModal()
    del popup 
Example #8
Source File: window.py    From plugin.program.openwizard with GNU General Public License v3.0 6 votes vote down vote up
def show_text_box(title, msg):
    class TextBox(xbmcgui.WindowXMLDialog):
        def onInit(self):
            self.title = 101
            self.msg = 102
            self.scrollbar = 103
            self.closebutton = 201
            
            self.setProperty('texture.color1', CONFIG.COLOR1)
            self.setProperty('texture.color2', CONFIG.COLOR2)
            self.setProperty('message.title', title)
            self.setProperty('message.msg', msg)

        def onClick(self, controlid):
            if controlid == self.closebutton:
                self.close()

        def onAction(self, action):
            if action.getId() in BACK_ACTIONS:
                self.close()

    tb = TextBox("text_box.xml", CONFIG.ADDON_PATH, 'Default', title=title, msg=msg)
    tb.doModal()
    del tb 
Example #9
Source File: infodialog.py    From script.skin.helper.service with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        xbmcgui.WindowXMLDialog.__init__(self)
        self.listitem = kwargs.get("listitem") 
Example #10
Source File: launcher_plugin.py    From advanced-launcher with GNU General Public License v2.0 5 votes vote down vote up
def __init__( self, *args, **kwargs ):
        xbmcgui.WindowXMLDialog.__init__( self, *args, **kwargs )
        xbmc.executebuiltin( "Skin.Reset(AnimeWindowXMLDialogClose)" )
        xbmc.executebuiltin( "Skin.SetBool(AnimeWindowXMLDialogClose)" )
        self.listing = kwargs.get( "listing" ) 
Example #11
Source File: ChineseKeyboard.py    From xbmc-addons-chinese with GNU General Public License v2.0 5 votes vote down vote up
def __init__( self, *args, **kwargs ):
        self.Kodi14 = False
        self.CTL_NUM_START = 48
        self.CTL_NUM_END   = 57
        self.strEdit = kwargs.get("default").decode('utf-8') or u""
        self.strHeading = kwargs.get("heading") or ""
        self.bIsConfirmed = False
        self.bChinese = False
        self.keyType = LOWER
        self.words = []
        self.hzcode = ''
        self.pos = 0
        self.num = 0
        self.HTTP = HttpClient(BAIDU_API_BASE)
        xbmcgui.WindowXMLDialog.__init__(self) 
Example #12
Source File: addon.py    From xbmc-addons-chinese with GNU General Public License v2.0 5 votes vote down vote up
def __init__( self, *args, **kwargs):
        self.resolution = settings['resolution']
        self.language = settings['language']
        self.play = settings['play']
        self.inited = False
        #BaseWindowDialog.__init__( self )
        xbmcgui.WindowXMLDialog.__init__(self) 
Example #13
Source File: addon.py    From xbmc-addons-chinese with GNU General Public License v2.0 5 votes vote down vote up
def onInit(self):
        #BaseWindowDialog.onInit(self)
        xbmcgui.WindowXMLDialog.onInit(self)
        self.init() 
Example #14
Source File: addon.py    From xbmc-addons-chinese with GNU General Public License v2.0 5 votes vote down vote up
def onAction(self,action):
        #BaseWindowDialog.onAction(self, action)
        xbmcgui.WindowXMLDialog.onAction(self, action)
        Id = action.getId()
        if Id == ACTION_MOVE_LEFT or  Id == ACTION_MOVE_RIGHT or Id == ACTION_MOUSE_MOVE:
            self.updateSelection(self.getFocusId())
        elif Id == ACTION_PARENT_DIR or Id == ACTION_PREVIOUS_MENU:
            self.close()
        else:
            return False 
Example #15
Source File: DialogDownloadProgress.py    From ru with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
        self.doModal() 
Example #16
Source File: RussianKey.py    From ru with GNU General Public License v2.0 5 votes vote down vote up
def __init__( self, *args, **kwargs ):
        self.totalpage = 1
        self.nowpage = 0
        self.words = ''
        self.wordperpage = WORD_PER_PAGE[0]
        self.inputString = kwargs.get("default") or ""
        self.heading = kwargs.get("heading") or ""
        xbmcgui.WindowXMLDialog.__init__(self) 
Example #17
Source File: wmodal.py    From repository.evgen_dev.xbmc-addons with GNU General Public License v2.0 5 votes vote down vote up
def doModal(self, movieInfo):
        self.movieInfo = movieInfo
        xbmcgui.WindowXMLDialog.doModal(self) 
Example #18
Source File: dialogselect.py    From script.skin.helper.service with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        xbmcgui.WindowXMLDialog.__init__(self)
        self.listing = kwargs.get("listing")
        self.windowtitle = kwargs.get("windowtitle")
        self.multiselect = kwargs.get("multiselect")
        self.richlayout = kwargs.get("richlayout", False)
        self.getmorebutton = kwargs.get("getmorebutton", "")
        self.autofocus_id = kwargs.get("autofocusid", 0)
        self.autofocus_label = kwargs.get("autofocuslabel", "")
        self.totalitems = 0
        self.result = None 
Example #19
Source File: searchdialog.py    From script.skin.helper.service with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        self.mutils = MetaDataUtils()
        xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs) 
Example #20
Source File: StillWatchingInfo.py    From service.nextup.notification with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        self.action_exitkeys_id = [10, 13]
        if OS_MACHINE[0:5] == 'armv7':
            xbmcgui.WindowXMLDialog.__init__(self)
        else:
            xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs) 
Example #21
Source File: UnwatchedInfo.py    From service.nextup.notification with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        if OS_MACHINE[0:5] == 'armv7':
            xbmcgui.WindowXMLDialog.__init__(self)
        else:
            xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs) 
Example #22
Source File: NextUpInfo.py    From service.nextup.notification with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        if OS_MACHINE[0:5] == 'armv7':
            xbmcgui.WindowXMLDialog.__init__(self)
        else:
            xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs) 
Example #23
Source File: xmldialogs.py    From plugin.video.netflix with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        self.skip_to = kwargs['skip_to']
        self.label = kwargs['label']
        if OS_MACHINE[0:5] == 'armv7':
            xbmcgui.WindowXMLDialog.__init__(self)
        else:
            xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs) 
Example #24
Source File: captcha.py    From plugin.video.xunleicloud with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        self.totalpage = 1
        self.nowpage = 0
        self.words = ''
        self.url = kwargs.get("url")
        self.inputString = kwargs.get("default") or ""
        self.heading = kwargs.get("heading") or ""
        # self.captcha = kwargs.get( "captcha" ) or ""
        self.captcha, self.verify_key = self.initializeImage()
        xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs) 
Example #25
Source File: DialogXml.py    From repository.evgen_dev.xbmc-addons with GNU General Public License v2.0 5 votes vote down vote up
def doModal(self, movieInfo):
        self.movieInfo = movieInfo
        xbmcgui.WindowXMLDialog.doModal(self) 
Example #26
Source File: DialogReviews.py    From repository.evgen_dev.xbmc-addons with GNU General Public License v2.0 5 votes vote down vote up
def doModal(self, movieHtml):
        self.movieHtml = movieHtml
        xbmcgui.WindowXMLDialog.doModal(self) 
Example #27
Source File: serverconnect.py    From plugin.video.emby with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):

        xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs) 
Example #28
Source File: window.py    From plugin.program.openwizard with GNU General Public License v3.0 5 votes vote down vote up
def show_qr_code(layout, imagefile, message):
    class QRCode(xbmcgui.WindowXMLDialog):
        def __init__(self, *args, **kwargs):
            self.image = kwargs["image"]
            self.text = kwargs["text"]

        def onInit(self):
            self.imagecontrol = 501
            self.textbox = 502
            self.okbutton = 503
            self.title = 504
            self.show_dialog()

        def show_dialog(self):
            self.getControl(self.imagecontrol).setImage(self.image)
            self.getControl(self.textbox).setText(self.text)
            self.getControl(self.title).setLabel(CONFIG.ADDONTITLE)
            self.setFocus(self.getControl(self.okbutton))

        def onClick(self, controlid):
            if controlid == self.okbutton:
                self.close()

        def onAction(self, action):
            if action.getId() in BACK_ACTIONS:
                self.close()

    qr = QRCode(layout, CONFIG.ADDON_PATH, 'Default', image=imagefile, text=message)
    qr.doModal()
    del qr 
Example #29
Source File: window.py    From plugin.program.openwizard with GNU General Public License v3.0 5 votes vote down vote up
def show_contact(msg=""):
    class ContactWindow(xbmcgui.WindowXMLDialog):
        def __init__(self, *args, **kwargs):
            self.title = CONFIG.THEME3.format(kwargs["title"])
            self.image = kwargs["image"]
            self.fanart = kwargs["fanart"]
            self.msg = CONFIG.THEME2.format(kwargs["msg"])

        def onInit(self):
            self.fanartimage = 101
            self.titlebox = 102
            self.imagecontrol = 103
            self.textbox = 104
            self.scrollcontrol = 105
            self.show_dialog()

        def show_dialog(self):
            self.getControl(self.imagecontrol).setImage(self.image)
            self.getControl(self.fanartimage).setImage(self.fanart)
            self.getControl(self.fanartimage).setColorDiffuse('9FFFFFFF')
            self.getControl(self.textbox).setText(self.msg)
            self.getControl(self.titlebox).setLabel(self.title)
            self.setFocusId(self.scrollcontrol)

        def onAction(self, action):
            if action.getId() in BACK_ACTIONS:
                self.close()

    cw = ContactWindow("Contact.xml", CONFIG.ADDON_PATH, 'Default', title=CONFIG.ADDONTITLE, fanart=CONFIG.CONTACTFANART,
                  image=CONFIG.CONTACTICON, msg=msg)
    cw.doModal()
    del cw 
Example #30
Source File: osd.py    From plugin.audio.spotify with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        self.metadatautils = MetadataUtils()
        xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)