Bug 830175 - Turn buttons in the prompt service from objects with labels to just strings. r=wesj

This commit is contained in:
Kartikaya Gupta
2013-01-15 15:31:24 -05:00
parent 42a798bddf
commit 79448dd0ee
4 changed files with 13 additions and 35 deletions

View File

@@ -134,8 +134,8 @@ Prompt.prototype = {
if (aTitle) msg.title = aTitle;
if (aText) msg.text = aText;
msg.buttons = aButtons || [
{ label: PromptUtils.getLocaleString("OK") },
{ label: PromptUtils.getLocaleString("Cancel") }
PromptUtils.getLocaleString("OK"),
PromptUtils.getLocaleString("Cancel")
];
msg.inputs = aInputs;
return PromptUtils.sendMessageToJava(msg);
@@ -181,17 +181,17 @@ Prompt.prototype = {
/* ---------- nsIPrompt ---------- */
alert: function alert(aTitle, aText) {
this.commonPrompt(aTitle, aText, [{ label: PromptUtils.getLocaleString("OK") }], "", {value: false}, []);
this.commonPrompt(aTitle, aText, [ PromptUtils.getLocaleString("OK") ], "", { value: false }, []);
},
alertCheck: function alertCheck(aTitle, aText, aCheckMsg, aCheckState) {
let data = this.commonPrompt(aTitle, aText, [{ label: PromptUtils.getLocaleString("OK") }], aCheckMsg, aCheckState, []);
let data = this.commonPrompt(aTitle, aText, [ PromptUtils.getLocaleString("OK") ], aCheckMsg, aCheckState, []);
if (aCheckMsg)
aCheckState.value = data.checkbox == "true";
},
confirm: function confirm(aTitle, aText) {
let data = this.commonPrompt(aTitle, aText, null, "", {value: false}, []);
let data = this.commonPrompt(aTitle, aText, null, "", { value: false }, []);
return (data.button == 0);
},
@@ -237,7 +237,7 @@ Prompt.prototype = {
}
if (bTitle)
buttons.push({label:bTitle});
buttons.push(bTitle);
aButtonFlags >>= 8;
}
@@ -289,11 +289,8 @@ Prompt.prototype = {
},
select: function select(aTitle, aText, aCount, aSelectList, aOutSelection) {
let data = this.commonPrompt(aTitle, aText, [
{ label: PromptUtils.getLocaleString("OK") }
], "", {value: false}, [
{ type: "menulist", values: aSelectList },
]);
let data = this.commonPrompt(aTitle, aText, [ PromptUtils.getLocaleString("OK") ], "",
{ value: false }, [{ type: "menulist", values: aSelectList }]);
let ok = data.button == 0;
if (ok)