attach to the "logout" event in the connectionmanager in onRender instead of onShow

fix clearing the torrent grid on logout
This commit is contained in:
Damien Churchill 2009-02-21 04:35:11 +00:00
parent 0f0c0cef9b
commit ee028f2a52
2 changed files with 10 additions and 6 deletions

View File

@ -53,6 +53,13 @@ Deluge.Connections = {
selection.selectRow(Deluge.Connections.selectedRow);
},
onRender: function() {
Deluge.Events.on('logout', function(e) {
Deluge.Connections.disconnect();
Deluge.Connections.Window.hide();
});
},
onSelect: function(selModel, rowIndex, record) {
Deluge.Connections.selectedRow = rowIndex;
},
@ -60,10 +67,6 @@ Deluge.Connections = {
onShow: function(window) {
Deluge.Connections.running = Deluge.Connections.runCheck.periodical(2000);
Deluge.Connections.runCheck();
Deluge.Events.on('logout', function(e) {
Deluge.Connections.disconnect();
Deluge.Connections.Window.hide();
});
},
runCheck: function() {
@ -126,6 +129,7 @@ Deluge.Connections.Window = new Ext.Window({
}],
listeners: {
'hide': Deluge.Connections.onClose,
'show': Deluge.Connections.onShow
'show': Deluge.Connections.onShow,
'render': Deluge.Connections.onRender
}
});

View File

@ -134,7 +134,7 @@ Deluge.Ui = {
if (this.running) {
$clear(this.running);
this.running = false;
Deluge.Torrents.store.loadData([]);
Deluge.Torrents.Store.loadData([]);
}
}
}