Kodi Community Forum

Full Version: AddonInformation dialog Auto-update button
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to add the Auto-update button in AddonInformation dialog but not as a common radio button. I want to use a toggle button so to have text look button like all the others that Bello is using in information dialogs....

Image

So, the code that i am using is this...
php:
<control type="togglebutton" id="130">
    <description>Auto-Update</description>
    <label>$LOCALIZE[21340]: $INFO[Control.GetLabel(13).index(1)]</label>
    <altlabel>$LOCALIZE[21340]: $INFO[Control.GetLabel(13).index(1)]</altlabel>
    <include>TopMenuButton</include>
    <onclick>SendClick(13)</onclick>
</control>
...and i have the radiobutton id="13" hidden in the end of the file.

The problem is that the SendClick action it's not working here nor the Control.GetLabel(13).index(1) to get the <label2/> of the button.
I'm using this way in several places in Bello and is working fine except from the AddonInformation dialog.

I've also try these but none of them is working too...
php:
<onclick>SendClick(146,13)</onclick>
<onclick>SendClick(addoninformation,13)</onclick>

Is this a bug on Leia nightlies or am i doing something wrong here?... or is there another way to achieve want i want?

Cheers
Nessus
Try this:
Code:
<onclick>SetFocus(13)</onclick>
<onclick>Select</onclick>
<onclick>SetFocus(130)</onclick>

For the label, you probably will have to use a variable and use the following for the enabled condition
Code:
String.Contains(Control.GetLabel(13),*)
Yea, i could do that but seems to me like a... hack for a simple standard action and i never liked hacks.
Nevertheless if it's the only option i will use it. Thanks.

Another weird behavior that i discover while was dealing with this is that if you use a "radiobutton" with auto </width> in a horizontal groulist the button textures are taking the max value of the </width> tag.

So the code bellow...
php:
<control type="radiobutton" id="13">
    <description>Auto-Update</description>
    <height>66</height>
    <width min="0" max="860">auto</width>
    <font>FontSize_20</font>
    <textcolor>88white</textcolor>
    <focusedcolor>white</focusedcolor>
    <disabledcolor>44white</disabledcolor>
    <shadowcolor>77000000</shadowcolor>
    <texturefocus colordiffuse="$VAR[Textures.GlobalColor]">dialogs/other/topmenu_underline.png</texturefocus>
    <texturenofocus></texturenofocus>
    <textureradioonfocus></textureradioonfocus>
    <textureradioonnofocus></textureradioonnofocus>
    <textureradioofffocus></textureradioofffocus>
    <textureradiooffnofocus></textureradiooffnofocus>
    <textureradioondisabled></textureradioondisabled>
    <textureradiooffdisabled></textureradiooffdisabled>
    <radiowidth></radiowidth>
    <radioheight></radioheight>
    <label></label>
</control>

...it gives me the following visual result:
Image

IMHO this is not a normal behavior. The textures (and the button) width should change dynamically.

EDIT: <radioposx/> tag has no affect to the width of textures or the button.

Cheers
Nessus
auto width is only supported for button & togglebutton controls.
 
also, Control.GetLabel(id).index(num) is only supported for edit controls.

not sure why SendClick() doesn't work... i'll try to make some time to dig through the source-code for that one.
@ronie - sendclick has never worked for radiobuttons afaik.
very likely, i'm just wondering why...
I use sendclick on a radiobutton in AddonBrowser and that works fine.
It probably only works in windows and not in dialogs
@BigNoid - I tested in Skin Settings window and it didn't work.

Also, it never worked for the Notifications radiobutton in AddonBrowser (which has now been removed). Though it does work for the new ones (id 7 and 8).

I have a feeling it only works for built-ins, and has to be individually specified for each one.
SendClick it works fine for me in any place that i use it so far. At least till Krypton. Although i cant remember if all of them are not radio buttons.
The AddonInfo dialog it's the first place that i found that is not working. In any case, IMHO this should work the same like any other control that can take onclick action.
 
(2018-03-09, 00:21)ronie Wrote: [ -> ]auto width is only supported for button & togglebutton controls.
also, Control.GetLabel(id).index(num) is only supported for edit controls.
Thanks for clarification Ronie. Any chance of these to be added in Leia?

Cheers
Nessus
(2018-03-09, 22:54)jurialmunkey Wrote: [ -> ]@BigNoid - I tested in Skin Settings window and it didn't work.

Also, it never worked for the Notifications radiobutton in AddonBrowser (which has now been removed). Though it does work for the new ones (id 7 and 8).

I have a feeling it only works for built-ins, and has to be individually specified for each one.
Yeah it works in dialogs too ofc, don't know what i was thinking there as I used that for years in video info dialog myself.
You are right, it needs to be coded for every builtin, in addon info that is the case for button 13, so not sure why it doesn't work.