Boolean preferences

Hi,



I am trying to add some boolean preferences to my v2 plugin (https://github.com/chhitz/teleboyPlugin). I have added the following to the DefaultPrefs.json:



[<br />
    {<br />
        "id":           "channels_de",<br />
        "label":        "German channels",<br />
        "type":         "boolean",<br />
        "default":      "true"<br />
    },<br />
    {<br />
        "id":           "channels_fr",<br />
        "label":        "French channels",<br />
        "type":         "boolean",<br />
        "default":      "false"<br />
    },<br />
    {<br />
        "id":           "channels_it",<br />
        "label":        "Italien channels",<br />
        "type":         "boolean",<br />
        "default":      "false"<br />
    },<br />
    {<br />
        "id":           "channels_en",<br />
        "label":        "English channels",<br />
        "type":         "boolean",<br />
        "default":      "false"<br />
    }<br />
]



The JSON parses fine (no errors in the log). Also the other (non boolean) preferences work fine. Only the booleans do not appear in the preferences dialog.

Do you have any pointers or suggestions?

Thanks.

I’ve had the same problem, and ended up using a [“Yes”,“No”] enum preference as a workaround.

I also ran into that problem, and I’m pretty sure the answer was to use ‘bool’ instead of ‘boolean’.

Just to confirm that Mike is correct, there is a mistake in the docs, the correct value to use for a boolean type preferences is indeed bool.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.