Kodi Community Forum

Full Version: GUI.ActivateWindow custom window ID
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,

I'm trying to show a custom window through JSON-RPC. Calling GUI.ActivateWindow("videos") for example works. But I have added some custom window ID's to the skin that I need to show. With the keyboards.xml file I can set a key to call ActivateWindow(1113) and this work. But when doing GUI.ActivateWindow("1113") through JSON-RPC it says: Received value does not match any of the defined enum values. Calling GUI.ActivateWindow(1113) gives: Invalid type integer received.

From this I'm thinking that it is not possible to open custom windows through JSON-RPC. Any thoughts?

I could solve my problem by using some of the existing window names and change the xml of those, but this is a bit dirty.

Thanks!
(2017-09-27, 17:44)Thof Wrote: [ -> ]Hi All,

I'm trying to show a custom window through JSON-RPC. Calling GUI.ActivateWindow("videos") for example works. But I have added some custom window ID's to the skin that I need to show. With the keyboards.xml file I can set a key to call ActivateWindow(1113) and this work. But when doing GUI.ActivateWindow("1113") through JSON-RPC it says: Received value does not match any of the defined enum values. Calling GUI.ActivateWindow(1113) gives: Invalid type integer received.

From this I'm thinking that it is not possible to open custom windows through JSON-RPC. Any thoughts?

I could solve my problem by using some of the existing window names and change the xml of those, but this is a bit dirty.

Thanks!

I believe json only works with built-in window ids and not custom ones.... for reference look in the links below:
http://kodi.wiki/view/JSON-RPC_API/v8#GUI.Window
http://kodi.wiki/view/Window_IDs

If you'd like to access a custom id you need to use executebuiltin or xbmcgui
http://kodi.wiki/view/list_of_built-in_functions
Ok got it, I'm going to try making an addon and call that through json.
(2017-09-28, 10:35)Thof Wrote: [ -> ]Ok got it, I'm going to try making an addon and call that through json.
Json from within python has the same enums as the link I sent you... So custom windows will still be inaccessible.

Sent from my SM-G935T
(2017-09-28, 14:26)Lunatixz Wrote: [ -> ]
(2017-09-28, 10:35)Thof Wrote: [ -> ]Ok got it, I'm going to try making an addon and call that through json.
Json from within python has the same enums as the link I sent you... So custom windows will still be inaccessible.
Possibly I've misunderstood., but you wouldn't need to use json in python.
eg I use
xbmc.executebuiltin('ActivateWindowAndFocus(%d,return)'% target)
I'm trying to do the same thing. I have a Custom XML with id 1101, which calls a Python plugin inside the <content> tags. Everything works as it should when I call that through a button. But I NEED to call this via RPC as well, I don't mind going any route (HTTP, WS, Python) to achieve ActivateWindow("1101").

I'm trying to avoid modifying any of the existing XMLs from the Skin too. But if it comes down to that then so be it.

Were you able to pursue this ? If you ended up modifying existing XML, then any recommendations or gotchas ?
Sorry for the late reply, but I fixed this by making a small custom script addon. A script can open custom window id's. Through RPC you would then do: 

Code:
Addons.ExecuteAddon({"addonid":"script.activatewindowid","params":{"windowid":"1101"}})
Thanks Thof. I've been busy with other stuff, I'll hopefully be able to circle back to this in a few weeks and try it out.
"Thof" @

Could you share the script.activatewindowid because I need also to open custom window with RPC

Thank you Smile