diff --git a/deluge/ui/web/js/Deluge.Preferences.Bandwidth.js b/deluge/ui/web/js/Deluge.Preferences.Bandwidth.js index 42218a057..3f4d2d65d 100644 --- a/deluge/ui/web/js/Deluge.Preferences.Bandwidth.js +++ b/deluge/ui/web/js/Deluge.Preferences.Bandwidth.js @@ -27,37 +27,73 @@ Ext.deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, { name: 'max_connections_global', fieldLabel: _('Maximum Connections'), width: 80, - value: -1 + value: -1, + strategy: { + xtype: 'number', + decimalPrecision: 0, + minValue: -1, + maxValue: 99999 + } })); optMan.bind('max_upload_slots_global', fieldset.add({ name: 'max_upload_slots_global', fieldLabel: _('Maximum Upload Slots'), width: 80, - value: -1 + value: -1, + strategy: { + xtype: 'number', + decimalPrecision: 0, + minValue: -1, + maxValue: 99999 + } })); optMan.bind('max_download_speed', fieldset.add({ name: 'max_download_speed', fieldLabel: _('Maximum Download Speed (KiB/s)'), width: 80, - value: -1 + value: -1, + strategy: { + xtype: 'number', + decimalPrecision: 1, + minValue: -1, + maxValue: 99999 + } })); optMan.bind('max_upload_speed', fieldset.add({ name: 'max_upload_speed', fieldLabel: _('Maximum Upload Speed (KiB/s)'), width: 80, - value: -1 + value: -1, + strategy: { + xtype: 'number', + decimalPrecision: 1, + minValue: -1, + maxValue: 99999 + } })); optMan.bind('max_half_open_connections', fieldset.add({ name: 'max_half_open_connections', fieldLabel: _('Maximum Half-Open Connections'), width: 80, - value: -1 + value: -1, + strategy: { + xtype: 'number', + decimalPrecision: 0, + minValue: -1, + maxValue: 99999 + } })); optMan.bind('max_connections_per_second', fieldset.add({ name: 'max_connections_per_second', fieldLabel: _('Maximum Connection Attempts per Second'), width: 80, - value: -1 + value: -1, + strategy: { + xtype: 'number', + decimalPrecision: 0, + minValue: -1, + maxValue: 99999 + } })); fieldset = this.add({ @@ -93,25 +129,49 @@ Ext.deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, { name: 'max_connections_per_torrent', fieldLabel: _('Maximum Connections'), width: 80, - value: -1 + value: -1, + strategy: { + xtype: 'number', + decimalPrecision: 0, + minValue: -1, + maxValue: 99999 + } })); optMan.bind('max_upload_slots_per_torrent', fieldset.add({ name: 'max_upload_slots_per_torrent', fieldLabel: _('Maximum Upload Slots'), width: 80, - value: -1 + value: -1, + strategy: { + xtype: 'number', + decimalPrecision: 0, + minValue: -1, + maxValue: 99999 + } })); optMan.bind('max_download_speed_per_torrent', fieldset.add({ name: 'max_download_speed_per_torrent', fieldLabel: _('Maximum Download Speed (KiB/s)'), width: 80, - value: -1 + value: -1, + strategy: { + xtype: 'number', + decimalPrecision: 1, + minValue: -1, + maxValue: 99999 + } })); optMan.bind('max_upload_speed_per_torrent', fieldset.add({ name: 'max_upload_speed_per_torrent', fieldLabel: _('Maximum Upload Speed (KiB/s)'), width: 80, - value: -1 + value: -1, + strategy: { + xtype: 'number', + decimalPrecision: 1, + minValue: -1, + maxValue: 99999 + } })); } });