-
Notifications
You must be signed in to change notification settings - Fork 263
Bug 710107 - Support radio type for simple-prefs #597
Bug 710107 - Support radio type for simple-prefs #597
Conversation
@erikvold I think you'd be the perfect reviewer for this, could you please pick this one up ? Thanks! |
@Gozala |
Updated the title. |
hey @taku0 thanks for taking this one on! I'm just starting to review this, but so far I noticed there aren't any tests, that is something that should be added. There is a new type of test for Jetpacks called add-on tests which use a addon as a test, which would allow us to test this bug most extensively, but there are other tests that currently exist that should be extended as well. Let me know if you need/want help with this. |
I think that we should just use |
please also mention these new types in the documentation, but I won't block on this, it can be another bug. |
Added test for options.xul generation. |
@@ -25,6 +25,12 @@ function onOptionsDisplayed(document, addonId) { | |||
let title = core.get(name + "_title"); | |||
if (title) | |||
node.setAttribute("title", title); | |||
|
|||
for (let item of node.querySelectorAll("menuitem, radio")) { | |||
let label = core.get(item.getAttribute("label")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use core.get(name + "_options." + item.getAttribute("label"))
to stick to the convention already started.
This branch should be updated, master has changed a bit. Other than the one change mentioned for the l10n this looks good. Once you do the merge with master I'll run the tests and it should be good! |
Merge succeeded without conflict and test_xpi.py works fine :). |
looks good! I just need to get home and try on Fennec now.. |
hmm, there is an issue on Fennec with the menu drop down, when I select it I don't see the "left_button" option, and when I select a value I am asked to make a selection a second time. I can take a look into these issues. |
ok this looks like it is a platform bug to me |
Fix Bug 710107 - Support radio type for simple-prefs r=@erikvold
Thanks @taku0 ! |
I filed bug 802651 |
This is cool. Does the menulist option allow for omitting the value or label to serve as the other? What about hierarchical menus? Thanks! |
Also, any way to distinguish single select while allowing multiple select? |
Added “menulist” and “radio” types to simple-prefs.
Sample:
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.