diff --git a/deluge/plugins/autoadd/autoadd/data/autoadd.js b/deluge/plugins/autoadd/autoadd/data/autoadd.js index f8f004f01..7302d8afb 100644 --- a/deluge/plugins/autoadd/autoadd/data/autoadd.js +++ b/deluge/plugins/autoadd/autoadd/data/autoadd.js @@ -31,20 +31,49 @@ Copyright: statement from all source files in the program, then also delete it here. */ -AutoAddPlugin = Ext.extend(Deluge.Plugin, { - constructor: function(config) { - config = Ext.apply({ - name: "AutoAdd" - }, config); - AutoAddPlugin.superclass.constructor.call(this, config); - }, - - onDisable: function() { - - }, - - onEnable: function() { - - } +Ext.ns('Deluge.ux.preferences'); + +/** + * @class Deluge.ux.preferences.AutoAddPage + * @extends Ext.Panel + */ +Deluge.ux.preferences.AutoAddPage = Ext.extend(Ext.Panel, { + + title: _('AutoAdd'), + layout: 'fit', + border: false, + + initComponent: function() { + Deluge.ux.preferences.AutoAddPage.superclass.initComponent.call(this); + fieldset = this.add({ + xtype: 'fieldset', + border: false, + title: _('AutoAdd Preferences'), + autoHeight: true, + labelWidth: 1, + defaultType: 'panel' + }); + fieldset.add({ + border: false, + bodyCfg: { + html: _('
The AutoAdd plugin is enabled however there is no WebUI ' + + 'preferences page implemented yet for this plugin.
In the meantime please use GtkUI preference page to configure this plugin.
') + } + }); + } }); -new AutoAddPlugin(); + +Deluge.plugins.AutoAddPlugin = Ext.extend(Deluge.Plugin, { + name: 'AutoAdd', + + onDisable: function() { + deluge.preferences.removePage(this.prefsPage); + }, + + onEnable: function() { + this.prefsPage = deluge.preferences.addPage(new Deluge.ux.preferences.AutoAddPage()); + } +}); + +Deluge.registerPlugin('AutoAdd', Deluge.plugins.AutoAddPlugin); diff --git a/deluge/plugins/label/label/data/label.js b/deluge/plugins/label/label/data/label.js index 43585afa7..7895495df 100644 --- a/deluge/plugins/label/label/data/label.js +++ b/deluge/plugins/label/label/data/label.js @@ -31,6 +31,40 @@ */ Ext.ns('Deluge.ux'); +/** + * @class Deluge.ux.preferences.LabelPage + * @extends Ext.Panel + */ +Deluge.ux.preferences.LabelPage = Ext.extend(Ext.Panel, { + + title: _('Label'), + layout: 'fit', + border: false, + + initComponent: function() { + Deluge.ux.preferences.LabelPage.superclass.initComponent.call(this); + fieldset = this.add({ + xtype: 'fieldset', + border: false, + title: _('Label Preferences'), + autoHeight: true, + labelWidth: 1, + defaultType: 'panel' + }); + fieldset.add({ + border: false, + bodyCfg: { + html: _('
The Label plugin is enabled.
To add, remove or edit labels right-click on the Label filter ' + + 'entry in the sidebar.
To apply a label right-click on torrent(s).
') + } + }); + + }, + +}); + /** * @class Deluge.ux.AddLabelWindow * @extends Ext.Window @@ -413,9 +447,11 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, { this.deregisterTorrentStatus('label'); deluge.menus.torrent.remove(this.tmSep); deluge.menus.torrent.remove(this.tm); + deluge.preferences.removePage(this.prefsPage); }, onEnable: function() { + this.prefsPage = deluge.preferences.addPage(new Deluge.ux.preferences.LabelPage()); this.torrentMenu = new Ext.menu.Menu(); this.tmSep = deluge.menus.torrent.add({