From c172a36ca2114de967e7d39b9f0f677e1653a442 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Wed, 8 Oct 2008 12:55:55 +0000 Subject: [PATCH] complete the statusbar popup menus for changing max_* (download, upload, connections) --- .../ui/webui/templates/ajax/static/js/deluge-bars.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge-bars.js b/deluge/ui/webui/templates/ajax/static/js/deluge-bars.js index 1cbda0f8c..86874d406 100644 --- a/deluge/ui/webui/templates/ajax/static/js/deluge-bars.js +++ b/deluge/ui/webui/templates/ajax/static/js/deluge-bars.js @@ -42,14 +42,17 @@ Deluge.Widgets.StatusBar = new Class({ this.connections.addEvent('contextmenu', this.bound.onConnectionsClick); this.connectionsMenu = new Widgets.PopupMenu(); this.connectionsMenu.add(Deluge.Menus.Connections); + this.connectionsMenu.addEvent('action', this.onMenuAction); this.downspeed.addEvent('contextmenu', this.bound.onDownloadClick); this.downloadMenu = new Widgets.PopupMenu(); this.downloadMenu.add(Deluge.Menus.Download); + this.downloadMenu.addEvent('action', this.onMenuAction); this.upspeed.addEvent('contextmenu', this.bound.onUploadClick); this.uploadMenu = new Widgets.PopupMenu(); this.uploadMenu.add(Deluge.Menus.Upload); + this.uploadMenu.addEvent('action', this.onMenuAction); }, update: function(stats) { @@ -80,8 +83,12 @@ Deluge.Widgets.StatusBar = new Class({ this.uploadMenu.show(e); }, - onMenuClick: function(e) { - + onMenuAction: function(e) { + if (e.action == 'max_connections') e.action = 'max_connections_global'; + configDict = {} + configDict[e.action] = e.value; + Deluge.Client.set_config(configDict); + Deluge.UI.update(); } });