Kodi Community Forum

Full Version: launching add-ons
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to allow launching add-ons from the homescreen menu trough user defined shortcuts.

However, the content type can differ per shortcut depending on what add-on is defined as a shortcut. It can be music, video or a program.

So for instance in skin settings I'll have:

PHP Code:
<control type="button" id="217">
    <
width>557</width>
    <
label2>[i]$INFO[Skin.String(addonsmenu.addon5.path)][/i]</label2>
    <
label>-$LOCALIZE[31977]</label>
    <
onclick>Skin.SetAddOn(addonsmenu.addon5.path,xbmc.python.pluginsource)</onclick>
    <
enable>Skin.HasSetting(addonsmenu.addon5)</enable>
    <
visible>Skin.HasSetting(addonsmenu.addon5)</visible>
    <include>
dialog_Button-list</include>
</
control

But then I would like to use ActivateWindow in the home menu:

PHP Code:
<item id="5">
    <
label>$INFO[Skin.String(addonsmenu.5.label)]</label>
    <
onclick>ActivateWindow(Videos,plugin://$INFO[Skin.String(addonsmenu.addon5.path)],return)</onclick>
    
<visible>Skin.HasSetting(addonsmenu.addon5)</visible>
</
item

This works, even if the user defined add-on is not a video add-on. However it's not correct obviously. Plus, it will screw up my window titles because it will say it's a video add-on when it obviously is not.

Would there be a way to have the window activation be dependant on the type of add-on? Or perhaps something like:

PHP Code:
<onclick>ActivateWindow(Addons,plugin://$INFO[Skin.String(addonsmenu.addon6.path)],return)</onclick> 
RunAddon($INFO[Skin.String(addonsmenu.addon6.path)])

if plugin - it will launch proper window, if script - it will just run it
I see I have some wiki catchup reading to do Blush
Great, thanks Pieh Wink
in eden nightlies its like this
Quote:RunAddon(ID)
where id is what you get from Skin.SetAddOn
And it will auto open the window or run the script depending on what it is
doh too slow