Bug #312940 --> instead of using an ifdef, hijack the preview text pref to allow devs

with release builds to try out the new alert prototype.
This commit is contained in:
scott%scott-macgregor.org 2005-11-17 23:14:17 +00:00
Родитель 7616b5cb7c
Коммит 5c54e898af
1 изменённых файлов: 45 добавлений и 23 удалений

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

@ -466,7 +466,16 @@ nsresult nsMessengerWinIntegration::ShowAlertMessage(const PRUnichar * aAlertTit
if (showAlert)
{
#if 0
#ifdef MOZ_THUNDERBIRD
// Since the new mail notification alert isn't ready for primetype yet,
// tie it to the showPreviewText pref so testers can try it out
// in their builds...
PRBool useNewAlert = PR_FALSE;
if (prefBranch)
prefBranch->GetBoolPref("mail.showPreviewText", &useNewAlert);
if (useNewAlert)
{
nsCOMPtr<nsISupportsArray> argsArray;
rv = NS_NewISupportsArray(getter_AddRefs(argsArray));
NS_ENSURE_SUCCESS(rv, rv);
@ -491,6 +500,19 @@ nsresult nsMessengerWinIntegration::ShowAlertMessage(const PRUnichar * aAlertTit
"chrome,dialog=yes,titlebar=no,popup=yes", argsArray,
getter_AddRefs(newWindow));
mAlertInProgress = PR_TRUE;
}
else
{
// this code will go away when the new alert service is ready to be turned on...
nsCOMPtr<nsIAlertsService> alertsService (do_GetService(NS_ALERTSERVICE_CONTRACTID, &rv));
if (NS_SUCCEEDED(rv))
{
rv = alertsService->ShowAlertNotification(NS_LITERAL_STRING(NEW_MAIL_ALERT_ICON), nsDependentString(aAlertTitle),
nsDependentString(aAlertText), PR_TRUE,
NS_ConvertASCIItoUCS2(aFolderURI), this);
mAlertInProgress = PR_TRUE;
}
}
#else
nsCOMPtr<nsIAlertsService> alertsService (do_GetService(NS_ALERTSERVICE_CONTRACTID, &rv));
if (NS_SUCCEEDED(rv))