From 68f0e9ddc7de9180af60c87344d05513a9d4d401 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Wed, 28 Apr 2010 16:09:53 +0100 Subject: [PATCH] renderer the event column correctly and remove the bottom panel --- .../plugins/execute/execute/data/execute.js | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/deluge/plugins/execute/execute/data/execute.js b/deluge/plugins/execute/execute/data/execute.js index c31d7bdef..7ca989922 100644 --- a/deluge/plugins/execute/execute/data/execute.js +++ b/deluge/plugins/execute/execute/data/execute.js @@ -39,11 +39,16 @@ Ext.ns('Deluge.ux.preferences'); Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, { title: _('Execute'), - layout: 'border', + layout: 'fit', border: false, initComponent: function() { 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({ store: new Ext.data.SimpleStore({ fields: [ @@ -56,7 +61,12 @@ Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, { width: .3, header: _('Event'), 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', header: _('Command'), @@ -68,32 +78,19 @@ Deluge.ux.preferences.ExecutePage = Ext.extend(Ext.Panel, { }); this.panel = this.add({ - region: 'center', items: [this.list] }); - this.details = this.add({ - xtype: 'tabpanel', - region: 'south', - activeTab: 0 - }); - - this.add = this.details.add({ - title: _('Add') - }); - this.edit = this.details.add({ - title: _('Edit') - }); + deluge.preferences.on('show', this.onPreferencesShow, this); }, - - onShow: function() { - Deluge.ux.preferences.ExecutePage.superclass.onShow.call(this); + + onPreferencesShow: function() { deluge.client.execute.get_commands({ success: function(commands) { this.list.getStore().loadData(commands); }, scope: this - }); + }); } });