Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Script can't read Skin String...
#1
I'm still battling with Kodi (that's what it feels like) to create my addon. Part of it includes a dialog (XML based) that collects an email address from the user and then calls a URL with the value entered by a user into the dialog

However, I can't for the life of me work out how I'm supposed to do this.

I've created the dialog. (XML: http://pastebin.com/CDRfDSLK)

I'm calling Skin.SetString(email) on a focus onto the edit control...

And I have a script that processes a button click (python: http://pastebin.com/D5RUShz7)

But the script can't see the Skin value ... The log file ( http://pastebin.com/x00i5E93 ) shows the lookup via

Code:
xbmc.getInfoLabel('Skin.String(email)')

showing a blank value. There's a line
Code:
20:23:34 T:9424 WARNING: CSkinInfo: failed to load skin settings

Could this be why the lookup via Skin.String returns blank?

I'm very confused about how I should process my dialog, should I be doing it some other way than the onClick(controlId) handler ? I've seen a number of different ways of getting skin values too

eg
Code:
xbmc.getInfoLabel('Skin.String(email)')
xbmc.getInfoLabel( '$INFO[Skin.string(email)]' )

Which is correct?
Reply
#2
rule #1: addons should NOT set skin settings.
you can use your own addon settings for that, or use window properties to temporary store data, depending on the usecase
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
#3
(2016-03-01, 23:29)ronie Wrote: rule #1: addons should NOT set skin settings.
you can use your own addon settings for that, or use window properties to temporary store data, depending on the usecase
Would you be able to elaborate on that please? I have no idea how to make my dialog or python pop-up the keyboard/editor and set a window property. This add-on does not need to store the entered value at all, it only uses it to invoke a URL so I guess a window property is the way to go. How does a script (or the XML ?) do that. ?

A pointer to a current code fragment would really help if such a thing exists.

Cheers, Mark
Reply
#4
you can invoke the keyboard dialog like this:
http://mirrors.xbmc.org/docs/python-docs...l#Keyboard

you can probably remove the edit control from your skin xml
and let your button handle it all:

PHP Code:
def onClick(selfcontrolId):
    if (
controlId == 300):
        
keyboard xbmc.Keyboard'''please enter your email address'False )
        
keyboard.doModal()
        if ( 
keyboard.isConfirmed() ):
            
email keyboard.getText()
            
xbmc.log("Will register '" email "' with unblockr")
            
registerwithunblockr('D7CqmCqIpO0XwqfNzS49'email'2')
            
self.close() 
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
#5
(2016-03-02, 01:13)ronie Wrote: you can invoke the keyboard dialog like this:
http://mirrors.xbmc.org/docs/python-docs...l#Keyboard

you can probably remove the edit control from your skin xml
and let your button handle it all:

PHP Code:
... Code snipped 

That is the most helpful info I've encountered during my time writing this addon. Thank you very much for that, It's obvious when you know where to look and how to approach the prob. Solves the issue 'properly' and the previous methodology I was using even felt clunky.
Reply

Logout Mark Read Team Forum Stats Members Help
Script can't read Skin String...0