Bug 502799 add new nsISound method for the event sounds r=roc+neil, sr=roc

This commit is contained in:
Masayuki Nakano
2009-07-09 10:55:46 +09:00
parent a28c341f82
commit 8cf4b22364
15 changed files with 168 additions and 34 deletions

View File

@@ -141,6 +141,7 @@ nsPromptService::Alert(nsIDOMWindow *parent,
NS_ConvertASCIItoUTF16 styleClass(kAlertIconClass);
block->SetString(eIconClass, styleClass.get());
block->SetString(eOpeningSound, NS_SYSSOUND_ALERT_DIALOG.get());
block->SetInt(eSoundEventId, nsISound::EVENT_AELRT_DIALOG_OPEN);
rv = DoDialog(parent, block, kPromptURL);
@@ -186,6 +187,7 @@ nsPromptService::AlertCheck(nsIDOMWindow *parent,
block->SetString(eCheckboxMsg, checkMsg);
block->SetInt(eCheckboxState, *checkValue);
block->SetString(eOpeningSound, NS_SYSSOUND_ALERT_DIALOG.get());
block->SetInt(eSoundEventId, nsISound::EVENT_AELRT_DIALOG_OPEN);
rv = DoDialog(parent, block, kPromptURL);
if (NS_FAILED(rv))
@@ -232,6 +234,7 @@ nsPromptService::Confirm(nsIDOMWindow *parent,
NS_ConvertASCIItoUTF16 styleClass(kQuestionIconClass);
block->SetString(eIconClass, styleClass.get());
block->SetString(eOpeningSound, NS_SYSSOUND_CONFIRM_DIALOG.get());
block->SetInt(eSoundEventId, nsISound::EVENT_CONFIRM_DIALOG_OPEN);
rv = DoDialog(parent, block, kPromptURL);
if (NS_FAILED(rv))
@@ -282,6 +285,7 @@ nsPromptService::ConfirmCheck(nsIDOMWindow *parent,
block->SetString(eCheckboxMsg, checkMsg);
block->SetInt(eCheckboxState, *checkValue);
block->SetString(eOpeningSound, NS_SYSSOUND_CONFIRM_DIALOG.get());
block->SetInt(eSoundEventId, nsISound::EVENT_CONFIRM_DIALOG_OPEN);
rv = DoDialog(parent, block, kPromptURL);
if (NS_FAILED(rv))
@@ -384,6 +388,7 @@ nsPromptService::ConfirmEx(nsIDOMWindow *parent,
block->SetString(eIconClass, NS_ConvertASCIItoUTF16(kQuestionIconClass).get());
block->SetString(eOpeningSound, NS_SYSSOUND_CONFIRM_DIALOG.get());
block->SetInt(eSoundEventId, nsISound::EVENT_CONFIRM_DIALOG_OPEN);
if (checkMsg && checkValue) {
block->SetString(eCheckboxMsg, checkMsg);
@@ -460,6 +465,7 @@ nsPromptService::Prompt(nsIDOMWindow *parent,
block->SetInt(eCheckboxState, *checkValue);
}
block->SetString(eOpeningSound, NS_SYSSOUND_PROMPT_DIALOG.get());
block->SetInt(eSoundEventId, nsISound::EVENT_PROMPT_DIALOG_OPEN);
rv = DoDialog(parent, block, kPromptURL);
if (NS_FAILED(rv))
@@ -536,6 +542,7 @@ nsPromptService::PromptUsernameAndPassword(nsIDOMWindow *parent,
block->SetInt(eCheckboxState, *checkValue);
}
block->SetString(eOpeningSound, NS_SYSSOUND_PROMPT_DIALOG.get());
block->SetInt(eSoundEventId, nsISound::EVENT_PROMPT_DIALOG_OPEN);
rv = DoDialog(parent, block, kPromptURL);
if (NS_FAILED(rv))
@@ -616,6 +623,7 @@ NS_IMETHODIMP nsPromptService::PromptPassword(nsIDOMWindow *parent,
block->SetInt(eCheckboxState, *checkValue);
}
block->SetString(eOpeningSound, NS_SYSSOUND_PROMPT_DIALOG.get());
block->SetInt(eSoundEventId, nsISound::EVENT_PROMPT_DIALOG_OPEN);
rv = DoDialog(parent, block, kPromptURL);
if (NS_FAILED(rv))
@@ -751,6 +759,7 @@ nsPromptService::ShowNonBlockingAlert(nsIDOMWindow *aParent,
paramBlock->SetString(eDialogTitle, aDialogTitle);
paramBlock->SetString(eMsg, aText);
paramBlock->SetString(eOpeningSound, NS_SYSSOUND_ALERT_DIALOG.get());
paramBlock->SetInt(eSoundEventId, nsISound::EVENT_AELRT_DIALOG_OPEN);
nsCOMPtr<nsIDOMWindow> dialog;
mWatcher->OpenWindow(aParent, "chrome://global/content/commonDialog.xul",