2007-05-08, 17:48
Hi Donno,
A couple of things:
1. Can the force_fallback, force the media folder in the default skin to be used also, as it should with the xml?
2. Maybe not an issue with WindowXML, I'm not sure. The following code works fine:
But in real life I have other things going on from onInit() and calling "xbmc.executehttpapi( "SetGUISetting(0,videoplayer.displayresolution,%d)" % ( self.videoplayer_resolution, ) )" before onInit() finishes causes a lockup. I haven't been able to track down the conflict, since it works fine with the above code it may not be related.
Could we have another event OnWindowLoaded() <- not sure if that's the correct event though, but something after onInit(). This may not solve my issue though.
Edit: Another issue, the object count label id="12", when setting the list id="50" invisible and visible, sometimes the labels count is one less than it should be.
Edit2: <info>Listitem.Icon</info> doesn't seem to work for separate cimage controls, unless I'm doing something wrong. I set the list id="50" to have an image with Listitem.icon.
A couple of things:
1. Can the force_fallback, force the media folder in the default skin to be used also, as it should with the xml?
2. Maybe not an issue with WindowXML, I'm not sure. The following code works fine:
Code:
import xbmc, xbmcgui
import os
class GUI( xbmcgui.WindowXML ):
def __init__( self, *args, **kwargs ):
self.videoplayer_resolution = int( xbmc.executehttpapi( "getguisetting(0,videoplayer.displayresolution)" ).replace("<li>","") )
def onInit( self ):
self._change_resolution()
def _change_resolution( self ):
print self.videoplayer_resolution
xbmc.executehttpapi( "SetGUISetting(0,videoplayer.displayresolution,%d)" % ( self.videoplayer_resolution, ) )
ui = GUI("httptest.xml", os.getcwd().replace(";",""),"Default", True)
ui.doModal()
del ui
But in real life I have other things going on from onInit() and calling "xbmc.executehttpapi( "SetGUISetting(0,videoplayer.displayresolution,%d)" % ( self.videoplayer_resolution, ) )" before onInit() finishes causes a lockup. I haven't been able to track down the conflict, since it works fine with the above code it may not be related.
Could we have another event OnWindowLoaded() <- not sure if that's the correct event though, but something after onInit(). This may not solve my issue though.
Edit: Another issue, the object count label id="12", when setting the list id="50" invisible and visible, sometimes the labels count is one less than it should be.
Edit2: <info>Listitem.Icon</info> doesn't seem to work for separate cimage controls, unless I'm doing something wrong. I set the list id="50" to have an image with Listitem.icon.
Code:
<control type="image" id="201">
<description>Trailer Poster</description>
<posx>520</posx>
<posy>120</posy>
<width>170</width>
<height>250</height>
<info>Listitem.Icon</info>
<aspectratio>keep</aspectratio>
<visible>Control.IsVisible(50)</visible>
</control>
<control type="list" id="50">
<posx>190</posx>
<posy>100</posy>
<width>485</width>
<height>425</height>
<onleft>9000</onleft>
<onright>60</onright>
<onup>50</onup>
<ondown>50</ondown>
<viewtype label="535">list</viewtype>
<pagecontrol>60</pagecontrol>
<scrolltime>200</scrolltime>
<include>contentpanelslide</include>
<itemlayout height="29">
<control type="image">
<posx>5</posx>
<posy>3</posy>
<width>22</width>
<height>22</height>
<info>ListItem.Icon</info>
</control>
<control type="label">
<posx>30</posx>
<posy>3</posy>
<width>430</width>
<height>22</height>
<font>font13</font>
<aligny>center</aligny>
<include>listselectedcolor</include>
<align>left</align>
<info>ListItem.Label</info>
<visible>!Container.Sort(SongRating)</visible>
</control>
<control type="label">
<posx>475</posx>
<posy>3</posy>
<width>300</width>
<height>22</height>
<font>font13</font>
<aligny>center</aligny>
<include>listselectedcolor</include>
<textcolor>60ffffff</textcolor>
<align>right</align>
<info>ListItem.Label2</info>
<visible>!Container.Sort(SongRating)</visible>
</control>
<control type="label">
<posx>30</posx>
<posy>3</posy>
<width>345</width>
<height>22</height>
<font>font13</font>
<aligny>center</aligny>
<include>listselectedcolor</include>
<align>left</align>
<info>ListItem.Label</info>
<visible>Container.Sort(SongRating)</visible>
</control>
<control type="image" id="1">
<description>Song Rating Image</description>
<height>21</height>
<width>121</width>
<posx>380</posx>
<posy>4</posy>
<info>listitem.rating</info>
<aspectratio>stretch</aspectratio>
<texture flipx="true" />
<visible>Container.Sort(SongRating)</visible>
</control>
</itemlayout>
<focusedlayout height="29">
<control type="image">
<width>485</width>
<height>29</height>
<posx>0</posx>
<posy>0</posy>
<visible>Control.HasFocus(50)</visible>
<texture>list-focus.png</texture>
</control>
<control type="image">
<posx>5</posx>
<posy>3</posy>
<width>22</width>
<height>22</height>
<info>ListItem.Icon</info>
</control>
<control type="label">
<posx>30</posx>
<posy>3</posy>
<width>430</width>
<height>22</height>
<font>font13</font>
<aligny>center</aligny>
<include>listselectedcolor</include>
<align>left</align>
<info>ListItem.Label</info>
<visible>!Container.Sort(SongRating)</visible>
</control>
<control type="label">
<posx>475</posx>
<posy>3</posy>
<width>300</width>
<height>22</height>
<font>font13</font>
<aligny>center</aligny>
<include>listselectedcolor</include>
<textcolor>60ffffff</textcolor>
<align>right</align>
<info>ListItem.Label2</info>
<visible>!Container.Sort(SongRating)</visible>
</control>
<control type="label">
<posx>30</posx>
<posy>3</posy>
<width>345</width>
<height>22</height>
<font>font13</font>
<aligny>center</aligny>
<include>listselectedcolor</include>
<align>left</align>
<info>ListItem.Label</info>
<visible>Container.Sort(SongRating)</visible>
</control>
<control type="image" id="1">
<description>Song Rating Image</description>
<height>21</height>
<width>121</width>
<posx>380</posx>
<posy>4</posy>
<info>listitem.rating</info>
<aspectratio>stretch</aspectratio>
<texture flipx="true" />
<visible>Container.Sort(SongRating)</visible>
</control>
</focusedlayout>
</control>