begin implementation of the SideBar

This commit is contained in:
Damien Churchill 2009-03-17 10:33:51 +00:00
parent 5512606f8a
commit f909c2409f
2 changed files with 37 additions and 18 deletions

View File

@ -183,20 +183,6 @@ Deluge.ToolBar.Bar = new Ext.Toolbar({
listeners: {'render': Deluge.ToolBar.onToolbarRender, scope: Deluge.ToolBar}
});
Deluge.SideBar = {
region: 'west',
id: 'sidebar',
cls: 'deluge-sidebar',
title: _('Sidebar'),
split: true,
width: 200,
minSize: 175,
collapsible: true,
margins: '5 0 0 5'
};
Deluge.StatusBar = {
onRender: function() {
this.bound = {
@ -341,4 +327,34 @@ Deluge.StatusBar.Bar = new Ext.StatusBar({
defaultIconCls: 'x-not-connected',
defaultText: _('Not Connected'),
listeners: {'render': {scope: Deluge.StatusBar, fn: Deluge.StatusBar.onRender}}
});
});
Deluge.SideBar = {
onRender: function(bar) {
this.Bar = bar;
Deluge.Events.on("disconnect", this.onDisconnect);
},
onDisconnect: function() {
},
update: function(filters) {
}
};
Deluge.SideBar.Config = {
region: 'west',
id: 'sidebar',
cls: 'deluge-sidebar',
title: _('Sidebar'),
layout: 'accordion',
split: true,
width: 200,
minSize: 175,
collapsible: true,
margins: '5 0 0 5',
listeners: {'render': {scope: Deluge.SideBar, fn: Deluge.SideBar.onRender}}
}

View File

@ -32,7 +32,11 @@ Deluge.Ui = {
title: 'Deluge',
layout: 'border',
tbar: Deluge.ToolBar.Bar,
items: [Deluge.SideBar, Deluge.Details.Panel, Deluge.Torrents.Grid],
items: [
Deluge.SideBar.Config,
Deluge.Details.Panel,
Deluge.Torrents.Grid
],
bbar: Deluge.StatusBar.Bar
});
@ -45,8 +49,6 @@ Deluge.Ui = {
Deluge.Events.on("connect", this.onConnect.bindWithEvent(this));
Deluge.Events.on("disconnect", this.onDisconnect.bindWithEvent(this));
Deluge.Client = new JSON.RPC('/json');
Deluge.SideBar = this.MainPanel.items.get('sidebar');
},
update: function() {
@ -101,6 +103,7 @@ Deluge.Ui = {
});
Deluge.Torrents.Store.loadData(torrents);
Deluge.StatusBar.update(data['stats']);
Deluge.SideBar.update(data['filters']);
this.errorCount = 0;
},