history: Fix HistoryManager

Make GSettings support optional, refactor text entry handling,
fix some off-by-one bugs in the management itself, use Params
for parsing, fix other typos and bugs.

https://bugzilla.gnome.org/show_bug.cgi?id=642793
This commit is contained in:
Jasper St. Pierre
2011-02-28 12:22:12 -05:00
parent 8ce97961b4
commit 75ae209653
3 changed files with 70 additions and 53 deletions

View File

@ -778,23 +778,8 @@ LookingGlass.prototype = {
return true;
}));
this._history = new History.HistoryManager(HISTORY_KEY);
this._history.connect('changed', Lang.bind(this, function(history, text) {
this._entry.text = text;
}));
this._entry.clutter_text.connect('key-press-event', Lang.bind(this, function(o, e) {
let symbol = e.get_key_symbol();
if (symbol == Clutter.Up) {
this._history.prevItem(o.get_text());
return true;
} else if (symbol == Clutter.Down) {
this._history.nextItem(o.get_text());
return true;
} else {
return false;
}
}));
this._history = new History.HistoryManager({ gsettingsKey: HISTORY_KEY,
entry: this._entry.clutter_text });
},
_updateFont: function() {