WindowXML GUI Toolkit (replaces GUIBuilder for XBMC python scripts for GUI coding)

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Nuka1195 Offline
Skilled Python Coder
Posts: 3,917
Joined: Dec 2004
Reputation: 17
Post: #161
yes you can, sort of. I do this in AMT with the showtimes. JMarshall just added this ability.

I don't have any thumbs in that list. If you have just a thumb then use the icon.

Set the list item: listitem = xbmcgui("Label1", "label2", "Extra info1", "Thumb or extra info 2")

then for your label set it's info tag:
<info>ListItem.ActualIcon</info> <- returns Extra Info1
<info>ListItem.Thumb</info> <- returns Thumb or Extra Info2

Is this what you wanted?

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
chunk_1970 Offline
Skilled Python Coder
Posts: 244
Joined: Jan 2005
Reputation: 0
Post: #162
Yes that does sound alot less hassle. Would be nice if we could have more available labels in Listitem for future use..Saves the need to have threading on the record number to pick up extra info..

Lovely Jubbly..

New: Azureus/Vuze Program Plugin [ Additional Torrent website Plugins here ]

Bedroom: Xbox1: Executer 2 - 120GB:nod:
Main: Asrock ION 330HT, HT Remote configured as XBOX Remote, Also Tvheadend, VncServer, Transmission, Sabnzbd, Acting as Router with (Hostapd/USB modem) and finally a Samba server for Drobo (5TB) running XBMC 9.11 on Ubuntu 2.6.17
:shocked:
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,917
Joined: Dec 2004
Reputation: 17
Post: #163
If anybody could point me in the direction of where listitem.* labels are set I could have a look at creating a new method, but I couldn't find it.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,523
Joined: Oct 2003
Reputation: 138
Post: #164
They're properties of the CFileItem class, which is derived from CGUIListItem.

The first thing that you'll need to do is change CGUIListItem -> CFileItem in the python functions.

You can then do things like:

item->GetMusicInfoTag()->SetArtist(artist) etc. For MusicInfoTag and PictureInfoTag you'll have to set the Loaded bool as well for the info to show up.

It might pay to have an "indexed" function where you pass a string for the index and the string to set.

That should give you another 20 or so strings to play with Tongue

Note that it is recommended that you only set one of the tag items (eg Music, Picture, or Video) and not all 3, though there will be no problems in doing so, other than some of the listitems refer to both music and video, so if you have the musicinfotag stuff set as loaded, but are wanting to refer to the videoinfotag the infomanager will pick the music one, even if it's empty (eg Ratings for instance). It also consumes more memory having both.

Cheers,
Jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
chunk_1970 Offline
Skilled Python Coder
Posts: 244
Joined: Jan 2005
Reputation: 0
Post: #165
The extra functionality would be sweet.

The listitem mod in the last xbmc release works really well being able to replace the second icon with additional text info..

New: Azureus/Vuze Program Plugin [ Additional Torrent website Plugins here ]

Bedroom: Xbox1: Executer 2 - 120GB:nod:
Main: Asrock ION 330HT, HT Remote configured as XBOX Remote, Also Tvheadend, VncServer, Transmission, Sabnzbd, Acting as Router with (Hostapd/USB modem) and finally a Samba server for Drobo (5TB) running XBMC 9.11 on Ubuntu 2.6.17
:shocked:
find quote
bortoni Offline
Member
Posts: 56
Joined: Jul 2007
Reputation: 0
Post: #166
I have a small question. I'm looking at the WindowXMLExample that is in svn. I want to be able to have second label in a list but have it invisible. In the #xbmc-scripts channel I was given the suggestion that I could use the <visible> tag to do this. However, in the sample script above, I can't find anywhere in the XML file for it where list items are described.

Where could I make this change? As I mentioned, I'm learning with the example so if anyone can provide a response based on it I'd really appreciate it.

Thanks.
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,917
Joined: Dec 2004
Reputation: 17
Post: #167
@chunk1970, checkout the new setInfo() method added to the listitem

@bortoni, make label2 <visible>false<visible> that was taken from amt credits xml file, there should be plenty of examples in that script.

Code:
<control type="list" id="101">
   <description>Team Credits List</description>
   <posx>33</posx>
   <posy>100</posy>
   <width>360</width>
   <height>60</height>
   <scrolltime>200</scrolltime>
   <itemlayout height="20">
    <control type="label">
     <posx>3</posx>
     <posy>1</posy>
     <width>200</width>
     <height>18</height>
     <font>font10</font>
     <aligny>center</aligny>
     <align>left</align>
     <info>ListItem.Label</info>
    </control>
    <control type="label">
     <posx>335</posx>
     <posy>1</posy>
     <width>150</width>
     <height>18</height>
     <font>font10</font>
     <aligny>center</aligny>
     <align>right</align>
     <info>ListItem.Label2</info>
    </control>
   </itemlayout>
   <focusedlayout height="20">
    <control type="label">
     <posx>3</posx>
     <posy>1</posy>
     <width>200</width>
     <height>18</height>
     <font>font10</font>
     <aligny>center</aligny>
     <align>left</align>
     <info>ListItem.Label</info>
    </control>
    <control type="label">
     <posx>335</posx>
     <posy>1</posy>
     <width>150</width>
     <height>18</height>
     <font>font10</font>
     <aligny>center</aligny>
     <align>right</align>
     <info>ListItem.Label2</info>
    </control>
   </focusedlayout>
  </control>

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,917
Joined: Dec 2004
Reputation: 17
Post: #168
Code:
<animation effect="rotate" center="128,128" start="0" end="-360" time="60000" loop="true" condition="Control.IsVisible(100)">Conditional</animation>

The above animation works with a WindowXML, but does not work with WindowXMLDialog. Can anything be done to fix this?

I know WindowClose animations won't work with dialogs, but this one would be helpful.

Thanks

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,917
Joined: Dec 2004
Reputation: 17
Post: #169
friendly bump for my previous question

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,523
Joined: Oct 2003
Reputation: 138
Post: #170
Would you mind providing a script and/or xml files with it all setup?

* jmarshall is lazy Tongue

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
Post Reply