Bug 226955: Conversion from <window class="dialog"> to <dialog>.

r=neil, sr=alecf, a=chofmann
This commit is contained in:
Stefan.Borggraefe%gmx.de 2005-05-05 02:25:04 +00:00
parent b482b21f44
commit e446bed4da
2 changed files with 12 additions and 40 deletions

View File

@ -21,6 +21,7 @@
the Initial Developer. All Rights Reserved.
Contributor(s):
Stefan Borggraefe <Stefan.Borggraefe@gmx.de>
Alternatively, the contents of this file may be used under the terms of
either of the GNU General Public License Version 2 or later (the "GPL"),
@ -38,15 +39,13 @@
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE dialog SYSTEM "chrome://communicator/locale/pref/pref-fonts.dtd" >
<!DOCTYPE window SYSTEM "chrome://communicator/locale/pref/pref-fonts.dtd" >
<window id="calibrateScreen"
<dialog id="calibrateScreen"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&calibrateDialog.title;"
class="dialog"
onload="Init();"
buttons="accept,cancel"
ondialogaccept="return onOK();"
persist="screenX screenY">
<script type="application/x-javascript"
@ -63,8 +62,6 @@
<label value="&calibrate.instructions;"/>
</hbox>
<separator class="thin"/>
<hbox align="center">
<textbox id="horizSize" size="5"/>
<menulist id="units" persist="value">
@ -73,14 +70,8 @@
<menuitem value="inches" label="&units.inches;"/>
</menupopup>
</menulist>
</hbox>
<separator/>
<keyset id="dialogKeys"/>
<hbox id="okCancelButtonsRight"/>
</vbox>
</window>
</dialog>

View File

@ -22,6 +22,7 @@
* Contributor(s):
* Gervase Markham <gerv@gerv.net>
* Tuukka Tolvanen <tt@lament.cjb.net>
* Stefan Borggraefe <Stefan.Borggraefe@gmx.de>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -569,7 +570,7 @@ function changeScreenResolution()
if (screenResolution.value == "other")
{
// If the user selects "Other..." we bring up the calibrate screen dialog
var rv = { newdpi : 0 };
var rv = { newdpi : -1 };
var calscreen = window.openDialog("chrome://communicator/content/pref/pref-calibrate-screen.xul",
"_blank",
"modal,chrome,centerscreen,resizable=no,titlebar",
@ -627,32 +628,19 @@ function setResolution( resolution )
// "Calibrate screen" dialog code
function Init()
{
sizeToContent();
doSetOKCancel(onOK, onCancel);
document.getElementById("horizSize").focus();
}
function onOK()
{
// Get value from the dialog to work out dpi
var horizSize = parseFloat(document.getElementById("horizSize").value);
var units = document.getElementById("units").value;
// We can't calculate anything without a proper value
if (!horizSize || horizSize < 0)
{
// We can't calculate anything without a proper value
window.arguments[0].newdpi = -1;
return true;
}
return true;
// Convert centimetres to inches.
// The magic number is allowed because it's a fundamental constant :-)
if (units === "centimetres")
{
horizSize /= 2.54;
}
if (document.getElementById("units").value === "centimetres")
horizSize /= 2.54;
// These shouldn't change, but you can't be too careful.
var horizBarLengthPx = document.getElementById("horizRuler").boxObject.width;
@ -665,13 +653,6 @@ function onOK()
return true;
}
function onCancel()
{
// We return -1 to show that no value has been given.
window.arguments[0].newdpi = -1;
return true;
}
// disable font items, but not the browserUseDocumentFonts checkbox nor the resolution
// menulist
function disableAllFontElements()