From a3c01158173d1e907b6abeed7caa823455f59097 Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 28 Mar 2011 16:31:30 +0000 Subject: [PATCH] clear print.always_print_silent instead of setting it to false in the Printer Settings Editor git-svn-id: svn://svn.open-ils.org/ILS/trunk@19866 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/admin/printer_settings.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/admin/printer_settings.js b/Open-ILS/xul/staff_client/server/admin/printer_settings.js index 671360f453..82f5de087d 100644 --- a/Open-ILS/xul/staff_client/server/admin/printer_settings.js +++ b/Open-ILS/xul/staff_client/server/admin/printer_settings.js @@ -36,8 +36,17 @@ function my_init() { g.toggle_silent_print = function() { var x = document.getElementById('print_silent'); netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - g.prefs.setBoolPref('print.always_print_silent', x.checked); - dump('Setting print.always_print_silent to ' + x.checked + '\n'); + if (x.checked) { + g.prefs.setBoolPref('print.always_print_silent', true); + dump('Setting print.always_print_silent to true\n'); + } else { + // Setting print.always_print_silent to false is not the same as clearing it, since a false here will prevent + // gPrintSettings.printSilent = true from working when fed to webBrowserPrint + if (g.prefs.HasUserValue('print.always_print_silent')) { + g.prefs.clearUserPref('print.always_print_silent'); + } + dump('Clearing print.always_print_silent\n'); + } } g.set_printer_context = function(context) { -- 2.11.0