Kodi Community Forum

Full Version: Select multiple files in a browse dialog
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

I want to create an addon, where I can select multiple files.
I already tried using xbmcgui.Dialog().browseMultiple with no luck.

My code:
PHP Code:
dialog xbmcgui.Dialog()
files dialog.browseMultiple(1'Select files''files'
The documentation says: "returns tuple of marked filenames as a string"

It returns a tuple, but i can't mark multiple files, only select one.

I'm using Krypton Beta 5, it neither works in Jarvis.

What am I doing wrong? Is this even possible with Kodi the addon API?

Thanks for the replies!
well, it does work... if you can figure out how to :-)
when you want to select multiple items, you need to do so by pressing the space bar on your keyboard.

i have to admit, this is far from intuitive (and it's not even possible to do this with a remote control).
everywhere else in kodi where multiselect is applicable, you can simply click on items to select them.
(2016-11-29, 19:31)ronie Wrote: [ -> ]well, it does work... if you can figure out how to :-)
when you want to select multiple items, you need to do so by pressing the space bar on your keyboard.

i have to admit, this is far from intuitive (and it's not even possible to do this with a remote control).
everywhere else in kodi where multiselect is applicable, you can simply click on items to select them.

You could build a simple method for simple multi select. Basically you would select every item a user clicks on and only deselect when the click on it again. Keep an internal map of selected indexes. If you are familiar with extjs they have a similar method set using a trigger. Would be a nice feature in kodi for those that do not use keyboards.
(2016-11-29, 19:31)ronie Wrote: [ -> ]well, it does work... if you can figure out how to :-)
when you want to select multiple items, you need to do so by pressing the space bar on your keyboard.

i have to admit, this is far from intuitive (and it's not even possible to do this with a remote control).
everywhere else in kodi where multiselect is applicable, you can simply click on items to select them.

Thank you very much!
It's working now.

I'll maybe use a hack to make it rc compatible, until it gets fixed in the core.
(2016-11-29, 19:36)Protocol-X Wrote: [ -> ]
(2016-11-29, 19:31)ronie Wrote: [ -> ]well, it does work... if you can figure out how to :-)
when you want to select multiple items, you need to do so by pressing the space bar on your keyboard.

i have to admit, this is far from intuitive (and it's not even possible to do this with a remote control).
everywhere else in kodi where multiselect is applicable, you can simply click on items to select them.

You could build a simple method for simple multi select. Basically you would select every item a user clicks on and only deselect when the click on it again. Keep an internal map of selected indexes. If you are familiar with extjs they have a similar method set using a trigger. Would be a nice feature in kodi for those that do not use keyboards.

You mean, it should be implemented in the core, not in my addon, right?
(2016-11-29, 23:17)ronie Wrote: [ -> ]proposed fix in core: https://github.com/xbmc/xbmc/pull/11011

Thanks! It was fast. Blush
(2016-11-29, 22:43)ata2001 Wrote: [ -> ]
(2016-11-29, 19:36)Protocol-X Wrote: [ -> ]
(2016-11-29, 19:31)ronie Wrote: [ -> ]well, it does work... if you can figure out how to :-)
when you want to select multiple items, you need to do so by pressing the space bar on your keyboard.

i have to admit, this is far from intuitive (and it's not even possible to do this with a remote control).
everywhere else in kodi where multiselect is applicable, you can simply click on items to select them.

You could build a simple method for simple multi select. Basically you would select every item a user clicks on and only deselect when the click on it again. Keep an internal map of selected indexes. If you are familiar with extjs they have a similar method set using a trigger. Would be a nice feature in kodi for those that do not use keyboards.

You mean, it should be implemented in the core, not in my addon, right?

Well the best solution would be the core, but you could always build something custom. Core is always preferable as user would have the same feature in all addons I have had to build a few custom solutions due to Limitations and it is not always the best solution. But glad to see Ronie has a solution coming your way Smile