зеркало из https://github.com/mozilla/pjs.git
The Mother Of All Download Landings, Phase I
http://bugzilla.mozilla.org/show_bug.cgi?id=214259 Firebird Download System Upgrades. components/prefwindow/content/pref-connection.js components/prefwindow/content/pref-connection.xul components/prefwindow/locale/pref-connection.dtd components/prefwindow/content/pref-fonts.js components/prefwindow/content/pref-fonts.xul components/prefwindow/content/pref-features.js components/prefwindow/content/pref-features.xul components/prefwindow/locale/pref-features.dtd components/prefwindow/content/pref-navigator.js components/prefwindow/content/pref-navigator.xul components/prefwindow/locale/pref-navigator.dtd components/prefwindow/locale/pref.dtd - Update Connection and Fonts panel to be sub-dialogs
This commit is contained in:
Родитель
0f78321f66
Коммит
d54b7c5379
|
@ -18,6 +18,15 @@
|
|||
#
|
||||
# Contributor(s):
|
||||
|
||||
var _elementIDs = ["networkProxyType",
|
||||
"networkProxyFTP", "networkProxyFTP_Port",
|
||||
"networkProxyGopher", "networkProxyGopher_Port",
|
||||
"networkProxyHTTP", "networkProxyHTTP_Port",
|
||||
"networkProxySOCKS", "networkProxySOCKS_Port",
|
||||
"networkProxySOCKSVersion",
|
||||
"networkProxySSL", "networkProxySSL_Port",
|
||||
"networkProxyNone", "networkProxyAutoconfigURL"];
|
||||
|
||||
function Startup()
|
||||
{
|
||||
DoEnabling();
|
||||
|
@ -78,10 +87,18 @@ function DoEnabling()
|
|||
const nsIProtocolProxyService = Components.interfaces.nsIProtocolProxyService;
|
||||
const kPROTPROX_CID = '{e9b301c0-e0e4-11D3-a1a8-0050041caf44}';
|
||||
|
||||
function ReloadPAC() {
|
||||
function ReloadPAC()
|
||||
{
|
||||
var autoURL = document.getElementById("networkProxyAutoconfigURL");
|
||||
var pps = Components.classesByID[kPROTPROX_CID]
|
||||
.getService(nsIProtocolProxyService);
|
||||
pps.configureFromPAC(autoURL.value);
|
||||
}
|
||||
|
||||
function onConnectionsDialogOK()
|
||||
{
|
||||
window.opener.top.hPrefWindow.wsm.savePageData(window.location.href, window);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,22 +24,10 @@
|
|||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://browser/locale/pref/pref-connection.dtd" >
|
||||
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="parent.initPanel('chrome://browser/content/pref/pref-connection.xul');"
|
||||
headertitle="&lHeader;">
|
||||
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = ["networkProxyType",
|
||||
"networkProxyFTP", "networkProxyFTP_Port",
|
||||
"networkProxyGopher", "networkProxyGopher_Port",
|
||||
"networkProxyHTTP", "networkProxyHTTP_Port",
|
||||
"networkProxySOCKS", "networkProxySOCKS_Port",
|
||||
"networkProxySOCKSVersion",
|
||||
"networkProxySSL", "networkProxySSL_Port",
|
||||
"networkProxyNone", "networkProxyAutoconfigURL"];
|
||||
]]>
|
||||
</script>
|
||||
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="window.opener.top.initPanel('chrome://browser/content/pref/pref-connection.xul', window);"
|
||||
buttons="accept,cancel" ondialogaccept="return onConnectionsDialogOK(event);"
|
||||
title="&lHeader;">
|
||||
|
||||
<stringbundle id="bundle_prefutilities"
|
||||
src="chrome://pref/locale/prefutilities.properties"/>
|
||||
|
@ -151,5 +139,5 @@
|
|||
</radiogroup>
|
||||
|
||||
</groupbox>
|
||||
</page>
|
||||
</dialog>
|
||||
|
||||
|
|
|
@ -334,3 +334,86 @@ function HandlePermissionKeyPress(e) {
|
|||
DeletePermission();
|
||||
}
|
||||
}
|
||||
|
||||
function showFontsAndColors()
|
||||
{
|
||||
top.hPrefWindow.registerOKCallbackFunc(saveFontPrefs);
|
||||
|
||||
openDialog("chrome://browser/content/pref/pref-fonts.xul", "", "centerscreen,chrome,modal=yes,dialog=yes");
|
||||
}
|
||||
|
||||
function saveFontPrefs()
|
||||
{
|
||||
var dataObject = top.hPrefWindow.wsm.dataManager.pageData["chrome://browser/content/pref/pref-fonts.xul"];
|
||||
var pref = top.hPrefWindow.pref;
|
||||
for (var language in dataObject.languageData) {
|
||||
for (var type in dataObject.languageData[language].types) {
|
||||
var fontPrefString = "font.name." + type + "." + language;
|
||||
var currValue = "";
|
||||
try {
|
||||
currValue = pref.CopyUnicharPref(fontPrefString);
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
if (currValue != dataObject.languageData[language].types[type])
|
||||
pref.SetUnicharPref(fontPrefString, dataObject.languageData[language].types[type]);
|
||||
}
|
||||
var variableSizePref = "font.size.variable." + language;
|
||||
var fixedSizePref = "font.size.fixed." + language;
|
||||
var minSizePref = "font.minimum-size." + language;
|
||||
var currVariableSize = 12, currFixedSize = 12, minSizeVal = 0;
|
||||
try {
|
||||
currVariableSize = pref.GetIntPref(variableSizePref);
|
||||
currFixedSize = pref.GetIntPref(fixedSizePref );
|
||||
minSizeVal = pref.GetIntPref(minSizePref);
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
if (currVariableSize != dataObject.languageData[language].variableSize)
|
||||
pref.SetIntPref(variableSizePref, dataObject.languageData[language].variableSize);
|
||||
if (currFixedSize != dataObject.languageData[language].fixedSize)
|
||||
pref.SetIntPref(fixedSizePref, dataObject.languageData[language].fixedSize);
|
||||
if (minSizeVal != dataObject.languageData[language].minSize) {
|
||||
pref.SetIntPref(minSizePref, dataObject.languageData[language].minSize);
|
||||
}
|
||||
}
|
||||
|
||||
// font scaling
|
||||
var fontDPI = parseInt(dataObject.fontDPI);
|
||||
var myFonts = dataObject.dataEls["useMyFonts"].checked;
|
||||
var defaultFont = dataObject.defaultFont;
|
||||
var myColors = dataObject.dataEls["useMyColors"].checked;
|
||||
try {
|
||||
var currDPI = pref.GetIntPref("browser.display.screen_resolution");
|
||||
var currFonts = pref.GetIntPref("browser.display.use_document_fonts");
|
||||
var currColors = pref.GetBoolPref("browser.display.use_document_colors");
|
||||
var currDefault = pref.CopyUnicharPref( "font.default" );
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
|
||||
if (currDPI != fontDPI)
|
||||
pref.SetIntPref("browser.display.screen_resolution", fontDPI);
|
||||
if (currFonts == myFonts)
|
||||
pref.SetIntPref("browser.display.use_document_fonts", !myFonts);
|
||||
if(currDefault != defaultFont)
|
||||
pref.SetUnicharPref( "font.default", defaultFont );
|
||||
if (currColors == myColors)
|
||||
pref.SetBoolPref("browser.display.use_document_colors", !myColors);
|
||||
|
||||
var items = ["foregroundText", "background", "unvisitedLinks", "visitedLinks"];
|
||||
var prefs = ["browser.display.foreground_color", "browser.display.background_color",
|
||||
"browser.anchor_color", "browser.visited_color"];
|
||||
var prefvalue;
|
||||
for (var i = 0; i < items.length; ++i) {
|
||||
prefvalue = dataObject.dataEls[items[i]].value;
|
||||
pref.SetUnicharPref(prefs[i], prefvalue)
|
||||
}
|
||||
items = ["browserUseSystemColors", "browserUnderlineAnchors"];
|
||||
prefs = ["browser.display.use_system_colors", "browser.underline_anchors"];
|
||||
for (var i = 0; i < items.length; ++i) {
|
||||
prefvalue = dataObject.dataEls[items[i]].checked;
|
||||
pref.SetBoolPref(prefs[i], prefvalue)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -123,5 +123,14 @@
|
|||
</vbox>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
<groupbox>
|
||||
<hbox align="center">
|
||||
<description flex="1">&fontsInfo.label;</description>
|
||||
<button label="&showFontsAndColors.label;"
|
||||
accesskey="&showFontsAndColors.accesskey;"
|
||||
oncommand="showFontsAndColors();"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
</page>
|
||||
|
||||
|
|
|
@ -53,30 +53,30 @@ var variableSize, fixedSize, minSize, languageList;
|
|||
var languageData = [];
|
||||
var currentLanguage;
|
||||
var gPrefutilitiesBundle;
|
||||
var gPrefWindow = window.opener.parent.hPrefWindow;
|
||||
|
||||
// manual data retrieval function for PrefWindow
|
||||
function GetFields()
|
||||
{
|
||||
var dataObject = parent.hPrefWindow.wsm.dataManager.pageData["chrome://browser/content/pref/pref-fonts.xul"];
|
||||
|
||||
var dataObject = { };
|
||||
|
||||
// store data for language independent widgets
|
||||
var lists = ["selectLangs", "proportionalFont"];
|
||||
for( var i = 0; i < lists.length; i++ )
|
||||
{
|
||||
if( !( "dataEls" in dataObject ) )
|
||||
dataObject.dataEls = [];
|
||||
dataObject.dataEls[ lists[i] ] = [];
|
||||
dataObject.dataEls = new Object;
|
||||
dataObject.dataEls[ lists[i] ] = new Object;
|
||||
dataObject.dataEls[ lists[i] ].value = document.getElementById( lists[i] ).value;
|
||||
}
|
||||
|
||||
dataObject.defaultFont = document.getElementById( "proportionalFont" ).value;
|
||||
dataObject.fontDPI = document.getElementById( "screenResolution" ).value;
|
||||
dataObject.useMyFonts = document.getElementById( "useMyFonts" ).checked ? 1 : 0;
|
||||
|
||||
|
||||
var items = ["foregroundText", "background", "unvisitedLinks", "visitedLinks", "browserUseSystemColors", "browserUnderlineAnchors", "useMyColors", "useMyFonts"];
|
||||
for (i = 0; i < items.length; ++i) {
|
||||
dataObject.dataEls[items[i]] = [];
|
||||
}
|
||||
for (i = 0; i < items.length; ++i)
|
||||
dataObject.dataEls[items[i]] = new Object;
|
||||
dataObject.dataEls["foregroundText"].value = document.getElementById("foregroundtextmenu").color;
|
||||
dataObject.dataEls["background"].value = document.getElementById("backgroundmenu").color;
|
||||
dataObject.dataEls["unvisitedLinks"].value = document.getElementById("unvisitedlinkmenu").color;
|
||||
|
@ -116,7 +116,7 @@ function SetFields( aDataObject )
|
|||
var preftype = element.getAttribute( "preftype" );
|
||||
if( prefstring && preftype )
|
||||
{
|
||||
prefvalue = parent.hPrefWindow.getPref( preftype, prefstring );
|
||||
prefvalue = gPrefWindow.getPref( preftype, prefstring );
|
||||
element.selectedItem = element.getElementsByAttribute( "value", prefvalue )[0];
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ function SetFields( aDataObject )
|
|||
}
|
||||
else
|
||||
{
|
||||
prefvalue = parent.hPrefWindow.getPref( "int", "browser.display.screen_resolution" );
|
||||
prefvalue = gPrefWindow.getPref( "int", "browser.display.screen_resolution" );
|
||||
if( prefvalue != "!/!ERROR_UNDEFINED_PREF!/!" )
|
||||
resolution = prefvalue;
|
||||
else
|
||||
|
@ -140,11 +140,11 @@ function SetFields( aDataObject )
|
|||
|
||||
setResolution( resolution );
|
||||
|
||||
if ( parent.hPrefWindow.getPrefIsLocked( "browser.display.screen_resolution" ) ) {
|
||||
if ( gPrefWindow.getPrefIsLocked( "browser.display.screen_resolution" ) ) {
|
||||
screenResolution.disabled = true;
|
||||
}
|
||||
|
||||
if ( parent.hPrefWindow.getPrefIsLocked( "browser.display.use_document_fonts" ) ) {
|
||||
if ( gPrefWindow.getPrefIsLocked( "browser.display.use_document_fonts" ) ) {
|
||||
useMyFontsCheckbox.disabled = true;
|
||||
}
|
||||
if ("dataEls" in aDataObject) {
|
||||
|
@ -165,7 +165,7 @@ function SetFields( aDataObject )
|
|||
elt = document.getElementById(checkboxes[i]);
|
||||
prefstring = elt.getAttribute( "prefstring" );
|
||||
if( prefstring ) {
|
||||
prefvalue = parent.hPrefWindow.getPref( "bool", prefstring );
|
||||
prefvalue = gPrefWindow.getPref( "bool", prefstring );
|
||||
elt.checked = prefvalue;
|
||||
}
|
||||
}
|
||||
|
@ -174,13 +174,13 @@ function SetFields( aDataObject )
|
|||
elt = document.getElementById(colors[i]);
|
||||
prefstring = elt.nextSibling.getAttribute("prefstring");
|
||||
if (prefstring) {
|
||||
prefvalue = parent.hPrefWindow.getPref("color", prefstring);
|
||||
prefvalue = gPrefWindow.getPref("color", prefstring);
|
||||
elt.color = prefvalue;
|
||||
}
|
||||
}
|
||||
var useDocColors = parent.hPrefWindow.getPref("bool", "browser.display.use_document_colors");
|
||||
var useDocColors = gPrefWindow.getPref("bool", "browser.display.use_document_colors");
|
||||
document.getElementById("useMyColors").checked = !useDocColors;
|
||||
var useDocFonts = parent.hPrefWindow.getPref("int", "browser.display.use_document_fonts");
|
||||
var useDocFonts = gPrefWindow.getPref("int", "browser.display.use_document_fonts");
|
||||
document.getElementById("useMyFonts").checked = !useDocFonts;
|
||||
|
||||
}
|
||||
|
@ -188,6 +188,7 @@ function SetFields( aDataObject )
|
|||
|
||||
function Startup()
|
||||
{
|
||||
// Initialize the sub-dialog
|
||||
variableSize = document.getElementById( "sizeVar" );
|
||||
fixedSize = document.getElementById( "sizeMono" );
|
||||
minSize = document.getElementById( "minSize" );
|
||||
|
@ -195,9 +196,6 @@ function Startup()
|
|||
|
||||
gPrefutilitiesBundle = document.getElementById("bundle_prefutilities");
|
||||
|
||||
// register our ok callback function
|
||||
parent.hPrefWindow.registerOKCallbackFunc( saveFontPrefs );
|
||||
|
||||
// eventually we should detect the default language and select it by default
|
||||
selectLanguage();
|
||||
|
||||
|
@ -241,7 +239,7 @@ function Startup()
|
|||
|
||||
// Get the pref and set up the dialog appropriately. Startup is called
|
||||
// after SetFields so we can't rely on that call to do the business.
|
||||
var prefvalue = parent.hPrefWindow.getPref( "int", "browser.display.screen_resolution" );
|
||||
var prefvalue = gPrefWindow.getPref( "int", "browser.display.screen_resolution" );
|
||||
if( prefvalue != "!/!ERROR_UNDEFINED_PREF!/!" )
|
||||
resolution = prefvalue;
|
||||
else
|
||||
|
@ -251,10 +249,17 @@ function Startup()
|
|||
|
||||
// This prefstring is a contrived pref whose sole purpose is to lock some
|
||||
// elements in this panel. The value of the pref is not used and does not matter.
|
||||
if ( parent.hPrefWindow.getPrefIsLocked( "browser.display.languageList" ) ) {
|
||||
if ( gPrefWindow.getPrefIsLocked( "browser.display.languageList" ) ) {
|
||||
disableAllFontElements();
|
||||
}
|
||||
}
|
||||
|
||||
function onFontsDialogOK()
|
||||
{
|
||||
window.opener.top.hPrefWindow.wsm.savePageData(window.location.href, window);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function getFontEnumerator()
|
||||
{
|
||||
|
@ -467,7 +472,7 @@ function saveFontPrefs()
|
|||
var currValue = "";
|
||||
try
|
||||
{
|
||||
currValue = pref.CopyUnicharPref( fontPrefString );
|
||||
currValue = gPrefWindow.pref.CopyUnicharPref( fontPrefString );
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
|
@ -478,7 +483,7 @@ function saveFontPrefs()
|
|||
{
|
||||
if (dataValue)
|
||||
{
|
||||
pref.SetUnicharPref( fontPrefString, dataValue );
|
||||
gPrefWindow.pref.SetUnicharPref( fontPrefString, dataValue );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -489,7 +494,7 @@ function saveFontPrefs()
|
|||
try
|
||||
{
|
||||
// ClearUserPref throws an exception...
|
||||
pref.ClearUserPref( fontPrefString );
|
||||
gPrefWindow.pref.ClearUserPref( fontPrefString );
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
|
@ -503,19 +508,19 @@ function saveFontPrefs()
|
|||
var currVariableSize = 12, currFixedSize = 12, minSizeVal = 0;
|
||||
try
|
||||
{
|
||||
currVariableSize = pref.GetIntPref( variableSizePref );
|
||||
currFixedSize = pref.GetIntPref( fixedSizePref );
|
||||
minSizeVal = pref.GetIntPref( minSizePref );
|
||||
currVariableSize = gPrefWindow.pref.GetIntPref( variableSizePref );
|
||||
currFixedSize = gPrefWindow.pref.GetIntPref( fixedSizePref );
|
||||
minSizeVal = gPrefWindow.pref.GetIntPref( minSizePref );
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
if( currVariableSize != dataObject.languageData[language].variableSize )
|
||||
pref.SetIntPref( variableSizePref, dataObject.languageData[language].variableSize );
|
||||
gPrefWindow.pref.SetIntPref( variableSizePref, dataObject.languageData[language].variableSize );
|
||||
if( currFixedSize != dataObject.languageData[language].fixedSize )
|
||||
pref.SetIntPref( fixedSizePref, dataObject.languageData[language].fixedSize );
|
||||
gPrefWindow.pref.SetIntPref( fixedSizePref, dataObject.languageData[language].fixedSize );
|
||||
if ( minSizeVal != dataObject.languageData[language].minSize ) {
|
||||
pref.SetIntPref ( minSizePref, dataObject.languageData[language].minSize );
|
||||
gPrefWindow.pref.SetIntPref ( minSizePref, dataObject.languageData[language].minSize );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -526,24 +531,24 @@ function saveFontPrefs()
|
|||
var myColors = dataObject.dataEls["useMyColors"].checked;
|
||||
try
|
||||
{
|
||||
var currDPI = pref.GetIntPref( "browser.display.screen_resolution" );
|
||||
var currFonts = pref.GetIntPref( "browser.display.use_document_fonts" );
|
||||
var currColors = pref.GetBoolPref("browser.display.use_document_colors");
|
||||
var currDefault = pref.CopyUnicharPref( "font.default" );
|
||||
var currDPI = gPrefWindow.pref.GetIntPref( "browser.display.screen_resolution" );
|
||||
var currFonts = gPrefWindow.pref.GetIntPref( "browser.display.use_document_fonts" );
|
||||
var currColors = gPrefWindow.pref.GetBoolPref("browser.display.use_document_colors");
|
||||
var currDefault = gPrefWindow.pref.CopyUnicharPref( "font.default" );
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
if( currDPI != fontDPI )
|
||||
pref.SetIntPref( "browser.display.screen_resolution", fontDPI );
|
||||
gPrefWindow.pref.SetIntPref( "browser.display.screen_resolution", fontDPI );
|
||||
if( currFonts == myFonts )
|
||||
pref.SetIntPref( "browser.display.use_document_fonts", !myFonts );
|
||||
gPrefWindow.pref.SetIntPref( "browser.display.use_document_fonts", !myFonts );
|
||||
if( currDefault != defaultFont )
|
||||
{
|
||||
pref.SetUnicharPref( "font.default", defaultFont );
|
||||
gPrefWindow.pref.SetUnicharPref( "font.default", defaultFont );
|
||||
}
|
||||
if (currColors == myColors)
|
||||
pref.SetBoolPref("browser.display.use_document_colors", !myColors);
|
||||
gPrefWindow.pref.SetBoolPref("browser.display.use_document_colors", !myColors);
|
||||
|
||||
var items = ["foregroundText", "background", "unvisitedLinks", "visitedLinks"];
|
||||
var prefs = ["browser.display.foreground_color", "browser.display.background_color",
|
||||
|
@ -551,13 +556,13 @@ function saveFontPrefs()
|
|||
var prefvalue;
|
||||
for (var i = 0; i < items.length; ++i) {
|
||||
prefvalue = dataObject.dataEls[items[i]].value;
|
||||
pref.SetUnicharPref(prefs[i], prefvalue)
|
||||
gPrefWindow.pref.SetUnicharPref(prefs[i], prefvalue)
|
||||
}
|
||||
items = ["browserUseSystemColors", "browserUnderlineAnchors"];
|
||||
prefs = ["browser.display.use_system_colors", "browser.underline_anchors"];
|
||||
for (var i = 0; i < items.length; ++i) {
|
||||
prefvalue = dataObject.dataEls[items[i]].checked;
|
||||
pref.SetBoolPref(prefs[i], prefvalue)
|
||||
gPrefWindow.pref.SetBoolPref(prefs[i], prefvalue)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -641,11 +646,10 @@ function selectLanguage()
|
|||
try
|
||||
{
|
||||
var minSizePref = "font.minimum-size." + languageList.value;
|
||||
minSizeVal = pref.GetIntPref( minSizePref );
|
||||
minSizeVal = gPrefWindow.pref.GetIntPref( minSizePref );
|
||||
}
|
||||
catch(e) { }
|
||||
minSizeSelect( minSizeVal );
|
||||
|
||||
currentLanguage = languageList.value;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,9 +38,13 @@
|
|||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://browser/locale/pref/pref-fonts.dtd" >
|
||||
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="parent.initPanel('chrome://browser/content/pref/pref-fonts.xul');"
|
||||
headertitle="&lHeader;">
|
||||
|
||||
<dialog id="prefFontsDialog"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&prefFontsDialog.title;"
|
||||
style="width: 36em;"
|
||||
buttons="accept,cancel" ondialogaccept="return onFontsDialogOK(event);"
|
||||
onload="window.opener.top.initPanel('chrome://browser/content/pref/pref-fonts.xul', window);">
|
||||
|
||||
<stringbundle id="bundle_prefutilities"
|
||||
src="chrome://communicator/locale/pref/prefutilities.properties"/>
|
||||
|
@ -308,4 +312,4 @@
|
|||
<checkbox id="useMyColors" label="&useMyColors.label;"
|
||||
accesskey="&useMyColors.accesskey;"/>
|
||||
</hbox>
|
||||
</page>
|
||||
</dialog>
|
||||
|
|
|
@ -163,3 +163,8 @@ function Startup()
|
|||
parent.hPrefWindow.registerOKCallbackFunc(onOK);
|
||||
}
|
||||
|
||||
function showConnections()
|
||||
{
|
||||
openDialog("chrome://browser/content/pref/pref-connection.xul", "", "centerscreen,chrome,modal=yes,dialog=yes");
|
||||
}
|
||||
|
||||
|
|
|
@ -57,60 +57,7 @@
|
|||
|
||||
<script type="application/x-javascript">
|
||||
<![CDATA[
|
||||
var _elementIDs = ["browserStartupHomepage", "tabBackground", "downloadDir", "defaultDir"];
|
||||
|
||||
function selectFolder()
|
||||
{
|
||||
const nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
const nsILocalFile = Components.interfaces.nsILocalFile;
|
||||
var fp = Components.classes["@mozilla.org/filepicker;1"]
|
||||
.createInstance(nsIFilePicker);
|
||||
var pref = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
|
||||
var prefbundle = document.getElementById("bundle_prefutilities");
|
||||
var description = prefbundle.getString("downloadDirTitle");
|
||||
fp.init(window, description, nsIFilePicker.modeGetFolder);
|
||||
try
|
||||
{
|
||||
var initialDir = pref.getComplexValue("browser.download.dir", nsILocalFile);
|
||||
if (initialDir)
|
||||
fp.displayDirectory = initialDir;
|
||||
}
|
||||
catch (ex)
|
||||
{
|
||||
// ignore exception: file picker will open at default location
|
||||
}
|
||||
fp.appendFilters(nsIFilePicker.filterAll);
|
||||
var ret = fp.show();
|
||||
|
||||
var folderField = document.getElementById("defaultDir");
|
||||
if (ret == nsIFilePicker.returnOK) {
|
||||
var localFile = fp.file.QueryInterface(nsILocalFile);
|
||||
var viewable = fp.file.path;
|
||||
folderField.value = viewable;
|
||||
pref.setComplexValue("browser.download.dir", nsILocalFile, localFile)
|
||||
}
|
||||
else if (ret == nsIFilePicker.returnCancel) {
|
||||
if (folderField.value == "") {
|
||||
var downloadDir = document.getElementById("downloadDir");
|
||||
downloadDir.selectedItem = document.getElementById("alwaysAskRadio");
|
||||
}
|
||||
}
|
||||
}
|
||||
function doEnabling(aRadioButton)
|
||||
{
|
||||
if (aRadioButton.localName != "radio")
|
||||
return;
|
||||
|
||||
var textbox = document.getElementById("defaultDir");
|
||||
var button = document.getElementById("browse");
|
||||
var disable = aRadioButton.id == "alwaysAskRadio";
|
||||
textbox.disabled = disable;
|
||||
button.disabled = disable;
|
||||
if (!disable && textbox.value == "")
|
||||
selectFolder();
|
||||
}
|
||||
var _elementIDs = ["browserStartupHomepage", "tabBackground"];
|
||||
|
||||
#ifdef XP_WIN
|
||||
// "Install" the SetFields function. This will be
|
||||
|
@ -230,19 +177,6 @@
|
|||
label="&background.label;"
|
||||
prefstring="browser.tabs.loadInBackground"/>
|
||||
</groupbox>
|
||||
<groupbox orient="horizontal">
|
||||
<caption label="&defaultDir.label;"/>
|
||||
<radiogroup id="downloadDir" oncommand="doEnabling(event.target);" flex="1"
|
||||
preftype="bool" prefstring="browser.download.useDownloadDir">
|
||||
<radio id="alwaysAskRadio" label="&rememberLast.label;" value="false"/>
|
||||
<hbox flex="1">
|
||||
<radio id="useDownloadDirRadio" label="&useDownloadDir.label;" value="true"/>
|
||||
<textbox id="defaultDir" flex="1" prefstring="browser.download.dir"
|
||||
onchange="checkDownloadDirectory();"/>
|
||||
<button id="browse" label="&browse.label;" oncommand="selectFolder();"/>
|
||||
</hbox>
|
||||
</radiogroup>
|
||||
</groupbox>
|
||||
#ifdef XP_WIN
|
||||
<groupbox orient="horizontal">
|
||||
<caption label="&defaultBrowserGroup.label;"/>
|
||||
|
@ -254,5 +188,15 @@
|
|||
</hbox>
|
||||
</groupbox>
|
||||
#endif
|
||||
|
||||
<groupbox>
|
||||
<caption label="&connectionsInfo.caption;"/>
|
||||
<hbox align="center">
|
||||
<description flex="1">&proxiesInfo.label;</description>
|
||||
<button id="catProxiesButton" label="&showConnections.label;"
|
||||
accesskey="&showConnections.accesskey;"
|
||||
oncommand="showConnections();"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
</page>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!-- extracted from content/pref-proxies.xul -->
|
||||
|
||||
<!--LOCALIZATION NOTE : FILE The Proxies preferences dialog -->
|
||||
<!ENTITY lHeader "Connection">
|
||||
<!ENTITY lHeader "Connection Settings">
|
||||
<!ENTITY proxyTitle.label "Configure Proxies to Access the Internet">
|
||||
<!ENTITY directTypeRadio.label "Direct connection to the Internet">
|
||||
<!ENTITY directTypeRadio.accesskey "d">
|
||||
|
|
|
@ -21,3 +21,11 @@
|
|||
<!ENTITY removepermission.label "Remove Site">
|
||||
<!ENTITY removeallpermissions.label "Remove All Sites">
|
||||
|
||||
|
||||
<!-- XXXben can we do better than this text-wise? -->
|
||||
<!ENTITY fonts.label "Fonts & Colors">
|
||||
<!ENTITY fontsInfo.caption "Fonts & Colors Settings">
|
||||
<!ENTITY fontsInfo.label "Select default Fonts and Colors used when displaying pages.">
|
||||
|
||||
<!ENTITY showFontsAndColors.label "Fonts & Colors">
|
||||
<!ENTITY showFontsAndColors.accesskey "f">
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<!-- extracted from content/pref-fonts.xul -->
|
||||
|
||||
<!-- LOCALIZATION NOTE : FILE 'Fonts' prefs dialog -->
|
||||
<!ENTITY lHeader "Fonts & Colors">
|
||||
<!ENTITY prefFontsDialog.title "Fonts & Colors">
|
||||
|
||||
<!ENTITY language.label "Fonts for:">
|
||||
<!ENTITY language.accesskey "t">
|
||||
|
|
|
@ -14,13 +14,15 @@
|
|||
<!ENTITY windowsAndTabs.label "Windows and Tabs">
|
||||
<!ENTITY background.label "Open Links in the background">
|
||||
|
||||
<!ENTITY defaultDir.label "Download Folder">
|
||||
<!ENTITY rememberLast.label "Ask me where to save every file">
|
||||
<!ENTITY useDownloadDir.label "Save all files to this folder:">
|
||||
<!ENTITY browse.label "Browse...">
|
||||
|
||||
#ifdef XP_WIN
|
||||
<!ENTITY defaultBrowserGroup.label "Default Browser">
|
||||
<!ENTITY defaultBrowserButton.label "Set Default Browser">
|
||||
<!ENTITY makeDefaultText "Set &brandShortName; as your default browser.">
|
||||
#endif
|
||||
#endif
|
||||
|
||||
<!-- XXXben oh please, can we do better than this text-wise? -->
|
||||
<!ENTITY showConnections.label "Connection Settings">
|
||||
<!ENTITY showConnections.accesskey "o">
|
||||
|
||||
<!ENTITY proxiesInfo.label "Set up Proxies for accessing the internet.">
|
||||
<!ENTITY connectionsInfo.caption "Connection">
|
|
@ -12,14 +12,12 @@
|
|||
size of this window for en-US. -->
|
||||
<!ENTITY prefWindow.size "width: 52.3em; height: 41em;">
|
||||
<!--LOCALIZATION NOTE : FILE Lists preferences categories that appear on the left of the preferences dialog -->
|
||||
<!ENTITY fonts.label "Fonts & Colors">
|
||||
<!ENTITY themes.label "Themes">
|
||||
<!ENTITY ext.label "Extensions">
|
||||
<!--LOCALIZATION NOTE (navigator.label): DONT_TRANSLATE -->
|
||||
<!ENTITY general.label "General">
|
||||
<!--LOCALIZATION NOTE (smartBrowse.label): DONT_TRANSLATE -->
|
||||
<!ENTITY privacy.label "Privacy">
|
||||
<!ENTITY proxies.label "Connection">
|
||||
<!ENTITY downloads.label "Downloads">
|
||||
<!ENTITY features.label "Web Features">
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче