diff --git a/NEWS b/NEWS index 4db4ae28..1ccc1aea 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@
2007-XX-XX:
* version 0.5.3
+ * options are no longer stored in preferences - use the RC file instead
* added new :mkvimperatorc command
* remove :redraw and Ctrl-L commands as they rely on FF3 features
* :ls, :history and :bmarks output is now hyperlinked
diff --git a/content/options.js b/content/options.js
index 0a4b31af..e2be66e7 100644
--- a/content/options.js
+++ b/content/options.js
@@ -31,14 +31,13 @@ function Option(names, type, extra_info) //{{{
if (!names || !type)
return null;
+ var value = null;
+
this.name = names[0];
this.names = names;
this.usage = this.names;
this.type = type;
- this.setter = function(value) { Options.setPref(this.name, value); };
- this.getter = function() { return Options.getPref(this.name); };
-
if (extra_info)
{
if (extra_info.usage)
@@ -53,6 +52,8 @@ function Option(names, type, extra_info) //{{{
else
this.default_value = null;
+ value = this.default_value;
+
if (extra_info.setter)
this.setter = extra_info.setter;
if (extra_info.getter)
@@ -75,8 +76,22 @@ function Option(names, type, extra_info) //{{{
}
// NOTE: forced defaults need to use Options.getPref
- Option.prototype.__defineGetter__("value", function() { return this.getter.call(this); });
- Option.prototype.__defineSetter__("value", function(value) { this.setter.call(this, value); });
+ this.__defineGetter__("value",
+ function()
+ {
+ if (this.getter)
+ this.getter.call(this);
+ return value;
+ }
+ );
+ this.__defineSetter__("value",
+ function(new_value)
+ {
+ value = new_value;
+ if (this.setter)
+ this.setter.call(this, value);
+ }
+ );
// TODO: add is[Type]() queries for use in set()?
// : add isValid() or just throw an exception?
@@ -445,7 +460,7 @@ function Options() //{{{
":set titlestring=Mozilla Firefox.",
- setter: function(value) { Options.setPref("titlestring", value); setTitleString(value); },
+ setter: function(value) { setTitleString(value); },
default_value: "Vimperator"
}
));
@@ -649,7 +664,7 @@ function Options() //{{{
addOption(new Option(["visualbell", "vb"], "boolean",
{
short_help: "Use visual bell instead of beeping on errors",
- setter: function(value) { Options.setPref("visualbell", value); Options.setFirefoxPref("accessibility.typeaheadfind.enablesound", !value); },
+ setter: function(value) { Options.setFirefoxPref("accessibility.typeaheadfind.enablesound", !value); },
default_value: false
}
));