Bug 461417 - Default application pref visible in Advanced pref pane on non-windows OS, r=Neil
authorFrank Wein <mcsmurf@mcsmurf.de>
Fri, 24 Oct 2008 12:01:58 +0200
changeset 705 c8e7221a108d268696fb15ab047a8d00b88b7eba
parent 704 234790ffe6a0dff573800318e1f1370da41f3e3b
child 706 659472bd1018d970303f21ba0186ac16c2570a48
push id632
push usermcsmurf@mcsmurf.de
push dateFri, 24 Oct 2008 10:08:19 +0000
treeherdercomm-central@c8e7221a108d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil
bugs461417
Bug 461417 - Default application pref visible in Advanced pref pane on non-windows OS, r=Neil
suite/common/pref/pref-advanced.js
suite/common/pref/pref-advanced.xul
--- a/suite/common/pref/pref-advanced.js
+++ b/suite/common/pref/pref-advanced.js
@@ -35,21 +35,30 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 function Startup()
 {
   SysPrefCheck();
+  ShellServiceCheck();
 }
 
 /**
  * System preferences
  */
 
 function SysPrefCheck()
 {
   const kPrefService = "@mozilla.org/system-preference-service;1";
   let visible = kPrefService in Components.classes &&
     Components.classes[kPrefService].getService() instanceof Components.interfaces.nsIPrefBranch;
   document.getElementById("systemPrefs").hidden = !visible;
 }
+
+function ShellServiceCheck()
+{
+  const NS_SHELLSERVICE_CID = "@mozilla.org/suite/shell-service;1";
+
+  if (NS_SHELLSERVICE_CID in Components.classes)
+    document.getElementById("checkDefault").hidden = false;
+}
--- a/suite/common/pref/pref-advanced.xul
+++ b/suite/common/pref/pref-advanced.xul
@@ -73,17 +73,17 @@
       <caption id="systemPrefCaption" label="&systemPref.caption;"/>
       <description>&systemPref.desc;</description>
       <checkbox id="systemPrefCheck"
                 label="&systemPrefCheck.label;"
                 accesskey="&systemPrefCheck.accesskey;"
                 preference="config.use_system_prefs"/>
     </groupbox>
 
-    <groupbox id="checkDefault">
+    <groupbox id="checkDefault" hidden="true">
       <caption label="&prefCheckDefault.caption;"/>
       <checkbox id="checkDefaultClient"
                 label="&prefCheckDefaultClient.label;"
                 accesskey="&prefCheckDefaultClient.accesskey;"
                 preference="shell.checkDefaultClient"/>
     </groupbox>
 
   </prefpane>