mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-18 14:26:24 +00:00
[Plugins] Add webui pref pages for Label and Autoadd
* Add info-only preference pages for these plugins in WebUI.
This commit is contained in:
parent
0353b82c0c
commit
c9692bb5bd
@ -9,20 +9,49 @@
|
|||||||
* See LICENSE for more details.
|
* See LICENSE for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
AutoAddPlugin = Ext.extend(Deluge.Plugin, {
|
Ext.ns('Deluge.ux.preferences');
|
||||||
constructor: function(config) {
|
|
||||||
config = Ext.apply({
|
/**
|
||||||
name: "AutoAdd"
|
* @class Deluge.ux.preferences.AutoAddPage
|
||||||
}, config);
|
* @extends Ext.Panel
|
||||||
AutoAddPlugin.superclass.constructor.call(this, config);
|
*/
|
||||||
},
|
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: _('<p>The AutoAdd plugin is enabled however there is no WebUI ' +
|
||||||
|
'preferences page implemented yet for this plugin.</p><br>' +
|
||||||
|
'<p>In the meantime please use GtkUI preference page to configure this plugin.<p>')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Deluge.plugins.AutoAddPlugin = Ext.extend(Deluge.Plugin, {
|
||||||
|
name: 'AutoAdd',
|
||||||
|
|
||||||
onDisable: function() {
|
onDisable: function() {
|
||||||
|
deluge.preferences.removePage(this.prefsPage);
|
||||||
},
|
},
|
||||||
|
|
||||||
onEnable: function() {
|
onEnable: function() {
|
||||||
|
this.prefsPage = deluge.preferences.addPage(new Deluge.ux.preferences.AutoAddPage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
new AutoAddPlugin();
|
|
||||||
|
Deluge.registerPlugin('AutoAdd', Deluge.plugins.AutoAddPlugin);
|
||||||
|
@ -9,6 +9,42 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Ext.ns('Deluge.ux.preferences');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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: _('<p>The Label plugin is enabled.</p><br>' +
|
||||||
|
'<p>To add, remove or edit labels right-click on the Label filter ' +
|
||||||
|
'entry in the sidebar.</p><br>' +
|
||||||
|
'<p>To apply a label right-click on torrent(s).<p>')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
Ext.ns('Deluge.ux');
|
Ext.ns('Deluge.ux');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -393,9 +429,11 @@ Deluge.plugins.LabelPlugin = Ext.extend(Deluge.Plugin, {
|
|||||||
this.deregisterTorrentStatus('label');
|
this.deregisterTorrentStatus('label');
|
||||||
deluge.menus.torrent.remove(this.tmSep);
|
deluge.menus.torrent.remove(this.tmSep);
|
||||||
deluge.menus.torrent.remove(this.tm);
|
deluge.menus.torrent.remove(this.tm);
|
||||||
|
deluge.preferences.removePage(this.prefsPage);
|
||||||
},
|
},
|
||||||
|
|
||||||
onEnable: function() {
|
onEnable: function() {
|
||||||
|
this.prefsPage = deluge.preferences.addPage(new Deluge.ux.preferences.LabelPage());
|
||||||
this.torrentMenu = new Ext.menu.Menu();
|
this.torrentMenu = new Ext.menu.Menu();
|
||||||
|
|
||||||
this.tmSep = deluge.menus.torrent.add({
|
this.tmSep = deluge.menus.torrent.add({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user