diff --git a/deluge/ui/web/js/deluge-all/ConnectionManager.js b/deluge/ui/web/js/deluge-all/ConnectionManager.js index 3891b91e7..54b3b25ed 100644 --- a/deluge/ui/web/js/deluge-all/ConnectionManager.js +++ b/deluge/ui/web/js/deluge-all/ConnectionManager.js @@ -48,7 +48,6 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, { this.on('hide', this.onHide, this); this.on('show', this.onShow, this); - deluge.events.on('disconnect', this.onDisconnect, this); deluge.events.on('login', this.onLogin, this); deluge.events.on('logout', this.onLogout, this); @@ -81,6 +80,7 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, { header: _('Version'), width: .25, sortable: true, + tpl: '{version}', dataIndex: 'version' }], singleSelect: true, @@ -141,8 +141,12 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, { }); }, - disconnect: function() { + disconnect: function(show) { deluge.events.fire('disconnect'); + if (show) { + if (this.isVisible()) return; + this.show(); + } }, loadHosts: function() { @@ -240,12 +244,6 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, { } }, - // private - onDisconnect: function() { - if (this.isVisible()) return; - this.show(); - }, - // private onGetHosts: function(hosts) { this.list.getStore().loadData(hosts); @@ -296,9 +294,6 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, { if (!this.hidden && this.rendered) { this.hide(); } - if (this.running) { - - } }, // private @@ -335,7 +330,6 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, { } else { this.removeHostButton.disable(); this.stopHostButton.disable(); - this.updateButtons(null); } }, diff --git a/deluge/ui/web/js/deluge-all/UI.js b/deluge/ui/web/js/deluge-all/UI.js index 879ec5fbb..2e8f0373f 100644 --- a/deluge/ui/web/js/deluge-all/UI.js +++ b/deluge/ui/web/js/deluge-all/UI.js @@ -129,7 +129,10 @@ deluge.ui = { * Updates the various components in the interface. */ onUpdate: function(data) { - if (!data['connected']) deluge.events.fire('disconnect'); + if (!data['connected']) { + deluge.connectionManager.disconnect(true); + return; + } if (deluge.config.show_session_speed) { document.title = this.originalTitle +