mozilla/addon-sdk — pull request #597 by taku0 (2012-10-03 13:08:22+00:00)
Title: Added menulist and radio type to simple-prefs

Added “menulist” and “radio” types to simple-prefs.

Sample:

"preferences": [
{
"name": "openButton",
"title": "Mouse button to open menu",
"type": "menulist",
"value": 2,
"menulist": [
{
"value": "0",
"label": "left_button"
},
{
"value": "1",
"label": "middle_button"
},
{
"value": "2",
"label": "right_button"
},
{
"value": "3",
"label": "fourth_button"
},
{
"value": "4",
"label": "fifth_button"
}
]
},
{
"name": "radio",
"title": "Label color",
"type": "radio",
"value": "red",
"radio": [
{
"value": "red",
"label": "red"
},
{
"value": "blue",
"label": "blue"
}
]
}
]

The values of the “label” are used as l10n keys, or used vervatim as labels if no matching entries are exist in locale file.

Note that “value” of items are always strings like “on” and “off” properties for “boolint” type.