Is there a way select a profile name?
#1
Hi everyone,

I'm trying to provide a way for my users to switch between mastermode and a user selected profile from a toggle in the home menu. Is there a way to provide a dialog listing the profile names available and then allow me to write the name to a skin string?

I currently do something similar with Sources by having a script parse sources.xml and present the resulting list to the user to select from. I could probably do likewise with profiles.xml, but would prefer not to as I think this way is too easy to break with a xbmc update.

Is there a better way?

Wyrm (xTV SAF)
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply
#2
Other than the login screen, no.
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
Reply
#3
jmarshall Wrote:Other than the login screen, no.

Thank you Jonathan,

Guess I will go dust off my sources script then.

Wyrm (xTV SAF)
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply
#4
I strongly recommend against doing that, unless you anticipate to control the binaries that the user is running. Don't try and work around inherent limitations: either fix them, or accept them and move on. Your script (and thus skin) will almost certainly break at some point in the future.

Cheres,
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
Reply
#5
Isn't it easier to let the user log in as they want and then activate master mode when needed ?
Reply
#6
jmarshall Wrote:I strongly recommend against doing that, unless you anticipate to control the binaries that the user is running. Don't try and work around inherent limitations: either fix them, or accept them and move on. Your script (and thus skin) will almost certainly break at some point in the future.

Cheres,
Jonathan

Jonathan,

Not a criticism mate, but is that not the situation we have at the moment anyway. Post SVN 28000 my skin (and others I'm sure) breaks due to changes in the binaries. You fix the script (or skin) and move on. Besides, isn't hacking the art of not accepting limitationsBig Grin.

What I am trying to do is allow the wife and kids to access age appropriate material in a spouse (and small child) friendly manner. Adult material accessed from mastermode and children's material accessed from another profile. From my home menu I will have a button that changes profile to the alternate profile (with a PIN on mastermode). Nice and simple (for the user at least).

Now I could put in a request for the functionality, but I'm pretty sure the chances of seeing it any time in the next couple of months is exactly zero, thus the script idea. As I said, I currently do something similar with the sources.xml file, so no biggy in the script department.

Wyrm xTV SAF (Spouse Acceptance Factor)
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply
#7
Quote:Not a criticism mate, but is that not the situation we have at the moment anyway. Post SVN 28000 my skin (and others I'm sure) breaks due to changes in the binaries. You fix the script (or skin) and move on. Besides, isn't hacking the art of not accepting limitations.

Yes, it is a similar situation. The addons system is being put into place to ensure that end users don't have to put up with breakage (as much as we can avoid it at least!). Ofcourse, you the developer will always have to deal with it, as skinning XBMC is and always will be a moving target, particularly when large changes like we're going through at the moment are in play. Part of this is due to you guys pushing the barrier - which is something I certainly don't want to discourage you from doing! However, scripts are more likely to break than skins are, and even if they aren't, you're introducing a further dependency which will make your skin more fragile, thus the recommendation. You're free to ignore the advice ofcourse! Smile

Perhaps I'm missing something, but I don't really see the problem of having the user switch to the login screen - after all it gives you a list of users to click on, exactly as you are after?

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
Reply
#8
jmarshall Wrote:Perhaps I'm missing something, but I don't really see the problem of having the user switch to the login screen - after all it gives you a list of users to click on, exactly as you are after?

Cheers,
Jonathan

Jonathan,

We are coming at the problem from two different directions. You from a sophisticated Users point of view and Me from a 5 year olds view (or my Wife, but PLEASE don't tell her that).Big Grin

I'm expecting a semi sophisticated user to set this up for the family. The Wife understands press the Family button and key a pin. The Kids understand don't touch the button with two people pictured next to it, because a strange screen comes up that you need Dad to make go away (or not, will play with this to see if it times out on the pin). Nothing more to understand, everybody happy.

Using a script lets me make it a general solution and selecting a profile for the family friendly sources means that if you have a pre existing profile that fits the bill, you can use that. All Good.

Wyrm (xTV SAF)
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply
#9
So why can't that "Family button" just Log off ? Mum then clicks on the master user, enters the password and away she goes. The kids see the same thing, and they can just click on "Kids" to get back out of it, saving Dad the hassle of "fixing" it.

It seems to me that what you're wanting to do with a script is exactly the same as this.

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
Reply
#10
jmarshall Wrote:So why can't that "Family button" just Log off ? Mum then clicks on the master user, enters the password and away she goes. The kids see the same thing, and they can just click on "Kids" to get back out of it, saving Dad the hassle of "fixing" it.

It seems to me that what you're wanting to do with a script is exactly the same as this.

Cheers,
Jonathan

Jonathan,

Sorry, script is only used in the skin settings menu to display a list of valid profiles to chose from and then set a Skin.String.

Currently have all the pieces in place but I'm having a problem with the <visible> condition to show the correct button. This is what I have at the moment:

PHP Code:
<!-- Adult/Family Toggle -->
                <
item>
                     <
icon>icon-adult.png</icon>
                     <
thumb>icon-adult-blur1.png</thumb>
                    <
label>31039</label>
                    <
onclick>Mastermode()</onclick>
                    <
visible>Skin.HasSetting(home-familymode) + StringCompare($INFO[System.ProfileName)]$INFO[Skin.String(home-familypname)])</visible>                    
                </
item>
                <
item>
                     <
icon>icon-family.png</icon>
                     <
thumb>icon-family-blur1.png</thumb>
                    <
label>31040</label>
                    <
onclick>LoadProfile($INFO[Skin.String(home-familypname)])</onclick>
                    <
visible>Skin.HasSetting(home-familymode) + !StringCompare($INFO[System.ProfileName],$INFO[Skin.String(home-familypname)])</visible>
                </
item
The Skin.String(home-familypname) is set by the above mentioned script (which is working fine). Can you see any problem with the above code, because nothing jumps out at me at the moment?

Wyrm (xTV SAF)
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply
#11
try this:
StringCompare(System.ProfileName,$INFO[Skin.String(home-familypname)])
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
#12
ronie Wrote:try this:
StringCompare(System.ProfileName,$INFO[Skin.String(home-familypname)])

ronie,

Thanks mate, but NO unfortunately not. Did a cut and paste of your StringCompare with mine and still no go. I'm running a pre merge build (28274), that would not be it would it?

Wyrm (xTV SAF)
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply
#13
wyrm Wrote:ronie,

Thanks mate, but NO unfortunately not. Did a cut and paste of your StringCompare with mine and still no go. I'm running a pre merge build (28274), that would not be it would it?

the option to compare two info labels was added in r25617, so you should be good to go.

have you already tried this:
StringCompare(System.ProfileName,Skin.String(home-familypname))
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
#14
I may be missing something, but would it not be possible to call the loadprofile builtin from a skin element?
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.
Reply
#15
ronie Wrote:the option to compare two info labels was added in r25617, so you should be good to go.

have you already tried this:
StringCompare(System.ProfileName,Skin.String(home-familypname))

ronie,

No I hadn't. And Yes that seems to be working, thank you for the help. The previous StringCompare you suggested gave a "Error evaluating boolean expression" but that's now gone.

Now all seems to be working except for a minor error with a <visible> condition somewhere in home.xml, but can't see that being too hard to pin down. Thanks to everyone who chipped in with help on this one.

Wyrm (xTV SAF)
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply

Logout Mark Read Team Forum Stats Members Help
Is there a way select a profile name?0