begin implementation of the SideBar
This commit is contained in:
parent
5512606f8a
commit
f909c2409f
|
@ -183,20 +183,6 @@ Deluge.ToolBar.Bar = new Ext.Toolbar({
|
||||||
listeners: {'render': Deluge.ToolBar.onToolbarRender, scope: Deluge.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 = {
|
Deluge.StatusBar = {
|
||||||
onRender: function() {
|
onRender: function() {
|
||||||
this.bound = {
|
this.bound = {
|
||||||
|
@ -341,4 +327,34 @@ Deluge.StatusBar.Bar = new Ext.StatusBar({
|
||||||
defaultIconCls: 'x-not-connected',
|
defaultIconCls: 'x-not-connected',
|
||||||
defaultText: _('Not Connected'),
|
defaultText: _('Not Connected'),
|
||||||
listeners: {'render': {scope: Deluge.StatusBar, fn: Deluge.StatusBar.onRender}}
|
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}}
|
||||||
|
}
|
|
@ -32,7 +32,11 @@ Deluge.Ui = {
|
||||||
title: 'Deluge',
|
title: 'Deluge',
|
||||||
layout: 'border',
|
layout: 'border',
|
||||||
tbar: Deluge.ToolBar.Bar,
|
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
|
bbar: Deluge.StatusBar.Bar
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -45,8 +49,6 @@ Deluge.Ui = {
|
||||||
Deluge.Events.on("connect", this.onConnect.bindWithEvent(this));
|
Deluge.Events.on("connect", this.onConnect.bindWithEvent(this));
|
||||||
Deluge.Events.on("disconnect", this.onDisconnect.bindWithEvent(this));
|
Deluge.Events.on("disconnect", this.onDisconnect.bindWithEvent(this));
|
||||||
Deluge.Client = new JSON.RPC('/json');
|
Deluge.Client = new JSON.RPC('/json');
|
||||||
|
|
||||||
Deluge.SideBar = this.MainPanel.items.get('sidebar');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
update: function() {
|
update: function() {
|
||||||
|
@ -101,6 +103,7 @@ Deluge.Ui = {
|
||||||
});
|
});
|
||||||
Deluge.Torrents.Store.loadData(torrents);
|
Deluge.Torrents.Store.loadData(torrents);
|
||||||
Deluge.StatusBar.update(data['stats']);
|
Deluge.StatusBar.update(data['stats']);
|
||||||
|
Deluge.SideBar.update(data['filters']);
|
||||||
this.errorCount = 0;
|
this.errorCount = 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue