Selecting a ListItem and firing off an event?
#1
I'm curious if this is possible and if so, how to do it:

The plugin I've created interacts with an API I wrote. It is 98% functional right now in that it gets all of the data from the server. But once I get to an end point, I need the user to click on a list item, and a request sent to my server.

It will start off a download of the list item on other software. So essentially, I need to just fire off a request, but without changing views.

Does anyone know if this is possible, and if so, how?

I know i can do this using the context menu, but that isn't the interaction I want.

Thanks!
Reply
#2
Isn't there a "replace current listing" ability in the plugin api? If so, that would do the trick I think?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
This plugin api? http://xbmc.sourceforge.net/python-docs/xbmcplugin.html

I dont see anything like that. All i'm hoping for is to be able to fire off a method on click, or at the worst, XBMC.RunScript
Reply
#4
i think you want to have a callback to your plugin, setting "isFolder=False"
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#5
I see that I can do this, and have resolved that this means that when clicked, it will not attempt a round trip in the plug in.

But how and where do I define the callback? I can't really tell with the docs.
Reply
#6
What I was referring to is making the item a folder, and call endDirectory with updateListing = false
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#7
jmarshall Wrote:What I was referring to is making the item a folder, and call endDirectory with updateListing = false

Oh, so then i could create a "download" destination that does all my work for me, but the endOfDirectory call is set to NOT update the listing, so that when fired, it does the work, without changing the view?

I'll give this a shot.

Thanks.
Reply
#8
Code:
ok = xbmcplugin.addDirectoryItem( handle=int( sys.argv[ 1 ] ), url=url, listitem=listitem, isFolder=False, totalItems=total )

set the url to your plugin path "sys.argv[ 0 ]" with a special arg like:

Code:
url = "%s?request=" % ( sys.argv[ 0 ], request, )

then in your plugin, if request is in sys.argv[ 2 ], send your request.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply

Logout Mark Read Team Forum Stats Members Help
Selecting a ListItem and firing off an event?0