Plugin: Ask for user input
#1
I can't find it in the forum or the wiki, is there a way to ask for a user to input some text in a plugin?

Basically I want to ask a user for a string, then search a website based on that string.

Thanks.
Reply
#2
Various plugins do this - basically you pop up the virtual keyboard to grab the string.

Take a nosy through the youtube plugin as an example perhaps? A simple example where this is done that we can add to the docs would be useful.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
MrFinn Wrote:I can't find it in the forum or the wiki, is there a way to ask for a user to input some text in a plugin?

Basically I want to ask a user for a string, then search a website based on that string.

Thanks.

Here is a sample
Code:
#########################################################
# Function  : GUIEditExportName                         #
#########################################################
# Parameter :                                           #
#                                                       #
# name        sugested name for export                  #
#                                                       #
# Returns   :                                           #
#                                                       #
# name        name of export excluding any extension    #
#                                                       #
#########################################################
def GUIEditExportName(name):

    exit = True
    while (exit):
          kb = xbmc.Keyboard('default', 'heading', True)
          kb.setDefault(name)
          kb.setHeading(__language__(33223))
          kb.setHiddenInput(False)
          kb.doModal()
          if (kb.isConfirmed()):
              name_confirmed  = kb.getText()
              name_correct = name_confirmed.count(' ')
              if (name_correct):
                 GUIInfo(2,__language__(33224))
              else:
                   name = name_confirmed
                   exit = False
          else:
              GUIInfo(2,__language__(33225))
    return(name)
  
#########################################################
Reply
#4
Nice, that worked great. Thanks.
Reply

Logout Mark Read Team Forum Stats Members Help
Plugin: Ask for user input0