2 question about communication XML <-> python
#16
I don't ^^
But I can imagine something :
onInit, you get the ID of your custom window and pass it to the Home windows in a variable
Then, you can get it in your window with window(home).property....
You also can pass the ID to the window it points :
Code:
self.window_id = xbmcgui.getCurrentWindowId()
self.window = xbmcgui.Window(self.window_id)
self.window.setProperty('myID', str(self.window_id))

I choose to use Home window because I'm not sure how to get property from self in XML... I found some $INFO[window.property(...)] on the Internet but can't achieve it Sad
Reply
#17
$INFO[window.property(...)] is correct and works. (when not explicitely pointing to a window name/id, it will just take the property of the window the label is used in)
I am doing this (attaching properties to self) a lot in ExtendedInfo script for example, so there is no way it doesnt work. Wink
If you would start posting the complete code (both python and XML) then it would probably be easier for us to find the issue.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#18
(2015-06-25, 15:32)phil65 Wrote: $INFO[window.property(...)] is correct and works. (when not explicitely pointing to a window name/id, it will just take the property of the window the label is used in)
I am doing this (attaching properties to self) a lot in ExtendedInfo script for example, so there is no way it doesnt work. Wink
If you would start posting the complete code (both python and XML) then it would probably be easier for us to find the issue.

Nice! Will give that a try.

Now I'll stop hijacking this thread Smile
Reply
#19
In fact, I can totally do what I want with visible conditions only.
I don't really need to print properties in labels... Just a curiosity ^^.

@spoyser : this post is already a multi-questions mess, there's no Hijacking possible Wink

Edit : I did a quick test and have no problem to print any property of any window in a label control put outside my itemLayout. I thing I can't achieve it earlier because I try to use some labels in <itemlayout>... They use the <info> tag and not the <label> one... I imagine (with no certitude at all...) that the <info> tag wants a certain type of variable to be feed with...
Reply
#20
(2015-06-25, 15:46)JoGoiA Wrote: In fact, I can totally do what I want with visible conditions only.
I don't really need to print properties in labels... Just a curiosity ^^.

@spoyser : this post is already a multi-questions mess, there's no Hijacking possible Wink

Edit : I did a quick test and have no problem to print any property of any window in a label control put outside my itemLayout. I thing I can't achieve it earlier because I try to use some labels in <itemlayout>... They use the <info> tag and not the <label> one... I imagine (with no certitude at all...) that the <info> tag wants a certain type of variable to be feed with...

correct. inside containers, only ListItem.* infolabels are supported.
so window properties won't work there.
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
#21
@ronie : Mystery solved !


OK.
I've got a setting and when the window init() itself, it use this data to "choose" (with visible conditions) how to be displayed.
I've got a button. By clicking it, I can change my setting and if I quit my addon then reload it, it display differently because of this. It's what I want.

But, I don't want to exit and reload my addon to see the changes...
How can I "reparse" my XML file to change the way my window is displayed after altering the setting ?
I know about ActivateWindow(...) but I'm looking for a way to just reRead my XML and rePlay every visible conditions, without reload the whole thing.

I'm not here now but I see the problem coming to me very fast : How can I empty (sorry about my English level...) a listItem list before to refill it with new items ?
Reply
#22
Visible conditions do not need any "re-parsing", they are always evaluated on-the-fly.
lists can get reset with xbmcgui.controlList.reset() and "re-filled" with .addItems() or .addItem()
Again: Please always post all your code in case you want us to be able to help properly.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#23
Thanks a lot ^^
As i'm in learning phase, I try to extract every problem from a very messy code...
I'm kind of ashamed of my work for now Wink

EDIT : I did it ! The windows didn't update itself because I forgot to update the window property I use in the condition after editing the setting... Now, everything is working fine !
Reply
#24
(2015-06-25, 17:59)JoGoiA Wrote: Thanks a lot ^^
As i'm in learning phase, I try to extract every problem from a very messy code...
I'm kind of ashamed of my work for now Wink

That´s how everyone starts. Wink
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#25
I think I learn better by following the leads you give to me by myself... If you do the job, I will not learn that much ^^
Reply

Logout Mark Read Team Forum Stats Members Help
2 question about communication XML <-> python0