bug 213228: new toolkit independence bug, part 5.

fork printing front end.
#ifdef XP_UNIX printjoboption.js and printjoboption.xul
remove communicator dependency (dialogs.css)
This commit is contained in:
chanial%noos.fr 2003-08-16 11:39:10 +00:00
Родитель 6f15f1b68f
Коммит 3c076279da
14 изменённых файлов: 2267 добавлений и 0 удалений

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

@ -0,0 +1,46 @@
# ***** 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 build.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# 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 NPL, 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 NPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk

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

@ -0,0 +1,217 @@
# -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
# ***** 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 printing front-end.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributors:
# Rod Spears <rods@netscape.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 NPL, 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 NPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
// dialog is just an array we'll use to store various properties from the dialog document...
var dialog;
// the printProgress is a nsIPrintProgress object
var printProgress = null;
// random global variables...
var targetFile;
var docTitle = "";
var docURL = "";
var progressParams = null;
function elipseString(aStr, doFront)
{
if (aStr.length > 3 && (aStr.substr(0, 3) == "..." || aStr.substr(aStr.length-4, 3) == "...")) {
return aStr;
}
var fixedLen = 64;
if (aStr.length > fixedLen) {
if (doFront) {
var endStr = aStr.substr(aStr.length-fixedLen, fixedLen);
var str = "..." + endStr;
return str;
} else {
var frontStr = aStr.substr(0, fixedLen);
var str = frontStr + "...";
return str;
}
}
return aStr;
}
// all progress notifications are done through the nsIWebProgressListener implementation...
var progressListener = {
onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus)
{
if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP)
{
window.close();
}
},
onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress)
{
if (progressParams)
{
var docTitleStr = elipseString(progressParams.docTitle, false);
if (docTitleStr != docTitle) {
docTitle = docTitleStr;
dialog.title.value = docTitle;
}
var docURLStr = elipseString(progressParams.docURL, true);
if (docURLStr != docURL && dialog.title != null) {
docURL = docURLStr;
if (docTitle == "") {
dialog.title.value = docURLStr;
}
}
}
},
onLocationChange: function(aWebProgress, aRequest, aLocation)
{
// we can ignore this notification
},
onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage)
{
if (aMessage != "")
dialog.title.setAttribute("value", aMessage);
},
onSecurityChange: function(aWebProgress, aRequest, state)
{
// we can ignore this notification
},
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsIWebProgressListener) || iid.equals(Components.interfaces.nsISupportsWeakReference))
return this;
throw Components.results.NS_NOINTERFACE;
}
};
function onLoad() {
// Set global variables.
printProgress = window.arguments[0];
if (window.arguments[1])
{
progressParams = window.arguments[1].QueryInterface(Components.interfaces.nsIPrintProgressParams)
if (progressParams)
{
docTitle = elipseString(progressParams.docTitle, false);
docURL = elipseString(progressParams.docURL, true);
}
}
if ( !printProgress ) {
dump( "Invalid argument to printPreviewProgress.xul\n" );
window.close()
return;
}
dialog = new Object;
dialog.strings = new Array;
dialog.title = document.getElementById("dialog.title");
dialog.titleLabel = document.getElementById("dialog.titleLabel");
dialog.title.value = docTitle;
// set our web progress listener on the helper app launcher
printProgress.registerListener(progressListener);
moveToAlertPosition();
//We need to delay the set title else dom will overwrite it
window.setTimeout(doneIniting, 100);
}
function onUnload()
{
if (printProgress)
{
try
{
printProgress.unregisterListener(progressListener);
printProgress = null;
}
catch( exception ) {}
}
}
function getString( stringId ) {
// Check if we've fetched this string already.
if (!(stringId in dialog.strings)) {
// Try to get it.
var elem = document.getElementById( "dialog.strings."+stringId );
try {
if ( elem
&&
elem.childNodes
&&
elem.childNodes[0]
&&
elem.childNodes[0].nodeValue ) {
dialog.strings[ stringId ] = elem.childNodes[0].nodeValue;
} else {
// If unable to fetch string, use an empty string.
dialog.strings[ stringId ] = "";
}
} catch (e) { dialog.strings[ stringId ] = ""; }
}
return dialog.strings[ stringId ];
}
// If the user presses cancel, tell the app launcher and close the dialog...
function onCancel ()
{
// Cancel app launcher.
try
{
printProgress.processCanceledByUser = true;
}
catch( exception ) {return true;}
// don't Close up dialog by returning false, the backend will close the dialog when everything will be aborted.
return false;
}
function doneIniting()
{
// called by function timeout in onLoad
printProgress.doneIniting();
}

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

@ -0,0 +1,75 @@
<?xml version="1.0"?>
# -*- Mode: HTML -*-
# ***** 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 printing front-end.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Rod Spears <rods@netscape.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 NPL, 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 NPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://global/locale/printPreviewProgress.dtd">
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
class="dialog"
title="&printWindow.title;"
style="width: 36em;"
onload="onLoad()"
onunload="onUnload()">
<script type="application/x-javascript" src="chrome://global/content/printPreviewProgress.js"/>
<grid flex="1">
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<hbox pack="end">
<label id="dialog.titleLabel" value="&title;"/>
</hbox>
<label id="dialog.title"/>
</row>
<row class="thin-separator">
<hbox pack="end">
<label id="dialog.progressSpaces" value="&progress;"/>
</hbox>
<label id="dialog.progressLabel" value="&preparing;"/>
</row>
</rows>
</grid>
</window>

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

@ -0,0 +1,308 @@
# -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
# ***** 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 printing front-end.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributors:
# William A. ("PowerGUI") Law <law@netscape.com>
# Scott MacGregor <mscott@netscape.com>
# jean-Francois Ducarroz <ducarroz@netscape.com>
# Rod Spears <rods@netscape.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 NPL, 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 NPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
// dialog is just an array we'll use to store various properties from the dialog document...
var dialog;
// the printProgress is a nsIPrintProgress object
var printProgress = null;
// random global variables...
var targetFile;
var docTitle = "";
var docURL = "";
var progressParams = null;
var switchUI = true;
function elipseString(aStr, doFront)
{
if (aStr.length > 3 && (aStr.substr(0, 3) == "..." || aStr.substr(aStr.length-4, 3) == "...")) {
return aStr;
}
var fixedLen = 64;
if (aStr.length > fixedLen) {
if (doFront) {
var endStr = aStr.substr(aStr.length-fixedLen, fixedLen);
var str = "..." + endStr;
return str;
} else {
var frontStr = aStr.substr(0, fixedLen);
var str = frontStr + "...";
return str;
}
}
return aStr;
}
// all progress notifications are done through the nsIWebProgressListener implementation...
var progressListener = {
onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus)
{
if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_START)
{
// Put progress meter in undetermined mode.
// dialog.progress.setAttribute( "value", 0 );
dialog.progress.setAttribute( "mode", "undetermined" );
}
if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP)
{
// we are done printing
// Indicate completion in title area.
var msg = getString( "printComplete" );
dialog.title.setAttribute("value", msg);
// Put progress meter at 100%.
dialog.progress.setAttribute( "value", 100 );
dialog.progress.setAttribute( "mode", "normal" );
var percentPrint = getString( "progressText" );
percentPrint = replaceInsert( percentPrint, 1, 100 );
dialog.progressText.setAttribute("value", percentPrint);
window.close();
}
},
onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress)
{
if (switchUI)
{
dialog.tempLabel.setAttribute("hidden", "true");
dialog.progress.setAttribute("hidden", "false");
dialog.cancel.setAttribute("disabled", "false");
var progressLabel = getString("progress");
if (progressLabel == "") {
progressLabel = "Progress:"; // better than nothing
}
switchUI = false;
}
if (progressParams)
{
var docTitleStr = elipseString(progressParams.docTitle, false);
if (docTitleStr != docTitle) {
docTitle = docTitleStr;
dialog.title.value = docTitle;
}
var docURLStr = progressParams.docURL;
if (docURLStr != docURL && dialog.title != null) {
docURL = docURLStr;
if (docTitle == "") {
dialog.title.value = elipseString(docURLStr, true);
}
}
}
// Calculate percentage.
var percent;
if ( aMaxTotalProgress > 0 )
{
percent = Math.round( (aCurTotalProgress*100)/aMaxTotalProgress );
if ( percent > 100 )
percent = 100;
dialog.progress.removeAttribute( "mode");
// Advance progress meter.
dialog.progress.setAttribute( "value", percent );
// Update percentage label on progress meter.
var percentPrint = getString( "progressText" );
percentPrint = replaceInsert( percentPrint, 1, percent );
dialog.progressText.setAttribute("value", percentPrint);
}
else
{
// Progress meter should be barber-pole in this case.
dialog.progress.setAttribute( "mode", "undetermined" );
// Update percentage label on progress meter.
dialog.progressText.setAttribute("value", "");
}
},
onLocationChange: function(aWebProgress, aRequest, aLocation)
{
// we can ignore this notification
},
onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage)
{
if (aMessage != "")
dialog.title.setAttribute("value", aMessage);
},
onSecurityChange: function(aWebProgress, aRequest, state)
{
// we can ignore this notification
},
QueryInterface : function(iid)
{
if (iid.equals(Components.interfaces.nsIWebProgressListener) || iid.equals(Components.interfaces.nsISupportsWeakReference))
return this;
throw Components.results.NS_NOINTERFACE;
}
};
function getString( stringId ) {
// Check if we've fetched this string already.
if (!(stringId in dialog.strings)) {
// Try to get it.
var elem = document.getElementById( "dialog.strings."+stringId );
try {
if ( elem
&&
elem.childNodes
&&
elem.childNodes[0]
&&
elem.childNodes[0].nodeValue ) {
dialog.strings[ stringId ] = elem.childNodes[0].nodeValue;
} else {
// If unable to fetch string, use an empty string.
dialog.strings[ stringId ] = "";
}
} catch (e) { dialog.strings[ stringId ] = ""; }
}
return dialog.strings[ stringId ];
}
function loadDialog()
{
}
function replaceInsert( text, index, value ) {
var result = text;
var regExp = new RegExp( "#"+index );
result = result.replace( regExp, value );
return result;
}
function onLoad() {
// Set global variables.
printProgress = window.arguments[0];
if (window.arguments[1])
{
progressParams = window.arguments[1].QueryInterface(Components.interfaces.nsIPrintProgressParams)
if (progressParams)
{
docTitle = elipseString(progressParams.docTitle, false);
docURL = elipseString(progressParams.docURL, true);
}
}
if ( !printProgress ) {
dump( "Invalid argument to printProgress.xul\n" );
window.close()
return;
}
dialog = new Object;
dialog.strings = new Array;
dialog.title = document.getElementById("dialog.title");
dialog.titleLabel = document.getElementById("dialog.titleLabel");
dialog.progress = document.getElementById("dialog.progress");
dialog.progressText = document.getElementById("dialog.progressText");
dialog.progressLabel = document.getElementById("dialog.progressLabel");
dialog.tempLabel = document.getElementById("dialog.tempLabel");
dialog.cancel = document.getElementById("cancel");
dialog.progress.setAttribute("hidden", "true");
dialog.cancel.setAttribute("disabled", "true");
var progressLabel = getString("preparing");
if (progressLabel == "") {
progressLabel = "Preparing..."; // better than nothing
}
dialog.tempLabel.value = progressLabel;
dialog.title.value = docTitle;
// Set up dialog button callbacks.
var object = this;
doSetOKCancel("", function () { return object.onCancel();});
// Fill dialog.
loadDialog();
// set our web progress listener on the helper app launcher
printProgress.registerListener(progressListener);
moveToAlertPosition();
//We need to delay the set title else dom will overwrite it
window.setTimeout(doneIniting, 500);
}
function onUnload()
{
if (printProgress)
{
try
{
printProgress.unregisterListener(progressListener);
printProgress = null;
}
catch( exception ) {}
}
}
// If the user presses cancel, tell the app launcher and close the dialog...
function onCancel ()
{
// Cancel app launcher.
try
{
printProgress.processCanceledByUser = true;
}
catch( exception ) {return true;}
// don't Close up dialog by returning false, the backend will close the dialog when everything will be aborted.
return false;
}
function doneIniting()
{
printProgress.doneIniting();
}

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

@ -0,0 +1,100 @@
<?xml version="1.0"?>
# -*- Mode: HTML -*-
# ***** 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 printing front-end.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Scott MacGregor <mscott@netscape.com>
# Jean-Francois Ducarroz <ducarroz@netscape.com>
# Rod Spears <rods@netscape.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 NPL, 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 NPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://global/locale/printProgress.dtd">
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
class="dialog"
title="&printWindow.title;"
style="width: 36em;"
onload="onLoad()"
onunload="onUnload()">
<script type="application/x-javascript" src="chrome://global/content/printProgress.js"/>
<!-- This is non-visible content that simply adds translatable string
into the document so that it is accessible to JS code.
XXX-TODO:
convert to use string bundles.
-->
<data id="dialog.strings.dialogCloseLabel">&dialogClose.label;</data>
<data id="dialog.strings.printComplete">&printComplete;</data>
<data id="dialog.strings.progressText">&percentPrint;</data>
<data id="dialog.strings.progressLabel">&progress;</data>
<data id="dialog.strings.preparing">&preparing;</data>
<grid flex="1">
<columns>
<column/>
<column/>
<column/>
</columns>
<rows>
<row>
<hbox pack="end">
<label id="dialog.titleLabel" value="&title;"/>
</hbox>
<label id="dialog.title"/>
</row>
<row class="thin-separator">
<hbox pack="end">
<label id="dialog.progressLabel" value="&progress;"/>
</hbox>
<label id="dialog.tempLabel" value="&preparing;"/>
<progressmeter id="dialog.progress" mode="normal" value="0"/>
<hbox pack="end" style="min-width: 2.5em;">
<label id="dialog.progressText"/>
</hbox>
</row>
</rows>
</grid>
<separator/>
<hbox id="CancelButton" pack="end">
<button id="cancel" label="&dialogCancel.label;"
oncommand="doCancelButton()"/>
</hbox>
</window>

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

@ -0,0 +1,524 @@
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# ***** 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 printing front-end.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Masaki Katakai <katakai@japan.sun.com>
# Jessica Blanco <jblanco@us.ibm.com>
# Asko Tontti <atontti@cc.hut.fi>
# Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
#
# 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 NPL, 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 NPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
var dialog;
var printService = null;
var printOptions = null;
var gOriginalNumCopies = 1;
var paramBlock;
var gPrefs = null;
var gPrintSettings = null;
var gWebBrowserPrint = null;
var default_file = "mozilla.ps";
var gPrintSetInterface = Components.interfaces.nsIPrintSettings;
var doDebug = false;
var gFileFromPicker = "";
//---------------------------------------------------
function initDialog()
{
dialog = new Object;
dialog.propertiesButton = document.getElementById("properties");
dialog.destGroup = document.getElementById("destGroup");
dialog.fileRadio = document.getElementById("fileRadio");
dialog.printerRadio = document.getElementById("printerRadio");
dialog.printrangeGroup = document.getElementById("printrangeGroup");
dialog.allpagesRadio = document.getElementById("allpagesRadio");
dialog.rangeRadio = document.getElementById("rangeRadio");
dialog.selectionRadio = document.getElementById("selectionRadio");
dialog.frompageInput = document.getElementById("frompageInput");
dialog.frompageLabel = document.getElementById("frompageLabel");
dialog.topageInput = document.getElementById("topageInput");
dialog.topageLabel = document.getElementById("topageLabel");
dialog.numCopiesInput = document.getElementById("numCopiesInput");
dialog.printframeGroup = document.getElementById("printframeGroup");
dialog.aslaidoutRadio = document.getElementById("aslaidoutRadio");
dialog.selectedframeRadio = document.getElementById("selectedframeRadio");
dialog.eachframesepRadio = document.getElementById("eachframesepRadio");
dialog.printframeGroupLabel = document.getElementById("printframeGroupLabel");
dialog.fileInput = document.getElementById("fileInput");
dialog.fileLabel = document.getElementById("fileLabel");
dialog.printerLabel = document.getElementById("printerLabel");
dialog.chooseButton = document.getElementById("chooseFile");
dialog.printerList = document.getElementById("printerList");
dialog.printButton = document.documentElement.getButton("accept");
// <data> elements
dialog.printName = document.getElementById("printButton");
dialog.fpDialog = document.getElementById("fpDialog");
dialog.enabled = false;
}
//---------------------------------------------------
function checkInteger(element)
{
var value = element.value;
if (value && value.length > 0) {
value = value.replace(/[^0-9]/g,"");
if (!value) value = "";
element.value = value;
}
if (!value || value < 1 || value > 999)
dialog.printButton.setAttribute("disabled","true");
else
dialog.printButton.removeAttribute("disabled");
}
//---------------------------------------------------
function stripTrailingWhitespace(element)
{
var value = element.value;
value = value.replace(/\s+$/,"");
element.value = value;
}
//---------------------------------------------------
function doEnablePrintToFile(value)
{
if (value) {
dialog.fileLabel.removeAttribute("disabled");
dialog.fileInput.removeAttribute("disabled");
dialog.chooseButton.removeAttribute("disabled");
} else {
dialog.fileLabel.setAttribute("disabled","true");
dialog.fileInput.setAttribute("disabled","true");
dialog.chooseButton.setAttribute("disabled","true");
}
}
//---------------------------------------------------
function listElement(aListElement)
{
this.listElement = aListElement;
}
listElement.prototype =
{
clearList:
function ()
{
// remove the menupopup node child of the menulist.
this.listElement.removeChild(this.listElement.firstChild);
},
appendPrinterNames:
function (aDataObject)
{
var popupNode = document.createElement("menupopup");
var strDefaultPrinterName = "";
var printerName;
// build popup menu from printer names
while (aDataObject.hasMoreElements()) {
printerName = aDataObject.getNext();
printerName = printerName.QueryInterface(Components.interfaces.nsISupportsString);
var printerNameStr = printerName.toString();
if (strDefaultPrinterName == "")
strDefaultPrinterName = printerNameStr;
var itemNode = document.createElement("menuitem");
itemNode.setAttribute("value", printerNameStr);
itemNode.setAttribute("label", printerNameStr);
popupNode.appendChild(itemNode);
}
if (strDefaultPrinterName != "") {
this.listElement.removeAttribute("disabled");
} else {
var stringBundle = srGetStrBundle("chrome://global/locale/printing.properties");
this.listElement.setAttribute("value", strDefaultPrinterName);
this.listElement.setAttribute("label", stringBundle.GetStringFromName("noprinter"));
// disable dialog
this.listElement.setAttribute("disabled", "true");
dialog.destGroup.setAttribute("disabled","true");
dialog.printerRadio.setAttribute("disabled","true");
dialog.printerLabel.setAttribute("disabled","true");
dialog.propertiesButton.setAttribute("disabled","true");
dialog.fileRadio.setAttribute("disabled","true");
dialog.printButton.setAttribute("disabled","true");
doEnablePrintToFile(false);
}
this.listElement.appendChild(popupNode);
return strDefaultPrinterName;
}
};
//---------------------------------------------------
function getPrinters()
{
var printerEnumerator = printOptions.availablePrinters();
var selectElement = new listElement(dialog.printerList);
selectElement.clearList();
var strDefaultPrinterName = selectElement.appendPrinterNames(printerEnumerator);
selectElement.listElement.value = strDefaultPrinterName;
// make sure we load the prefs for the initially selected printer
setPrinterDefaultsForSelectedPrinter();
}
//---------------------------------------------------
// update gPrintSettings with the defaults for the selected printer
function setPrinterDefaultsForSelectedPrinter()
{
gPrintSettings.printerName = dialog.printerList.value;
// First get any defaults from the printer
printService.initPrintSettingsFromPrinter(gPrintSettings.printerName, gPrintSettings);
// now augment them with any values from last time
printService.initPrintSettingsFromPrefs(gPrintSettings, true, gPrintSetInterface.kInitSaveAll);
if (doDebug) {
dump("setPrinterDefaultsForSelectedPrinter: printerName='"+gPrintSettings.printerName+"', paperName='"+gPrintSettings.paperName+"'\n");
}
}
//---------------------------------------------------
function displayPropertiesDialog()
{
gPrintSettings.numCopies = dialog.numCopiesInput.value;
try {
var printingPromptService = Components.classes["@mozilla.org/embedcomp/printingprompt-service;1"]
.getService(Components.interfaces.nsIPrintingPromptService);
if (printingPromptService) {
printingPromptService.showPrinterProperties(null, dialog.printerList.value, gPrintSettings);
dialog.numCopiesInput.value = gPrintSettings.numCopies;
}
} catch(e) {
dump("problems getting printingPromptService\n");
}
}
//---------------------------------------------------
function doPrintRange(inx)
{
if (inx == 1) {
dialog.frompageInput.removeAttribute("disabled");
dialog.frompageLabel.removeAttribute("disabled");
dialog.topageInput.removeAttribute("disabled");
dialog.topageLabel.removeAttribute("disabled");
} else {
dialog.frompageInput.setAttribute("disabled","true");
dialog.frompageLabel.setAttribute("disabled","true");
dialog.topageInput.setAttribute("disabled","true");
dialog.topageLabel.setAttribute("disabled","true");
}
}
//---------------------------------------------------
function loadDialog()
{
var print_copies = 1;
var print_file = default_file;
var print_selection_radio_enabled = false;
var print_frametype = gPrintSetInterface.kSelectedFrame;
var print_howToEnableUI = gPrintSetInterface.kFrameEnableNone;
var print_tofile = "";
try {
gPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
printService = Components.classes["@mozilla.org/gfx/printsettings-service;1"];
if (printService) {
printService = printService.getService();
if (printService) {
printService = printService.QueryInterface(Components.interfaces.nsIPrintSettingsService);
printOptions = printService.QueryInterface(Components.interfaces.nsIPrintOptions);
}
}
} catch(e) {}
// Note: getPrinters sets up the PrintToFile radio buttons and initalises gPrintSettings
getPrinters();
if (gPrintSettings) {
print_tofile = gPrintSettings.printToFile;
gOriginalNumCopies = gPrintSettings.numCopies;
print_copies = gPrintSettings.numCopies;
print_file = gPrintSettings.toFileName;
print_frametype = gPrintSettings.printFrameType;
print_howToEnableUI = gPrintSettings.howToEnableFrameUI;
print_selection_radio_enabled = gPrintSettings.GetPrintOptions(gPrintSetInterface.kEnableSelectionRB);
}
if (print_tofile) {
dialog.destGroup.selectedItem = dialog.fileRadio;
doEnablePrintToFile(true);
} else {
dialog.destGroup.selectedItem = dialog.printerRadio;
doEnablePrintToFile(false);
}
if (doDebug) {
dump("loadDialog*********************************************\n");
dump("toFileName ["+print_file+"]\n");
dump("print_tofile "+print_tofile+"\n");
dump("print_frame "+print_frametype+"\n");
dump("print_howToEnableUI "+print_howToEnableUI+"\n");
dump("selection_radio_enabled "+print_selection_radio_enabled+"\n");
}
if (print_file == "") {
print_file = default_file;
}
dialog.printrangeGroup.selectedItem = dialog.allpagesRadio;
if (print_selection_radio_enabled) {
dialog.selectionRadio.removeAttribute("disabled");
} else {
dialog.selectionRadio.setAttribute("disabled","true");
}
doPrintRange(dialog.rangeRadio.selected);
dialog.frompageInput.value = 1;
dialog.topageInput.value = 1;
dialog.numCopiesInput.value = print_copies;
dialog.fileInput.value = print_file;
if (gPrintSettings.toFileName != "") {
dialog.fileInput.value = gPrintSettings.toFileName;
}
if (doDebug) {
dump("print_howToEnableUI: "+print_howToEnableUI+"\n");
}
// print frame
if (print_howToEnableUI == gPrintSetInterface.kFrameEnableAll) {
dialog.aslaidoutRadio.removeAttribute("disabled");
dialog.selectedframeRadio.removeAttribute("disabled");
dialog.eachframesepRadio.removeAttribute("disabled");
dialog.printframeGroupLabel.removeAttribute("disabled");
// initialize radio group
dialog.printframeGroup.selectedItem = dialog.selectedframeRadio;
} else if (print_howToEnableUI == gPrintSetInterface.kFrameEnableAsIsAndEach) {
dialog.aslaidoutRadio.removeAttribute("disabled"); //enable
dialog.selectedframeRadio.setAttribute("disabled","true"); // disable
dialog.eachframesepRadio.removeAttribute("disabled"); // enable
dialog.printframeGroupLabel.removeAttribute("disabled"); // enable
// initialize
dialog.printframeGroup.selectedItem = dialog.eachframesepRadio;
} else {
dialog.aslaidoutRadio.setAttribute("disabled","true");
dialog.selectedframeRadio.setAttribute("disabled","true");
dialog.eachframesepRadio.setAttribute("disabled","true");
dialog.printframeGroupLabel.setAttribute("disabled","true");
}
dialog.printButton.label = dialog.printName.getAttribute("label");
}
//---------------------------------------------------
function onLoad()
{
// Init dialog.
initDialog();
// param[0]: nsIPrintSettings object
// param[1]: container for return value (1 = print, 0 = cancel)
gPrintSettings = window.arguments[0].QueryInterface(gPrintSetInterface);
gWebBrowserPrint = window.arguments[1].QueryInterface(Components.interfaces.nsIWebBrowserPrint);
paramBlock = window.arguments[2].QueryInterface(Components.interfaces.nsIDialogParamBlock);
// default return value is "cancel"
paramBlock.SetInt(0, 0);
loadDialog();
}
//---------------------------------------------------
function onAccept()
{
if (gPrintSettings != null) {
var print_howToEnableUI = gPrintSetInterface.kFrameEnableNone;
var stringBundle = srGetStrBundle("chrome://global/locale/printing.properties");
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
if (dialog.fileRadio.selected && dialog.fileInput.value == "") {
var titleText = stringBundle.GetStringFromName("noPrintFilename.title");
var alertText = stringBundle.GetStringFromName("noPrintFilename.alert");
promptService.alert(this.window, titleText, alertText);
return false;
}
// save these out so they can be picked up by the device spec
gPrintSettings.printToFile = dialog.fileRadio.selected;
print_howToEnableUI = gPrintSettings.howToEnableFrameUI;
// save these out so they can be picked up by the device spec
gPrintSettings.toFileName = dialog.fileInput.value;
gPrintSettings.printerName = dialog.printerList.value;
if (gPrintSettings.printToFile) {
if (gPrintSettings.toFileName == "")
return false;
var sfile = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
sfile.initWithPath(gPrintSettings.toFileName);
if (sfile.exists() &&
gPrintSettings.toFileName != gFileFromPicker) {
var desc = stringBundle.formatStringFromName("fileConfirm.exists",
[gPrintSettings.toFileName],
1);
if (!promptService.confirm(this.window, null, desc)) {
return false;
}
}
}
if (dialog.allpagesRadio.selected) {
gPrintSettings.printRange = gPrintSetInterface.kRangeAllPages;
} else if (dialog.rangeRadio.selected) {
gPrintSettings.printRange = gPrintSetInterface.kRangeSpecifiedPageRange;
} else if (dialog.selectionRadio.selected) {
gPrintSettings.printRange = gPrintSetInterface.kRangeSelection;
}
gPrintSettings.startPageRange = dialog.frompageInput.value;
gPrintSettings.endPageRange = dialog.topageInput.value;
gPrintSettings.numCopies = dialog.numCopiesInput.value;
var frametype = gPrintSetInterface.kNoFrames;
if (print_howToEnableUI != gPrintSetInterface.kFrameEnableNone) {
if (dialog.aslaidoutRadio.selected) {
frametype = gPrintSetInterface.kFramesAsIs;
} else if (dialog.selectedframeRadio.selected) {
frametype = gPrintSetInterface.kSelectedFrame;
} else if (dialog.eachframesepRadio.selected) {
frametype = gPrintSetInterface.kEachFrameSep;
} else {
frametype = gPrintSetInterface.kSelectedFrame;
}
}
gPrintSettings.printFrameType = frametype;
if (doDebug) {
dump("onAccept*********************************************\n");
dump("frametype "+frametype+"\n");
dump("numCopies "+gPrintSettings.numCopies+"\n");
dump("printRange "+gPrintSettings.printRange+"\n");
dump("printerName "+gPrintSettings.printerName+"\n");
dump("startPageRange "+gPrintSettings.startPageRange+"\n");
dump("endPageRange "+gPrintSettings.endPageRange+"\n");
dump("printToFile "+gPrintSettings.printToFile+"\n");
}
}
var saveToPrefs = false;
saveToPrefs = gPrefs.getBoolPref("print.save_print_settings");
if (saveToPrefs && printService != null) {
var flags = gPrintSetInterface.kInitSavePaperSizeType |
gPrintSetInterface.kInitSavePaperSizeUnit |
gPrintSetInterface.kInitSavePaperWidth |
gPrintSetInterface.kInitSavePaperHeight |
gPrintSetInterface.kInitSavePaperName |
gPrintSetInterface.kInitSaveInColor |
gPrintSetInterface.kInitSavePrintCommand;
printService.savePrintSettingsToPrefs(gPrintSettings, true, flags);
}
// set return value to "print"
if (paramBlock) {
paramBlock.SetInt(0, 1);
} else {
dump("*** FATAL ERROR: No paramBlock\n");
}
return true;
}
//---------------------------------------------------
function onCancel()
{
// set return value to "cancel"
if (paramBlock) {
paramBlock.SetInt(0, 0);
} else {
dump("*** FATAL ERROR: No paramBlock\n");
}
return true;
}
//---------------------------------------------------
const nsIFilePicker = Components.interfaces.nsIFilePicker;
function onChooseFile()
{
if (dialog.fileRadio.selected == false)
return;
try {
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
fp.init(window, dialog.fpDialog.getAttribute("label"), nsIFilePicker.modeSave);
fp.appendFilters(nsIFilePicker.filterAll);
fp.show();
if (fp.file && fp.file.path.length > 0) {
dialog.fileInput.value = fp.file.path;
gFileFromPicker = dialog.fileInput.value;
}
} catch(ex) {
dump(ex);
}
}

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

@ -0,0 +1,139 @@
<?xml version="1.0"?>
# -*- Mode: HTML -*-
# ***** 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 printing front-end.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Masaki Katakai <katakai@japan.sun.com>
# Dan Rosen <dr@netscape.com>
# Jessica Blanco <jblanco@us.ibm.com>
# Asko Tontti <atontti@cc.hut.fi>
# Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
#
# 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 NPL, 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 NPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE dialog SYSTEM "chrome://global/locale/printdialog.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();"
ondialogaccept="return onAccept();"
oncancel="return onCancel();"
title="&printDialog.title;"
persist="screenX screenY"
screenX="24" screenY="24">
<script type="application/x-javascript" src="chrome://global/content/printdialog.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<groupbox>
<caption label="&printer.label;"/>
<grid>
<columns>
<column/>
<column flex="1"/>
<column/>
</columns>
<rows>
<row align="center">
<hbox align="center" pack="end">
<label value="&printTo.label;"/>
</hbox>
<radiogroup id="destGroup" orient="horizontal">
<radio id="printerRadio" label="&printerRadio.label;" oncommand="if (!this.disabled) doEnablePrintToFile(false);"/>
<radio id="fileRadio" label="&fileRadio.label;" oncommand="if (!this.disabled) doEnablePrintToFile(true);"/>
</radiogroup>
</row>
<row align="center">
<hbox align="center" pack="end">
<label id="printerLabel" value="&printerInput.label;"/>
</hbox>
<menulist id="printerList" flex="1" oncommand="setPrinterDefaultsForSelectedPrinter();">
<menupopup/>
</menulist>
<button id="properties" label="&propertiesButton.label;" oncommand="displayPropertiesDialog();"/>
</row>
<row align="center">
<hbox align="center" pack="end">
<label id="fileLabel" control="fileInput" value="&fileInput.label;"/>
</hbox>
<textbox id="fileInput" flex="1" onblur="stripTrailingWhitespace(this)"/>
<button id="chooseFile" label="&chooseButton.label;" oncommand="onChooseFile()"/>
</row>
</rows>
</grid>
</groupbox>
<hbox>
<groupbox flex="1">
<caption label="&printrangeGroup.label;"/>
<radiogroup id="printrangeGroup">
<radio id="allpagesRadio" label="&allpagesRadio.label;" oncommand="doPrintRange(0)"/>
<hbox align="center">
<radio id="rangeRadio" label="&rangeRadio.label;" oncommand="doPrintRange(1)"/>
<label id="frompageLabel" control="frompageInput" value="&frompageInput.label;" />
<textbox id="frompageInput" style="width:5em;" onkeyup="checkInteger(this)"/>
<label id="topageLabel" control="topageInput" value="&topageInput.label;" />
<textbox id="topageInput" style="width:5em;" onkeyup="checkInteger(this)"/>
</hbox>
<radio id="selectionRadio" label="&selectionRadio.label;" oncommand="doPrintRange(2)"/>
</radiogroup>
</groupbox>
<groupbox flex="1">
<caption label="&copies.label;"/>
<hbox align="center">
<label control="numCopiesInput" value="&numCopies.label;"/>
<textbox id="numCopiesInput" style="width:5em;" onkeyup="checkInteger(this)"/>
</hbox>
</groupbox>
</hbox>
<groupbox flex="1">
<caption label="&printframeGroup.label;" id="printframeGroupLabel"/>
<radiogroup id="printframeGroup">
<radio id="aslaidoutRadio" label="&aslaidoutRadio.label;" />
<radio id="selectedframeRadio" label="&selectedframeRadio.label;" />
<radio id="eachframesepRadio" label="&eachframesepRadio.label;" />
</radiogroup>
</groupbox>
<!-- used to store titles and labels -->
<data style="display:none;" id="printButton" label="&printButton.label;"/>
<data style="display:none;" id="fpDialog" label="&fpDialog.title;"/>
</dialog>

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

@ -0,0 +1,631 @@
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# ***** 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 printing front-end.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Masaki Katakai <katakai@japan.sun.com>
# Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
# Asko Tontti <atontti@cc.hut.fi>
#
# 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 NPL, 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 NPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK ***** */
#
#ifdef XP_UNIX
var dialog;
var gPrintSettings = null;
var gStringBundle = null;
var gPrintSettingsInterface = Components.interfaces.nsIPrintSettings;
var gPaperArray;
var gPlexArray;
var gPrefs;
var default_command = "lpr";
var gPrintSetInterface = Components.interfaces.nsIPrintSettings;
var doDebug = true;
//---------------------------------------------------
function checkDouble(element, maxVal)
{
var value = element.value;
if (value && value.length > 0) {
value = value.replace(/[^\.|^0-9]/g,"");
if (!value) {
element.value = "";
} else {
if (value > maxVal) {
element.value = maxVal;
} else {
element.value = value;
}
}
}
}
//---------------------------------------------------
function isListOfPrinterFeaturesAvailable()
{
var has_printerfeatures = false;
try {
has_printerfeatures = gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".has_special_printerfeatures");
} catch(ex) {
}
return has_printerfeatures;
}
//---------------------------------------------------
function getDoubleStr(val, dec)
{
var str = val.toString();
var inx = str.indexOf(".");
return str.substring(0, inx+dec+1);
}
//---------------------------------------------------
function initDialog()
{
dialog = new Object;
dialog.paperList = document.getElementById("paperList");
dialog.paperGroup = document.getElementById("paperGroup");
dialog.plexList = document.getElementById("plexList");
dialog.plexGroup = document.getElementById("plexGroup");
dialog.cmdLabel = document.getElementById("cmdLabel");
dialog.cmdGroup = document.getElementById("cmdGroup");
dialog.cmdInput = document.getElementById("cmdInput");
dialog.colorGroup = document.getElementById("colorGroup");
dialog.colorRadio = document.getElementById("colorRadio");
dialog.grayRadio = document.getElementById("grayRadio");
dialog.topInput = document.getElementById("topInput");
dialog.bottomInput = document.getElementById("bottomInput");
dialog.leftInput = document.getElementById("leftInput");
dialog.rightInput = document.getElementById("rightInput");
}
//---------------------------------------------------
function round10(val)
{
return Math.round(val * 10) / 10;
}
//---------------------------------------------------
function paperListElement(aPaperListElement)
{
this.paperListElement = aPaperListElement;
}
paperListElement.prototype =
{
clearPaperList:
function ()
{
// remove the menupopup node child of the menulist.
this.paperListElement.removeChild(this.paperListElement.firstChild);
},
appendPaperNames:
function (aDataObject)
{
var popupNode = document.createElement("menupopup");
for (var i=0;i<aDataObject.length;i++) {
var paperObj = aDataObject[i];
var itemNode = document.createElement("menuitem");
var label;
try {
label = gStringBundle.GetStringFromName(paperObj.name)
}
catch (e) {
/* No name in string bundle ? Then build one manually (this
* usually happens when gPaperArray was build by createPaperArrayFromPrinterFeatures() ...) */
if (paperObj.inches) {
label = paperObj.name + " (" + round10(paperObj.width) + "x" + round10(paperObj.height) + " inch)";
}
else {
label = paperObj.name + " (" + paperObj.width + "x" + paperObj.height + " mm)";
}
}
itemNode.setAttribute("label", label);
itemNode.setAttribute("value", i);
popupNode.appendChild(itemNode);
}
this.paperListElement.appendChild(popupNode);
}
};
//---------------------------------------------------
function createPaperArrayFromDefaults()
{
var paperNames = ["letterSize", "legalSize", "exectiveSize", "a5Size", "a4Size", "a3Size", "a2Size", "a1Size", "a0Size"];
//var paperNames = ["&letterRadio.label;", "&legalRadio.label;", "&exectiveRadio.label;", "&a4Radio.label;", "&a3Radio.label;"];
var paperWidths = [ 8.5, 8.5, 7.25, 148.0, 210.0, 287.0, 420.0, 594.0, 841.0];
var paperHeights = [11.0, 14.0, 10.50, 210.0, 297.0, 420.0, 594.0, 841.0, 1189.0];
var paperInches = [true, true, true, false, false, false, false, false, false];
// this is deprecated
var paperEnums = [0, 1, 2, 3, 4, 5, 6, 7, 8];
gPaperArray = new Array();
for (var i=0;i<paperNames.length;i++) {
var obj = new Object();
obj.name = paperNames[i];
obj.width = paperWidths[i];
obj.height = paperHeights[i];
obj.inches = paperInches[i];
obj.paperSize = paperEnums[i]; // deprecated
/* Calculate the width/height in millimeters */
if (paperInches[i]) {
obj.width_mm = paperWidths[i] * 25.4;
obj.height_mm = paperHeights[i] * 25.4;
}
else {
obj.width_mm = paperWidths[i];
obj.height_mm = paperHeights[i];
}
gPaperArray[i] = obj;
}
}
//---------------------------------------------------
function createPaperArrayFromPrinterFeatures()
{
var printername = gPrintSettings.printerName;
if (doDebug) {
dump("createPaperArrayFromPrinterFeatures for " + printername + ".\n");
}
gPaperArray = new Array();
var numPapers = gPrefs.getIntPref("print.tmp.printerfeatures." + printername + ".paper.count");
if (doDebug) {
dump("processing " + numPapers + " entries...\n");
}
for (var i=0;i<numPapers;i++) {
var obj = new Object();
obj.name = gPrefs.getCharPref("print.tmp.printerfeatures." + printername + ".paper." + i + ".name");
obj.width_mm = gPrefs.getIntPref("print.tmp.printerfeatures." + printername + ".paper." + i + ".width_mm");
obj.height_mm = gPrefs.getIntPref("print.tmp.printerfeatures." + printername + ".paper." + i + ".height_mm");
obj.inches = gPrefs.getBoolPref("print.tmp.printerfeatures." + printername + ".paper." + i + ".is_inch");
obj.paperSize = 666; // deprecated
/* Calculate the width/height in paper's native units (either inches or millimeters) */
if (obj.inches) {
obj.width = obj.width_mm / 25.4;
obj.height = obj.height_mm / 25.4;
}
else {
obj.width = obj.width_mm;
obj.height = obj.height_mm;
}
gPaperArray[i] = obj;
if (doDebug) {
dump("paper index=" + i + ", name=" + obj.name + ", width=" + obj.width + ", height=" + obj.height + ".\n");
}
}
}
//---------------------------------------------------
function createPaperArray()
{
if (isListOfPrinterFeaturesAvailable()) {
createPaperArrayFromPrinterFeatures();
}
else {
createPaperArrayFromDefaults();
}
}
//---------------------------------------------------
function createPaperSizeList(selectedInx)
{
gStringBundle = srGetStrBundle("chrome://communicator/locale/printPageSetup.properties");
var selectElement = new paperListElement(dialog.paperList);
selectElement.clearPaperList();
selectElement.appendPaperNames(gPaperArray);
if (selectedInx > -1) {
selectElement.paperListElement.selectedIndex = selectedInx;
}
//dialog.paperList = selectElement;
}
//---------------------------------------------------
function plexListElement(aPlexListElement)
{
this.plexListElement = aPlexListElement;
}
plexListElement.prototype =
{
clearPlexList:
function ()
{
// remove the menupopup node child of the menulist.
this.plexListElement.removeChild(this.plexListElement.firstChild);
},
appendPlexNames:
function (aDataObject)
{
var popupNode = document.createElement("menupopup");
for (var i=0;i<aDataObject.length;i++) {
var plexObj = aDataObject[i];
var itemNode = document.createElement("menuitem");
var label;
try {
label = gStringBundle.GetStringFromName(plexObj.name)
}
catch (e) {
/* No name in string bundle ? Then build one manually (this
* usually happens when gPlexArray was build by createPlexArrayFromPrinterFeatures() ...) */
label = plexObj.name;
}
itemNode.setAttribute("label", label);
itemNode.setAttribute("value", i);
popupNode.appendChild(itemNode);
}
this.plexListElement.appendChild(popupNode);
}
};
//---------------------------------------------------
function createPlexArrayFromDefaults()
{
var plexNames = ["default"];
gPlexArray = new Array();
for (var i=0;i<plexNames.length;i++) {
var obj = new Object();
obj.name = plexNames[i];
gPlexArray[i] = obj;
}
}
//---------------------------------------------------
function createPlexArrayFromPrinterFeatures()
{
var printername = gPrintSettings.printerName;
if (doDebug) {
dump("createPlexArrayFromPrinterFeatures for " + printername + ".\n");
}
gPlexArray = new Array();
var numPlexs = gPrefs.getIntPref("print.tmp.printerfeatures." + printername + ".plex.count");
if (doDebug) {
dump("processing " + numPlexs + " entries...\n");
}
for ( var i=0 ; i < numPlexs ; i++ ) {
var obj = new Object();
obj.name = gPrefs.getCharPref("print.tmp.printerfeatures." + printername + ".plex." + i + ".name");
gPlexArray[i] = obj;
if (doDebug) {
dump("plex index=" + i + ", name='" + obj.name + "'.\n");
}
}
}
//---------------------------------------------------
function createPlexArray()
{
if (isListOfPrinterFeaturesAvailable()) {
createPlexArrayFromPrinterFeatures();
}
else {
createPlexArrayFromDefaults();
}
}
//---------------------------------------------------
function createPlexNameList(selectedInx)
{
gStringBundle = srGetStrBundle("chrome://communicator/locale/printPageSetup.properties");
var selectElement = new plexListElement(dialog.plexList);
selectElement.clearPlexList();
selectElement.appendPlexNames(gPlexArray);
if (selectedInx > -1) {
selectElement.plexListElement.selectedIndex = selectedInx;
}
//dialog.plexList = selectElement;
}
//---------------------------------------------------
function loadDialog()
{
var print_paper_type = 0;
var print_paper_unit = 0;
var print_paper_width = 0.0;
var print_paper_height = 0.0;
var print_paper_name = "";
var print_plex_name = "";
var print_color = true;
var print_command = default_command;
gPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
if (gPrintSettings) {
print_paper_type = gPrintSettings.paperSizeType;
print_paper_unit = gPrintSettings.paperSizeUnit;
print_paper_width = gPrintSettings.paperWidth;
print_paper_height = gPrintSettings.paperHeight;
print_paper_name = gPrintSettings.paperName;
print_plex_name = gPrintSettings.plexName;
print_color = gPrintSettings.printInColor;
print_command = gPrintSettings.printCommand;
}
if (doDebug) {
dump("loadDialog******************************\n");
dump("paperSizeType "+print_paper_unit+"\n");
dump("paperWidth "+print_paper_width+"\n");
dump("paperHeight "+print_paper_height+"\n");
dump("paperName "+print_paper_name+"\n");
dump("plexName "+print_plex_name+"\n");
dump("printInColor "+print_color+"\n");
dump("printCommand "+print_command+"\n");
}
createPaperArray();
var paperSelectedInx = 0;
for (var i=0;i<gPaperArray.length;i++) {
if (print_paper_name == gPaperArray[i].name) {
paperSelectedInx = i;
break;
}
}
if (doDebug) {
if (i == gPaperArray.length)
dump("loadDialog: No paper found.\n");
else
dump("loadDialog: found paper '"+gPaperArray[paperSelectedInx].name+"'.\n");
}
createPaperSizeList(paperSelectedInx);
createPlexArray();
var plexSelectedInx = 0;
for (var i=0;i<gPlexArray.length;i++) {
if (print_plex_name == gPlexArray[i].name) {
plexSelectedInx = i;
break;
}
}
if (doDebug) {
if (i == gPlexArray.length)
dump("loadDialog: No plex found.\n");
else
dump("loadDialog: found plex '"+gPlexArray[plexSelectedInx].name+"'.\n");
}
createPlexNameList(plexSelectedInx);
/* Enable/disable and/or hide/unhide widgets based in the information
* whether the selected printer and/or print module supports the matching
* feature or not */
if (isListOfPrinterFeaturesAvailable()) {
// spooler command
if (gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".can_change_spoolercommand"))
dialog.cmdInput.removeAttribute("disabled");
else
dialog.cmdInput.setAttribute("disabled","true");
if (gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".supports_spoolercommand_change"))
dialog.cmdGroup.removeAttribute("hidden");
else
dialog.cmdGroup.setAttribute("hidden","true");
// paper size
if (gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".can_change_paper_size"))
dialog.paperList.removeAttribute("disabled");
else
dialog.paperList.setAttribute("disabled","true");
if (gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".supports_paper_size_change"))
dialog.paperGroup.removeAttribute("hidden");
else
dialog.paperGroup.setAttribute("hidden","true");
// plex mode
if (gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".can_change_plex"))
dialog.plexList.removeAttribute("disabled");
else
dialog.plexList.setAttribute("disabled","true");
if (gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".supports_plex_change"))
dialog.plexGroup.removeAttribute("hidden");
else
dialog.plexGroup.setAttribute("hidden","true");
}
if (print_command == "") {
print_command = default_command;
}
if (print_color) {
dialog.colorGroup.selectedItem = dialog.colorRadio;
} else {
dialog.colorGroup.selectedItem = dialog.grayRadio;
}
dialog.cmdInput.value = print_command;
/* First initalize with the hardcoded defaults... */
dialog.topInput.value = "0.04";
dialog.bottomInput.value = "0.04";
dialog.leftInput.value = "0.04";
dialog.rightInput.value = "0.04";
try {
/* ... then try to get the generic settings ... */
dialog.topInput.value = gPrefs.getIntPref("print.print_edge_top") / 100.0;
dialog.bottomInput.value = gPrefs.getIntPref("print.print_edge_bottom") / 100.0;
dialog.leftInput.value = gPrefs.getIntPref("print.print_edge_left") / 100.0;
dialog.rightInput.value = gPrefs.getIntPref("print.print_edge_right") / 100.0;
/* ... and then the printer specific settings. */
var printername = gPrintSettings.printerName;
dialog.topInput.value = gPrefs.getIntPref("print.printer_"+printername+".print_edge_top") / 100.0;
dialog.bottomInput.value = gPrefs.getIntPref("print.printer_"+printername+".print_edge_bottom") / 100.0;
dialog.leftInput.value = gPrefs.getIntPref("print.printer_"+printername+".print_edge_left") / 100.0;
dialog.rightInput.value = gPrefs.getIntPref("print.printer_"+printername+".print_edge_right") / 100.0;
} catch (e) { }
}
//---------------------------------------------------
function onLoad()
{
// Init dialog.
initDialog();
gPrintSettings = window.arguments[0].QueryInterface(gPrintSetInterface);
paramBlock = window.arguments[1].QueryInterface(Components.interfaces.nsIDialogParamBlock);
if (doDebug) {
if (gPrintSettings == null) alert("PrintSettings is null!");
if (paramBlock == null) alert("nsIDialogParam is null!");
}
// default return value is "cancel"
paramBlock.SetInt(0, 0);
loadDialog();
}
//---------------------------------------------------
function onAccept()
{
var print_paper_type = gPrintSettingsInterface.kPaperSizeDefined;
var print_paper_unit = gPrintSettingsInterface.kPaperSizeInches;
var print_paper_width = 0.0;
var print_paper_height = 0.0;
var print_paper_name = "";
var print_plex_name = "";
if (gPrintSettings != null) {
var paperSelectedInx = dialog.paperList.selectedIndex;
var plexSelectedInx = dialog.plexList.selectedIndex;
if (gPaperArray[paperSelectedInx].inches) {
print_paper_unit = gPrintSettingsInterface.kPaperSizeInches;
} else {
print_paper_unit = gPrintSettingsInterface.kPaperSizeMillimeters;
}
print_paper_width = gPaperArray[paperSelectedInx].width;
print_paper_height = gPaperArray[paperSelectedInx].height;
print_paper_name = gPaperArray[paperSelectedInx].name;
print_plex_name = gPlexArray[plexSelectedInx].name;
gPrintSettings.paperSize = gPaperArray[paperSelectedInx].paperSize; // deprecated
gPrintSettings.paperSizeType = print_paper_type;
gPrintSettings.paperSizeUnit = print_paper_unit;
gPrintSettings.paperWidth = print_paper_width;
gPrintSettings.paperHeight = print_paper_height;
gPrintSettings.paperName = print_paper_name;
gPrintSettings.plexName = print_plex_name;
// save these out so they can be picked up by the device spec
gPrintSettings.printInColor = dialog.colorRadio.selected;
gPrintSettings.printCommand = dialog.cmdInput.value;
//
try {
var printerName = gPrintSettings.printerName;
var i = dialog.topInput.value * 100;
gPrefs.setIntPref("print.printer_"+printerName+".print_edge_top", i);
i = dialog.bottomInput.value * 100;
gPrefs.setIntPref("print.printer_"+printerName+".print_edge_bottom", i);
i = dialog.leftInput.value * 100;
gPrefs.setIntPref("print.printer_"+printerName+".print_edge_left", i);
i = dialog.rightInput.value * 100;
gPrefs.setIntPref("print.printer_"+printerName+".print_edge_right", i);
} catch (e) {
}
if (doDebug) {
dump("onAccept******************************\n");
dump("paperSize "+gPrintSettings.paperSize+" (deprecated)\n");
dump("paperSizeType "+print_paper_type+" (should be 1)\n");
dump("paperSizeUnit "+print_paper_unit+"\n");
dump("paperWidth "+print_paper_width+"\n");
dump("paperHeight "+print_paper_height+"\n");
dump("paperName '"+print_paper_name+"'\n");
dump("plexName '"+print_plex_name+"'\n");
dump("printInColor "+gPrintSettings.printInColor+"\n");
dump("printCommand '"+gPrintSettings.printCommand+"'\n");
}
} else {
dump("************ onAccept gPrintSettings: "+gPrintSettings+"\n");
}
if (paramBlock) {
// set return value to "ok"
paramBlock.SetInt(0, 1);
} else {
dump("*** FATAL ERROR: paramBlock missing\n");
}
return true;
}
#endif

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

@ -0,0 +1,136 @@
<?xml version="1.0"?>
# -*- Mode: HTML -*-
# ***** 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 printing front-end.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2002
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Masaki Katakai <katakai@japan.sun.com>
# Dan Rosen <dr@netscape.com>
# Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
# Asko Tontti <atontti@cc.hut.fi>
# Jessica Blanco <jblanco@us.ibm.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 NPL, 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 NPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
#
#ifdef XP_UNIX
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE dialog SYSTEM "chrome://global-platform/locale/printjoboptions.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();"
ondialogaccept="return onAccept();"
title="&printJobOptions.title;"
persist="screenX screenY"
screenX="24" screenY="24">
<script type="application/x-javascript" src="chrome://global/content/printjoboptions.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<grid>
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row id="paperGroup">
<hbox align="center" pack="end">
<label id="paperLabel" value="&paperInput.label;"/>
</hbox>
<menulist id="paperList" flex="1">
<menupopup/>
</menulist>
</row>
<row id="plexGroup">
<hbox align="center" pack="end">
<label id="plexLabel" value="&plexInput.label;"/>
</hbox>
<menulist id="plexList" flex="1">
<menupopup/>
</menulist>
</row>
<row id="cmdGroup">
<label id="cmdLabel" value="&cmdInput.label;"/>
<textbox id="cmdInput" flex="1"/>
</row>
<row>
<hbox align="center" pack="end">
<label value="&colorGroup.label;"/>
</hbox>
<radiogroup id="colorGroup" orient="horizontal">
<radio id="grayRadio" label="&grayRadio.label;"/>
<radio id="colorRadio" label="&colorRadio.label;"/>
</radiogroup>
</row>
</rows>
</grid>
<grid>
<columns>
<column/>
</columns>
<rows>
<row>
<groupbox flex="1">
<caption label="&edgeMarginInput.label;"/>
<hbox>
<hbox align="center">
<label id="topLabel" control="topInput" value="&topInput.label;"/>
<textbox id="topInput" style="width:5em;" onkeyup="checkDouble(this, 0.5)"/>
</hbox>
<hbox align="center">
<label id="bottomLabel" control="bottomInput" value="&bottomInput.label;"/>
<textbox id="bottomInput" style="width:5em;" onkeyup="checkDouble(this, 0.5)"/>
</hbox>
<hbox align="center">
<label id="leftLabel" control="leftInput" value="&leftInput.label;"/>
<textbox id="leftInput" style="width:5em;" onkeyup="checkDouble(this, 0.5)"/>
</hbox>
<hbox align="center">
<label id="rightLabel" control="rightInput" value="&rightInput.label;"/>
<textbox id="rightInput" style="width:5em;" onkeyup="checkDouble(this, 0.5)"/>
</hbox>
</hbox>
</groupbox>
</row>
</rows>
</grid>
</dialog>
#endif

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

@ -0,0 +1,15 @@
toolkit.jar:
*+ content/global/printdialog.xul (content/printdialog.xul)
*+ content/global/printdialog.js (content/printdialog.js)
*+ content/global/printProgress.xul (content/printProgress.xul)
*+ content/global/printProgress.js (content/printProgress.js)
*+ content/global/printPreviewProgress.xul (content/printPreviewProgress.xul)
*+ content/global/printPreviewProgress.js (content/printPreviewProgress.js)
en-US.jar:
+ locale/global/printdialog.dtd (locale/printdialog.dtd)
+ locale/global/printProgress.dtd (locale/printProgress.dtd)
+ locale/global/printPreviewProgress.dtd (locale/printPreviewProgress.dtd)
en-unix.jar:
+ locale/global-platform/printjoboptions.dtd (locale/printjoboptions.dtd)

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

@ -0,0 +1,6 @@
<!--LOCALIZATION NOTE printPreviewProgress.dtd Main UI for Print Preview Progress Dialog -->
<!ENTITY printWindow.title "Print Preview">
<!ENTITY title "Title:">
<!ENTITY spaces " ">
<!ENTITY preparing "Preparing...">
<!ENTITY progress "Progress:">

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

@ -0,0 +1,18 @@
<!--LOCALIZATION NOTE printProgress.dtd Main UI for Print Progress Dialog -->
<!ENTITY printWindow.title "Printing">
<!ENTITY title "Title:">
<!ENTITY progress "Progress:">
<!ENTITY preparing "Preparing...">
<!ENTITY printComplete "Printing is Completed.">
<!ENTITY dialogCancel.label "Cancel">
<!ENTITY dialogClose.label "Close">
<!-- LOCALIZATION NOTE (percentPrint):
This string is used to format the text to the right of the progress
meter.
#1 will be replaced by the percentage of the file that has been saved -->
<!ENTITY percentPrint "#1&#037;">

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

@ -0,0 +1,33 @@
<!-- extracted from printdialog.xul -->
<!ENTITY printButton.label "Print">
<!ENTITY printDialog.title "Print">
<!ENTITY fpDialog.title "Save File">
<!ENTITY printTo.label "Print To:">
<!ENTITY printerRadio.label "Printer">
<!ENTITY fileRadio.label "File">
<!ENTITY propertiesButton.label "Properties...">
<!ENTITY printer.label "Printer">
<!ENTITY printerInput.label "Printer:">
<!ENTITY fileInput.label "File:">
<!ENTITY chooseButton.label "Choose File...">
<!ENTITY printrangeGroup.label "Print Range">
<!ENTITY allpagesRadio.label "All Pages">
<!ENTITY rangeRadio.label "Pages">
<!ENTITY frompageInput.label "from">
<!ENTITY topageInput.label "to">
<!ENTITY selectionRadio.label "Selection">
<!ENTITY copies.label "Copies">
<!ENTITY numCopies.label "Number of copies:">
<!ENTITY printframeGroup.label "Print Frames">
<!ENTITY aslaidoutRadio.label "As laid out on the screen">
<!ENTITY selectedframeRadio.label "The selected frame">
<!ENTITY eachframesepRadio.label "Each frame separately">

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

@ -0,0 +1,19 @@
<!-- extracted from printjoboptions.xul -->
<!ENTITY printJobOptions.title "Printer Properties">
<!ENTITY paperInput.label "Paper Size:">
<!ENTITY plexInput.label "Plex mode:">
<!ENTITY cmdInput.label "Print Command:">
<!ENTITY colorGroup.label "Color:">
<!ENTITY grayRadio.label "GrayScale">
<!ENTITY colorRadio.label "Color">
<!ENTITY edgeMarginInput.label "Gap from edge of paper to Margin (inches)">
<!ENTITY topInput.label "Top:">
<!ENTITY bottomInput.label "Bottom:">
<!ENTITY leftInput.label "Left:">
<!ENTITY rightInput.label "Right:">