rest of fix for #21901, a=sdagley (a while ago).

give alerts, prompts, and other common dialogs default titles, if none
are passed in.

todo:  put those defaults into a string bundle so ICP doesn't kill me.
This commit is contained in:
sspitzer%netscape.com 1999-12-22 04:55:43 +00:00
Родитель 228489052e
Коммит 1df68ebcfd
1 изменённых файлов: 56 добавлений и 7 удалений

Просмотреть файл

@ -71,7 +71,14 @@ NS_IMETHODIMP nsCommonDialogs::Alert(nsIDOMWindow *inParent, const PRUnichar *i
block->SetInt( eNumberButtons, 1 );
block->SetString( eMsg, inMsg );
block->SetString( eDialogTitle,inWindowTitle );
if (inWindowTitle) {
block->SetString( eDialogTitle,inWindowTitle );
}
else {
// todo, put that in a string bundle
nsString defaultTitle("Alert");
block->SetString( eDialogTitle, defaultTitle.GetUnicode());
}
nsString url( kAlertIconURL );
block->SetString( eIconURL, url.GetUnicode());
@ -95,7 +102,14 @@ NS_IMETHODIMP nsCommonDialogs::Confirm(nsIDOMWindow *inParent, const PRUnichar *
// Stuff in Parameters
block->SetInt( eNumberButtons,2 );
block->SetString( eMsg, inMsg );
block->SetString( eDialogTitle, inWindowTitle );
if (inWindowTitle) {
block->SetString( eDialogTitle, inWindowTitle );
}
else {
// todo, put that in a string bundle
nsString defaultTitle("Confirm");
block->SetString( eDialogTitle, defaultTitle.GetUnicode());
}
nsString url( kQuestionIconURL );
block->SetString( eIconURL, url.GetUnicode());
@ -122,7 +136,14 @@ NS_IMETHODIMP nsCommonDialogs::ConfirmCheck(nsIDOMWindow *inParent, const PRUni
// Stuff in Parameters
block->SetInt( eNumberButtons,2 );
block->SetString( eMsg, inMsg );
block->SetString( eDialogTitle, inWindowTitle );
if (inWindowTitle) {
block->SetString( eDialogTitle, inWindowTitle );
}
else {
// todo, put that in a string bundle
nsString defaultTitle("Confirm");
block->SetString( eDialogTitle, defaultTitle.GetUnicode());
}
nsString url( kQuestionIconURL );
block->SetString( eIconURL, url.GetUnicode());
block->SetString( eCheckboxMsg, inCheckMsg );
@ -154,7 +175,14 @@ NS_IMETHODIMP nsCommonDialogs::Prompt(nsIDOMWindow *inParent, const PRUnichar *i
// Stuff in Parameters
block->SetInt( eNumberButtons,2 );
block->SetString( eMsg, inMsg );
block->SetString( eDialogTitle, inWindowTitle );
if (inWindowTitle) {
block->SetString( eDialogTitle, inWindowTitle );
}
else {
// todo, put that in a string bundle
nsString defaultTitle("Prompt");
block->SetString( eDialogTitle, defaultTitle.GetUnicode());
}
nsString url( kQuestionIconURL );
block->SetString( eIconURL, url.GetUnicode());
block->SetInt( eNumberEditfields, 1 );
@ -186,7 +214,14 @@ NS_IMETHODIMP nsCommonDialogs::PromptUsernameAndPassword(nsIDOMWindow *inParent,
// Stuff in Parameters
block->SetInt( eNumberButtons,2 );
block->SetString( eMsg, inMsg );
block->SetString( eDialogTitle, inWindowTitle );
if (inWindowTitle) {
block->SetString( eDialogTitle, inWindowTitle );
}
else {
// todo, put that in a string bundle
nsString defaultTitle("Prompt Username and Password");
block->SetString( eDialogTitle, defaultTitle.GetUnicode());
}
nsString url( kQuestionIconURL );
block->SetString( eIconURL, url.GetUnicode());
block->SetInt( eNumberEditfields, 2 );
@ -219,7 +254,14 @@ NS_IMETHODIMP nsCommonDialogs::PromptPassword(nsIDOMWindow *inParent, const PRU
// Stuff in Parameters
block->SetInt( eNumberButtons,2 );
block->SetString( eMsg, inMsg );
block->SetString( eDialogTitle, inWindowTitle );
if (inWindowTitle) {
block->SetString( eDialogTitle, inWindowTitle );
}
else {
// todo, put that in a string bundle
nsString defaultTitle("Prompt Password");
block->SetString( eDialogTitle, defaultTitle.GetUnicode());
}
nsString url( kQuestionIconURL );
block->SetString( eIconURL, url.GetUnicode());
block->SetInt( eNumberEditfields, 1 );
@ -249,7 +291,14 @@ nsresult nsCommonDialogs::Select(nsIDOMWindow *inParent, const PRUnichar *inDial
if ( NS_FAILED( rv ) )
return rv;
block->SetNumberStrings( inCount + 2 );
block->SetString( 0, inDialogTitle );
if (inDialogTitle) {
block->SetString( 0, inDialogTitle );
}
else {
// todo, put that in a string bundle
nsString defaultTitle("Select");
block->SetString( eDialogTitle, defaultTitle.GetUnicode());
}
block->SetString(1, inMsg );
block->SetInt( eSelection, inCount );
for ( PRUint32 i = 2; i<= inCount+1; i++ )