Posts: 7
Joined: Dec 2011
Reputation:
0
What is the preferred or recommended method to send notifications from a skin to a plugin?
I realize that I can subclass xbmcgui.WindowXML and override the on... functions, but that doesn't work for standard windows. I've tried to subclass xbmcgui.Window with a given ID (0 for the home window for example) but the overrides don't get called (I would have been surprised if they did).
I can use the window properties to pass information, but then I would need to poll them in the plugin with the obvious tradeoff between polling overhead and reaction delay.
Is there any way to trigger a plugin directly, by sending a JSON notification or something like that?
Posts: 7
Joined: Dec 2011
Reputation:
0
Thanks for the quick reply and suggestion, pkscuot!
That would result in a separate instance being created and run every time, or not? I would need to use a separate (lightweight) script for that, again facing the problem of having to notify the original (resident) plugin/add-on.
Posts: 7
Joined: Dec 2011
Reputation:
0
What I'm trying to achieve is similar to populating a list and I've considered that approach. Let me explain...
I do like the feature of home menu customization a lot that some skins provide, but dislike the bloat it involves. I've only seen it implemented through mindless repitition, because of a skin's static nature. That also limits the level of customization, depending on what the skin creator considered necessary or useful.
I could use the list provider addon solution for a main menu but would still need to revert to the repititive approach when it comes to submenus (I think it might even sometimes be useful to have a third level). It's also potentially a lot of state to load whenever the home screen is activated.
I'm looking for a way to populate those lists dynamically while the user navigates through the menu structure. That's why I need the skin to notify the addon (I guess it would be called a service? I'm a little uncertain of the terminology here) of the user's activity.
removed151214
Unregistered
removed151214
Unregistered
Posts: N/A
Take a look at my
skin shortcuts script, which can provide a whole menu/submenu to a skin via python. Initially it used the dynamic list contents, but this prooved too slow. These days, it writes the menu to the skins directory as an include, which the skin can stick in a list and display as it wants. Might give you some ideas
Posts: 7
Joined: Dec 2011
Reputation:
0
Very nice, thanks. Your script didn't come up when I was searching for existing solutions to my problem. I'll certainly check it out.
I also checked the XBMC sources for the NotifyAll built-in function and found out that it takes up to 3 parameters (something the wiki docs don't mention). I will try to see if I can utilize that together with xbmc.Monitor.
I will report back here with my findings.