зеркало из https://github.com/mozilla/gecko-dev.git
add "public" method savePrintSettings that saves the print settings to the prefs.
This commit is contained in:
Родитель
e756284526
Коммит
add6afd316
|
@ -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. //
|
||||
////////////////////////////////////////
|
||||
|
|
Загрузка…
Ссылка в новой задаче