fix enabling plugins when the UI is created
change Deluge.Plugin so it implements the enable/disable methods that merely fire events that the plugins can use
This commit is contained in:
parent
4df98df1f2
commit
e7095195f7
|
@ -41,5 +41,15 @@ Deluge.Plugin = Ext.extend(Ext.util.Observable, {
|
|||
this.isDelugePlugin = true;
|
||||
Deluge.Plugins[this.name] = this;
|
||||
Deluge.Plugin.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
disable: function() {
|
||||
this.fireEvent("disabled", this);
|
||||
if (this.onDisable) this.onDisable();
|
||||
},
|
||||
|
||||
enable: function() {
|
||||
this.fireEvent("enable", this);
|
||||
if (this.onEnable) this.onEnable();
|
||||
}
|
||||
});
|
|
@ -74,10 +74,11 @@ Deluge.UI = {
|
|||
Deluge.Client = new Ext.ux.util.RpcClient({
|
||||
url: '/json'
|
||||
});
|
||||
|
||||
Ext.each(Deluge.Plugins, function(plugin) {
|
||||
|
||||
for (var plugin in Deluge.Plugins) {
|
||||
plugin = Deluge.Plugins[plugin];
|
||||
plugin.enable();
|
||||
});
|
||||
}
|
||||
|
||||
Deluge.Client.on('connected', function(e) {
|
||||
Deluge.Login.show();
|
||||
|
|
Loading…
Reference in New Issue