Implementing Login Screen functionality
#1
Hi

On start of my add on I want to show Login/Password screen which will show next screen on successful login. The Login will be done via a REST API.

Which GUI controls will be helpful for this?

Thanks
Reply
#2
Just a thought (and there will be other people with practical experience who can offer more advice): do you actually need a login screen? Why not just store login details in the settings for the addon and then do the login in the background when the addon is run?
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#3
(2014-01-12, 12:05)el_Paraguayo Wrote: Just a thought (and there will be other people with practical experience who can offer more advice): do you actually need a login screen? Why not just store login details in the settings for the addon and then do the login in the background when the addon is run?


Because passwords can be changed.
Reply
#4
So can settings
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#5
Login data will be fetched from a remote URL, it will also be validated remotely. What I want user can input user/password visually. If you have some sample for it then please guide. Users are required to be shown typical login/password screen.
Reply
#6
Like I said, I'm not an expert on this point. I'd envisaged you setting username and password via the settings, the add-on then attempts to log on using those credentials. If the login falls then the user is notified and the add-on opens the settings screen to change login details.

If that's not what you want then you're best ignoring me!
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#7
(2014-01-12, 11:24)volatil3 Wrote: Hi

On start of my add on I want to show Login/Password screen which will show next screen on successful login. The Login will be done via a REST API.

Which GUI controls will be helpful for this?

Thanks

If you really need a pop-up Login screen, then I think xbmcgui.ControlImage for a background, ControlLabel for text labels ("Login", "Password" etc.) and ControlEdit for text input.
You can also look into my PyXBMCt framework which provides ready-to-use Controls to create arbitrary UIs for XBMC addons.
Reply
#8
(2014-01-15, 12:16)Roman_V_M Wrote:
(2014-01-12, 11:24)volatil3 Wrote: Hi

On start of my add on I want to show Login/Password screen which will show next screen on successful login. The Login will be done via a REST API.

Which GUI controls will be helpful for this?

Thanks

If you really need a pop-up Login screen, then I think xbmcgui.ControlImage for a background, ControlLabel for text labels ("Login", "Password" etc.) and ControlEdit for text input.
You can also look into my PyXBMCt framework which provides ready-to-use Controls to create arbitrary UIs for XBMC addons.

Looks promising and easy to use. DOes it have any external dependency? does it also support skinning?
Reply
#9
(2014-01-15, 14:40)volatil3 Wrote: . DOes it have any external dependency?

No, it does not, especially in case of the "local" version.

Quote:does it also support skinning?

I haven't fully implemented this, but in theory it's possible - you will need a set of necessary textures from the skin you're going to support and made minor modification into framework's code, so that it would set a path to the necessary texture image files and all position adjustment constants depending on a current skin.
Reply
#10
I just tried local version. Thankyou for this pieace, Sir!
I have yet to test and see how input box will work, specially to retrieve values on Click event of button
Reply
#11
How do I set width and height of textbox, by looking code, I guess it is depending on Grid's width and height?
Reply
#12
(2014-01-15, 19:31)volatil3 Wrote: How do I set width and height of textbox, by looking code, I guess it is depending on Grid's width and height?

Sizes of individual controls depend on the size of the main window and row/column count in window's coordinate grid. You can also adjust the sizes of individual control by using pad_x and pad_y parameters of placeControl method.

As for your other question in PM, the answer is actually covered in PyXBMCt Quick Start Guide and the demo add-on.
Your mistake is that you are trying to connect a function call, not a function object, which is wrong.
Wrong:
Code:
self.connect(foo, bar())
Correct:
Code:
self.connect(foo, bar)
Where: foo - a control object, bar - a function/method name.

If you need to connect a function with parameters known at runtime, you should use lambda:
Wrong:
Code:
self.connect(foo, bar(x, y))
Correct:
Code:
self.connect(foo, lambda: bar(x, y))

BTW, other Python GUI frameworks, e.g. Tkinter use the same approach.

P.S. I think questions regarding PyXBMCt specifics (if any) better to discuss in the respective topic.
Reply

Logout Mark Read Team Forum Stats Members Help
Implementing Login Screen functionality0