diff --git a/mailnews/base/resources/locale/en-US/messenger.properties b/mailnews/base/resources/locale/en-US/messenger.properties index dfbaa673132..742b9d56223 100644 --- a/mailnews/base/resources/locale/en-US/messenger.properties +++ b/mailnews/base/resources/locale/en-US/messenger.properties @@ -263,9 +263,8 @@ recipientSearchCriteria=Subject or Recipient contains: senderSearchCriteria=Subject or Sender contains: # LOCALIZATION NOTES(biffNotification): %1$S is a user name %2$S is the number of new messages -biffNotification_message=%1$S has %2$S new message -biffNotification_messages=%1$S has %2$S new messages -newMail_Alert_Title=New Messages +biffNotification_message=has %1$S new message +biffNotification_messages=has %1$S new messages # For the Quota tab in the mail folder properties dialog quotaUsedFree=%S of %S KB used diff --git a/mailnews/base/src/nsMessengerWinIntegration.cpp b/mailnews/base/src/nsMessengerWinIntegration.cpp index 4a0e7a9268f..394a13d79f0 100644 --- a/mailnews/base/src/nsMessengerWinIntegration.cpp +++ b/mailnews/base/src/nsMessengerWinIntegration.cpp @@ -497,7 +497,7 @@ nsresult nsMessengerWinIntegration::GetStringBundle(nsIStringBundle **aBundle) return rv; } -nsresult nsMessengerWinIntegration::ShowAlertMessage(const PRUnichar * aAlertText, const char * aFolderURI) +nsresult nsMessengerWinIntegration::ShowAlertMessage(const PRUnichar * aAlertTitle, const PRUnichar * aAlertText, const char * aFolderURI) { nsresult rv; @@ -517,21 +517,10 @@ nsresult nsMessengerWinIntegration::ShowAlertMessage(const PRUnichar * aAlertTex nsCOMPtr alertsService (do_GetService(NS_ALERTSERVICE_CONTRACTID, &rv)); if (NS_SUCCEEDED(rv)) { - nsCOMPtr alertListener (do_QueryInterface(NS_STATIC_CAST(nsIMessengerOSIntegration*, this))); - - nsCOMPtr bundle; - GetStringBundle(getter_AddRefs(bundle)); - if (bundle) - { - nsXPIDLString alertTitle; - bundle->GetStringFromName(NS_LITERAL_STRING("newMail_Alert_Title").get(), getter_Copies(alertTitle)); - rv = alertsService->ShowAlertNotification(NEW_MAIL_ALERT_ICON, alertTitle, aAlertText, PR_TRUE, - NS_ConvertASCIItoUCS2(aFolderURI).get(), alertListener); - - mAlertInProgress = PR_TRUE; - } - else - rv = NS_ERROR_FAILURE; + nsCOMPtr alertListener (do_QueryInterface(NS_STATIC_CAST(nsIMessengerOSIntegration*, this))); + rv = alertsService->ShowAlertNotification(NEW_MAIL_ALERT_ICON, aAlertTitle, aAlertText, PR_TRUE, + NS_ConvertASCIItoUCS2(aFolderURI).get(), alertListener); + mAlertInProgress = PR_TRUE; } } @@ -571,7 +560,7 @@ NS_IMETHODIMP nsMessengerWinIntegration::OnAlertClickCallback(const PRUnichar * void nsMessengerWinIntegration::FillToolTipInfo() { // iterate over all the folders in mFoldersWithNewMail - nsXPIDLCString userName; + nsXPIDLString accountName; nsXPIDLCString hostName; nsAutoString toolTipText; nsAutoString animatedAlertText; @@ -591,30 +580,27 @@ void nsMessengerWinIntegration::FillToolTipInfo() folder = do_QueryReferent(weakReference); if (folder) { - folder->GetUsername(getter_Copies(userName)); + folder->GetPrettiestName(getter_Copies(accountName)); + numNewMessages = 0; folder->GetNumNewMessages(PR_TRUE, &numNewMessages); nsCOMPtr bundle; GetStringBundle(getter_AddRefs(bundle)); if (bundle) { - nsAutoString numNewMsgsText; - nsAutoString uniUsername; - - uniUsername.AssignWithConversion(userName); + nsAutoString numNewMsgsText; numNewMsgsText.AppendInt(numNewMessages); const PRUnichar *formatStrings[] = { - uniUsername.get(), numNewMsgsText.get(), }; nsXPIDLString finalText; if (numNewMessages == 1) - bundle->FormatStringFromName(NS_LITERAL_STRING("biffNotification_message").get(), formatStrings, 2, getter_Copies(finalText)); + bundle->FormatStringFromName(NS_LITERAL_STRING("biffNotification_message").get(), formatStrings, 1, getter_Copies(finalText)); else - bundle->FormatStringFromName(NS_LITERAL_STRING("biffNotification_messages").get(), formatStrings, 2, getter_Copies(finalText)); + bundle->FormatStringFromName(NS_LITERAL_STRING("biffNotification_messages").get(), formatStrings, 1, getter_Copies(finalText)); // the alert message is special...we actually only want to show the first account with // new mail in the alert. @@ -622,10 +608,12 @@ void nsMessengerWinIntegration::FillToolTipInfo() animatedAlertText = finalText; // only add this new string if it will fit without truncation.... - if (maxTooltipSize >= toolTipText.Length() + finalText.Length() + 2) + if (maxTooltipSize >= toolTipText.Length() + accountName.Length() + finalText.Length() + 2) { if (index > 0) - toolTipText.Append(NS_LITERAL_STRING("\n").get()); + toolTipText.Append(NS_LITERAL_STRING("\n").get()); + toolTipText.Append(accountName); + toolTipText.Append(NS_LITERAL_STRING(" ")); toolTipText.Append(finalText); } } // if we got a bundle @@ -636,7 +624,7 @@ void nsMessengerWinIntegration::FillToolTipInfo() if (!mBiffIconVisible) { - ShowAlertMessage(animatedAlertText.get(), ""); + ShowAlertMessage(accountName, animatedAlertText.get(), ""); } else GenericShellNotify( NIM_MODIFY); diff --git a/mailnews/base/src/nsMessengerWinIntegration.h b/mailnews/base/src/nsMessengerWinIntegration.h index 578c0f01c1c..d1249f5075a 100644 --- a/mailnews/base/src/nsMessengerWinIntegration.h +++ b/mailnews/base/src/nsMessengerWinIntegration.h @@ -98,7 +98,7 @@ private: void RevertToNonUnicodeShellAPI(); PRUint32 GetToolTipSize(); // available space for the tooltip string - nsresult ShowAlertMessage(const PRUnichar * aAlertText, const char * aFolderURI); + nsresult ShowAlertMessage(const PRUnichar * aAlertTitle, const PRUnichar * aAlertText, const char * aFolderURI); nsresult GetFirstFolderWithNewMail(char ** aFolderURI); nsresult GetStringBundle(nsIStringBundle **aBundle);