pjs/suite/common/pref/pref-appearance.xul

130 строки
4.5 KiB
XML

<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % prefAppearanceDTD SYSTEM "chrome://communicator/locale/pref/pref-appearance.dtd" >
%prefAppearanceDTD;
]>
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="parent.initPanel(panel);"
headertitle="&lHeader;">
<script type="application/x-javascript">
<![CDATA[
var panel = "chrome://communicator/content/pref/pref-appearance.xul";
// the first elements in this array will be poked from chromeregistry loaded
// overlays once overlays.rdf works properly
var _elementIDs = ["generalStartupBrowser", "showHideTooltips", "useSiteIcons", "languageList"];
function Startup()
{
parent.hPrefWindow.registerOKCallbackFunc( switchUILanguage );
}
function switchUILanguage()
{
var oldLangCode = parent.hPrefWindow.getPref( "localizedstring", "general.useragent.locale");
var newLangCode;
try {
var languageList = document.getElementById('languageList');
newLangCode = languageList ?
languageList.selectedItem.value :
parent.hPrefWindow.wsm.dataManager.getItemData( "chrome://communicator/content/pref/pref-appearance.xul", "languageList" ).value;
}
catch (e) {}
if (newLangCode != oldLangCode) {
try {
var chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"].getService(Components.interfaces.nsIChromeRegistry);
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
chromeRegistry.selectLocale(newLangCode, true);
observerService.notifyObservers(null, "locale-selected", null);
}
catch(e) {
return false;
}
}
return true;
}
]]>
</script>
<groupbox id="generalStartupPreferences" align="start">
<caption label="&onStartLegend.label;"/>
<!-- XXX remove when navigator overlays.rdf works -->
<checkbox id="generalStartupBrowser"
label="&navCheck.label;" accesskey="&navCheck.accesskey;"
prefstring="general.startup.browser"/>
<!-- XXX -->
</groupbox>
<vbox class="box-padded" align="start">
<separator class="thin" />
<checkbox id="showHideTooltips" label="&showHideTooltips.label;"
accesskey="&showHideTooltips.accesskey;"
prefstring="browser.chrome.toolbar_tips"/>
<checkbox id="useSiteIcons" label="&useSiteIcons.label;"
accesskey="&useSiteIcons.accesskey;"
prefstring="browser.chrome.site_icons"/>
<separator/>
<description>&languageList.txt.label;</description>
<separator class="thin" />
<label value="&languageList.label;" control="languageList"/>
<separator class="thin" />
<menulist id="languageList"
preftype="localizedstring"
prefstring="general.useragent.locale"
wsm_attributes="value"
datasources="rdf:chrome" ref="urn:mozilla:locale:root"
sortResource="http://www.mozilla.org/rdf/chrome#name"
sortDirection="ascending">
<template xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<rule chrome:localeType="region"/>
<rule>
<menupopup>
<menuitem
uri="..."
label="rdf:http://www.mozilla.org/rdf/chrome#displayName"
value="rdf:http://www.mozilla.org/rdf/chrome#name"/>
</menupopup>
</rule>
</template>
</menulist>
</vbox>
</page>