gecko-dev/suite/common/pref/pref-smartupdate.xul

120 lines
4.1 KiB
XML

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<!DOCTYPE page SYSTEM "chrome://communicator/locale/pref/pref-smartupdate.dtd" >
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="parent.initPanel('chrome://communicator/content/pref/pref-smartupdate.xul'); initUpdateNotifications();"
headertitle="&lHeader;">
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["XPInstallEnabled", "updateNotificationsEnabled",
"updateFrequency"];
function initUpdateNotifications()
{
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch);
if (!prefs.getBoolPref("update_notifications.enabled"))
{
// disable frequency radiogroup
var freqWeekly = document.getElementById("freqWeekly");
var freqMonthly = document.getElementById("freqMonthly");
freqWeekly.setAttribute("disabled", "true");
freqMonthly.setAttribute("disabled", "true");
}
}
function toggleFrequency()
{
var enabled = document.getElementById("updateNotificationsEnabled");
var freqWeekly = document.getElementById("freqWeekly");
var freqMonthly = document.getElementById("freqMonthly");
if (enabled.getAttribute("checked") == "true")
{
// enable frequency radiogroup
freqWeekly.removeAttribute("disabled");
freqMonthly.removeAttribute("disabled");
}
else
{
// disable frequency radiogroup
freqWeekly.setAttribute("disabled", "true");
freqMonthly.setAttribute("disabled", "true");
}
}
]]>
</script>
<groupbox align="start">
<caption label="&smartTitle.label;"/>
<checkbox id="XPInstallEnabled" label="&enableSU.label;" accesskey="&enableSU.accesskey;"
prefstring="xpinstall.enabled"/>
</groupbox>
<groupbox align="start">
<caption label="&updateNotifications.label;"/>
<description>&updateNotifications.desc;</description>
<checkbox id="updateNotificationsEnabled" label="&enableUN.label;"
accesskey="&enableUN.accesskey;" oncommand="toggleFrequency();"
prefstring="update_notifications.enabled"/>
<radiogroup id="updateFrequency" orient="horizontal"
prefstring="update_notifications.provider.0.frequency"
prefdefval="7">
<radio id="freqWeekly" label="&weekly.label;"
accesskey="&weekly.accesskey;" value="7"/>
<radio id="freqMonthly" label="&monthly.label;"
accesskey="&monthly.accesskey;" value="30"/>
</radiogroup>
</groupbox>
<!--
<groupbox align="start">
<caption label="Installed Packages"/>
<script>
<![CDATA[
function InstallPackage()
{
var chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"].getService();
if ( chromeRegistry )
chromeRegistry = chromeRegistry.QueryInterface( Components.interfaces.nsIChromeRegistry );
var packageURI = prompt('give the resource uri of the package to install','');
if (packageURI)
chromeRegistry.installPackage(packageURI, false);
}
]]>
</script>
<button label="Install Package" oncommand="InstallPackage();"/>
</groupbox>
-->
<!--
<html:fieldset style="width: 100%; height: 100%">
<html:div class="hspace-both">&selectUninstall.label;</html:div>
<hbox class="hspace-both vspace" flex="100%" style="width: 93%; height: 100%">
<tree id="smartUpdatePackages" flex="100%" style="height: 40%;">
<treecols>
<treecol flex="1"/>
</treecols>
<treechildren flex="1">
<treeitem>
<treerow>
<treeitem/>
</treerow>
</treeitem>
</treechildren>
</tree>
<spacer flex="5%"/>
<vbox>
<button class="push" id="pref:0:bool:smartupdate" label="&uninstallButton.label;" accesskey="&uninstallButton.accesskey;"/>
<spacer flex="100%"/>
</vbox>
</hbox>
<spacer style="height: 28px;"/>
</html:fieldset>
-->
</page>