improve the statusbar, default to "Not Connected" with an icon

This commit is contained in:
Damien Churchill 2009-02-19 20:38:06 +00:00
parent b9d84be341
commit faae99d3d8
5 changed files with 39 additions and 2 deletions

View File

@ -68,3 +68,14 @@ html, body {
.deluge-status dd.torrent_name, .deluge-status dd.tracker, .deluge-status dd.path {
width: 500px;
}
/* Statusbar */
#deluge-statusbar .x-not-connected {
background: url('/icons/16/error.png') no-repeat 2px;
padding-left: 20px;
}
#deluge-statusbar .x-connected {
background: transparent;
}

View File

@ -15,6 +15,7 @@ Licensed under the Creative Common Attribution-ShareAlike 3.0 License.
- connection_manager.png
- create.png
- down.png
- error.png
- go-bottom.png
- go-top.png
- help.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 886 B

View File

@ -177,7 +177,31 @@ Deluge.SideBar = {
margins: '5 0 0 5'
};
Deluge.StatusBar = new Ext.StatusBar({
Deluge.StatusBar = {
onRender: function() {
this.bound = {
onConnect: this.onConnect.bindWithEvent(this)
}
Deluge.Events.on('connect', this.bound.onConnect);
Deluge.Events.on('disconnect', this.bound.onDisconnect);
},
onConnect: function() {
this.Bar.setStatus({
iconCls: 'x-connected',
text: ''
});
},
onDisconnect: function() {
this.Bar.clearStatus({useDefaults:true});
}
}
Deluge.StatusBar.Bar = new Ext.StatusBar({
id: 'deluge-statusbar',
defaultIconCls: 'x-not-connected',
defaultText: _('Not Connected'),
/*items: [{
id: 'statusbar-connections',
text: '200 (200)',
@ -207,4 +231,5 @@ Deluge.StatusBar = new Ext.StatusBar({
cls: 'x-btn-text-icon',
icon: '/icons/16/dht.png'
}]*/
listeners: {'render': {scope: Deluge.StatusBar, fn: Deluge.StatusBar.onRender}}
});

View File

@ -8,7 +8,7 @@ Deluge.Ui = {
layout: 'border',
tbar: Deluge.ToolBar.Bar,
items: [Deluge.SideBar, Deluge.Details.Panel, Deluge.Torrents],
bbar: Deluge.StatusBar
bbar: Deluge.StatusBar.Bar
});
this.Viewport = new Ext.Viewport({