fix confirmEx api's (smoketest blocker bug 135672), r=ccarlen, sr=kin, a=leaf

This commit is contained in:
brade%netscape.com 2002-04-05 18:15:13 +00:00
parent fb28b6190a
commit fd10559242
3 changed files with 13 additions and 18 deletions

View File

@ -1102,14 +1102,14 @@ var gEditorOutputProgressListener =
if (!promptServ)
return;
outButtonPressed = promptServ.confirmEx(window, dlgTitle, text, nsIPromptService.STD_OK_CANCEL_BUTTONS,
promptServ.confirmEx(window, dlgTitle, text, nsIPromptService.STD_OK_CANCEL_BUTTONS,
"", "", "", checkBoxLabel, checkObj);
},
confirmEx : function(dlgTitle, text, btnFlags, btn0Title, btn1Title, btn2Title, checkBoxLabel, checkVal)
{
var promptServ = GetPromptService();
if (!promptServ)
return;
return 0;
return promptServ.confirmEx(window, dlgTitle, text, btnFlags,
btn0Title, btn1Title, btn2Title,
@ -1764,8 +1764,6 @@ var nsRevertCommand =
if (promptService)
{
var result = {value:0};
// Put the page title in the message string
var title = window.editorShell.GetDocumentTitle();
if (!title)
@ -1773,13 +1771,13 @@ var nsRevertCommand =
var msg = GetString("AbandonChanges").replace(/%title%/,title);
result = promptService.confirmEx(window, GetString("RevertCaption"), msg,
var result = promptService.confirmEx(window, GetString("RevertCaption"), msg,
(promptService.BUTTON_TITLE_REVERT * promptService.BUTTON_POS_0) +
(promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1),
null, null, null, null, {value:0});
// Reload page if first button (Revert) was pressed
if(result.value == 0)
if(result == 0)
{
FinishHTMLSource();
window.editorShell.LoadUrl(GetDocumentUrl());

View File

@ -511,13 +511,11 @@ function CheckAndSaveDocument(command, allowDontSave)
promptFlags += doPublish ?
(promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2)
: (promptService.BUTTON_TITLE_DONT_SAVE * promptService.BUTTON_POS_2);
result = promptService.confirmEx(window, dialogTitle, dialogMsg, promptFlags,
button1Title, null, button3Title, null, {value:0});
result = promptService.confirmEx(
window, dialogTitle, dialogMsg, promptFlags,
button1Title, null, button3Title, null, {value:0}
);
if (result.value == 0)
if (result == 0)
{
// Save, but first finish HTML source mode
if (gHTMLSourceChanged)
@ -538,10 +536,10 @@ function CheckAndSaveDocument(command, allowDontSave)
return success;
}
if (result.value == 2) // "Don't Save"
if (result == 2) // "Don't Save"
return true;
// Default or result.value == 1 (Cancel)
// Default or result == 1 (Cancel)
return false;
}

View File

@ -117,7 +117,7 @@ function showNeedSetupInfo()
if (promptService && gBundle && gBrandBundle) {
var dummy = new Object;
var buttonPressed = new Object;
var buttonPressed =
promptService.confirmEx(window,
gBrandBundle.getString("brandShortName"),
gBundle.getString("NeedSetup"),
@ -127,10 +127,9 @@ function showNeedSetupInfo()
0,
0,
null,
dummy,
buttonPressed);
dummy);
if (0 == buttonPressed.value) {
if (0 == buttonPressed) {
openHelp("sign-encrypt");
}
}