Kodi Community Forum

Full Version: xbmcgui.Dialog().browse
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Is there a way to make xbmcgui.Dialog().browse display all network locations? Right now, it only displays local directories, but I want to display everything, like you would normally see when launching the file browser window (which includes smb/nfs locations, etc)

http://mirrors.kodi.tv/docs/python-docs/...log-browse

As a current workaround, I'm calling xbmc.executebuiltin('Skin.SetPath(settings)') - but it doesn't allow me to control the header which is displayed as Browse to image folder. It would be great to have this working with the Kodi api for python. Any tips?
I'd need this as well Smile

BTW, when you do xbmc.executebuiltin('Skin.SetPath(settings)', how do you get the result which user selected??
please don't use that method.
addons should store whatever they need inside their own addon_data folder or addon settings.

never store stuff inside settings of other addons or skins.
I know, but there is no other way to get the browse dialog...? Is there something similar for the addon? Like xbmc.executebuiltin('Addon.SetPath(settings)') ??

D.
@ronie

I don't necessarily want to use the workaround. Any idea how to achieve the same dialog displaying network (smb/nfs, etc) via the Kodi api?

Otherwise, I guess the only real way is to create an add-on setting type folder, but it's not really flexible: http://kodi.wiki/view/Add-on_settings#ty...2folder.22

I don't understand how this is not a thing in the Kodi api... Why is the only option to allow the user to browse by "source"... How useless Wink

Sent from my iPhone
(2016-09-21, 20:24)angelblue05 Wrote: [ -> ]Otherwise, I guess the only real way is to create an add-on setting type folder, but it's not really flexible: http://kodi.wiki/view/Add-on_settings#ty...2folder.22


Hmm, not a bad idea at all!
Skin.SetPath() will set a skin setting.

<setting type="folder" ...> will set an addon setting.

as far as i can see they both provide similar functionality and both can access smb shares.
what kind of functionality are you missing?
@ronie thanks for your reply as usual.

My main concern is to control what happens before displaying the browse dialog. The purpose of the dialog, in my case, is to help our Emby users give Kodi access to their Emby shares by properly entering their network credentials when Kodi prompts them to.

This is why I need a regular browse dialog which contains network entries such as smb/nfs. Our Emby users are not always adept with Kodi, so I want to provide an easy way to get this done without having users fumbling around Kodi. Unfortunately with the add-on settings "folder" type, there's no way to add a simple dialog to provide an explanation as to what the user is expected to do once the browse dialog is open. But I could live with only having the browse dialog, I guess I was just hoping for a bit of flexibility.

Do you any suggestions as to how I could provide such functionality to new Kodi but current Emby users? Smile


Sent from my iPhone
i dug around in our source code for a bit, and python settings basically behave the same as kodi settings.
they use the settings label as the header for the browse dialog.

i'm not sure why you can't browse smb:// shares through xbmcgui.Dialog().browse(), i find it a bit odd indeed.
i'll check if it's easy to add this functionality and pr it.
Thanks a lot for taking the time to look into this. It's really appreciated.


Sent from my iPhone
been a while, but not forgotten: https://github.com/xbmc/xbmc/pull/11420
This is great news! Thanks Ronie
I doesn't work for me. I still get no smb:// or nfs:// lines in the browse window (or equivalent). Do I need to do do something extra?

I'm using win 7 and Kodi 17.1

This is the code I use:
Code:
browse_dialog = xbmcgui.Dialog()
iso_file = browse_dialog.browse(type=1, heading='BIU Builder - Select bluray iso', shares='files', mask='.iso', useThumbs=False, treatAsFolder=False, defaultt='F:', enableMultiple=False)

Some other problems (I probably do something wrong, but what?):

When I use this code while no iso is mounted through virtual clonedrive, all is ok (besides that I can't select nfs & smb drives). I can see and select the C:, F:, .... and mapped drives and home folder.
When I mount a (bluray) iso with virtual clonedrive, and then run the test code, I only get to see the root of the mounted iso. I can browse inside this mounted iso. But I can't go 'up' to the C: or other drives anymore!

How can I preselect a directory? I always get all drives (if no iso is mounted). How can I open de dialog in 'F:' ?
setting shares='F:\\' gives me a "RuntimeError: Error: GetSources given F:\ is NULL."
setting shares='F:' gives me a "RuntimeError: Error: GetSources given F: is NULL."

My sources.xml contains a F: source.
Code:
<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>X:</name>
            <path pathversion="1">X:\</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>W:</name>
            <path pathversion="1">W:\</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>Over_te_copieren</name>
            <path pathversion="1">F:\Over_te_copieren\</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>E:</name>
            <path pathversion="1">E:\</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>__Blu-Ray</name>
            <path pathversion="1">E:\__Blu-Ray\</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>F:</name>
            <path pathversion="1">F:\</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>Kodi_Test_Movies</name>
            <path pathversion="1">nfs://192.168.157.75/mnt/user/Kodi_Test_Movies/</path>
            <allowsharing>true</allowsharing>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
    </music>
    <pictures>
        <default pathversion="1"></default>
    </pictures>
    <files>
        <default pathversion="1"></default>
    </files>
</sources>
Am I doing something wrong?

Nobody has any idea?

If it's working for you, what addon so i can check the code to see what I did wrong?

What about the other 2 problems?...
(2017-01-11, 05:19)ronie Wrote: [ -> ]been a while, but not forgotten: https://github.com/xbmc/xbmc/pull/11420

Ehm, ofcourse it doesn't work.

I looked at the PR again and it hasn't been merged!

Ronie, I assume this will be for Kodi 18, not in Kodi 17.2?

Thanks!
Pages: 1 2