Bug 81094 - re-introduce the ability to set the DPI value to "Ask X server"; i18n fixes, general clean-up and also make the Fonts prefs panel slightly more clear by adding a separator. r=mcafee, sr=alecf, a=blizzard.

This commit is contained in:
gerv%gerv.net 2001-06-05 21:38:24 +00:00
Родитель c52208ee11
Коммит c4d23bd566
4 изменённых файлов: 45 добавлений и 12 удалений

Просмотреть файл

@ -26,6 +26,7 @@ pref("mail.empty_trash", false);
pref("network.hosts.smtp_server", "localhost");
pref("network.hosts.pop_server", "pop");
pref("mail.check_new_mail", true);
pref("browser.display.screen_resolution", 0); // System setting
pref("browser.startup.license_accepted", "");
pref("browser.cache.memory_cache_size", 4096);
pref("browser.cache.disk_cache_size", 50000);

Просмотреть файл

@ -114,17 +114,19 @@ function SetFields( aDataObject )
var userResolution = document.getElementById("userResolution");
// If it's one of the hard-coded values, this will work...
try
var item = screenResolution.getElementsByAttribute( "value", resolution )[0];
if (item != null)
{
screenResolution.selectedItem = screenResolution.getElementsByAttribute( "value", resolution )[0];
// If it's one of the hard-coded values, we'll select it directly
screenResolution.selectedItem = item;
userResolution.setAttribute("hidden", "true");
}
catch (e)
}
else
{
// Otherwise we need to set up the userResolution field
var dpi = screenResolution.getAttribute( "dpi" );
userResolution.setAttribute("value", resolution);
userResolution.setAttribute("label", resolution);
userResolution.setAttribute("label", dpi.replace(/\$val/, resolution));
userResolution.removeAttribute("hidden");
screenResolution.selectedItem = userResolution;
}
@ -153,6 +155,21 @@ function Startup()
// eventually we should detect the default language and select it by default
selectLanguage();
// Allow user to ask the OS for a DPI if we are under X
if (navigator.appVersion.indexOf("X11") != -1)
{
document.getElementById( "systemResolution" ).removeAttribute( "hidden" );
}
// Set up the labels for the standard issue resolutions
var resolution;
resolution = document.getElementById( "screenResolution" );
var dpi = resolution.getAttribute( "dpi" );
resolution = document.getElementById( "otherResolution" );
resolution.setAttribute( "value", dpi.replace(/\$val/, "72" ) );
resolution = document.getElementById( "defaultResolution" );
resolution.setAttribute( "value", dpi.replace(/\$val/, "96" ) );
}
function listElement( aListID )
@ -419,8 +436,9 @@ function changeScreenResolution()
if (rv.newdpi != -1)
{
// They have entered values, and we have a DPI value back
var dpi = screenResolution.getAttribute( "dpi" );
userResolution.setAttribute("value", rv.newdpi);
userResolution.setAttribute("label", rv.newdpi + " dpi");
userResolution.setAttribute("label", dpi.replace(/\$val/, rv.newdpi));
userResolution.removeAttribute("hidden");
screenResolution.selectedItem = userResolution;
}

Просмотреть файл

@ -115,6 +115,9 @@
</menupopup>
</menulist>
</row>
<row>
<separator class="thin"/>
</row>
<row autostretch="never" valign="middle">
<box autostretch="never" halign="right">
<text class="label small-margin"
@ -222,12 +225,19 @@
accesskey="&resolution.accesskey;"
for="screenResolution"/>
<menulist id="screenResolution"
oncommand="changeScreenResolution()">
oncommand="changeScreenResolution()"
dpi="&resolution.dpival;">
<menupopup>
<menuitem value="72" label="72 dpi"/>
<menuitem value="96"
label="96 dpi (&resolution.default;)"
<menuitem value="&resolution.72.value;"
label="&resolution.72.value; &resolution.dpi;"
id="otherResolution"/>
<menuitem value="&resolution.96.value;"
label="&resolution.96.value; &resolution.dpi;"
id="defaultResolution"/>
<menuitem value="0"
label="&resolution.system.label;"
id="systemResolution"
hidden="true"/>
<menuseparator/>
<menuitem id="userResolution" hidden="true"/>
<menuitem value="other" label="&resolution.other;"/>

Просмотреть файл

@ -63,8 +63,12 @@
<!-- font scaling -->
<!ENTITY resolution.label "Display resolution:">
<!ENTITY resolution.accesskey "r">
<!-- LOCALIZATION NOTE (resolution.dpi): dpi stands for "dots per inch" -->
<!ENTITY resolution.dpi "dpi">
<!-- LOCALIZATION NOTE (resolution.dpi): $val will be replaced by a numeric dpi value. -->
<!ENTITY resolution.dpival "$val &resolution.dpi;">
<!ENTITY resolution.system.label "System setting">
<!ENTITY resolution.other "Other...">
<!ENTITY resolution.default "default">
<!-- screen calibration dialog -->
<!ENTITY calibrateDialog.title "Calibrate Resolution">