[HELP] Proper coding for addon update toggle button
#1
I am creating my menu bar at the moment and I want to have the two buttons within the addon browser that toggles automatic updates and the other that turns notifications on/off. I have been coding my buttons like so for when there is an on/off action to show the different labels and icons created.

<include name="Menu_Watched">

<item>
<icon>icons\new-icon-off.png</icon>
<label>$LOCALIZE[50057]</label>
<onclick>SendClick(14)</onclick>
<visible>!System.Setting(HideWatched)</visible>
</item>

<item>
<icon>icons\new-icon-on.png</icon>
<label>$LOCALIZE[50058]</label>
<onclick>SendClick(14)</onclick>
<visible>System.Setting(HideWatched)</visible>
</item>

</include>

My question is what would be the proper coding for my two visibles for the auto update button and the notification on/off button. My send click works fine, but I can't get the icons and labels to switch which means I don't have my visibles correct. I didn't see anything in the wiki for these functions or I may have missed them. Any help that can be given would be most appreciated. Thanks!
Reply
#2
There is no system setting available, so you'd have to have a skin setting yourself that you toggle instead. The problem with that is it may (will?) get out of sync.

What's so awful with using a radio button? Keep things simple! :p
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
You could try these but I haven't tested if they work -

PHP Code:
<visible>system.getbool(general.addonautoupdate)</visible

PHP Code:
<visible>system.getbool(general.addonnotifications)</visible

EDIT: That doesn't work but this will -

Auto-update On-

PHP Code:
<visible>SubString(Control.GetLabel(5),ON)</visible

Notification On -

PHP Code:
<visible>SubString(Control.GetLabel(6),ON)</visible
Reply
#4
Thanks so much for the help guys!

Got it working and axed off another problem on a list that is starting to get shorter by the day.
Reply

Logout Mark Read Team Forum Stats Members Help
[HELP] Proper coding for addon update toggle button0