From faae99d3d818af59b38065ba88cee11d2d2392c5 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Thu, 19 Feb 2009 20:38:06 +0000 Subject: [PATCH] improve the statusbar, default to "Not Connected" with an icon --- deluge/ui/web/css/deluge.css | 11 +++++++++++ deluge/ui/web/icons/16/LICENSE | 1 + deluge/ui/web/icons/16/error.png | Bin 0 -> 886 bytes deluge/ui/web/js/deluge-bars.js | 27 ++++++++++++++++++++++++++- deluge/ui/web/js/deluge-ui.js | 2 +- 5 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 deluge/ui/web/icons/16/error.png 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 0000000000000000000000000000000000000000..0db86f68622b938352e8bfa7fc21156227a5aef5 GIT binary patch literal 886 zcmV-+1Bv{JP)BpXyJ6#{|4m;V0#zHm7FmVQkT5^NL9W;1(b z^2Nr+##Wonc3<*%@_#>nj$b`Jhzt%Q8VEp4PtUKrcJ(|(D)@XpCWi@Ig2`m!P^y}m znp$gXYj1`+I-njOhn~FZwOZ(Mb0My-V#VdcZ}&%(*;>m5L6Asffkl*CTU+^sg@x7U z&ehoh9ql+khfj=-Vtsubkw`?w#>NItzIuh+#YN0?cA}=H#-`Khs+r3IrB|+8zW(#| zYh=#O!RTqHBJ$;Jo-d_0qeguO-JkH5MbY%t64{m6++EV7SKvp!mhM30#DVan@dODs^-d?X4 z^Yinv5VzN5vB+(TlK`KM#o}PDidw}Ykf^UQGH%SxL8Ltu3Tm|)DJdy3GIo0{Y;Gb> zc9}z5B|V~opn|&e7~+&~8X1m^jr~XFIXF8t1(5}a%x3{53q;xb-1M}6QnXmHMB!@p zkiS+`;8S_IEWohRJj5unv{Mxbg=Qw1%L1S6cKc9nRSgoyj>B`|f=u=i`4IVGxM@~+ zy)YWFO^&iFtKf7F4KbHf_!SKLUBknJ1LlWaP*_gmB^7KRkMJ&d-)AsDVXcJm!6S@} zI0r(Zpo_V}?!}n(dcP?tJ>{jgc5`a65n(}%kF!7EQ>h`F zP0B1moa5AVcYXATM M07*qoM6N<$g8TQSBme*a literal 0 HcmV?d00001 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({