diff --git a/deluge/ui/web/css/deluge.css b/deluge/ui/web/css/deluge.css index f0b8224f6..0d13a0f94 100644 --- a/deluge/ui/web/css/deluge.css +++ b/deluge/ui/web/css/deluge.css @@ -67,4 +67,15 @@ 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; } \ No newline at end of file diff --git a/deluge/ui/web/icons/16/LICENSE b/deluge/ui/web/icons/16/LICENSE index 3baa3ecf9..8d6d0478e 100644 --- a/deluge/ui/web/icons/16/LICENSE +++ b/deluge/ui/web/icons/16/LICENSE @@ -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 diff --git a/deluge/ui/web/icons/16/error.png b/deluge/ui/web/icons/16/error.png new file mode 100644 index 000000000..0db86f686 Binary files /dev/null and b/deluge/ui/web/icons/16/error.png differ diff --git a/deluge/ui/web/js/deluge-bars.js b/deluge/ui/web/js/deluge-bars.js index 0651878a4..9c28dbd76 100644 --- a/deluge/ui/web/js/deluge-bars.js +++ b/deluge/ui/web/js/deluge-bars.js @@ -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}} }); \ No newline at end of file diff --git a/deluge/ui/web/js/deluge-ui.js b/deluge/ui/web/js/deluge-ui.js index 391e8d855..ea7b7ca49 100644 --- a/deluge/ui/web/js/deluge-ui.js +++ b/deluge/ui/web/js/deluge-ui.js @@ -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({