mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
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:
parent
0f0c0cef9b
commit
ee028f2a52
2 changed files with 10 additions and 6 deletions
|
@ -53,6 +53,13 @@ Deluge.Connections = {
|
||||||
selection.selectRow(Deluge.Connections.selectedRow);
|
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) {
|
onSelect: function(selModel, rowIndex, record) {
|
||||||
Deluge.Connections.selectedRow = rowIndex;
|
Deluge.Connections.selectedRow = rowIndex;
|
||||||
},
|
},
|
||||||
|
@ -60,10 +67,6 @@ Deluge.Connections = {
|
||||||
onShow: function(window) {
|
onShow: function(window) {
|
||||||
Deluge.Connections.running = Deluge.Connections.runCheck.periodical(2000);
|
Deluge.Connections.running = Deluge.Connections.runCheck.periodical(2000);
|
||||||
Deluge.Connections.runCheck();
|
Deluge.Connections.runCheck();
|
||||||
Deluge.Events.on('logout', function(e) {
|
|
||||||
Deluge.Connections.disconnect();
|
|
||||||
Deluge.Connections.Window.hide();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
runCheck: function() {
|
runCheck: function() {
|
||||||
|
@ -126,6 +129,7 @@ Deluge.Connections.Window = new Ext.Window({
|
||||||
}],
|
}],
|
||||||
listeners: {
|
listeners: {
|
||||||
'hide': Deluge.Connections.onClose,
|
'hide': Deluge.Connections.onClose,
|
||||||
'show': Deluge.Connections.onShow
|
'show': Deluge.Connections.onShow,
|
||||||
|
'render': Deluge.Connections.onRender
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -134,7 +134,7 @@ Deluge.Ui = {
|
||||||
if (this.running) {
|
if (this.running) {
|
||||||
$clear(this.running);
|
$clear(this.running);
|
||||||
this.running = false;
|
this.running = false;
|
||||||
Deluge.Torrents.store.loadData([]);
|
Deluge.Torrents.Store.loadData([]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue