moving implementation details mistakenly placed in public promptservice interface to the private one. r=hyatt,jack

This commit is contained in:
danm%netscape.com 2001-04-12 02:18:06 +00:00
Родитель 2333d6b171
Коммит 04d1dedd25
4 изменённых файлов: 25 добавлений и 25 удалений

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

@ -2835,9 +2835,9 @@ nsEditorShell::ConfirmWithCancel(const nsString& aTitle, const nsString& aQuesti
if ( NS_SUCCEEDED(rv) )
{
// Stuff in Parameters
block->SetString( nsIPromptService::eMsg, aQuestion.GetUnicode());
block->SetString( nsPIPromptService::eMsg, aQuestion.GetUnicode());
nsAutoString url; url.AssignWithConversion( "chrome://global/skin/question-icon.gif" );
block->SetString( nsIPromptService::eIconURL, url.GetUnicode());
block->SetString( nsPIPromptService::eIconURL, url.GetUnicode());
nsAutoString yesStr, noStr;
// Default is Yes, No, Cancel
@ -2851,22 +2851,22 @@ nsEditorShell::ConfirmWithCancel(const nsString& aTitle, const nsString& aQuesti
if (aNoString && aNoString->Length() > 0)
{
noStr.Assign(*aNoString);
block->SetString( nsIPromptService::eButton2Text, noStr.GetUnicode() );
block->SetString( nsPIPromptService::eButton2Text, noStr.GetUnicode() );
}
else
{
// No string for "No" means we only want Yes, Cancel
numberOfButtons = 2;
}
block->SetInt( nsIPromptService::eNumberButtons, numberOfButtons );
block->SetInt( nsPIPromptService::eNumberButtons, numberOfButtons );
nsAutoString cancelStr;
GetBundleString(NS_LITERAL_STRING("Cancel"), cancelStr);
block->SetString( nsIPromptService::eDialogTitle, aTitle.GetUnicode() );
block->SetString( nsPIPromptService::eDialogTitle, aTitle.GetUnicode() );
//Note: "button0" is always Ok or Yes action, "button1" is Cancel
block->SetString( nsIPromptService::eButton0Text, yesStr.GetUnicode() );
block->SetString( nsIPromptService::eButton1Text, cancelStr.GetUnicode() );
block->SetString( nsPIPromptService::eButton0Text, yesStr.GetUnicode() );
block->SetString( nsPIPromptService::eButton1Text, cancelStr.GetUnicode() );
nsCOMPtr<nsPIPromptService> dialog(do_GetService("@mozilla.org/embedcomp/prompt-service;1"));
if (dialog)
@ -2877,7 +2877,7 @@ nsEditorShell::ConfirmWithCancel(const nsString& aTitle, const nsString& aQuesti
nsCOMPtr<nsIDOMWindow> cwP = do_QueryReferent(mContentWindow);
if (!cwP) return result;
rv = dialog->DoDialog( cwP, block, "chrome://global/content/commonDialog.xul" );
block->GetInt( nsIPromptService::eButtonPressed, &buttonPressed );
block->GetInt( nsPIPromptService::eButtonPressed, &buttonPressed );
// NOTE: If order of buttons changes in nsIPromptService,
// then we must change the EConfirmResult enums in nsEditorShell.h
result = nsEditorShell::EConfirmResult(buttonPressed);

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

@ -2835,9 +2835,9 @@ nsEditorShell::ConfirmWithCancel(const nsString& aTitle, const nsString& aQuesti
if ( NS_SUCCEEDED(rv) )
{
// Stuff in Parameters
block->SetString( nsIPromptService::eMsg, aQuestion.GetUnicode());
block->SetString( nsPIPromptService::eMsg, aQuestion.GetUnicode());
nsAutoString url; url.AssignWithConversion( "chrome://global/skin/question-icon.gif" );
block->SetString( nsIPromptService::eIconURL, url.GetUnicode());
block->SetString( nsPIPromptService::eIconURL, url.GetUnicode());
nsAutoString yesStr, noStr;
// Default is Yes, No, Cancel
@ -2851,22 +2851,22 @@ nsEditorShell::ConfirmWithCancel(const nsString& aTitle, const nsString& aQuesti
if (aNoString && aNoString->Length() > 0)
{
noStr.Assign(*aNoString);
block->SetString( nsIPromptService::eButton2Text, noStr.GetUnicode() );
block->SetString( nsPIPromptService::eButton2Text, noStr.GetUnicode() );
}
else
{
// No string for "No" means we only want Yes, Cancel
numberOfButtons = 2;
}
block->SetInt( nsIPromptService::eNumberButtons, numberOfButtons );
block->SetInt( nsPIPromptService::eNumberButtons, numberOfButtons );
nsAutoString cancelStr;
GetBundleString(NS_LITERAL_STRING("Cancel"), cancelStr);
block->SetString( nsIPromptService::eDialogTitle, aTitle.GetUnicode() );
block->SetString( nsPIPromptService::eDialogTitle, aTitle.GetUnicode() );
//Note: "button0" is always Ok or Yes action, "button1" is Cancel
block->SetString( nsIPromptService::eButton0Text, yesStr.GetUnicode() );
block->SetString( nsIPromptService::eButton1Text, cancelStr.GetUnicode() );
block->SetString( nsPIPromptService::eButton0Text, yesStr.GetUnicode() );
block->SetString( nsPIPromptService::eButton1Text, cancelStr.GetUnicode() );
nsCOMPtr<nsPIPromptService> dialog(do_GetService("@mozilla.org/embedcomp/prompt-service;1"));
if (dialog)
@ -2877,7 +2877,7 @@ nsEditorShell::ConfirmWithCancel(const nsString& aTitle, const nsString& aQuesti
nsCOMPtr<nsIDOMWindow> cwP = do_QueryReferent(mContentWindow);
if (!cwP) return result;
rv = dialog->DoDialog( cwP, block, "chrome://global/content/commonDialog.xul" );
block->GetInt( nsIPromptService::eButtonPressed, &buttonPressed );
block->GetInt( nsPIPromptService::eButtonPressed, &buttonPressed );
// NOTE: If order of buttons changes in nsIPromptService,
// then we must change the EConfirmResult enums in nsEditorShell.h
result = nsEditorShell::EConfirmResult(buttonPressed);

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

@ -37,15 +37,6 @@ interface nsIDOMWindow;
[scriptable, uuid(1630C61A-325E-49ca-8759-A31B16C47AA5)]
interface nsIPromptService : nsISupports
{
%{C++
enum {eMsg=0, eCheckboxMsg=1, eIconURL=2, eTitleMessage=3, eEditfield1Msg=4,
eEditfield2Msg=5, eEditfield1Value=6, eEditfield2Value=7,
eButton0Text=8, eButton1Text=9, eButton2Text=10, eButton3Text=11,
eDialogTitle=12};
enum {eButtonPressed=0, eCheckboxState=1, eNumberButtons=2,
eNumberEditfields=3, eEditField1Password=4};
%}
void alert(in nsIDOMWindow parent,
in wstring dialogTitle,
in wstring text);

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

@ -31,6 +31,15 @@ interface nsIDialogParamBlock;
[uuid(d16e906d-bab3-49e0-8688-7f49a6f4293a)]
interface nsPIPromptService : nsISupports
{
%{C++
enum {eMsg=0, eCheckboxMsg=1, eIconURL=2, eTitleMessage=3, eEditfield1Msg=4,
eEditfield2Msg=5, eEditfield1Value=6, eEditfield2Value=7,
eButton0Text=8, eButton1Text=9, eButton2Text=10, eButton3Text=11,
eDialogTitle=12};
enum {eButtonPressed=0, eCheckboxState=1, eNumberButtons=2,
eNumberEditfields=3, eEditField1Password=4};
%}
void doDialog(in nsIDOMWindow aParent, in nsIDialogParamBlock aParamBlock, in string aChromeURL);
};