mirror of
https://github.com/rn10950/RetroZilla.git
synced 2024-11-14 03:30:17 +01:00
309 lines
12 KiB
Plaintext
309 lines
12 KiB
Plaintext
|
<?xml version="1.0"?>
|
||
|
<!-- ***** BEGIN LICENSE BLOCK *****
|
||
|
Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||
|
|
||
|
The contents of this file are subject to the Mozilla 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/MPL/
|
||
|
|
||
|
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.org Code.
|
||
|
|
||
|
The Initial Developer of the Original Code is
|
||
|
Netscape Communications Corporation.
|
||
|
Portions created by the Initial Developer are Copyright (C) 2001
|
||
|
the Initial Developer. All Rights Reserved.
|
||
|
|
||
|
Contributor(s):
|
||
|
J.Betak <jbetak@netscape.com>
|
||
|
Josh Soref <timeless@mac.com>
|
||
|
|
||
|
Alternatively, the contents of this file may be used under the terms of
|
||
|
either the GNU General Public License Version 2 or later (the "GPL"), or
|
||
|
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||
|
in which case the provisions of the GPL or the LGPL are applicable instead
|
||
|
of those above. If you wish to allow use of your version of this file only
|
||
|
under the terms of either the GPL or the LGPL, and not to allow others to
|
||
|
use your version of this file under the terms of the MPL, indicate your
|
||
|
decision by deleting the provisions above and replace them with the notice
|
||
|
and other provisions required by the GPL or the LGPL. If you do not delete
|
||
|
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 ***** -->
|
||
|
|
||
|
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
||
|
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
|
||
|
|
||
|
<!DOCTYPE page [
|
||
|
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
|
||
|
%brandDTD;
|
||
|
<!ENTITY % regionDTD SYSTEM "chrome://global-region/locale/region.dtd" >
|
||
|
%regionDTD;
|
||
|
<!ENTITY % prefContentDTD SYSTEM "chrome://content-packs/locale/pref-contentpacks.dtd" >
|
||
|
%prefContentDTD;
|
||
|
]>
|
||
|
|
||
|
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||
|
onload="parent.initPanel('chrome://content-packs/content/pref-contentpacks.xul'); "
|
||
|
headertitle="&pref.contentpacks.title;">
|
||
|
|
||
|
<script type="application/x-javascript">
|
||
|
<![CDATA[
|
||
|
var _elementIDs = ["contentPackList", "languagePackList"];
|
||
|
|
||
|
|
||
|
function Startup()
|
||
|
{
|
||
|
var contentList = document.getElementById( "contentPackList" );
|
||
|
var regionName = contentList.getAttribute("prefvalue");
|
||
|
var regionElements = contentList.getElementsByAttribute("value", regionName);
|
||
|
|
||
|
if (regionElements.item(0)) {
|
||
|
contentList.selectItem(regionElements.item(0));
|
||
|
} else {
|
||
|
contentList.selectedIndex = 0;
|
||
|
}
|
||
|
|
||
|
var languageList = document.getElementById( "languagePackList" );
|
||
|
var languageName = languageList.getAttribute("prefvalue");
|
||
|
var languageElements = languageList.getElementsByAttribute("value", languageName);
|
||
|
|
||
|
if (languageElements.item(0)) {
|
||
|
languageList.selectItem(languageElements.item(0));
|
||
|
} else {
|
||
|
languageList.selectedIndex = 0;
|
||
|
}
|
||
|
parent.hPrefWindow.registerOKCallbackFunc( SwitchPacks );
|
||
|
}
|
||
|
|
||
|
function SwitchPacks()
|
||
|
{
|
||
|
var shouldRemoveFaslFile = false;
|
||
|
//Switch the Content pack if necessary
|
||
|
var oldContentPack = parent.hPrefWindow.getPref( "localizedstring", "general.useragent.contentlocale");
|
||
|
var newContentPack = parent.hPrefWindow.wsm.dataManager.getItemData( "chrome://content-packs/content/pref-contentpacks.xul", "contentPackList" ).prefvalue;
|
||
|
if (newContentPack && (newContentPack != oldContentPack))
|
||
|
{
|
||
|
try {
|
||
|
parent.hPrefWindow.chromeRegistry.selectLocale(newContentPack, true);
|
||
|
shouldRemoveFaslFile = true;
|
||
|
parent.hPrefWindow.observerService.notifyObservers(null, "locale-selected", null);
|
||
|
}
|
||
|
catch(e) {}
|
||
|
}
|
||
|
|
||
|
//Switch the Language pack if necessary
|
||
|
var oldLanguagePack = parent.hPrefWindow.getPref( "localizedstring", "general.useragent.locale");
|
||
|
var newLanguagePack = parent.hPrefWindow.wsm.dataManager.getItemData( "chrome://content-packs/content/pref-contentpacks.xul", "languagePackList" ).prefvalue;
|
||
|
if (newLanguagePack && (newLanguagePack != oldLanguagePack))
|
||
|
{
|
||
|
try {
|
||
|
parent.hPrefWindow.chromeRegistry.selectLocale(newLanguagePack, true);
|
||
|
shouldRemoveFaslFile = true;
|
||
|
parent.hPrefWindow.observerService.notifyObservers(null, "locale-selected", null);
|
||
|
}
|
||
|
catch(e) {}
|
||
|
}
|
||
|
|
||
|
// If we changed locale, we need to destroy the fastload file so that it
|
||
|
// will load the language strings from the new locale jars. No one should
|
||
|
// have the fastload file open at this moment, so the remove should succeed.
|
||
|
// (XXX actually there is a small window where this is possible, in which
|
||
|
// case we're screwed).
|
||
|
// XXX This should really be done in the chrome registry itself, not be in
|
||
|
// front-end code, but this patch is only to get this mostly working for 1.1b
|
||
|
// The code below must die before 1.1final!!
|
||
|
if (shouldRemoveFaslFile) {
|
||
|
try {
|
||
|
const XUL_FASTLOAD_FILE_BASENAME = "XUL";
|
||
|
var faslService = Components.classes['@mozilla.org/fast-load-service;1']
|
||
|
.getService(Components.interfaces.nsIFastLoadService);
|
||
|
var faslFile = faslService.newFastLoadFile(XUL_FASTLOAD_FILE_BASENAME);
|
||
|
faslFile.remove(false);
|
||
|
} catch(e) {}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
function SelectPack(listbox, button)
|
||
|
{
|
||
|
var list = document.getElementById(listbox);
|
||
|
var selectedItem = list.selectedItems.length ? list.selectedItems[0] : null;
|
||
|
|
||
|
if (selectedItem) {
|
||
|
var uninstallButton = document.getElementById(button);
|
||
|
var packID = selectedItem.getAttribute("value");
|
||
|
|
||
|
//current chrome providers cannot be unistalled
|
||
|
uninstallButton.disabled = (packID == parent.hPrefWindow.getPref("localizedstring", list.getAttribute("prefstring")));
|
||
|
|
||
|
//out-of-date packs cannot become chrome providers
|
||
|
if (selectedItem.getAttribute("class") == "outofdate")
|
||
|
list.setAttribute("prefvalue", parent.hPrefWindow.getPref("localizedstring", list.getAttribute("prefstring")));
|
||
|
else
|
||
|
list.setAttribute("prefvalue", packID);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function UninstallPack(listbox)
|
||
|
{
|
||
|
var list = document.getElementById(listbox);
|
||
|
var selectedContentItem = list.selectedItems[0];
|
||
|
var packName = selectedContentItem.getAttribute("value");
|
||
|
|
||
|
try {
|
||
|
//uninstall from global chrome
|
||
|
parent.hPrefWindow.chromeRegistry.uninstallLocale(packName, false);
|
||
|
|
||
|
//uninstall from profile-bound chrome
|
||
|
parent.hPrefWindow.chromeRegistry.uninstallLocale(packName, true);
|
||
|
}
|
||
|
catch(e) {}
|
||
|
|
||
|
if (packName == list.getAttribute("prefvalue"))
|
||
|
list.setAttribute("prefvalue", parent.hPrefWindow.getPref("localizedstring", list.getAttribute("prefstring")));
|
||
|
|
||
|
//removed items cannot become chrome providers
|
||
|
var listSelection = list.getElementsByAttribute("value", list.getAttribute("prefvalue"));
|
||
|
|
||
|
//find and select the list item corresponding to the current chrome provider
|
||
|
if (listSelection.item(0))
|
||
|
list.selectedItem = listSelection.item(0);
|
||
|
else
|
||
|
list.selectedIndex = 0;
|
||
|
}
|
||
|
|
||
|
function DownloadRegionPacks()
|
||
|
{
|
||
|
openTopWin(xlateURL("urn:clienturl:viewmenu:intlwebcontent"));
|
||
|
}
|
||
|
]]>
|
||
|
</script>
|
||
|
|
||
|
<hbox class="box-smallheader" title="&pref.contentpacks.title;"/>
|
||
|
|
||
|
<!-- Language pack listbox -->
|
||
|
<description>&languageIntro.label;</description>
|
||
|
<separator class="thin"/>
|
||
|
|
||
|
<label control="languagePackList">&installedLanguagePacks.label;</label>
|
||
|
<listbox id="languagePackList" flex="1" rows="3"
|
||
|
ref="urn:mozilla:locale:root"
|
||
|
datasources="rdf:chrome"
|
||
|
sortResource="http://www.mozilla.org/rdf/chrome#name"
|
||
|
preftype="localizedstring"
|
||
|
prefstring="general.useragent.locale"
|
||
|
prefattribute="prefvalue"
|
||
|
wsm_attributes="value"
|
||
|
seltype="false"
|
||
|
onselect="SelectPack('languagePackList', 'uninstallLanguagePack');"
|
||
|
sortDirection="ascending">
|
||
|
<template xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||
|
|
||
|
<!-- This rule eliminates region packs from the language pack list -->
|
||
|
<rule chrome:localeType="region"/>
|
||
|
|
||
|
<!-- This rule displays only up to date language packs based on the localeVersion -->
|
||
|
<rule chrome:localeVersion="&lang.version;">
|
||
|
<listitem uri="..." translation="true" nselected="false"
|
||
|
label="rdf:http://www.mozilla.org/rdf/chrome#displayName"
|
||
|
value="rdf:http://www.mozilla.org/rdf/chrome#name"/>
|
||
|
</rule>
|
||
|
|
||
|
<!-- This rule "falls through" to match obsolete language packs -->
|
||
|
<rule>
|
||
|
<conditions>
|
||
|
<content uri="?container"/>
|
||
|
<member container="?container" child="?member"/>
|
||
|
<triple predicate="http://www.mozilla.org/rdf/chrome#localeVersion"
|
||
|
subject="?member" object="?version"/>
|
||
|
</conditions>
|
||
|
<bindings>
|
||
|
<binding predicate="http://www.mozilla.org/rdf/chrome#displayName"
|
||
|
subject="?member" object="?label"/>
|
||
|
<binding predicate="http://www.mozilla.org/rdf/chrome#name"
|
||
|
subject="?member" object="?value"/>
|
||
|
</bindings>
|
||
|
<action>
|
||
|
<listitem uri="?member" label="?label ?version &update.label;" value="?value"
|
||
|
translation="true" nselected="false" class="outofdate"/>
|
||
|
</action>
|
||
|
</rule>
|
||
|
</template>
|
||
|
</listbox>
|
||
|
|
||
|
<hbox>
|
||
|
<vbox>
|
||
|
<button id="uninstallLanguagePack"
|
||
|
label="&uninstallLanguagePack.label;"
|
||
|
accesskey="&uninstallLanguagePack.accesskey;"
|
||
|
oncommand="UninstallPack('languagePackList')"/>
|
||
|
</vbox>
|
||
|
<vbox>
|
||
|
<button id="downloadLanguagePacks"
|
||
|
label="&downloadLanguagePacks.label;"
|
||
|
accesskey="&downloadLanguagePacks.accesskey;"
|
||
|
oncommand="DownloadRegionPacks()"/>
|
||
|
</vbox>
|
||
|
</hbox>
|
||
|
|
||
|
<!-- Content (aka region) pack listbox -->
|
||
|
<separator class="thin"/>
|
||
|
<description>&contentIntro.label;</description>
|
||
|
|
||
|
<label control="contentPackList">&installedContentPacks.label;</label>
|
||
|
<listbox id="contentPackList" flex="1" rows="3"
|
||
|
ref="urn:mozilla:locale:root" datasources="rdf:chrome"
|
||
|
sortResource="http://www.mozilla.org/rdf/chrome#name"
|
||
|
preftype="localizedstring" prefstring="general.useragent.contentlocale"
|
||
|
prefvalue="" prefattribute="prefvalue" wsm_attributes="prefvalue"
|
||
|
seltype="false"
|
||
|
onselect="SelectPack('contentPackList', 'uninstallContentPack');"
|
||
|
sortDirection="ascending">
|
||
|
|
||
|
<template xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||
|
|
||
|
<!-- This rule displays only up to date content packs based on the localeVersion -->
|
||
|
<rule chrome:localeType="region" chrome:localeVersion="&content.version;">
|
||
|
<listitem uri="..." translation="true" nselected="false"
|
||
|
label="rdf:http://www.mozilla.org/rdf/chrome#displayName"
|
||
|
value="rdf:http://www.mozilla.org/rdf/chrome#name"/>
|
||
|
</rule>
|
||
|
|
||
|
<!-- This rule "falls through" to match obsolete content packs -->
|
||
|
<rule chrome:localeType="region">
|
||
|
<listitem uri="..." translation="true" nselected="false" class="outofdate"
|
||
|
label="rdf:http://www.mozilla.org/rdf/chrome#displayName &update.label;"
|
||
|
value="rdf:http://www.mozilla.org/rdf/chrome#name"/>
|
||
|
</rule>
|
||
|
|
||
|
</template>
|
||
|
</listbox>
|
||
|
|
||
|
<hbox>
|
||
|
<vbox>
|
||
|
<button id="uninstallContentPack"
|
||
|
label="&uninstallContentPack.label;"
|
||
|
accesskey="&uninstallContentPack.accesskey;"
|
||
|
oncommand="UninstallPack('contentPackList')"/>
|
||
|
</vbox>
|
||
|
<vbox>
|
||
|
<button id="downloadContentPacks"
|
||
|
label="&downloadContentPacks.label;"
|
||
|
accesskey="&downloadContentPacks.accesskey;"
|
||
|
oncommand="DownloadRegionPacks()"/>
|
||
|
</vbox>
|
||
|
</hbox>
|
||
|
|
||
|
<separator class="thin"/>
|
||
|
<description>&restartOnLangChange.label;</description>
|
||
|
<separator class="thin"/>
|
||
|
|
||
|
</page>
|