add the extra fields to bandwidth and network

add the required changes to the css and javascript
This commit is contained in:
Damien Churchill 2008-09-04 02:05:43 +00:00
parent 5eaf9dd259
commit f9dadd215d
5 changed files with 150 additions and 24 deletions

View File

@ -1,16 +1,51 @@
<form>
<form id="bandwidth_preferences">
<fieldset>
<legend>$_('Global Bandwidth Usage')</legend>
<label>$_('Max Connections'):</label><input type="text" name="max_connections_global" class="mooui-spinner" /><br/>
<label>$_('Max Upload Slots'):</label><input type="text" name="max_upload_slots_global" class="mooui-spinner" /><br/>
<label>$_('Max Download Speed') (KiB/s):</label><input type="text" name="max_download_speed" class="mooui-spinner" /><br/>
<label>$_('Max Upload Speed') (KiB/s):</label><input type="text" name="max_upload_speed" class="mooui-spinner" /><br/>
<label>$_('Max Connections'):</label>
<input type="text" name="max_connections_global" class="mooui-spinner" />
<br/>
<label>$_('Max Upload Slots'):</label>
<input type="text" name="max_upload_slots_global" class="mooui-spinner" />
<br/>
<label>$_('Max Download Speed') (KiB/s):</label>
<input type="text" name="max_download_speed" class="mooui-spinner" />
<br/>
<label>$_('Max Upload Speed') (KiB/s):</label>
<input type="text" name="max_upload_speed" class="mooui-spinner" />
<br/>
<label>$_('Max Half-Open Connections'):</label>
<input type="text" name="max_half_open_connections" class="mooui-spinner" />
<br/>
<label>$_('Max Conection Attempts per Second'):</label>
<input type="text" name="max_connections_per_second" class="mooui-spinner" />
<br/>
<label class="fluid">
<input type="checkbox" name="ignore_limits_on_local_network"/>
$_('Ignore limits on local network')
</label><br/>
</fieldset>
<fieldset>
<legend>$_('Per Torrent Bandwidth Usage')</legend>
<label>$_('Max Connections'):</label><input type="text" name="max_connections_per_torrent" class="mooui-spinner" /><br/>
<label>$_('Max Upload Slots'):</label><input type="text" name="max_upload_slots_per_torrent" class="mooui-spinner" /><br/>
<label>$_('Max Download Speed') (KiB/s):</label><input type="text" name="max_download_speed_per_torrent" class="mooui-spinner" /><br/>
<label>$_('Max Upload Speed') (KiB/s):</label><input type="text" name="max_upload_speed_per_torrent" class="mooui-spinner" /><br/>
<label>$_('Max Connections'):</label>
<input type="text" name="max_connections_per_torrent" class="mooui-spinner" />
<br/>
<label>$_('Max Upload Slots'):</label>
<input type="text" name="max_upload_slots_per_torrent" class="mooui-spinner" />
<br/>
<label>$_('Max Download Speed') (KiB/s):</label>
<input type="text" name="max_download_speed_per_torrent" class="mooui-spinner" />
<br/>
<label>$_('Max Upload Speed') (KiB/s):</label>
<input type="text" name="max_upload_speed_per_torrent" class="mooui-spinner" />
<br/>
</fieldset>
</form>

View File

@ -1,40 +1,94 @@
<form>
<fieldset>
<legend>$_('Ports')</legend>
<label class="fluid">$_('From'):</label><input type="text" name="start_listen_port" class="mooui-spinner" /><label class="fluid">$_('To'):</label><input type="text" name="end_listen_port" class="mooui-spinner" /><br/>
<label><input type="checkbox" name="random_port" />$_('Use Random Ports')</label>
<legend>$_('Incoming Ports')</legend>
<label>
<input type="checkbox" name="random_port" />
$_('Use Random Ports')
</label><br/>
<label class="fluid">
$_('From'):
</label>
<input type="text" name="start_listen_port" class="mooui-spinner" />
<label class="fluid">
$_('To'):
</label>
<input type="text" name="end_listen_port" class="mooui-spinner" /><br/>
</fieldset>
<fieldset>
<legend>$_('DHT')</legend>
<label><input type="checkbox" name="dht" />$_('Enable Mainline DHT')</label>
<legend>$_('Outgoing Ports')</legend>
<label>
<input type="checkbox" name="random_outgoing_ports" />
$_('Use Random Ports')
</label><br/>
<label class="fluid">
$_('From'):
</label>
<input type="text" name="start_outgoing_port" class="mooui-spinner" />
<label class="fluid">
$_('To'):
</label>
<input type="text" name="end_outgoing_port" class="mooui-spinner" /><br/>
</fieldset>
<fieldset>
<legend>$_('TOS')</legend>
<label>$_('Peer TOS Byte'):</label>
<input type="text" name="peer_tos" />
</fieldset>
<fieldset>
<legend>$_('Network Extras')</legend>
<label><input type="checkbox" name="upnp" />$_('UPnP')</label>
<label><input type="checkbox" name="natpmp" />$_('NAT-PMP')</label>
<label><input type="checkbox" name="utpex" />$_('Peer Exchange')</label>
<label><input type="checkbox" name="lsd" />$_('LSD')</label>
<label>
<input type="checkbox" name="upnp" />
$_('UPnP')
</label>
<label>
<input type="checkbox" name="natpmp" />
$_('NAT-PMP')
</label>
<label>
<input type="checkbox" name="dht" />
$_('Enable Mainline DHT')
</label>
<label>
<input type="checkbox" name="utpex" />
$_('Peer Exchange')
</label>
<label>
<input type="checkbox" name="lsd" />
$_('LSD')
</label>
</fieldset>
<fieldset>
<fieldset id="encryption">
<legend>$_('Encryption')</legend>
<label>$_('Inbound'):</label>
<select name="enc_in_policy">
<option value="0">$_('Forced')</option>
<option value="1">$_('Enabled')</option>
<option value="2">$_('Disabled')</option>
</select><br/>
</select>
<label>$_('Outbound'):</label>
<select name="enc_out_policy">
<option value="0">$_('Forced')</option>
<option value="1">$_('Enabled')</option>
<option value="2">$_('Disabled')</option>
</select><br/>
<label>$_('Level'):</label>
<select name="enc_level">
<option value="0">$_('Handshake')</option>
<option value="1">$_('Full Stream')</option>
<option value="2">$_('Either')</option>
</select><br/>
<label><input type="checkbox" name="enc_prefer_rc4" />$_('Encrypt entire stream')</label>
</select>
<label class="fluid">
<input type="checkbox" name="enc_prefer_rc4" />
$_('Encrypt entire stream')
</label>
</fieldset>
</form>

View File

@ -929,6 +929,7 @@ Deluge.Widgets.PreferencesWindow = new Class({
this.categories.each(function(category) {
config = $merge(config, category.getConfig());
});
if ($defined(config['end_listen_port']) || $defined(config['start_listen_port'])) {
var startport = $pick(config['start_listen_port'], this.config['listen_ports'][0]);
var endport = $pick(config['end_listen_port'], this.config['listen_ports'][1]);
@ -936,6 +937,15 @@ Deluge.Widgets.PreferencesWindow = new Class({
delete config['start_listen_port'];
config['listen_ports'] = [startport, endport];
}
if ($defined(config['end_outgoing_port']) || $defined(config['start_outgoing_port'])) {
var startport = $pick(config['start_outgoing_port'], this.config['outgoing_ports'][0]);
var endport = $pick(config['end_outgoing_port'], this.config['outgoing_ports'][1]);
delete config['end_outgoing_port'];
delete config['start_outgoing_port'];
config['outgoing_ports'] = [startport, endport];
}
Deluge.Client.set_config(config, {
onSuccess: function(e) {
this.hide();
@ -952,6 +962,9 @@ Deluge.Widgets.PreferencesWindow = new Class({
// in order to not have to modify the generic preferences class.
this.config['start_listen_port'] = this.config['listen_ports'][0];
this.config['end_listen_port'] = this.config['listen_ports'][1];
this.config['start_outgoing_port'] = this.config['outgoing_ports'][0];
this.config['end_outgoing_port'] = this.config['outgoing_ports'][1];
// Iterate through the pages and set the fields
this.categories.each(function(category) {

View File

@ -282,6 +282,22 @@ form br {
text-decoration: underline;
}
#preferences #bandwidth_preferences label {
width: 200px;
}
#preferences #encryption label {
width: 70px;
}
#preferences #encryption label.fluid {
width: auto;
}
#preferences #encryption select {
width: 70px;
}
.deluge-prefs-active {
font-weight: bold;
}
@ -295,3 +311,7 @@ label.fluid {
width: auto;
margin-right: 30px;
}
.deluge-prefs-page {
overflow: auto;
}

View File

@ -133,13 +133,17 @@ html, body {
.mooui-window-content #preferences .categories {
float: left;
width: 130px;
width: 100px;
padding-left: 10px;
}
.mooui-window-content #preferences .pref_pages h3 {
margin-bottom: 5px;
}
.mooui-window-content #preferences .pref_pages {
float: left;
width: 350px;
width: 380px;
}
.mooui-window-content #preferences .categories ul {