rearrange the details module to make it more managable

This commit is contained in:
Damien Churchill 2009-02-19 01:12:58 +00:00
parent 4b711883cb
commit 6adada01e4
2 changed files with 103 additions and 46 deletions

View File

@ -1,43 +1,103 @@
Deluge.Details = new Ext.TabPanel({
Deluge.Details = {}
Deluge.Details.Status = {
onRender: function(panel) {
this.panel = panel;
this.progressBar = new Ext.ProgressBar({
text: "0% Stopped",
id: "pbar-status",
cls: 'deluge-status-progressbar'
});
this.panel.add(this.progressBar);
this.panel.add({
id: 'status-details',
cls: 'deluge-status',
border: false,
listeners: {'render': Deluge.Details.Status.onStatusRender}
});
},
onStatusRender: function(panel) {
this.status = panel;
this.status.load({
url: "/render/tab_statistics.html",
text: _("Loading") + "...",
callback: this.onStatusLoaded
});
},
onStatusLoaded: function() {
alert("loaded");
}
}
Deluge.Details.Details = {
onRender: function(panel) {
this.panel = panel.load({
url: "/render/tab_details.html"
});
}
}
$extend(Deluge.Details, {
update: function(torrentId) {
},
Panel: new Ext.TabPanel({
region: 'south',
split: true,
height: 200,
minSize: 100,
collapsible: true,
title: 'Details',
margins: '0 5 5 5',
activeTab: 0,
items: [{
id: 'status',
title: 'Status'
title: _('Status'),
listeners: {'render': Deluge.Details.Status.onRender}
},{
id: 'details',
title: 'Details'
title: _('Details'),
listeners: {'render': Deluge.Details.Details.onRender}
},{
id: 'files',
title: 'Files'
title: _('Files')
},{
id: 'peers',
title: 'Peers'
title: _('Peers')
},{
id: 'options',
title: 'Options'
title: _('Options')
}]
})
});
Deluge.Details.StatusProgressBar = new Ext.ProgressBar({
/*Deluge.Details.Status = {
onShow: function(panel) {
this.panel = panel;
},
initialize: function() {
this.Panel = Deluge.Details.Panel.items.get('status');
this.ProgressBar = new Ext.ProgressBar({
text: "0% Stopped",
id: "pbar-status",
cls: 'deluge-status-progressbar'
});
Deluge.Details.Status = Deluge.Details.items.get('status');
Deluge.Details.Status.add(Deluge.Details.StatusProgressBar);
Deluge.Details.Status.add({
});
this.Panel.add(this.ProgressBar);
this.Panel.add({
id: 'status-details',
cls: 'deluge-status',
border: false
});
});
Deluge.Details.update = function(torrentId) {
Deluge.Details.getActiveTab().update(torrent);
}
//this.Details = Deluge.Details.Status.Panel.items.get("status-details").load({
// url: "/render/tab_statistics.html"
//});
}
}*/

View File

@ -7,7 +7,7 @@ Deluge.Ui = {
title: 'Deluge',
layout: 'border',
tbar: Deluge.ToolBar,
items: [Deluge.SideBar, Deluge.Details, Deluge.Torrents],
items: [Deluge.SideBar, Deluge.Details.Panel, Deluge.Torrents],
bbar: Deluge.StatusBar
});
@ -18,10 +18,7 @@ Deluge.Ui = {
Deluge.Login.Window.show();
Deluge.Client = new JSON.RPC('/json');
Deluge.Details.Status.items.get("status-details").load({
url: "/render/tab_statistics.html"
});
Deluge.Details.initialize();
Deluge.SideBar = this.MainPanel.items.get('sidebar');
},