From c3753032f5254d5f163c114d1c7a0746a429e54f Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Thu, 30 Jan 2003 00:46:28 +0000 Subject: [PATCH] fix for bug #158711. don't show the "show and alert" pref UI for platforms (like linux) that don't have the alert service. r/sr=dmose, a=asa --- .../base/prefs/resources/content/pref-notifications.js | 10 ++++++++++ .../prefwindow/resources/content/pref-download.js | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/mailnews/base/prefs/resources/content/pref-notifications.js b/mailnews/base/prefs/resources/content/pref-notifications.js index e2083aec26ed..a970bdef5afa 100644 --- a/mailnews/base/prefs/resources/content/pref-notifications.js +++ b/mailnews/base/prefs/resources/content/pref-notifications.js @@ -1,6 +1,16 @@ function Startup() { PlaySoundCheck(); + + // if we can't get the alert service, hide the pref UI for using alerts to notify on new mail + // see bug #158711 + try { + var alertService = Components.classes["@mozilla.org/alerts-service;1"].getService(Components.interfaces.nsIAlertsService); + } + catch(ex) { + var newMailNotificationAlertUI = document.getElementById("newMailNotificationAlert"); + newMailNotificationAlertUI.setAttribute("hidden","true"); + } } function PlaySoundCheck() diff --git a/xpfe/components/prefwindow/resources/content/pref-download.js b/xpfe/components/prefwindow/resources/content/pref-download.js index e2083aec26ed..a970bdef5afa 100644 --- a/xpfe/components/prefwindow/resources/content/pref-download.js +++ b/xpfe/components/prefwindow/resources/content/pref-download.js @@ -1,6 +1,16 @@ function Startup() { PlaySoundCheck(); + + // if we can't get the alert service, hide the pref UI for using alerts to notify on new mail + // see bug #158711 + try { + var alertService = Components.classes["@mozilla.org/alerts-service;1"].getService(Components.interfaces.nsIAlertsService); + } + catch(ex) { + var newMailNotificationAlertUI = document.getElementById("newMailNotificationAlert"); + newMailNotificationAlertUI.setAttribute("hidden","true"); + } } function PlaySoundCheck()