Custom Window in add on
#1
I am working on an addon and want to add custom windows. I am able to get these to work when I put the XML files in the skin's folder. But I don't want to. I want them contained in the addon folder structure.

I can't figure out how this is done. I know it's not loading, because when I try to ActivateWindow, it cannot be found.

Thanks!
Reply
#2
see the docs:
http://mirrors.xbmc.org/docs/python-docs...#WindowXML

so in your code, use something along these lines:
Code:
import xbmcaddon

__addon__ = xbmcaddon.Addon()
__cwd__   = __addon__.getAddonInfo('path').decode("utf-8")

ui = GUI('script-whatever.xml', __cwd__, 'default', '720p')

and store your xml files inside:
script.whatever/resources/skins/default/720p/...
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! I understand, but something is not right.

I'm initializing this class like so:
Code:
__addon__     = xbmcaddon.Addon()
__addonpath__ = __addon__.getAddonInfo('path').decode("utf-8")

dialog = myclass("mycustom.xml", __addonpath__, 'default', '16x10')

But the file isn't being found:
RuntimeError: XML File for Window is missing

When I run a strace and look at the logs, it's not looking in default:
Code:
stat("/home/pi/.kodi/addons/plugin.program.myplugin/resources/skins/skin.CarPC-touch_carbon/16x10/mycustom.xml", 0x7f2b1ada7a40) = -1 ENOENT (No such file or directory)

skin.CarPC-touch_carbon is the name of the skin I am using. But I specified 'default' up above.
Reply
#4
plugins can not use the WindowXML class.

if you want to provide custom windows with your addon, you need to write a script, not a plugin.
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
#5
Gotcha. Okay. In that case, I migrated everything to be a script instead of plugin.
The directory name, the extension point, and the addon id.
But that problem still exists:

Code:
stat("/home/pi/.kodi/addons/plugin.program.myplugin/resources/skins/skin.CarPC-touch_carbon/16x10/mycustom.xml", 0x7f2b1ada7a40) = -1 ENOENT (No such file or directory)
I created a symlink, and the plugin executes without error.
(It doesn't do anything yet, because I am just figuring this out, but it executes without error)
Reply
#6
please upload your addon somewhere so we can have a look.
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
#7
(2015-08-05, 22:58)ronie Wrote: plugins can not use the WindowXML class.

if you want to provide custom windows with your addon, you need to write a script, not a plugin.

Doesnt happen too often, but youre not exactly correct here. Wink All kind of add-ons can do anything with full access to all classes which are imported. The only thing which is different is that for python calls via plugin:// kodi expects an "answer" from the plugin. it would be pretty easy to adjust any script add-on to make it executable from plugin area.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#8
(2015-08-05, 23:57)ronie Wrote: please upload your addon somewhere so we can have a look.

I threw this in a git repo.

This should get you a working copy.
Code:
got clone https://[email protected]/jagauthier/script.program.bluetooth.git

I appreciate your time looking at this.
Reply
#9
as it turns out (i had to check the kodi source-code to figure this one out),
you can not use '16x10' as a folder name.
kodi only accepts a limited number of predefined resolutions.

you should either use '720p' or '1080i'.
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
#10
huh. I'll be damned. I'll change my folder structure. Thanks.
My target resolution will be 1280x800 (which is 16:10), but I can play along to make it work.

Thanks!
Reply
#11
Okay, well, that causes a bunch of other issues for me.
As stated, my vertical resolution is 800px.

Something with this folder structure forces kodi to believe my vertical resolution is 720px.

So, I have an image at 710 veritical pixel. In my previous folder structure, the entire image would show.
Now that I've renamed it, only the first 10 pixels are visible. Sad

What are my options, if any?
Reply
#12
you should code your window in 1280x720px.
kodi will handle the scaling to 1280x800.

in case you run a true 16x10 skin, you can additionally add a 16x10 version of your addon window to the skin.
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
#13
Thanks man!
Reply

Logout Mark Read Team Forum Stats Members Help
Custom Window in add on0