72530 - oversized dialog problems, r=jag, sr=alecf

This commit is contained in:
hewitt%netscape.com 2001-04-12 05:42:05 +00:00
Родитель eeb2282360
Коммит 58196589e7
12 изменённых файлов: 40 добавлений и 44 удалений

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

@ -2836,8 +2836,8 @@ nsEditorShell::ConfirmWithCancel(const nsString& aTitle, const nsString& aQuesti
{
// Stuff in Parameters
block->SetString( nsPIPromptService::eMsg, aQuestion.GetUnicode());
nsAutoString url; url.AssignWithConversion( "chrome://global/skin/question-icon.gif" );
block->SetString( nsPIPromptService::eIconURL, url.GetUnicode());
NS_NAMED_LITERAL_STRING(styleClass, "question-icon");
block->SetString(nsPIPromptService::eIconClass, styleClass.get());
nsAutoString yesStr, noStr;
// Default is Yes, No, Cancel

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

@ -2836,8 +2836,8 @@ nsEditorShell::ConfirmWithCancel(const nsString& aTitle, const nsString& aQuesti
{
// Stuff in Parameters
block->SetString( nsPIPromptService::eMsg, aQuestion.GetUnicode());
nsAutoString url; url.AssignWithConversion( "chrome://global/skin/question-icon.gif" );
block->SetString( nsPIPromptService::eIconURL, url.GetUnicode());
NS_NAMED_LITERAL_STRING(styleClass, "question-icon");
block->SetString(nsPIPromptService::eIconClass, styleClass.get());
nsAutoString yesStr, noStr;
// Default is Yes, No, Cancel

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

@ -400,7 +400,7 @@ var nsRevertCommand =
null,
{value:0},
{value:0},
"chrome://global/skin/question-icon.gif",
"question-icon",
{value:"false"},
2,
0,

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

@ -407,7 +407,7 @@ function CheckAndSaveDocument(reasonToSave, allowDontSave)
null,
{value:0},
{value:0},
"chrome://global/skin/question-icon.gif",
"question-icon",
{value:"false"},
(allowDontSave ? 3 : 2),
0,

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

@ -32,7 +32,7 @@ interface nsIDialogParamBlock;
interface nsPIPromptService : nsISupports
{
%{C++
enum {eMsg=0, eCheckboxMsg=1, eIconURL=2, eTitleMessage=3, eEditfield1Msg=4,
enum {eMsg=0, eCheckboxMsg=1, eIconClass=2, eTitleMessage=3, eEditfield1Msg=4,
eEditfield2Msg=5, eEditfield1Value=6, eEditfield2Value=7,
eButton0Text=8, eButton1Text=9, eButton2Text=10, eButton3Text=11,
eDialogTitle=12};

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

@ -32,9 +32,9 @@
const char *kPromptURL="chrome://global/content/commonDialog.xul";
const char *kSelectPromptURL="chrome://global/content/selectDialog.xul";
const char *kQuestionIconURL ="chrome://global/skin/question-icon.gif";
const char *kAlertIconURL ="chrome://global/skin/alert-icon.gif";
const char *kWarningIconURL ="chrome://global/skin/message-icon.gif";
const char *kQuestionIconClass ="question-icon";
const char *kAlertIconClass ="alert-icon";
const char *kWarningIconClass ="message-icon";
/****************************************************************
************************* ParamBlock ***************************
@ -100,8 +100,8 @@ nsPromptService::Alert(nsIDOMWindow *parent,
block->SetString(eDialogTitle, dialogTitle);
nsString url;
url.AssignWithConversion(kAlertIconURL);
block->SetString(eIconURL, url.GetUnicode());
NS_ConvertASCIItoUCS2 styleClass(kAlertIconClass);
block->SetString(eIconClass, styleClass.get());
rv = DoDialog(parent, block, kPromptURL);
@ -127,10 +127,8 @@ nsPromptService::AlertCheck(nsIDOMWindow *parent,
block->SetString(eDialogTitle, dialogTitle);
nsString url;
url.AssignWithConversion(kAlertIconURL);
block->SetString(eIconURL, url.GetUnicode());
NS_ConvertASCIItoUCS2 styleClass(kAlertIconClass);
block->SetString(eIconClass, styleClass.get());
block->SetString(eCheckboxMsg, checkMsg);
block->SetInt(eCheckboxState, *checkValue);
@ -158,9 +156,8 @@ nsPromptService::Confirm(nsIDOMWindow *parent,
block->SetString(eDialogTitle, dialogTitle);
nsString url;
url.AssignWithConversion(kQuestionIconURL);
block->SetString(eIconURL, url.GetUnicode());
NS_ConvertASCIItoUCS2 styleClass(kQuestionIconClass);
block->SetString(eIconClass, styleClass.get());
rv = DoDialog(parent, block, kPromptURL);
@ -188,8 +185,8 @@ nsPromptService::ConfirmCheck(nsIDOMWindow *parent,
block->SetString(eDialogTitle, dialogTitle);
nsString url; url.AssignWithConversion( kQuestionIconURL );
block->SetString(eIconURL, url.GetUnicode());
NS_ConvertASCIItoUCS2 styleClass(kQuestionIconClass);
block->SetString(eIconClass, styleClass.get());
block->SetString(eCheckboxMsg, checkMsg);
block->SetInt(eCheckboxState, *checkValue);
@ -212,7 +209,7 @@ nsPromptService::UniversalDialog(nsIDOMWindow *parent,
const PRUnichar *button2Text, const PRUnichar *button3Text,
const PRUnichar *editfield1Msg, const PRUnichar *editfield2Msg,
PRUnichar **editfield1Value, PRUnichar **editfield2Value,
const PRUnichar *iconURL, PRBool *checkboxState,
const PRUnichar *iconClass, PRBool *checkboxState,
PRInt32 numberButtons, PRInt32 numberEditfields,
PRInt32 editfield1Password, PRInt32 *buttonPressed)
{
@ -254,10 +251,10 @@ nsPromptService::UniversalDialog(nsIDOMWindow *parent,
block->SetString(eEditfield1Value, *editfield1Value);
block->SetInt(eEditField1Password, editfield1Password);
}
if (iconURL)
block->SetString(eIconURL, iconURL);
if (iconClass)
block->SetString(eIconClass, iconClass);
else
block->SetString(eIconURL, NS_ConvertASCIItoUCS2(kQuestionIconURL).GetUnicode());
block->SetString(eIconClass, NS_ConvertASCIItoUCS2(kQuestionIconClass).GetUnicode());
if (checkboxMsg)
block->SetInt(eCheckboxState, *checkboxState);
@ -306,8 +303,8 @@ nsPromptService::Prompt(nsIDOMWindow *parent,
block->SetString(eDialogTitle, dialogTitle);
nsString url; url.AssignWithConversion(kQuestionIconURL);
block->SetString(eIconURL, url.GetUnicode());
NS_ConvertASCIItoUCS2 styleClass(kQuestionIconClass);
block->SetString(eIconClass, styleClass.get());
block->SetInt(eNumberEditfields, 1);
if (*value)
block->SetString(eEditfield1Value, *value);
@ -360,9 +357,8 @@ nsPromptService::PromptUsernameAndPassword(nsIDOMWindow *parent,
block->SetString(eDialogTitle, dialogTitle);
nsString url;
url.AssignWithConversion(kQuestionIconURL);
block->SetString(eIconURL, url.GetUnicode());
NS_ConvertASCIItoUCS2 styleClass(kQuestionIconClass);
block->SetString(eIconClass, styleClass.get());
block->SetInt( eNumberEditfields, 2 );
if (*username)
block->SetString(eEditfield1Value, *username);
@ -422,8 +418,8 @@ NS_IMETHODIMP nsPromptService::PromptPassword(nsIDOMWindow *parent,
block->SetString(eDialogTitle, dialogTitle);
nsString url;
url.AssignWithConversion(kQuestionIconURL);
block->SetString(eIconURL, url.GetUnicode());
NS_ConvertASCIItoUCS2 styleClass(kQuestionIconClass);
block->SetString(eIconClass, styleClass.get());
block->SetInt(eNumberEditfields, 1);
block->SetInt(eEditField1Password, 1);
if (*password)

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

@ -77,7 +77,6 @@ permission_CheckConfirmYN(nsIPrompt *aPrompter, PRUnichar * szMessage, PRUnichar
PRUnichar * no_string = CKutil_Localize(NS_LITERAL_STRING("No").get());
PRUnichar * confirm_string = CKutil_Localize(NS_LITERAL_STRING("Confirm").get());
nsAutoString tempStr; tempStr.AssignWithConversion("chrome://global/skin/question-icon.gif");
res = dialog->UniversalDialog(
NULL, /* title message */
confirm_string, /* title text in top line of window */
@ -91,7 +90,7 @@ permission_CheckConfirmYN(nsIPrompt *aPrompter, PRUnichar * szMessage, PRUnichar
NULL, /* second edit field label */
NULL, /* first edit field initial and final value */
NULL, /* second edit field initial and final value */
tempStr.GetUnicode() ,
NS_LITERAL_STRING("question-icon").get(),
checkValue, /* initial and final value of checkbox */
2, /* number of buttons */
0, /* number of edit fields */

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

@ -1418,7 +1418,7 @@ function ComposeCanClose()
null,
{value:0},
{value:0},
"chrome://global/skin/question-icon.gif",
"question-icon",
{value:"false"},
3,
0,

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

@ -41,7 +41,7 @@ Contributor(s):
<box orient="horizontal">
<text id="outOfSpace" value="&errorText1.label;"/>
<spring flex="100%"/>
<image id="info.icon" src="chrome://global/skin/message-icon.gif" />
<image id="info.icon" class="message-icon"/>
</box>
<separator orient="vertical" class="thin"/>
</box>

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

@ -85,19 +85,19 @@ window[wait-cursor] {
/* ::::: alert icons :::::*/
.message-icon {
list-style-image: url("chrome://global/skin/icon/alert-message.gif");
list-style-image: url("chrome://global/skin/icons/alert-message.gif");
}
.alert-icon {
list-style-image: url("chrome://global/skin/icon/alert-exclam.gif");
list-style-image: url("chrome://global/skin/icons/alert-exclam.gif");
}
.error-icon {
list-style-image: url("chrome://global/skin/icon/alert-error.gif");
list-style-image: url("chrome://global/skin/icons/alert-error.gif");
}
.question-icon {
list-style-image: url("chrome://global/skin/icon/alert-question.gif");
list-style-image: url("chrome://global/skin/icons/alert-question.gif");
}
/* ::::: status bar ::::: */

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

@ -51,9 +51,10 @@ function commonDialogOnLoad()
// set the icon
var iconElement = document.getElementById("info.icon");
var iconURL = gCommonDialogParam.GetString(2);
if (iconURL)
iconElement.setAttribute("src", iconURL);
var iconClass = gCommonDialogParam.GetString(2);
if (!iconClass)
iconClass = "message-icon";
iconElement.setAttribute("class", iconElement.getAttribute("class") + " " + iconClass);
// set the number of command buttons
var nButtons = gCommonDialogParam.GetInt(2);

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

@ -17,7 +17,7 @@
<box flex="1">
<box autostretch="never" valign="top">
<image id="info.icon" class="spaced" src="chrome://global/skin/message-icon.gif" />
<image id="info.icon" class="spaced"/>
</box>
<separator orient="vertical" class="thin"/>
<box orient="vertical" flex="1">