1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 07:27:58 +01:00

Rename some functions. Add options.(set|get|reset|invert)Pref completion

This commit is contained in:
Kris Maglione
2008-11-15 00:04:47 +00:00
parent 257db25df2
commit 16b1273078
6 changed files with 16 additions and 12 deletions

View File

@@ -690,10 +690,6 @@ function Options() //{{{
{
var optionCompletions = [];
// What is this all about then, eh? It's too late to guess... -- djk
//if (prefix)
// filter = filter.replace(ret.prefix, "");
if (special) // list completions for about:config entries
{
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
@@ -851,6 +847,14 @@ function Options() //{{{
liberator.registerObserver("load_completion", function ()
{
completion.setFunctionCompleter(options.get, [function () ([o.name, o.description] for (o in options))]);
let listPrefs = [function () Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch)
.getChildList("", { value: 0 })
.map(function (pref) [pref, ""])];
completion.setFunctionCompleter(options.getPref, listPrefs);
completion.setFunctionCompleter(options.setPref, listPrefs);
completion.setFunctionCompleter(options.resetPref, listPrefs);
completion.setFunctionCompleter(options.invertPref, listPrefs);
});
return {