Bug 561427 protocol errors on libnotify-based systems show only empty popup notification windows. r=bienvenu,ui-review=clarkbw

This commit is contained in:
Mark Banner 2010-05-05 13:52:41 +01:00
Родитель aca7d38f5a
Коммит a46f590d98
1 изменённых файлов: 18 добавлений и 3 удалений

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

@ -62,6 +62,14 @@ let alertHook =
.getService(Ci.nsIAlertsService);
},
get brandShortName() {
delete this.brandShortName;
return this.brandShortName = Cc["@mozilla.org/intl/stringbundle;1"]
.getService(Ci.nsIStringBundleService)
.createBundle("chrome://branding/locale/brand.properties")
.GetStringFromName("brandShortName");
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIMsgUserFeedbackListener]),
onAlert: function (aMessage, aUrl) {
@ -79,9 +87,16 @@ let alertHook =
this.activityMgr.addActivity(warning);
this.alertService
.showAlertNotification("chrome://branding/content/icon48.png", "",
aMessage);
try {
this.alertService
.showAlertNotification("chrome://branding/content/icon48.png",
this.brandShortName, aMessage);
}
catch (ex) {
// XXX On Linux, if libnotify isn't supported, showAlertNotification
// can throw an error, so fall-back to the old method of modal dialogs.
return false;
}
return true;
},