diff options
author | Damien Churchill <damoc@gmail.com> | 2009-01-07 18:13:05 +0000 |
---|---|---|
committer | Damien Churchill <damoc@gmail.com> | 2009-01-07 18:13:05 +0000 |
commit | d88fe0e8945c7f0e2c887d757c7d8796e78f98c1 (patch) | |
tree | b36b4e91498ec15327a1615e9948f2e180dd24f1 | |
parent | 225afdec1f867f1ccaf98778b14612fb6d682709 (diff) | |
download | deluge-d88fe0e8945c7f0e2c887d757c7d8796e78f98c1.tar.gz deluge-d88fe0e8945c7f0e2c887d757c7d8796e78f98c1.tar.bz2 deluge-d88fe0e8945c7f0e2c887d757c7d8796e78f98c1.zip |
more improvements to the options tab
-rw-r--r-- | deluge/ui/webui/templates/ajax/render/html/add_torrent_options.html | 14 | ||||
-rw-r--r-- | deluge/ui/webui/templates/ajax/static/js/deluge-add.js | 54 |
2 files changed, 59 insertions, 9 deletions
diff --git a/deluge/ui/webui/templates/ajax/render/html/add_torrent_options.html b/deluge/ui/webui/templates/ajax/render/html/add_torrent_options.html index e20bf27f2..846f8a40d 100644 --- a/deluge/ui/webui/templates/ajax/render/html/add_torrent_options.html +++ b/deluge/ui/webui/templates/ajax/render/html/add_torrent_options.html @@ -2,11 +2,11 @@ <fieldset> <legend>$_('Allocation')</legend> <label class="fluid"> - <input type="radio" name="allocation" /> + <input type="radio" name="compact_allocation" value="false" /> $_('Full') </label><br /> <label class="fluid"> - <input type="radio" name="allocation" /> + <input type="radio" name="compact_allocation" value="true" /> $_('Compact') </label> </fieldset> @@ -14,16 +14,16 @@ <legend>$_('Bandwidth')</legend> <label>$_('Max Down Speed'):</label> - <input type="text" name="max_download_speed" class="moouiSpinner" /><br/> + <input type="text" name="max_download_speed_per_torrent" class="moouiSpinner" /><br/> <label>$_('Max Up Speed'):</label> - <input type="text" name="max_upload_speed" class="moouiSpinner" /><br/> + <input type="text" name="max_upload_speed_per_torrent" class="moouiSpinner" /><br/> <label>$_('Max Connections'):</label> - <input type="text" name="max_connections" class="moouiSpinner" /><br/> + <input type="text" name="max_connections_per_torrent" class="moouiSpinner" /><br/> <label>$_('Max Upload Slots'):</label> - <input type="text" name="max_upload_slots" class="moouiSpinner" /> + <input type="text" name="max_upload_slots_per_torrent" class="moouiSpinner" /> </fieldset> <fieldset> <legend>$_('General')</legend> @@ -32,7 +32,7 @@ $_('Add in Paused State') </label><br/> <label class="fluid"> - <input type="checkbox" /> + <input type="checkbox" name="prioritize_first_last_pieces" /> $_('Prioritize First/Last Pieces') </label> </fieldset> diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge-add.js b/deluge/ui/webui/templates/ajax/static/js/deluge-add.js index ed543bdc5..3d0b9527a 100644 --- a/deluge/ui/webui/templates/ajax/static/js/deluge-add.js +++ b/deluge/ui/webui/templates/ajax/static/js/deluge-add.js @@ -287,6 +287,42 @@ Deluge.Widgets.AddTorrent.OptionsTab = new Class({ onLoad: function(e) { this.form = this.element.getElement('form'); + + new Widgets.Spinner(this.form.max_download_speed_per_torrent, { + step: 10, + precision: 1, + limit: { + high: null, + low: -1 + } + }); + + new Widgets.Spinner(this.form.max_upload_speed_per_torrent, { + step: 10, + precision: 1, + limit: { + high: null, + low: -1 + } + }); + + new Widgets.Spinner(this.form.max_connections_per_torrent, { + step: 1, + precision: 0, + limit: { + high: null, + low: -1 + } + }); + + new Widgets.Spinner(this.form.max_upload_slots_per_torrent, { + step: 1, + precision: 0, + limit: { + high: null, + low: -1 + } + }); }, getDefaults: function() { @@ -301,10 +337,24 @@ Deluge.Widgets.AddTorrent.OptionsTab = new Class({ 'prioritize_first_last_pieces' ] Deluge.Client.get_config_values(keys, { - onSuccess: function(config) { - alert(JSON.encode(config)); + onSuccess: this.onGetConfigSuccess.bindWithEvent(this) + }); + }, + + onGetConfigSuccess: function(config) { + this.form.add_paused.checked = config['add_paused']; + $each(this.form.compact_allocation, function(el) { + if (el.value == config['compact_allocation'].toString()) { + el.checked = true; + } else { + el.checked = false; } }); + this.form.prioritize_first_last_pieces.checked = config['prioritize_first_last_pieces']; + $$W(this.form.max_download_speed_per_torrent).setValue(config['max_download_speed_per_torrent']); + $$W(this.form.max_upload_speed_per_torrent).setValue(config['max_upload_speed_per_torrent']); + $$W(this.form.max_connections_per_torrent).setValue(config['max_connections_per_torrent']); + $$W(this.form.max_upload_slots_per_torrent).setValue(config['max_upload_slots_per_torrent']); } }); |