• 1
  • 53
  • 54
  • 55(current)
  • 56
  • 57
  • 140
Release script.skinshortcuts
(2015-10-09, 09:24)BobCratchett Wrote: @tomer953 - with this truly global override, you could extend the parental controls hack with the addition of a custom property...

Code:
<override action="globaloverride">
    <condition>IsEmpty(Container(9000).ListItem.Property(ParentalControl)) | StringCompare(Skin.String(mypassword),1234)</condition>
    <action>::ACTION::</action>
</override>
<override action="globaloverride">
    <condition>!IsEmpty(Container(9000).ListItem.Property(ParentalControl)) + !StringCompare(Skin.String(mypassword),1234)</condition>
    <action>Skin.SetString(mypassword)</action>
</override>

With the custom property either setting or clearing the ParentalControls property. That should mean that you could lock any main menu item, and its submenu items would lock as well. It's still a hack, though Wink

Maybe I'm missing something, But from a simple check, its not working.
Code:
<control type="button" id="993">
    <include>skinbuttons</include>
    <onclick>SetProperty(customProperty,ParentalControl)</onclick>
    <onclick>SetProperty(customValue,True)</onclick>
    <onclick>SendClick(404)</onclick>            
    <label>ParentalControl</label>
</control>
the property is set to True, I checked it - but the overrides code is not working.. check it out?
b.t.w, what is the way to use boolean Property? so I can use radiobutton instead of button. ? I tought about some workarround with skin.togglesettings and onclick conditions - any fastest way ?
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
It works quite nicely for me. That's still a very simple usage, though. More complex usage will require more complex code (and probably some playing about to get it to work properly).

Anytime Skin Shortcuts takes a boolean, it's exactly the same as the booleans you'd use in the skinning xml - List of boolean conditions (wiki)

Edit:- Completely misunderstood your boolean question, but the answer is the same in you can use any boolean condition Kodi supports. However, I think you mean Skin.ToggleSetting / Skin.HasSetting ...?
Reply
(2015-10-15, 16:38)tomer953 Wrote: the property is set to True, I checked it - but the overrides code is not working.. check it out?
b.t.w, what is the way to use boolean Property? so I can use radiobutton instead of button. ? I tought about some workarround with skin.togglesettings and onclick conditions - any fastest way ?

Just check against the value in list 211 to get a bool value...

<selected>Container(211).ListItem.Property(Parental),activated</selected>

Something like that
Reply
(2015-10-15, 17:35)BobCratchett Wrote: It works quite nicely for me.

Are You sure it's worked for exactly like you posted ? I copied it and not worked for me.
I noticed that your variable is without "Yes" option:
Code:
<variable name="passcode">
        <value condition="[IsEmpty(Container(211).ListItem.Property(ParentalControl)) | StringCompare(Container(211).ListItem.Property(ParentalControl),no)]"></value>
        <value>No</value>
    </variable>
Thats ok ?
any way, I tried to play with it - none work for me... (b.t.w - I don't have recent commits of skinshortcuts, if thats the case)
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
I wouldn't say it works perfectly (it's a 20 min hack) but yes, it works for me. It does require a version of Skin Shortcuts from the last 6 days, though (that's when the commit which makes the global override able to be truly global - that is applied to every single shortcut in the users menus - was added).

And thanks for the note. I spotted that myself after I'd pushed it, and updated the commit Wink It wouldn't affect usage, though, just what is displayed in script-skinshortcuts.xml.
Reply
Ok - first thing - latest git did help. - now I see some things in action...
second - your variable is not working for me in the dialog management - I tried to fix it myself, used many different conditions - and for some strange reason - I didn't success to show the actual value. so for now I'm using
Container(211).ListItem.Property(ParentalControl) in label2 instead of VAR - (but when null, nothing is showing up).

third - Also the overrides conditions are wrong - or just not working, please double check it..

In the first overrides you use:
Code:
[IsEmpty(Container(9000).ListItem.Property(ParentalControl)) | StringCompare(Container(9000).ListItem.Property(ParentalControl),no)]
Which means: Nothing | no
and in the second one you use:
Code:
!StringCompare(Container(9000).ListItem.Property(ParentalControl),yes)
which means: not yes
so, its just me or you don't check for "yes" in both cases?
I know basic conditions and variable stuff, but with this case - I just can't get it to work.
or all the items are locked - or they are all open...
a little more help is needed please, Thank you for your patience.
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
That's what I get when I do a quick hack Blush

The variable labels are the wrong way round, should be:-

Code:
    <variable name="passcode">
        <value condition="[IsEmpty(Container(211).ListItem.Property(ParentalControl)) | SubString(Container(211).ListItem.Property(ParentalControl),no)]">No</value>
        <value>Yes</value>
    </variable>

And the conditions I was still playing around with, and never pushed the final versions (the StringCompare -> yes wasn't working, I was still trying to check why when I pushed that one) where I changed to SubString's:-

Code:
    <override action="globaloverride">
        <condition>[IsEmpty(Container(9000).ListItem.Property(ParentalControl)) | SubString(Container(9000).ListItem.Property(ParentalControl),no)] | StringCompare(Skin.String(mypassword),Skin.String(passcode))</condition>
        <action>AlarmClock(parental,Skin.Reset(mypassword),3,Silent)</action>
        <action>::ACTION::</action>
    </override>
    <override action="globaloverride">
        <condition>SubString(Container(9000).ListItem.Property(ParentalControl),yes) + !StringCompare(Skin.String(mypassword),Skin.String(passcode))</condition>
        <action>Skin.SetNumeric(mypassword)</action>
        <action>AlarmClock(parental,Skin.Reset(mypassword),3,Silent)</action>
    </override>

Sorry about that.
Reply
Oh, so It was the "StringCompare" all that time? damn, I can swear I wrote to myself once to avoid using that unreliable method lol.
10x for that, confirmed working now!

Now Im thinking how to take it to the next level, I tought to make some custom dialog to the unlock code instead of the Skin.SetNumeric window,
There is a way to pass the ::ACTION:: to my custom dialog? so once the user is typing the right code - it will perform the action immediately.
Code:
Skin.SetString(action,::ACTION::)
- will work fine in the override?
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
You can't use ::ACTION:: like that, no. It has to be the only text in the <action /> element. It's possible you can get the path property of the main menu/submenu item (you'd need some logic to work out which one your custom dialog was called from) and use that - as long as the first override's first action is <action>::ACTION::</action>, the first <property name="path"> will have the default action as its value. (And note to self, clean up the extra path properties when time allows)

Personally, I've gone with changing the color of 'locked' shortcuts for now, which seems to give a reasonable UX (particularly for the change passcode button - makes it clearer whether the click on it is unlocking or changing the passcode) but I may borrow your custom dialog if you can get it working Smile
Reply
OK Im on my way to custom dialog, but can't pass the Property(path)...
from overrides:
Code:
    <action>Skin.SetString(dialog_header,Enter Password)</action>            
    <action>Skin.SetString(dialog_action,$INFO[Container(9000).ListItem.Property(path)])</action>            
    <action>Skin.SetString(dialog_msg,Enter PIN:)</action>
    <action>ActivateWindow(1131)</action>
from gui:
Code:
<setting type="string" name="skin.phenomenal.dialog_header">Enter Password</setting>
  <setting type="string" name="skin.phenomenal.dialog_msg">Enter PIN:</setting>
  <setting type="string" name="skin.phenomenal.dialog_action">Skin.SetString(dialog_action,Skin.SetString(dialog_action,Skin.SetString(dialog_action,Skin.SetString(dialog_action,Skin.SetString(dialog_action,AlarmClock(parental,Skin.Reset(mypassword),3,Silent))))))</setting>
something is wrong with the action part
there is a fix for that? another way?

Edit:
I tried to play with It, for debug needs, I added a label in my home.xml with:
Code:
<label>Path: $INFO[Container(9000).ListItem.Property(path)]</label>
and when this <action /> below is in use , no matter if its in the first\second override, the path property is start to fill up with some Skin.SetString like In the code above ^, and it seems like it is stuck in a loop... so the path is fills until the limit of string chars...
Code:
<action>Skin.SetString(dialog_action,$INFO[Container(9000).ListItem.Property(path)])</action>
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
From a quick test Kodi actually picks up the last <action /> of the last override as the path property. However, if that doesn't work for you then it's either not possible or requires a more creative workaround than I have the time to come up with Smile
Reply
I played with it as much as I can think of... first\last - doesnt matter. I don't think the Path property can be assigned to SkinString from there without code change as you said.
OK thanks for you help, I guess for now I'll keep this method to myself, maybe some day ill find a good way to achive it and post to my skin users.
Or maybe Super-Marcel will save the planet with his helper Wink
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
Just another thought, maybe i'll stop trying to pass the Path from the override.xml file, and just put:
$INFO[Container(9000).ListItem.Property(path)]
in my custom dialog "OK" button
From a quick test, this stays empty in my custom dialog Sad I don't have any other "9000" id.. this trick is possible? grab the property to another dialog ?
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
Window(10000).Container(9000).ListItem.Property(path)? (You'll need to handle clicks from the submenu too, don't forget Wink)
Reply
Not working...
Code:
$INFO[Window(home).Container(9000).ListItem.Property(path)]
$INFO[Window(10000).Container(9000).ListItem.Property(path)]
$INFO[Container(9000).ListItem.Property(path)]
All is null in my custom_lock.xml "textbox" control.

Edit:
and once i'll make it work, I don't need for sub-menus too...
the whole Idea is to protect on main-menu, once its protected, i'll use visible conditions to hide submenu and widget.
after user is "unlock" the menu, the submenu and widget will show up and will function normally...
so the custom dialog will only appear when you try to enter to a main menu item that is in locked status while you pressing it.
make sense right?
Phenomenal™ Skin • ForumWebsiteGitHub
Reply
  • 1
  • 53
  • 54
  • 55(current)
  • 56
  • 57
  • 140

Logout Mark Read Team Forum Stats Members Help
script.skinshortcuts8