mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 18:07:58 +01:00
Add more helpful information to safeSetPref messages.
This commit is contained in:
@@ -185,7 +185,8 @@ const liberator = (function () //{{{
|
|||||||
styles.addSheet(true, "scrollbar", "*", class.join(", ") + " { visibility: collapse !important; }", true);
|
styles.addSheet(true, "scrollbar", "*", class.join(", ") + " { visibility: collapse !important; }", true);
|
||||||
else
|
else
|
||||||
styles.removeSheet(true, "scrollbar");
|
styles.removeSheet(true, "scrollbar");
|
||||||
options.safeSetPref("layout.scrollbar.side", opts.indexOf("l") >= 0 ? 3 : 2);
|
options.safeSetPref("layout.scrollbar.side", opts.indexOf("l") >= 0 ? 3 : 2,
|
||||||
|
"See 'guioptions' scrollbar flags.");
|
||||||
},
|
},
|
||||||
validator: function (opts) (opts.indexOf("l") < 0 || opts.indexOf("r") < 0)
|
validator: function (opts) (opts.indexOf("l") < 0 || opts.indexOf("r") < 0)
|
||||||
},
|
},
|
||||||
@@ -289,7 +290,8 @@ const liberator = (function () //{{{
|
|||||||
{
|
{
|
||||||
setter: function (value)
|
setter: function (value)
|
||||||
{
|
{
|
||||||
options.safeSetPref("accessibility.typeaheadfind.enablesound", !value);
|
options.safeSetPref("accessibility.typeaheadfind.enablesound", !value,
|
||||||
|
"See 'visualbell' option");
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -251,16 +251,7 @@ Option.prototype = {
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (this.setter)
|
if (this.setter)
|
||||||
{
|
newValue = this.setter(newValue);
|
||||||
let tmpValue = newValue;
|
|
||||||
newValue = this.setter.call(this, newValue);
|
|
||||||
|
|
||||||
if (newValue === undefined)
|
|
||||||
{
|
|
||||||
newValue = tmpValue;
|
|
||||||
liberator.log("DEPRECATED: '" + this.name + "' setter should return a value");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (liberator.has("tabs") && (scope & options.OPTION_SCOPE_LOCAL))
|
if (liberator.has("tabs") && (scope & options.OPTION_SCOPE_LOCAL))
|
||||||
tabs.options[this.name] = newValue;
|
tabs.options[this.name] = newValue;
|
||||||
@@ -1308,13 +1299,18 @@ function Options() //{{{
|
|||||||
* @param {value} value The new preference value.
|
* @param {value} value The new preference value.
|
||||||
*/
|
*/
|
||||||
// FIXME: Well it used to. I'm looking at you mst! --djk
|
// FIXME: Well it used to. I'm looking at you mst! --djk
|
||||||
safeSetPref: function (name, value)
|
safeSetPref: function (name, value, message)
|
||||||
{
|
{
|
||||||
let val = loadPreference(name, null, false);
|
let val = loadPreference(name, null, false);
|
||||||
let def = loadPreference(name, null, true);
|
let def = loadPreference(name, null, true);
|
||||||
let lib = loadPreference(SAVED + name);
|
let lib = loadPreference(SAVED + name);
|
||||||
if (lib == null && val != def || val != lib)
|
if (lib == null && val != def || val != lib)
|
||||||
liberator.echomsg("Warning: setting preference " + name + ", but it's changed from its default value.");
|
{
|
||||||
|
let msg = "Warning: setting preference " + name + ", but it's changed from its default value.";
|
||||||
|
if (message)
|
||||||
|
msg += " " + message;
|
||||||
|
liberator.echomsg(msg);
|
||||||
|
}
|
||||||
storePreference(name, value);
|
storePreference(name, value);
|
||||||
storePreference(SAVED + name, value);
|
storePreference(SAVED + name, value);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ function Tabs() //{{{
|
|||||||
setter: function (value)
|
setter: function (value)
|
||||||
{
|
{
|
||||||
let [open, restriction] = [1, 0];
|
let [open, restriction] = [1, 0];
|
||||||
for (let [, opt] in Iterator(value.split(",")))
|
for (let [, opt] in Iterator(this.parseValues(value)))
|
||||||
{
|
{
|
||||||
if (opt == "tab")
|
if (opt == "tab")
|
||||||
open = 3;
|
open = 3;
|
||||||
@@ -183,8 +183,8 @@ function Tabs() //{{{
|
|||||||
restriction = 2;
|
restriction = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
options.safeSetPref("browser.link.open_newwindow", open);
|
options.safeSetPref("browser.link.open_newwindow", open, "See 'popups' option.");
|
||||||
options.safeSetPref("browser.link.open_newwindow.restriction", restriction);
|
options.safeSetPref("browser.link.open_newwindow.restriction", restriction, "See 'popups' option.");
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
completer: function (context) [
|
completer: function (context) [
|
||||||
|
|||||||
Reference in New Issue
Block a user