2016-01-14, 09:53
(2016-01-14, 02:14)marcelveldt Wrote: For example:
<setting id="mediaflagsstyle" value="textbased - full info" label="Textbased - Full Info" condition="" icon="special://skin/extras/viewthumbs/flags_text.jpg" description="" default="true" optionalcommands="Skin.Reset(osdmediaflagsstyle)"/>
That's the idea
However, when having a lot of conditions and "bulk" actions it could turn to be hard to write / read the code, don't you think ?
Just my opinion but if the goal is to replace / make easier the <onclick> action, something maybe more "universal" could be :
Code:
<settings>
<!-- home layout -->
<setting id="HomeLayout" value="1" label="$LOCALIZE[31309] - 1 row" condition="" icon="" description="">
<onselect condition="Condition1IsTrue">Skin.SetString(MyString1)</onselect>
<onselect condition="Condition2IsTrue">Skin.SetString(MyString2)</onselect>
<onselect condition="Condition3IsTrue">WhateverAction</onselect>
</setting>
<setting id="HomeLayout" value="2" label="$LOCALIZE[31309] - 2 rows" condition="" icon="" description=""/>
<setting id="HomeLayout" value="3" label="$LOCALIZE[31309] - 3 rows" condition="" icon="" description=""/>
</settings>
I'm still not a python coder and don't know if that is possible but the typo looks more familiar to what we are used to know.
Also, when you don't use <onselect> (optional), your code keeps the initial structure, and "code migration" in mind, this is pretty straight forward for copy / paste the <onclick> content.
Will take a look at the Default properties too ... This could also be really helpful
EDIT : Huh ! Just thinking this could be a huge fail
My typo is :
Code:
Skin.SetString($INFO[Container(9300).ListItem.Property(SetID)],1ROW)
Will the $INFO[Container(9300).ListItem.Property(SetID)] be handled outside of the main window ? I mean for <onselect> ... I have some doubts.
I use the same for conditions, not sure I keep the focus and properties are active when DialogSelect is visible.
EDIT 2 :
Tried it and doesn't work because loosing the focus. Well, should be easily solved by passing the ListItem.Property to a Window.Property :
Code:
<control type="button" id="423003">
<label>[NEGATIVE SQUARED LATIN CAPITAL LETTER B]$LOCALIZE[31121]:[/B] $INFO[Skin.String(HomeLayout.label)]</label>
<onclick>SetProperty(SetID,$INFO[Container(9300).ListItem.Property(SetID)],Home</onclick>
<onclick>RunScript(script.skin.helper.service,action=setskinsetting,setting=HomeLayout,header=$LOCALIZE[31124])</onclick>
</control>
Sorry, thinking out loud too