Can we add stuff to the context menu yet?
#1
I want to make an addon that allows me to select a video and perform an operation on it before watching (if I choose this option from the context menu). Is it possible? How would I go about it?
Reply
#2
I'd link to the Python docs, but they're down, soo...

Code:
listitem.addContextMenuItems([('Label', 'XBMC.RunScript(blah)'])
Reply
#3
Here's an example of it in use in an addon: https://github.com/spudsdude/XBMC-Flicks...ue.py#L147
Reply
#4
Caveat: you can only add things to the context menu within your own add-on ATM, not in other addons or the global menu. There is a pull request that adds that ability but it hasn't been approved yet
Reply
#5
You mean this pull request?

Currently you can hack into the global context menu with a skin modification to DialogContextMenu.xml like the Play Locally addon.

Code:
<control type="button" id="1001">
    <onclick>RunScript(script.name, dosomething)</onclick>
    <label lang="en">Do something</label>
    <visible>System.HasAddon(script.name)</visible>
</control>

This is not at all user friendly, native support is much needed.
Reply

Logout Mark Read Team Forum Stats Members Help
Can we add stuff to the context menu yet?1