home *** CD-ROM | disk | FTP | other *** search
/ ftp.swcp.com / ftp.swcp.com.zip / ftp.swcp.com / mac / mozilla-macos9-1.3.1.sea.bin / Mozilla1.3.1 / Chrome / comm.jar / content / communicator / pref / pref-smartupdate.xul < prev    next >
Extensible Markup Language  |  2003-06-08  |  4KB  |  120 lines

  1. <?xml version="1.0"?> 
  2. <?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
  3.  
  4. <!DOCTYPE page SYSTEM "chrome://communicator/locale/pref/pref-smartupdate.dtd" >
  5.  
  6. <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  7.       onload="parent.initPanel('chrome://communicator/content/pref/pref-smartupdate.xul'); initUpdateNotifications();"
  8.       headertitle="&lHeader;">
  9.   
  10.   <script type="application/x-javascript">
  11.   <![CDATA[
  12.     var _elementIDs = ["XPInstallEnabled", "updateNotificationsEnabled", 
  13.                        "updateFrequency"];
  14.  
  15.     function initUpdateNotifications()
  16.     {
  17.       var prefs = Components.classes["@mozilla.org/preferences-service;1"].
  18.         getService(Components.interfaces.nsIPrefBranch);
  19.       if (!prefs.getBoolPref("update_notifications.enabled"))
  20.       {
  21.         // disable frequency radiogroup
  22.         var freqWeekly = document.getElementById("freqWeekly");
  23.         var freqMonthly = document.getElementById("freqMonthly");
  24.         freqWeekly.setAttribute("disabled", "true");
  25.         freqMonthly.setAttribute("disabled", "true");
  26.       }
  27.     }
  28.  
  29.     function toggleFrequency()
  30.     {
  31.       var enabled = document.getElementById("updateNotificationsEnabled");
  32.       var freqWeekly = document.getElementById("freqWeekly");
  33.       var freqMonthly = document.getElementById("freqMonthly");
  34.       if (enabled.getAttribute("checked") == "true")
  35.       {
  36.         // enable frequency radiogroup
  37.         freqWeekly.removeAttribute("disabled");
  38.         freqMonthly.removeAttribute("disabled");
  39.       }
  40.       else
  41.       {
  42.         // disable frequency radiogroup
  43.         freqWeekly.setAttribute("disabled", "true");
  44.         freqMonthly.setAttribute("disabled", "true");
  45.       }
  46.     }
  47.   ]]>
  48.   </script>
  49.    
  50.   <groupbox align="start">
  51.     <caption label="&smartTitle.label;"/>
  52.     <checkbox id="XPInstallEnabled" label="&enableSU.label;" accesskey="&enableSU.accesskey;"
  53.               prefstring="xpinstall.enabled"/>
  54.   </groupbox>
  55.  
  56.   <groupbox align="start">
  57.     <caption label="&updateNotifications.label;"/>
  58.     <description>&updateNotifications.desc;</description>
  59.     <checkbox id="updateNotificationsEnabled" label="&enableUN.label;"
  60.               accesskey="&enableUN.accesskey;" oncommand="toggleFrequency();"
  61.               prefstring="update_notifications.enabled"/>
  62.     <radiogroup id="updateFrequency" orient="horizontal" 
  63.                 prefstring="update_notifications.provider.0.frequency"
  64.                 prefdefval="7">
  65.       <radio id="freqWeekly" label="&weekly.label;" 
  66.              accesskey="&weekly.accesskey;" value="7"/>
  67.       <radio id="freqMonthly" label="&monthly.label;" 
  68.              accesskey="&monthly.accesskey;" value="30"/>
  69.     </radiogroup>
  70.   </groupbox>
  71.  
  72. <!--
  73.   <groupbox align="start">
  74.     <caption label="Installed Packages"/>
  75.   
  76.     <script>
  77.     <![CDATA[
  78.       function InstallPackage()
  79.       {
  80.         var chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"].getService();
  81.         if ( chromeRegistry )
  82.           chromeRegistry = chromeRegistry.QueryInterface( Components.interfaces.nsIChromeRegistry );
  83.         var packageURI = prompt('give the resource uri of the package to install','');
  84.         if (packageURI)
  85.           chromeRegistry.installPackage(packageURI, false);
  86.       }
  87.     ]]>
  88.     </script>
  89.     <button label="Install Package" oncommand="InstallPackage();"/>
  90.   </groupbox>
  91. -->
  92.  
  93. <!--
  94.   <html:fieldset style="width: 100%; height: 100%">
  95.     <html:div class="hspace-both">&selectUninstall.label;</html:div>
  96.     <hbox class="hspace-both vspace" flex="100%" style="width: 93%; height: 100%">
  97.       <tree id="smartUpdatePackages" flex="100%" style="height: 40%;">
  98.         <treecols>
  99.           <treecol flex="1"/>
  100.         </treecols>
  101.         <treechildren flex="1">
  102.           <treeitem>
  103.             <treerow>
  104.               <treeitem/>
  105.             </treerow>
  106.           </treeitem>
  107.         </treechildren>
  108.       </tree>
  109.       <spacer flex="5%"/>
  110.       <vbox>
  111.         <button class="push" id="pref:0:bool:smartupdate" label="&uninstallButton.label;" accesskey="&uninstallButton.accesskey;"/>
  112.         <spacer flex="100%"/>
  113.       </vbox>
  114.     </hbox>
  115.     <spacer style="height: 28px;"/>
  116.   </html:fieldset>
  117. -->
  118. </page>
  119.  
  120.