mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-08 09:28:41 +00:00
renderer the event column correctly and remove the bottom panel
This commit is contained in:
parent
5e1f6a8738
commit
68f0e9ddc7
1 changed files with 16 additions and 19 deletions
|
@ -39,11 +39,16 @@ Ext.ns('Deluge.ux.preferences');
|
||||||
Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
|
Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
|
||||||
|
|
||||||
title: _('Execute'),
|
title: _('Execute'),
|
||||||
layout: 'border',
|
layout: 'fit',
|
||||||
border: false,
|
border: false,
|
||||||
|
|
||||||
initComponent: function() {
|
initComponent: function() {
|
||||||
Deluge.ux.preferences.ExecutePage.superclass.initComponent.call(this);
|
Deluge.ux.preferences.ExecutePage.superclass.initComponent.call(this);
|
||||||
|
var event_map = this.event_map = {
|
||||||
|
'complete': _('Torrent Complete'),
|
||||||
|
'added': _('Torrent Added')
|
||||||
|
}
|
||||||
|
|
||||||
this.list = new Ext.list.ListView({
|
this.list = new Ext.list.ListView({
|
||||||
store: new Ext.data.SimpleStore({
|
store: new Ext.data.SimpleStore({
|
||||||
fields: [
|
fields: [
|
||||||
|
@ -56,7 +61,12 @@ Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
|
||||||
width: .3,
|
width: .3,
|
||||||
header: _('Event'),
|
header: _('Event'),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
dataIndex: 'event'
|
dataIndex: 'event',
|
||||||
|
tpl: new Ext.XTemplate('{[this.getEvent(values.event)]}', {
|
||||||
|
getEvent: function(e) {
|
||||||
|
return (event_map[e]) ? event_map[e] : e;
|
||||||
|
}
|
||||||
|
})
|
||||||
}, {
|
}, {
|
||||||
id: 'name',
|
id: 'name',
|
||||||
header: _('Command'),
|
header: _('Command'),
|
||||||
|
@ -68,32 +78,19 @@ Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.panel = this.add({
|
this.panel = this.add({
|
||||||
region: 'center',
|
|
||||||
items: [this.list]
|
items: [this.list]
|
||||||
});
|
});
|
||||||
|
|
||||||
this.details = this.add({
|
deluge.preferences.on('show', this.onPreferencesShow, this);
|
||||||
xtype: 'tabpanel',
|
|
||||||
region: 'south',
|
|
||||||
activeTab: 0
|
|
||||||
});
|
|
||||||
|
|
||||||
this.add = this.details.add({
|
|
||||||
title: _('Add')
|
|
||||||
});
|
|
||||||
this.edit = this.details.add({
|
|
||||||
title: _('Edit')
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow: function() {
|
onPreferencesShow: function() {
|
||||||
Deluge.ux.preferences.ExecutePage.superclass.onShow.call(this);
|
|
||||||
deluge.client.execute.get_commands({
|
deluge.client.execute.get_commands({
|
||||||
success: function(commands) {
|
success: function(commands) {
|
||||||
this.list.getStore().loadData(commands);
|
this.list.getStore().loadData(commands);
|
||||||
},
|
},
|
||||||
scope: this
|
scope: this
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue