mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 23:48:40 +00:00
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
2 changed files with 14 additions and 3 deletions
|
@ -41,5 +41,15 @@ Deluge.Plugin = Ext.extend(Ext.util.Observable, {
|
||||||
this.isDelugePlugin = true;
|
this.isDelugePlugin = true;
|
||||||
Deluge.Plugins[this.name] = this;
|
Deluge.Plugins[this.name] = this;
|
||||||
Deluge.Plugin.superclass.constructor.call(this, config);
|
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();
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -75,9 +75,10 @@ Deluge.UI = {
|
||||||
url: '/json'
|
url: '/json'
|
||||||
});
|
});
|
||||||
|
|
||||||
Ext.each(Deluge.Plugins, function(plugin) {
|
for (var plugin in Deluge.Plugins) {
|
||||||
|
plugin = Deluge.Plugins[plugin];
|
||||||
plugin.enable();
|
plugin.enable();
|
||||||
});
|
}
|
||||||
|
|
||||||
Deluge.Client.on('connected', function(e) {
|
Deluge.Client.on('connected', function(e) {
|
||||||
Deluge.Login.show();
|
Deluge.Login.show();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue