Kodi Community Forum

Full Version: more info about Dialog.browse and Dialog.numeric please
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi !
I need to use the Dialog.browse xbmcgui function and would like some more features. I had a look in the xbmcgui python doc and saw :
Code:
browse(type,heading, shares[, extra]) -- Show a dialog 'Browse'.
    
    type     : interger value
    heading  : string or unicode string
    shares   : string or unicode string
    extra    : (optional) string value
    returns String to the location when user pressed 'OK'
Does anybody can tell me what can be set in the 'extra' parameter ?
I need the browse function for files and I would like to be able to filter files extensions.
I would like to be able to start the browser in a path and not only at the root, is it possible ?

This is the command I use :
Code:
xbmcgui.Dialog().browse(1,"prompt","files")
- 1 is for file selecting
- "prompt" is to prompt user
- "files" is to enable ALL files (not only pic files or videos files)

thanks for any help

PS:
I need the Dialog.numeric as well. The online help from thor918 is not clear enough about 'type' parameter. Where can I get more infos ?
browse(...) browse(type, heading, shares[, mask, useThumbs, treatAsFolder]) -- Show a 'Browse' dialog.

type : integer - the type of browse dialog.
heading : string or unicode - dialog heading.
shares : string or unicode - from sources.xml. (i.e. 'myprograms')
mask : [opt] string or unicode - '|' separated file mask. (i.e. '.jpg|.png')
useThumbs : [opt] boolean - if True autoswitch to Thumb view if files exist.
treatAsFolder : [opt] boolean - if True playlists and archives act as folders.

Types:
0 : ShowAndGetDirectory
1 : ShowAndGetFile
2 : ShowAndGetImage
3 : ShowAndGetWriteableDirectory

*Note, Returns filename and/or path as a string to the location of the highlighted item,
if user pressed 'Ok' or a masked item was selected.

example:
- dialog = xbmcgui.Dialog()
- fn = dialog.browse(1, 'Xbox Media Center', 'pictures', '.jpg|.png')
numeric(...) numeric(type, heading) -- Show a 'Numeric' dialog.

type : integer - the type of numeric dialog.
heading : string or unicode - dialog heading.

Types:
0 : ShowAndGetNumber
1 : ShowAndGetDate
2 : ShowAndGetTime
3 : ShowAndGetIPAddress

*Note, Returns the entered data as a string.

example:
- dialog = xbmcgui.Dialog()
- d = dialog.numeric(1, 'Enter date of birth')

*The html docs in cvs are up to date
Thanks a lot !!!

I'm going to search for thes up to date html !

See ya
OK, it works great.

Only one thing to be sure, it is impossible to select a folder as a base for browsing ?
Cause right now, all I can do is to set the shortcuts for the section I choose in my call to the browser Dialog (in my example further up, Files will show every shorcuts I've got for the File section)