add "public" method savePrintSettings that saves the print settings to the prefs.

This commit is contained in:
chanial%noos.fr 2003-11-02 01:46:53 +00:00
Родитель e756284526
Коммит add6afd316
1 изменённых файлов: 9 добавлений и 5 удалений

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

@ -53,12 +53,9 @@ var PrintUtils = {
var PRINTPROMPTSVC = Components.classes["@mozilla.org/embedcomp/printingprompt-service;1"]
.getService(Components.interfaces.nsIPrintingPromptService);
didOK = PRINTPROMPTSVC.showPageSetup(window, printSettings, null);
if (didOK)
this.savePrintSettings();
if (didOK) {
var PSSVC = Components.classes["@mozilla.org/gfx/printsettings-service;1"]
.getService(Components.interfaces.nsIPrintSettingsService);
PSSVC.savePrintSettingsToPrefs(printSettings, false, printSettings.kInitSaveNativeData);
}
} catch (e) {
dump("showPageSetup "+e+"\n");
}
@ -121,6 +118,13 @@ var PrintUtils = {
.getInterface(Components.interfaces.nsIWebBrowserPrint);
},
savePrintSettings: function (aPrintSettings)
{
var PSSVC = Components.classes["@mozilla.org/gfx/printsettings-service;1"]
.getService(Components.interfaces.nsIPrintSettingsService);
PSSVC.savePrintSettingsToPrefs(printSettings, false, aPrintSettings.kInitSaveNativeData);
},
////////////////////////////////////////
// "private" methods. Don't use them. //
////////////////////////////////////////