mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-04 23:53:23 +00:00
rearrange the details module to make it more managable
This commit is contained in:
parent
4b711883cb
commit
6adada01e4
@ -1,43 +1,103 @@
|
||||
Deluge.Details = 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'
|
||||
},{
|
||||
id: 'details',
|
||||
title: 'Details'
|
||||
},{
|
||||
id: 'files',
|
||||
title: 'Files'
|
||||
},{
|
||||
id: 'peers',
|
||||
title: 'Peers'
|
||||
},{
|
||||
id: 'options',
|
||||
title: 'Options'
|
||||
}]
|
||||
});
|
||||
Deluge.Details = {}
|
||||
|
||||
Deluge.Details.StatusProgressBar = 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({
|
||||
id: 'status-details',
|
||||
cls: 'deluge-status',
|
||||
border: false
|
||||
});
|
||||
|
||||
Deluge.Details.update = function(torrentId) {
|
||||
Deluge.Details.getActiveTab().update(torrent);
|
||||
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,
|
||||
margins: '0 5 5 5',
|
||||
activeTab: 0,
|
||||
items: [{
|
||||
id: 'status',
|
||||
title: _('Status'),
|
||||
listeners: {'render': Deluge.Details.Status.onRender}
|
||||
},{
|
||||
id: 'details',
|
||||
title: _('Details'),
|
||||
listeners: {'render': Deluge.Details.Details.onRender}
|
||||
},{
|
||||
id: 'files',
|
||||
title: _('Files')
|
||||
},{
|
||||
id: 'peers',
|
||||
title: _('Peers')
|
||||
},{
|
||||
id: 'options',
|
||||
title: _('Options')
|
||||
}]
|
||||
})
|
||||
});
|
||||
|
||||
/*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'
|
||||
});
|
||||
this.Panel.add(this.ProgressBar);
|
||||
|
||||
|
||||
this.Panel.add({
|
||||
id: 'status-details',
|
||||
cls: 'deluge-status',
|
||||
border: false
|
||||
});
|
||||
|
||||
//this.Details = Deluge.Details.Status.Panel.items.get("status-details").load({
|
||||
// url: "/render/tab_statistics.html"
|
||||
//});
|
||||
|
||||
}
|
||||
}*/
|
@ -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');
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user