Module: deluge Branch: extjs4-port Commit: 033f38fb33e93792ba34d494ed075004d1cf8722
Author: Damien Churchill <[email protected]> Date: Thu Jul 7 15:14:02 2011 +0100 web: fix starting/stopping daemons Just a simple change from listview to gridview here. --- deluge/ui/web/js/deluge-all/ConnectionManager.js | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/deluge/ui/web/js/deluge-all/ConnectionManager.js b/deluge/ui/web/js/deluge-all/ConnectionManager.js index ef9bcc4..999041e 100644 --- a/deluge/ui/web/js/deluge-all/ConnectionManager.js +++ b/deluge/ui/web/js/deluge-all/ConnectionManager.js @@ -347,15 +347,16 @@ Ext.define('Deluge.ConnectionManager', { // private onStopClick: function(button, e) { - var connection = this.grid.getSelectedRecords()[0]; - if (!connection) return; + var sm = this.grid.getSelectionModel(), + selected = sm.getLastSelected(); + if (!selected) return; - if (connection.get('status') == 'Offline') { + if (selected.get('status') == 'Offline') { // This means we need to start the daemon - deluge.client.web.start_daemon(connection.get('port')); + deluge.client.web.start_daemon(selected.get('port')); } else { // This means we need to stop the daemon - deluge.client.web.stop_daemon(connection.id, { + deluge.client.web.stop_daemon(selected.getId(), { success: function(result) { if (!result[0]) { Ext.MessageBox.show({ -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.
