WIP Context Item Addons
#16
Sure you can help :)
Devs will be able to give you some pointers on where to start.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#17
I've always wanted to add the functionality to copy a local version of the file to be played before playing it, then delete afterwards (for those of us with slow networks). This would be perfect for that.
Reply
#18
Yes this would nicely integrate addons, via settings, in skins without needed work for skinners
Reply
#19
Also, I made a
post once about the picture section, including the context menu. Maybe thuis brings soms inspiration as well.

I think uniforming the picture setting the way audio and video works, would bring a better and more consistent user experience.
Reply
#20
Hi,

just wanted to let you guys know, that I've just rebased my PR (have removed "addon.hasSetting()" visibility expression for now. will add that one again later).

I haven't pushed yet, as the commits are a real mess, will have to clean this up a bit.

Right now I'm working on the ContextMenuManager so he knows when an item has been disabled/enabled/updated/installed/uninstalled Done.

I also started some work, so context items can be added to the new "manage" submenu (basically working, not extensively tested though). Done

I was also thinking about letting python developers group their items into their own submenus. Done
E.g. contextual facebook, google+, twitter addons could go into one "Socialise" submenu.

Also cleaned up and pushed

Is there anything else you guys want me to do in order to get this one ready?
Reply
#21
(2012-11-10, 15:26)Fice Wrote: b) Keep asynchron but supply the context item addon with the list item.

Right now i think version b is the better solution (probably also easier).
I tried to implement that behaviour yesterday but ran into some complications. Currently it seem's that you can only pass strings as parameters to a python script. Will need to look closer how i can actually achieve what i want.

This is just an idea, which only makes sense if there is no more straightforward way to do it, but perhaps we could serialize the listitem and then add something like xbmc.deserializeListItem() for the addon to use. Of course I don't know how hard it would be to serialize a ListItem or if there are any limits on the string size passed to addons.

Thanks for your work on this so far.
Hopefully we can get this in eventually Smile
Reply
#22
I have recently tried to serialise a listitem using pickle to pass it between the addon and services processes of my addon. But an error occurs with the Label method in the listitem class; traceback says pickles problem is that it should be a string or unicode.
Reply
#23
P.S. As I couldnt pickle the instances of ListItem, I have changed them to a generic class and am trying to add xbmcgui.ListItem to each instances __bases__. But you can only do that with classes, and type(xbmcgui.ListItem) returns 'type'.

What am I missing here?
Reply
#24
I just had a look at how i did it from the c++ side:

Code:
XBMCAddon::xbmcgui::ListItem* arg = new XBMCAddon::xbmcgui::ListItem(item);

m_item = PythonBindings::makePythonInstance(arg, &PythonBindings::PyXBMCAddon_xbmcgui_ListItem_Type, &PythonBindings::TyXBMCAddon_xbmcgui_ListItem_Type, true);

if (m_item != NULL) {
  if (0 != PySys_SetObject((char*)"item", m_item))
     CLog::Log(LOGDEBUG, "setSysParameter failed!");
}
I'm not really into python, so I can't really help you there. Perhabs you could have a look at the the makePythonInstance function? (i never did Smile).
My pr is rather outdated, perhabs sth. broke listitem serialized in curent master. Perhabs it's best you create a new thread with your question?
Reply
#25
Going back on topic: what happened to this project Fice? It was a really good idea.
Reply
#26
little free time and it somewhat got lost Sad

Everytime I could have worked on it, kodi was on feature freeze (no sense in rebasing then). Other thant that it just needs to be reviewed. I promise I will ping on my PR the moment helix is out the door.
Reply
#27
Just tested this yesterday after you rebased.. and it's awesome! I need this in my life.

Maybe it will event make it into kodi. The "freeze" part in "feature freeze" seems to be extremely relaxed at the moment lol.
Reply
#28
(2014-10-15, 13:00)takoi Wrote: The "freeze" part in "feature freeze" seems to be extremely relaxed at the moment lol.

It all depends on what you define as a fix Wink
Reply
#29
It has the helix tag, that gives hope Smile

Here are some test-builds if someone else want's to try it:
(test Context Item addons are included (not that they do anything useful, but you can have a look in the addons.xml as examples)
If you want access to the listitem in you addon, it is in sys.item (already changed in my pr to sys.listitem but the builds are from before)

OSX:
OSX x86_64
OSX i386

Win:
Unfortunately failed

Android:
Android x86
Android arm

iOS

atv2

Btw: Is there a chance you're interested in a "Queue after current" context item? the one feature I really miss from winamp times
Reply
#30
StringCompare(info,string)
For like a bool provided by addon. When you have two context items you can make one visible and one hidden while the context menu is open.
Code:
StringCompare(Window(Home).Property(key),true)
Quote:Returns true if the info equals the string. Please note that string can also be a $LOCALIZE[] or info label (without $INFO prefix). And that in a panelview or similar this only works on the focused item. Both arguments are evaluated on the fly, unlike substring.

SubString(info,string)
Anywhere in string
Code:
SubString(listitem.path,login=true)

Ends with.
Code:
SubString(listitem.path,avi,right)

Is not + starts with
Code:
!SubString(listitem.path,https,left)
Quote:Returns true if the string is found anywhere in the info
Parameter is evaluated at time of parsing (XML load) not on the fly.
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply

Logout Mark Read Team Forum Stats Members Help
Context Item Addons0