Python xbmcgui.ALPHANUM_HIDE_INPUT Examples

The following are 8 code examples of xbmcgui.ALPHANUM_HIDE_INPUT(). 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: kodi.py    From script.module.urlresolver with GNU General Public License v2.0 6 votes vote down vote up
def get_keyboard_new(heading, default='', hide_input=False):

    """
    This function has been in support since XBMC Gotham v13
    """

    if hide_input is False:
        hide_input = 0
    elif hide_input is True:
        hide_input = xbmcgui.ALPHANUM_HIDE_INPUT

    dialog = xbmcgui.Dialog()

    keyboard = dialog.input(heading, defaultt=default, type=0, option=hide_input)

    if keyboard:

        return keyboard

    return None 
Example #2
Source File: downloader.py    From plugin.video.themoviedb.helper with GNU General Public License v3.0 6 votes vote down vote up
def open_url(self, url, stream=False, check=False, cred=None, count=0):
        if not url:
            return False

        valid = self.check_url(url, cred)

        if not valid:
            return False
        if check:
            return True
        if valid == 'auth' and not cred:
            cred = (xbmcgui.Dialog().input(heading=xbmc.getLocalizedString(1014)) or '', xbmcgui.Dialog().input(heading=xbmc.getLocalizedString(733), option=xbmcgui.ALPHANUM_HIDE_INPUT) or '')

        response = requests.get(url, timeout=10.000, stream=stream, auth=cred)
        if response.status_code == 401:
            if count > 2 or not xbmcgui.Dialog().yesno(self.addon.getAddonInfo('name'), self.addon.getLocalizedString(32056), yeslabel=self.addon.getLocalizedString(32057), nolabel=xbmc.getLocalizedString(222)):
                xbmcgui.Dialog().ok(self.addon.getAddonInfo('name'), self.addon.getLocalizedString(32055))
                return False
            count += 1
            cred = (xbmcgui.Dialog().input(heading=xbmc.getLocalizedString(1014)) or '', xbmcgui.Dialog().input(heading=xbmc.getLocalizedString(733), option=xbmcgui.ALPHANUM_HIDE_INPUT) or '')
            response = self.open_url(url, stream, check, cred, count)
        return response 
Example #3
Source File: kodi.py    From script.module.resolveurl with GNU General Public License v2.0 6 votes vote down vote up
def get_keyboard_new(heading, default='', hide_input=False):

    """
    This function has been in support since XBMC Gotham v13
    """

    if hide_input is False:
        hide_input = 0
    elif hide_input is True:
        hide_input = xbmcgui.ALPHANUM_HIDE_INPUT

    dialog = xbmcgui.Dialog()

    keyboard = dialog.input(heading, defaultt=default, type=0, option=hide_input)

    if keyboard:

        return keyboard

    return None 
Example #4
Source File: dialogs.py    From plugin.video.netflix with MIT License 5 votes vote down vote up
def ask_for_password():
    """Ask the user for the password"""
    return g.py2_decode(xbmcgui.Dialog().input(
        heading=common.get_local_string(30004),
        type=xbmcgui.INPUT_ALPHANUM,
        option=xbmcgui.ALPHANUM_HIDE_INPUT)) or None 
Example #5
Source File: default.py    From xbmc-addons-chinese with GNU General Public License v2.0 5 votes vote down vote up
def login_dialog():
    username = dialog.input(u'用户名:', type=xbmcgui.INPUT_ALPHANUM)
    password = dialog.input(u'密码:', type=xbmcgui.INPUT_ALPHANUM, option=xbmcgui.ALPHANUM_HIDE_INPUT)
    if username and password:
        cookie,tokens = get_auth.run(username,password)
        if tokens:
            save_user_info(username,password,cookie,tokens)
            homemenu = plugin.get_storage('homemenu')
            homemenu.clear()
            dialog.ok('',u'登录成功', u'点击返回首页并耐心等待')
            items = [{'label': u'<< 返回首页', 'path': plugin.url_for('main_menu')}]
            return plugin.finish(items, update_listing=True)
    else:
        dialog.ok('Error',u'用户名或密码不能为空')
    return None 
Example #6
Source File: addon.py    From plugin.audio.tidal2 with GNU General Public License v3.0 5 votes vote down vote up
def login():
    username = addon.getSetting('username')
    password = addon.getSetting('password')
    subscription_type = [SubscriptionType.hifi, SubscriptionType.premium][int('0' + addon.getSetting('subscription_type'))]

    if not username or not password:
        # Ask for username/password
        dialog = xbmcgui.Dialog()
        username = dialog.input(_T(30008), username)
        if not username:
            return
        password = dialog.input(_T(30009), option=xbmcgui.ALPHANUM_HIDE_INPUT)
        if not password:
            return
        selected = dialog.select(_T(30010), [SubscriptionType.hifi, SubscriptionType.premium])
        if selected < 0:
            return
        subscription_type = [SubscriptionType.hifi, SubscriptionType.premium][selected]

    ok = session.login(username, password, subscription_type)
    if ok and (not addon.getSetting('username') or not addon.getSetting('password')):
        # Ask about remembering username/password
        dialog = xbmcgui.Dialog()
        if dialog.yesno(plugin.name, _T(30209)):
            addon.setSetting('username', username)
            addon.setSetting('password', password)
        else:
            addon.setSetting('password', '')
    if not ok:
        xbmcgui.Dialog().notification(plugin.name, _T(30253) , icon=xbmcgui.NOTIFICATION_ERROR)
    xbmc.executebuiltin('Container.Refresh()') 
Example #7
Source File: default.py    From plugin.video.bdyun with GNU General Public License v3.0 5 votes vote down vote up
def login_dialog():
    username = dialog.input(u'用户名:', type=xbmcgui.INPUT_ALPHANUM)
    password = dialog.input(u'密码:', type=xbmcgui.INPUT_ALPHANUM, option=xbmcgui.ALPHANUM_HIDE_INPUT)
    if username and password:
        cookie,tokens = get_auth.run(username,password)
        if tokens:
            save_user_info(username,password,cookie,tokens)
            homemenu = plugin.get_storage('homemenu')
            homemenu.clear()
            dialog.ok('',u'登录成功', u'点击返回首页并耐心等待')
            items = [{'label': u'<< 返回首页', 'path': plugin.url_for('main_menu')}]
            return plugin.finish(items, update_listing=True)
    else:
        dialog.ok('Error',u'用户名或密码不能为空')
    return None 
Example #8
Source File: Dialogs.py    From plugin.video.netflix with MIT License 5 votes vote down vote up
def show_password_dialog(self):
        """
        Asks the user for its Netflix password

        :returns: str - Netflix password
        """
        dlg = xbmcgui.Dialog()
        dialog = dlg.input(
            heading=self.get_local_string(string_id=30004),
            type=xbmcgui.INPUT_ALPHANUM,
            option=xbmcgui.ALPHANUM_HIDE_INPUT)
        return dialog