mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-22 01:58:45 +00:00
add a changeId method to the OptionManager
This commit is contained in:
parent
7dfce33065
commit
7bc81fbaf9
2 changed files with 14 additions and 2 deletions
|
@ -43,7 +43,7 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
|
||||||
this.changed = {};
|
this.changed = {};
|
||||||
this.defaults = config['defaults'] || {};
|
this.defaults = config['defaults'] || {};
|
||||||
this.options = {};
|
this.options = {};
|
||||||
|
this.currentId = null;
|
||||||
|
|
||||||
this.addEvents({
|
this.addEvents({
|
||||||
'add': true,
|
'add': true,
|
||||||
|
@ -86,6 +86,18 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Changes bound fields to use the specified id.
|
||||||
|
* @param {String} id
|
||||||
|
*/
|
||||||
|
changeId: function(id) {
|
||||||
|
this.currentId = id;
|
||||||
|
for (var option in this.defaults) {
|
||||||
|
if (!this.binds[option]) continue;
|
||||||
|
this.binds[option].setValue(this.getValue(id, option));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the changed values for a specified id.
|
* Returns the changed values for a specified id.
|
||||||
* @param {String} id
|
* @param {String} id
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue