mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
add basic edit trackers window
This commit is contained in:
parent
0b1b6d65de
commit
554181a590
5 changed files with 145 additions and 4 deletions
|
@ -184,7 +184,9 @@ Ext.deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
||||||
cls: 'x-btn-text-icon',
|
cls: 'x-btn-text-icon',
|
||||||
iconCls: 'x-deluge-edit-trackers',
|
iconCls: 'x-deluge-edit-trackers',
|
||||||
border: false,
|
border: false,
|
||||||
width: 100
|
width: 100,
|
||||||
|
handler: this.onEditTrackers,
|
||||||
|
scope: this
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
items: [{
|
items: [{
|
||||||
|
@ -238,6 +240,10 @@ Ext.deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onEditTrackers: function() {
|
||||||
|
Deluge.EditTrackers.show();
|
||||||
|
},
|
||||||
|
|
||||||
onRequestComplete: function(torrent, options) {
|
onRequestComplete: function(torrent, options) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
132
deluge/ui/web/js/Deluge.EditTrackers.js
Normal file
132
deluge/ui/web/js/Deluge.EditTrackers.js
Normal file
|
@ -0,0 +1,132 @@
|
||||||
|
/*
|
||||||
|
Script: Deluge.EditTrackers.js
|
||||||
|
Contains the edit trackers window.
|
||||||
|
|
||||||
|
Copyright:
|
||||||
|
(C) Damien Churchill 2009 <damoxc@gmail.com>
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 3, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, write to:
|
||||||
|
The Free Software Foundation, Inc.,
|
||||||
|
51 Franklin Street, Fifth Floor
|
||||||
|
Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
Ext.deluge.EditTrackers = Ext.extend(Ext.Window, {
|
||||||
|
|
||||||
|
constructor: function(config) {
|
||||||
|
config = Ext.apply({
|
||||||
|
title: _('Edit Trackers'),
|
||||||
|
width: 300,
|
||||||
|
height: 220,
|
||||||
|
bodyStyle: 'padding: 5px',
|
||||||
|
layout: 'fit',
|
||||||
|
buttonAlign: 'right',
|
||||||
|
closeAction: 'hide',
|
||||||
|
closable: true,
|
||||||
|
iconCls: 'x-deluge-edit-trackers',
|
||||||
|
plain: true,
|
||||||
|
resizable: true
|
||||||
|
}, config);
|
||||||
|
Ext.deluge.EditTrackers.superclass.constructor.call(this, config);
|
||||||
|
},
|
||||||
|
|
||||||
|
initComponent: function() {
|
||||||
|
Ext.deluge.EditTrackers.superclass.initComponent.call(this);
|
||||||
|
|
||||||
|
this.addButton(_('Cancel'), this.onCancel, this);
|
||||||
|
this.addButton(_('Ok'), this.onOk, this);
|
||||||
|
|
||||||
|
this.grid = this.add({
|
||||||
|
xtype: 'grid',
|
||||||
|
store: new Ext.data.SimpleStore({
|
||||||
|
fields: [
|
||||||
|
{name: 'tier', mapping: 0},
|
||||||
|
{name: 'tracker', mapping: 1}
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
columns: [{
|
||||||
|
header: _('Tier'),
|
||||||
|
width: 50,
|
||||||
|
sortable: true,
|
||||||
|
renderer: fplain,
|
||||||
|
dataIndex: 'tier'
|
||||||
|
}, {
|
||||||
|
id:'tracker',
|
||||||
|
header: _('Tracker'),
|
||||||
|
sortable: true,
|
||||||
|
renderer: fplain,
|
||||||
|
dataIndex: 'tracker'
|
||||||
|
}],
|
||||||
|
stripeRows: true,
|
||||||
|
selModel: new Ext.grid.RowSelectionModel({
|
||||||
|
singleSelect: true,
|
||||||
|
listeners: {
|
||||||
|
'rowselect': {fn: this.onSelect, scope: this}
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
autoExpandColumn: 'tracker',
|
||||||
|
deferredRender:false,
|
||||||
|
autoScroll:true,
|
||||||
|
margins: '0 0 0 0',
|
||||||
|
bbar: new Ext.Toolbar({
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
id: 'up',
|
||||||
|
cls: 'x-btn-text-icon',
|
||||||
|
text: _('Up'),
|
||||||
|
icon: '/icons/up.png',
|
||||||
|
handler: this.onUp,
|
||||||
|
scope: this
|
||||||
|
}, {
|
||||||
|
id: 'down',
|
||||||
|
cls: 'x-btn-text-icon',
|
||||||
|
text: _('Down'),
|
||||||
|
icon: '/icons/down.png',
|
||||||
|
handler: this.onDown,
|
||||||
|
scope: this
|
||||||
|
}, '->', {
|
||||||
|
id: 'add',
|
||||||
|
cls: 'x-btn-text-icon',
|
||||||
|
text: _('Add'),
|
||||||
|
icon: '/icons/add.png',
|
||||||
|
handler: this.onAdd,
|
||||||
|
scope: this
|
||||||
|
}, {
|
||||||
|
id: 'remove',
|
||||||
|
cls: 'x-btn-text-icon',
|
||||||
|
text: _('Remove'),
|
||||||
|
icon: '/icons/remove.png',
|
||||||
|
handler: this.onRemove,
|
||||||
|
scope: this
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onCancel: function() {
|
||||||
|
this.hide();
|
||||||
|
},
|
||||||
|
|
||||||
|
onHide: function() {
|
||||||
|
this.grid.getStore().removeAll();
|
||||||
|
},
|
||||||
|
|
||||||
|
onOk: function() {
|
||||||
|
this.hide();
|
||||||
|
},
|
||||||
|
|
||||||
|
onShow: function() {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Deluge.EditTrackers = new Ext.deluge.EditTrackers();
|
|
@ -48,6 +48,9 @@ Deluge.Menus = {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case 'edit_trackers':
|
||||||
|
Deluge.EditTrackers.show();
|
||||||
|
break;
|
||||||
case 'update':
|
case 'update':
|
||||||
Deluge.Client.core.force_reannounce(ids, {
|
Deluge.Client.core.force_reannounce(ids, {
|
||||||
success: function() {
|
success: function() {
|
||||||
|
@ -208,7 +211,7 @@ Deluge.Menus.Torrent = new Ext.menu.Menu({
|
||||||
handler: Deluge.Menus.onTorrentAction,
|
handler: Deluge.Menus.onTorrentAction,
|
||||||
scope: Deluge.Menus
|
scope: Deluge.Menus
|
||||||
}, {
|
}, {
|
||||||
edit: 'edit_trackers',
|
id: 'edit_trackers',
|
||||||
text: _('Edit Trackers'),
|
text: _('Edit Trackers'),
|
||||||
icon: '/icons/edit_trackers.png',
|
icon: '/icons/edit_trackers.png',
|
||||||
handler: Deluge.Menus.onTorrentAction,
|
handler: Deluge.Menus.onTorrentAction,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
DELUGE_FILES="Deluge.js Deluge.Formatters.js Deluge.Menus.js Deluge.Events.js Deluge.Add.js Deluge.Add.File.js Deluge.Add.Url.js Deluge.Client.js Deluge.ConnectionManager.js Deluge.Details.js Deluge.Details.Status.js Deluge.Details.Details.js Deluge.Details.Files.js Deluge.Details.Peers.js Deluge.Details.Options.js Deluge.Keys.js Deluge.Login.js Deluge.Preferences.js Deluge.Preferences.Downloads.js Deluge.Preferences.Network.js Deluge.Preferences.Bandwidth.js Deluge.Preferences.Interface.js Deluge.Preferences.Other.js Deluge.Preferences.Daemon.js Deluge.Preferences.Queue.js Deluge.Preferences.Proxy.js Deluge.Preferences.Notification.js Deluge.Preferences.Plugins.js Deluge.Sidebar.js Deluge.Statusbar.js Deluge.Toolbar.js Deluge.Torrents.js Deluge.UI.js"
|
DELUGE_FILES="Deluge.js Deluge.Formatters.js Deluge.Menus.js Deluge.Events.js Deluge.Add.js Deluge.Add.File.js Deluge.Add.Url.js Deluge.Client.js Deluge.ConnectionManager.js Deluge.Details.js Deluge.Details.Status.js Deluge.Details.Details.js Deluge.Details.Files.js Deluge.Details.Peers.js Deluge.Details.Options.js Deluge.EditTrackers.js Deluge.Keys.js Deluge.Login.js Deluge.Preferences.js Deluge.Preferences.Downloads.js Deluge.Preferences.Network.js Deluge.Preferences.Bandwidth.js Deluge.Preferences.Interface.js Deluge.Preferences.Other.js Deluge.Preferences.Daemon.js Deluge.Preferences.Queue.js Deluge.Preferences.Proxy.js Deluge.Preferences.Notification.js Deluge.Preferences.Plugins.js Deluge.Sidebar.js Deluge.Statusbar.js Deluge.Toolbar.js Deluge.Torrents.js Deluge.UI.js"
|
||||||
ALL_FILES="ext-extensions-debug.js $DELUGE_FILES"
|
ALL_FILES="ext-extensions-debug.js $DELUGE_FILES"
|
||||||
|
|
||||||
scan() {
|
scan() {
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue