Context Menu
#1
Hi all,

First time developing in python for XBMC and need some beginner's guidance on how to implement a certain feature.

Can anyone please point me in the right direction for how to add an item to the context menu for a movie or TV episode? Once my plugin is installed I'd like that there is an item in all of these context menu's that will then execute an action within my plugin when clicked.

Also, if I want to write something that doesn't have it's own GUI, would this be a script or a plugin?

Appreciate the guidance and help.


Cheers,
Jordan
Reply
#2
(2013-12-15, 09:56)JWindebank Wrote: Also, if I want to write something that doesn't have it's own GUI, would this be a script or a plugin?

plugins don't have their own gui, they simple use the current skin to display their listings.

strictly speaking, there are plenty of scripts that don't have a gui either, simply because they don't need one.
but , if needed, scripts can provide their own gui.

check our python docs for info on adding context menu items:
http://mirrors.xbmc.org/docs/python-docs...tMenuItems
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Thanks Ronie, that is helpful.

Two more questions and I should be right. Smile

1. How do I specify that I want to only add the context menu item for movies or TV episodes?

I'm assuming I need to somehow detect the appropriate ListItem at runtime?

2. How do I actually run the ListItem.addContextMenuItems() function at some point so that when XBMC starts it knows to run this whenever it renders a context menu? Is there some form of xbmc.onLoad() event I can hook in to?

Thanks heaps.
Reply
#4
(2013-12-15, 13:35)JWindebank Wrote: 2. How do I actually run the ListItem.addContextMenuItems() function at some point so that when XBMC starts it knows to run this whenever it renders a context menu? Is there some form of xbmc.onLoad() event I can hook in to?

Ok have worked out I can set the script up as a service so it runs at launch, will play with this now.

http://wiki.xbmc.org/index.php?title=HOW...g_services

Still need to work out the context menu though. Can potentially just loop and try to detect the listItem type or something similar?
Reply
#5
hmm... i've read your first post again and i think i misunderstood what you're trying to accomplish.

plugins can only add context menu items to the content they provide themselves.
they can't add context menu items the users movies or episodes or anything else.


this might change in future versions of xbmc, there's some work-in-progress code
to make it possible: 1654 (PR)

but for now,the only thing you can do, is ask skinners to add a context menu item to their skin that will run your addon.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#6
(2013-12-15, 14:50)ronie Wrote: hmm... i've read your first post again and i think i misunderstood what you're trying to accomplish.

plugins can only add context menu items to the content they provide themselves.
they can't add context menu items the users movies or episodes or anything else.


this might change in future versions of xbmc, there's some work-in-progress code
to make it possible: 1654 (PR)

but for now,the only thing you can do, is ask skinners to add a context menu item to their skin that will run your addon.

Thanks Ronie. I'll take a look at adding to a skin I've installed to see if this can work how I want it to. Appreciate the advice.
Reply

Logout Mark Read Team Forum Stats Members Help
Context Menu0