2018-08-19, 11:11
Hey
I'm learning about WindowXML
Im currently using Example from wiki. When I enter the new window created with example I end up seeing those two items, but they are converted with BusyDialog.xml
The only solution I found is to change WindowXML to WindowXMLDialog, but thats result in transparent background - but still that is just a workaround and Im unsure why its being "busy".
I can ESCAPE the busydialog, but thats now how it suppose to work, right ?
my calendar.xml file:
I know I shouldn't see 'end' until I exit the window, and here is the log:
And when I close Kodi by hand it stuck in process until I kill it with Task Manager.
Edit: The smalles footprint I could go was this, still BusyDialog on entering...
poppy.py
I'm learning about WindowXML
Im currently using Example from wiki. When I enter the new window created with example I end up seeing those two items, but they are converted with BusyDialog.xml
The only solution I found is to change WindowXML to WindowXMLDialog, but thats result in transparent background - but still that is just a workaround and Im unsure why its being "busy".
I can ESCAPE the busydialog, but thats now how it suppose to work, right ?
my calendar.xml file:
xml:
<?xml version="1.0" encoding="UTF-8"?>
<window>
<views>50</views>
<controls>
<control type="list" id="50">
<left>500</left>
<top>200</top>
<width>1000</width>
<height>500</height>
<viewtype label="535">list</viewtype>
<itemlayout height="100" width="1000">
<control type="label">
<left>20</left>
<top>0</top>
<height>50</height>
<width>960</width>
<font>font13</font>
<label>$INFO[ListItem.Label]</label>
</control>
</itemlayout>
<focusedlayout height="100" width="1000">
<control type="image">
<left>0</left>
<top>0</top>
<width>1000</width>
<height>50</height>
<texture>testwindow-focus.png</texture>
</control>
<control type="label">
<left>20</left>
<top>0</top>
<height>50</height>
<width>960</width>
<font>font13</font>
<label>$INFO[ListItem.Label]</label>
<textcolor>orange</textcolor>
</control>
</focusedlayout>
</control>
</controls>
</window>
I know I shouldn't see 'end' until I exit the window, and here is the log:
log:
10:59:17.187 T:5604 ERROR: ---> begin.....
10:59:17.190 T:5604 WARNING: CSkinInfo: failed to load skin settings
10:59:17.491 T:3604 DEBUG: ------ Window Init (DialogBusy.xml) ------
10:59:17.492 T:3604 DEBUG: Activating window ID: 13000
10:59:17.524 T:3604 DEBUG: ------ Window Deinit (MyVideoNav.xml) ------
10:59:17.537 T:3604 DEBUG: ------ Window Init (C:\Users\poppy\AppData\Roaming\Kodi\addons\plugin.video.poppy\resources\skins\default\1080i\calendar.xml) ------
10:59:17.537 T:3604 INFO: Loading skin file: C:\Users\poppy\AppData\Roaming\Kodi\addons\plugin.video.poppy\resources\skins\default\1080i\calendar.xml, load type: LOAD_ON_GUI_INIT
10:59:17.537 T:3604 DEBUG: CGUIMediaWindow::GetDirectory ()
10:59:17.537 T:3604 DEBUG: ParentPath =
And when I close Kodi by hand it stuck in process until I kill it with Task Manager.
Edit: The smalles footprint I could go was this, still BusyDialog on entering...
poppy.py
python:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import xbmcplugin
import xbmcgui
import xbmc
import xbmcaddon
from urllib import unquote_plus
import sys
ADDON = xbmcaddon.Addon()
CWD = ADDON.getAddonInfo('path').decode('utf-8')
ACTION_PREVIOUS_MENU = 10
ACTION_NAV_BACK = 92
list_items =
handle = int(sys.argv[1])
class GUI(xbmcgui.WindowXML):
# [optional] this function is only needed of you are passing optional data to your window
def __init__(self, *args, **kwargs):
# get the optional data and add it to a variable you can use elsewhere in your script
self.data = 'test'
# until now we have a blank window, the onInit function will parse your xml file
def onInit(self):
# select a view mode, '50' in our case, as defined in the skin file
xbmc.executebuiltin('Container.SetViewMode(50)')
# define a temporary list where we are going to add all the listitems to
listitems =
# this will be the first item in the list. 'my first item' will be the label that is shown in the list
listitem1 = xbmcgui.ListItem('my first item')
# add this item to our temporary list
listitems.append(listitem1)
# let's create another item
listitem2 = xbmcgui.ListItem('my second item')
# and add it to the temporary list as well
listitems.append(listitem2)
# by default the built-in container already contains one item, the 'up' (..) item, let's remove that one
self.clearList()
# now we are going to add all the items we have defined to the (built-in) container
self.addItems(listitems)
# give kodi a bit of (processing) time to add all items to the container
xbmc.sleep(100)
# this puts the focus on the top item of the container
self.setFocusId(self.getCurrentContainerId())
def onAction(self, action):
if action == ACTION_PREVIOUS_MENU:
self.close()
if action == ACTION_NAV_BACK:
self.close()
def my_window():
ui = GUI('calendar.xml',
CWD,
'default',
'1080i')
ui.doModal()
del ui
def parse_parameters(input_string):
parameters = {}
p1 = input_string.find('?')
if p1 >= 0:
split_parameters = input_string[p1 + 1:].split('&')
for name_value_pair in split_parameters:
# xbmc.log("parseParameter detected Value: " + str(name_value_pair))
if (len(name_value_pair) > 0) & ("=" in name_value_pair):
pair = name_value_pair.split('=')
key = pair[0]
value = unquote_plus(pair[1])
parameters[key] = value
return parameters
parameters = parse_parameters(sys.argv[2])
mode = parameters.get('mode', 0)
# xbmcgui.Dialog().ok(str(mode), str(parameters))
if mode == "1":
xbmc.log('---> begin.....', xbmc.LOGERROR)
my_window()
xbmc.log('<--- end.....', xbmc.LOGERROR)
else:
title = 'poppy'
liz = xbmcgui.ListItem(label=title, label2=title)
# liz.setInfo(type="Video", infoLabels={"Title": title, "Plot": title})
u = sys.argv[0] + '?mode=1'
list_items.append((u, liz, True))
xbmcplugin.addDirectoryItems(handle, list_items, len(list_items))
xbmcplugin.endOfDirectory(handle)