mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-27 02:20:32 +00:00
fix the connection manager when the ui disconnects from a daemon so it doesn't end up in a loop
This commit is contained in:
parent
759ae6356d
commit
bf28b3ac31
@ -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: '<tpl if="version">{version}</tpl>',
|
||||
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);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -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 +
|
||||
|
Loading…
x
Reference in New Issue
Block a user