add some icon preloading and improve the statusbar css classes

This commit is contained in:
Damien Churchill 2010-05-04 00:09:20 +01:00
parent facb4669e3
commit 5ea7e21943
4 changed files with 19 additions and 9 deletions

View File

@ -162,13 +162,17 @@ dl.singleline dd {
}
/* Statusbar */
#deluge-statusbar .x-not-connected {
background: url('../icons/error.png') no-repeat 2px;
padding-left: 20px;
.x-deluge-statusbar {
background: no-repeat 2px !important;
padding-left: 20px !important;
}
#deluge-statusbar .x-connected {
background: transparent;
.x-not-connected {
background-image: url('../icons/error.png') !important;
}
.x-connected {
background-image: transparent !important;
}
/* Styles for renderered progress bars */

View File

@ -29,5 +29,9 @@
</head>
<body>
<div style="background-image: url('${base}themes/default/tree/loading.gif');"></div>
<!-- Preload icon classes -->
<div class="ext-mb-error"></div>
<div class="icon-ok"></div>
</body>
</html>

View File

@ -35,8 +35,8 @@ Deluge.Statusbar = Ext.extend(Ext.ux.StatusBar, {
constructor: function(config) {
config = Ext.apply({
id: 'deluge-statusbar',
defaultIconCls: 'x-not-connected',
defaultText: _('Not Connected')
defaultIconCls: 'x-deluge-statusbar x-not-connected',
defaultText: _('Not Connected'),
}, config);
Deluge.Statusbar.superclass.constructor.call(this, config);
},

View File

@ -126,7 +126,10 @@ deluge.ui = {
},
onConnectionSuccess: function(result) {
deluge.statusbar.setStatus('Connection restored');
deluge.statusbar.setStatus({
iconCls: 'x-deluge-statusbar icon-ok',
text: _('Connection restored')
});
clearInterval(this.checking);
if (!result) {
deluge.connectionManager.show();
@ -143,7 +146,6 @@ deluge.ui = {
});
deluge.events.fire('disconnect');
deluge.statusbar.setStatus({
iconCls: 'icon-ok',
text: 'Lost connection to webserver'}
);
this.checking = setInterval(this.checkConnection, 2000);