mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 18:07:58 +01:00
Fix some Print to File issues.
This commit is contained in:
@@ -1306,10 +1306,19 @@ var Buffer = Module("buffer", {
|
|||||||
dactyl.assert(!arg || arg[0] == ">" && !util.OS.isWindows,
|
dactyl.assert(!arg || arg[0] == ">" && !util.OS.isWindows,
|
||||||
_("error.trailingCharacters"));
|
_("error.trailingCharacters"));
|
||||||
|
|
||||||
|
const PRINTER = "PostScript/default";
|
||||||
|
const BRANCH = "print.printer_" + PRINTER + ".";
|
||||||
|
|
||||||
prefs.withContext(function () {
|
prefs.withContext(function () {
|
||||||
if (arg) {
|
if (arg) {
|
||||||
prefs.set("print.print_to_file", "true");
|
prefs.set("print.print_printer", PRINTER);
|
||||||
prefs.set("print.print_to_filename", io.File(arg.substr(1)).path);
|
|
||||||
|
prefs.set( "print.print_to_file", true);
|
||||||
|
prefs.set(BRANCH + "print_to_file", true);
|
||||||
|
|
||||||
|
prefs.set( "print.print_to_filename", io.File(arg.substr(1)).path);
|
||||||
|
prefs.set(BRANCH + "print_to_filename", io.File(arg.substr(1)).path);
|
||||||
|
|
||||||
dactyl.echomsg(_("print.toFile", arg.substr(1)));
|
dactyl.echomsg(_("print.toFile", arg.substr(1)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -210,11 +210,8 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
|
|||||||
* @param {value} value The new preference value.
|
* @param {value} value The new preference value.
|
||||||
*/
|
*/
|
||||||
set: function (name, value) {
|
set: function (name, value) {
|
||||||
if (this._prefContexts.length) {
|
if (this._prefContexts.length)
|
||||||
let val = this.get(name, null);
|
this._prefContexts[this._prefContexts.length - 1][name] = this.get(name, null);
|
||||||
if (val != null)
|
|
||||||
this._prefContexts[this._prefContexts.length - 1][name] = val;
|
|
||||||
}
|
|
||||||
|
|
||||||
function assertType(needType)
|
function assertType(needType)
|
||||||
util.assert(type === Ci.nsIPrefBranch.PREF_INVALID || type === needType,
|
util.assert(type === Ci.nsIPrefBranch.PREF_INVALID || type === needType,
|
||||||
@@ -240,7 +237,10 @@ var Prefs = Module("prefs", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
|
|||||||
this.branch.setBoolPref(name, value);
|
this.branch.setBoolPref(name, value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw FailedAssertion("Unknown preference type: " + typeof value + " (" + name + "=" + value + ")");
|
if (value == null && this != this.defaults)
|
||||||
|
this.reset(name);
|
||||||
|
else
|
||||||
|
throw FailedAssertion("Unknown preference type: " + typeof value + " (" + name + "=" + value + ")");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user