Kodi Community Forum
WindowXML GUI Toolkit (replaces GUIBuilder for XBMC python scripts for GUI coding) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: WindowXML GUI Toolkit (replaces GUIBuilder for XBMC python scripts for GUI coding) (/showthread.php?tid=24839)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13


- jc85 - 2007-07-24

Thanks Smile glad you like it!

I'm actually quite suprised at how fast it's coming along - only got the idea a couple of days ago. The main menu window is working very well - there's a slight visual glitch when switching between pages, and the GUI needs cleaning up a bit. I need to add the settings & power menu buttons. I've already started a UI for enabling/disabling & reorganising channels. If there was interest in the channel menu idea I'd make the settings UI more fully featured.

Basically, there's a data directory which the script reads all the channel data from. Inside is an XML file containing the position of the channels within the menu and a subdirectory for each channel, each containing the images used & another XML file containing the channel name, type & action to take when it's selected, so each channel is an independant item.

I haven't tried this yet, but ideally I'd like to use a rar or zip archive to store the individual channel data, so adding a new channel is as simple as dropping the archive file into the data directory (or maybe downloading one straight from the web). I haven't looked into the support for archive files within Python yet - it's a pretty low priority since it wouldn't really affect how we'd use the menu here, but might be a useful feature if I ever released it.

If you've got any other ideas I'd welcome them! I've been developing small things for a while now (for XBMC, Windows, web etc) but only for use by myself & friends - I've never posted anything online. If people think this has potential I'll put more work into it Big Grin

And many, many, many thanks to donno for creating WindowXML, without which this would've been very difficult, perhaps even impossible.


- Freddo - 2007-07-24

It'd be especially awesome if channels could be defined per-user on the system for those of us with less xboxes than yourself Big Grin


- jc85 - 2007-07-24

Good idea Smile if anyone's got any pointers on how XBMC's profiles work (I've never had a use for them) and if the info can be accessed from a python script, then I'm willing to give it a go.


- Basje - 2007-07-24

Well, I continued without the possibility to change the view from within Python. To do this, I added a normal list with ID 70 and made it hidden. Now I can switch from list 50 to 70 by toggling the visibility.

HOWEVER: I changed the list 50 to a panel instead of a list. Now the setVisible() methode gives me the error:

Exception: Unknown control type for python

When I change it back to List, all is fine again. Is this a bug in WindowXML?


- Nuka1195 - 2007-07-25

no, as i've stated before. the panel is not a native python control. Wrap it in a controlgroup and set the group visible. adjust your <visible> tags to match.


- Basje - 2007-07-25

Nuka1195 Wrote:no, as i've stated before. the panel is not a native python control. Wrap it in a controlgroup and set the group visible. adjust your <visible> tags to match.

You're completely right. Forgot that Sad. My bad.


- chunk_1970 - 2007-08-10

Hi,

Im in the progress of modifying my Torrent-X script to use WindowXml. All the code has been changed and is working but using the newer xml skin files when you have the item focused in a list is it possible to display extra info. Can i just add extra entries to the ListItem or is there another way.

I would like the ability to display all the other info I have on a list item when its focused..


- Basje - 2007-08-10

chunk_1970 Wrote:Hi,

Im in the progress of modifying my Torrent-X script to use WindowXml. All the code has been changed and is working but using the newer xml skin files when you have the item focused in a list is it possible to display extra info. Can i just add extra entries to the ListItem or is there another way.

I would like the ability to display all the other info I have on a list item when its focused..
Well, I did this by catching the Up and Down actions in the OnAction methode of WindowXML. If those two actions occur, I fire a custom methode OnKeyUpDown which contains the code that displays info for the currently selected item.

See http://code.google.com/p/xot-uzg/ for my script. It is called Uitzendinggemist.v2 (it's dutch, but the coding comments are english). The part that I am referring to is in the libs\chn_class.py file.


- chunk_1970 - 2007-08-10

cheers...superfast response..

I'll have a look at your code..


- chunk_1970 - 2007-08-10

Thats nice but I was hoping for xbmc/python to do the work without any real additional coding..


- Nuka1195 - 2007-08-10

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?


- chunk_1970 - 2007-08-10

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..


- Nuka1195 - 2007-08-10

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.


- jmarshall - 2007-08-11

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 :p

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


- chunk_1970 - 2007-08-11

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..