clear print.always_print_silent instead of setting it to false in the Printer Setting...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 28 Mar 2011 16:31:30 +0000 (16:31 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 28 Mar 2011 16:31:30 +0000 (16:31 +0000)
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

index 671360f..82f5de0 100644 (file)
@@ -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) {