launching add-ons

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Jeroen Offline
Skilled Skinner
Posts: 1,885
Joined: Feb 2008
Reputation: 4
Location: The Netherlands
Post: #1
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> 
find quote
pieh Offline
Team-XBMC Member
Posts: 672
Joined: Aug 2010
Reputation: 13
Location: Poland
Post: #2
RunAddon($INFO[Skin.String(addonsmenu.addon6.path)])

if plugin - it will launch proper window, if script - it will just run it

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

My previous forum/trac nickname: grajen3
find quote
Jeroen Offline
Skilled Skinner
Posts: 1,885
Joined: Feb 2008
Reputation: 4
Location: The Netherlands
Post: #3
I see I have some wiki catchup reading to do Blush
Great, thanks Pieh Wink
find quote
Jezz_X Offline
Team-XBMC Skinner
Posts: 5,269
Joined: Jun 2006
Reputation: 55
Location: Earth
Post: #4
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

Skins I have done....
[Image: skinsq.png]
And others in the past...

Want to know what I'm working on currently? Check me out on Google+
find quote
Jezz_X Offline
Team-XBMC Skinner
Posts: 5,269
Joined: Jun 2006
Reputation: 55
Location: Earth
Post: #5
doh too slow

Skins I have done....
[Image: skinsq.png]
And others in the past...

Want to know what I'm working on currently? Check me out on Google+
find quote