[#2008] [WebUI] Fix translation marked text

* Remove labelSeparator and manually add ':' so text matches gtk translations.
 * Use consistent quotes around strings. This can affect gettext script picking up
   marked strings.
 * Added the equivalent deffered translation as gtkui for Filters and Progressbar
This commit is contained in:
Calum Lind 2015-08-20 19:11:46 +01:00
parent 522815d266
commit 7af7ecd82a
25 changed files with 222 additions and 148 deletions

View File

@ -1,6 +1,6 @@
/*! /*!
* Deluge.AddConnectionWindow.js * Deluge.AddConnectionWindow.js
* *
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com> * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -51,25 +51,27 @@ Deluge.AddConnectionWindow = Ext.extend(Ext.Window, {
Deluge.AddConnectionWindow.superclass.initComponent.call(this); Deluge.AddConnectionWindow.superclass.initComponent.call(this);
this.addEvents('hostadded'); this.addEvents('hostadded');
this.addButton(_('Close'), this.hide, this); this.addButton(_('Close'), this.hide, this);
this.addButton(_('Add'), this.onAddClick, this); this.addButton(_('Add'), this.onAddClick, this);
this.on('hide', this.onHide, this); this.on('hide', this.onHide, this);
this.form = this.add({ this.form = this.add({
xtype: 'form', xtype: 'form',
defaultType: 'textfield', defaultType: 'textfield',
baseCls: 'x-plain', baseCls: 'x-plain',
labelWidth: 60, labelWidth: 60,
items: [{ items: [{
fieldLabel: _('Host'), fieldLabel: _('Host:'),
labelSeparator : '',
name: 'host', name: 'host',
anchor: '75%', anchor: '75%',
value: '' value: ''
}, { }, {
xtype: 'spinnerfield', xtype: 'spinnerfield',
fieldLabel: _('Port'), fieldLabel: _('Port:'),
labelSeparator : '',
name: 'port', name: 'port',
strategy: { strategy: {
xtype: 'number', xtype: 'number',
@ -80,12 +82,14 @@ Deluge.AddConnectionWindow = Ext.extend(Ext.Window, {
value: '58846', value: '58846',
anchor: '40%' anchor: '40%'
}, { }, {
fieldLabel: _('Username'), fieldLabel: _('Username:'),
labelSeparator : '',
name: 'username', name: 'username',
anchor: '75%', anchor: '75%',
value: '' value: ''
}, { }, {
fieldLabel: _('Password'), fieldLabel: _('Password:'),
labelSeparator : '',
anchor: '75%', anchor: '75%',
name: 'password', name: 'password',
inputType: 'password', inputType: 'password',
@ -101,7 +105,7 @@ Deluge.AddConnectionWindow = Ext.extend(Ext.Window, {
if (!result[0]) { if (!result[0]) {
Ext.MessageBox.show({ Ext.MessageBox.show({
title: _('Error'), title: _('Error'),
msg: "Unable to add host: " + result[1], msg: 'Unable to add host: ' + result[1],
buttons: Ext.MessageBox.OK, buttons: Ext.MessageBox.OK,
modal: false, modal: false,
icon: Ext.MessageBox.ERROR, icon: Ext.MessageBox.ERROR,

View File

@ -1,6 +1,6 @@
/*! /*!
* Deluge.AddTrackerWindow.js * Deluge.AddTrackerWindow.js
* *
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com> * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -36,7 +36,7 @@ Ext.ns('Deluge');
* @extends Ext.Window * @extends Ext.Window
*/ */
Deluge.AddTrackerWindow = Ext.extend(Ext.Window, { Deluge.AddTrackerWindow = Ext.extend(Ext.Window, {
title: _('Add Tracker'), title: _('Add Tracker'),
layout: 'fit', layout: 'fit',
width: 375, width: 375,
@ -52,18 +52,19 @@ Deluge.AddTrackerWindow = Ext.extend(Ext.Window, {
initComponent: function() { initComponent: function() {
Deluge.AddTrackerWindow.superclass.initComponent.call(this); Deluge.AddTrackerWindow.superclass.initComponent.call(this);
this.addButton(_('Cancel'), this.onCancelClick, this); this.addButton(_('Cancel'), this.onCancelClick, this);
this.addButton(_('Add'), this.onAddClick, this); this.addButton(_('Add'), this.onAddClick, this);
this.addEvents('add'); this.addEvents('add');
this.form = this.add({ this.form = this.add({
xtype: 'form', xtype: 'form',
defaultType: 'textarea', defaultType: 'textarea',
baseCls: 'x-plain', baseCls: 'x-plain',
labelWidth: 55, labelWidth: 55,
items: [{ items: [{
fieldLabel: _('Trackers'), fieldLabel: _('Trackers:'),
labelSeparator: '',
name: 'trackers', name: 'trackers',
anchor: '100%' anchor: '100%'
}] }]
@ -73,7 +74,7 @@ Deluge.AddTrackerWindow = Ext.extend(Ext.Window, {
onAddClick: function() { onAddClick: function() {
var trackers = this.form.getForm().findField('trackers').getValue(); var trackers = this.form.getForm().findField('trackers').getValue();
trackers = trackers.split('\n'); trackers = trackers.split('\n');
var cleaned = []; var cleaned = [];
Ext.each(trackers, function(tracker) { Ext.each(trackers, function(tracker) {
if (Ext.form.VTypes.url(tracker)) { if (Ext.form.VTypes.url(tracker)) {

View File

@ -1,6 +1,6 @@
/*! /*!
* Deluge.Client.js * Deluge.Client.js
* *
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com> * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -1,6 +1,6 @@
/*! /*!
* Deluge.EditTrackerWindow.js * Deluge.EditTrackerWindow.js
* *
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com> * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -49,42 +49,43 @@ Deluge.EditTrackerWindow = Ext.extend(Ext.Window, {
buttonAlign: 'right', buttonAlign: 'right',
closeAction: 'hide', closeAction: 'hide',
iconCls: 'x-deluge-edit-trackers', iconCls: 'x-deluge-edit-trackers',
initComponent: function() { initComponent: function() {
Deluge.EditTrackerWindow.superclass.initComponent.call(this); Deluge.EditTrackerWindow.superclass.initComponent.call(this);
this.addButton(_('Cancel'), this.onCancelClick, this); this.addButton(_('Cancel'), this.onCancelClick, this);
this.addButton(_('Save'), this.onSaveClick, this); this.addButton(_('Save'), this.onSaveClick, this);
this.on('hide', this.onHide, this); this.on('hide', this.onHide, this);
this.form = this.add({ this.form = this.add({
xtype: 'form', xtype: 'form',
defaultType: 'textfield', defaultType: 'textfield',
baseCls: 'x-plain', baseCls: 'x-plain',
labelWidth: 55, labelWidth: 55,
items: [{ items: [{
fieldLabel: _('Tracker'), fieldLabel: _('Tracker:'),
labelSeparator: '',
name: 'tracker', name: 'tracker',
anchor: '100%' anchor: '100%'
}] }]
}); });
}, },
show: function(record) { show: function(record) {
Deluge.EditTrackerWindow.superclass.show.call(this); Deluge.EditTrackerWindow.superclass.show.call(this);
this.record = record; this.record = record;
this.form.getForm().findField('tracker').setValue(record.data['url']); this.form.getForm().findField('tracker').setValue(record.data['url']);
}, },
onCancelClick: function() { onCancelClick: function() {
this.hide(); this.hide();
}, },
onHide: function() { onHide: function() {
this.form.getForm().findField('tracker').setValue(''); this.form.getForm().findField('tracker').setValue('');
}, },
onSaveClick: function() { onSaveClick: function() {
var url = this.form.getForm().findField('tracker').getValue(); var url = this.form.getForm().findField('tracker').getValue();
this.record.set('url', url); this.record.set('url', url);

View File

@ -46,14 +46,24 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, {
initComponent: function() { initComponent: function() {
Deluge.FilterPanel.superclass.initComponent.call(this); Deluge.FilterPanel.superclass.initComponent.call(this);
this.filterType = this.initialConfig.filter; this.filterType = this.initialConfig.filter;
var title = '';
var title = this.filterType.replace('_', ' '), if (this.filterType == 'state') {
parts = title.split(' '), title = _('States');
title = ''; } else if (this.filterType == 'tracker_host') {
Ext.each(parts, function(p) { title = _('Trackers');
fl = p.substring(0, 1).toUpperCase(); } else if (this.filterType == 'owner') {
title += fl + p.substring(1) + ' '; title = _('Owner');
}); } else if (this.filterType == 'label') {
title = _('Labels');
} else {
title = this.filterType.replace('_', ' '),
parts = title.split(' '),
title = '';
Ext.each(parts, function(p) {
fl = p.substring(0, 1).toUpperCase();
title += fl + p.substring(1) + ' ';
});
}
this.setTitle(_(title)); this.setTitle(_(title));
if (Deluge.FilterPanel.templates[this.filterType]) { if (Deluge.FilterPanel.templates[this.filterType]) {
@ -121,7 +131,7 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, {
if (!show_zero) { if (!show_zero) {
var newStates = []; var newStates = [];
Ext.each(states, function(state) { Ext.each(states, function(state) {
if (state[1] > 0 || state[0] == _('All')) { if (state[1] > 0 || state[0] == 'All') {
newStates.push(state); newStates.push(state);
} }
}); });
@ -141,7 +151,7 @@ Deluge.FilterPanel = Ext.extend(Ext.Panel, {
store.insert(i, record); store.insert(i, record);
} }
record.beginEdit(); record.beginEdit();
record.set('filter', s[0]); record.set('filter', _(s[0]));
record.set('count', s[1]); record.set('count', s[1]);
record.endEdit(); record.endEdit();
filters[s[0]] = true; filters[s[0]] = true;

View File

@ -67,7 +67,8 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
this.passwordField = this.form.add({ this.passwordField = this.form.add({
xtype: 'textfield', xtype: 'textfield',
fieldLabel: _('Password'), fieldLabel: _('Password:'),
labelSeparator : '',
grow: true, grow: true,
growMin: '110', growMin: '110',
growMax: '145', growMax: '145',

View File

@ -1,6 +1,6 @@
/*! /*!
* Deluge.Plugin.js * Deluge.Plugin.js
* *
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com> * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -51,33 +51,33 @@ Deluge.Plugin = Ext.extend(Ext.util.Observable, {
* @event enabled * @event enabled
* @param {Plugin} plugin the plugin instance * @param {Plugin} plugin the plugin instance
*/ */
"enabled": true, 'enabled': true,
/** /**
* @event disabled * @event disabled
* @param {Plugin} plugin the plugin instance * @param {Plugin} plugin the plugin instance
*/ */
"disabled": true 'disabled': true
}); });
Deluge.Plugin.superclass.constructor.call(this, config); Deluge.Plugin.superclass.constructor.call(this, config);
}, },
/** /**
* Disables the plugin, firing the "{@link #disabled}" event and * Disables the plugin, firing the "{@link #disabled}" event and
* then executing the plugins clean up method onDisabled. * then executing the plugins clean up method onDisabled.
*/ */
disable: function() { disable: function() {
this.fireEvent("disabled", this); this.fireEvent('disabled', this);
if (this.onDisable) this.onDisable(); if (this.onDisable) this.onDisable();
}, },
/** /**
* Enables the plugin, firing the "{@link #enabled}" event and * Enables the plugin, firing the "{@link #enabled}" event and
* then executes the plugins setup method, onEnabled. * then executes the plugins setup method, onEnabled.
*/ */
enable: function() { enable: function() {
deluge.client.reloadMethods(); deluge.client.reloadMethods();
this.fireEvent("enable", this); this.fireEvent('enable', this);
if (this.onEnable) this.onEnable(); if (this.onEnable) this.onEnable();
}, },

View File

@ -61,7 +61,7 @@ Deluge.RemoveWindow = Ext.extend(Ext.Window, {
deluge.client.core.remove_torrents(this.torrentIds, removeData, { deluge.client.core.remove_torrents(this.torrentIds, removeData, {
success: function(result) { success: function(result) {
if (result) { if (result) {
console.log("Error(s) occured when trying to delete torrent(s)."); console.log('Error(s) occured when trying to delete torrent(s).');
} }
this.onRemoved(this.torrentIds); this.onRemoved(this.torrentIds);
}, },

View File

@ -67,7 +67,7 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, {
// private // private
initComponent: function() { initComponent: function() {
Deluge.Sidebar.superclass.initComponent.call(this); Deluge.Sidebar.superclass.initComponent.call(this);
deluge.events.on("disconnect", this.onDisconnect, this); deluge.events.on('disconnect', this.onDisconnect, this);
}, },
createFilter: function(filter, states) { createFilter: function(filter, states) {

View File

@ -310,6 +310,6 @@ Deluge.Statusbar = Ext.extend(Ext.ux.StatusBar, {
}); });
this.items.get('statusbar-dht').setText(stats.dht_nodes); this.items.get('statusbar-dht').setText(stats.dht_nodes);
this.items.get('statusbar-freespace').setText(stats.free_space >= 0 ? fsize(stats.free_space): _("Error")); this.items.get('statusbar-freespace').setText(stats.free_space >= 0 ? fsize(stats.free_space): _('Error'));
} }
}); });

View File

@ -50,7 +50,7 @@
function torrentProgressRenderer(value, p, r) { function torrentProgressRenderer(value, p, r) {
value = new Number(value); value = new Number(value);
var progress = value; var progress = value;
var text = r.data['state'] + ' ' + value.toFixed(2) + '%'; var text = _(r.data['state']) + ' ' + value.toFixed(2) + '%';
if ( this.style ) { if ( this.style ) {
var style = this.style var style = this.style
} else { } else {
@ -85,7 +85,7 @@
} }
function dateOrNever(date) { function dateOrNever(date) {
return date > 0.0 ? fdate(date) : "Never" return date > 0.0 ? fdate(date) : _('Never')
} }
/** /**

View File

@ -30,6 +30,30 @@
* statement from all source files in the program, then also delete it here. * statement from all source files in the program, then also delete it here.
*/ */
/** Dummy translation arrays so Torrent and Tracker states are available for Translators.
*
* All entries in deluge.common.TORRENT_STATE should be added here.
*
* No need to import these, just simply use the `_()` function around a status variable.
*/
var TORRENT_STATE_TRANSLATION = [
_('All'),
_('Active'),
_('Allocating'),
_('Checking'),
_('Downloading'),
_('Seeding'),
_('Paused'),
_('Checking'),
_('Queued'),
_('Error')];
var TRACKER_STATUS_TRANSLATION = [
_('Error'),
_('Warning'),
_('Announce OK'),
_('Announce Sent')];
/** /**
* @static * @static
* @class Deluge.UI * @class Deluge.UI
@ -92,8 +116,8 @@ deluge.ui = {
items: [this.MainPanel] items: [this.MainPanel]
}); });
deluge.events.on("connect", this.onConnect, this); deluge.events.on('connect', this.onConnect, this);
deluge.events.on("disconnect", this.onDisconnect, this); deluge.events.on('disconnect', this.onDisconnect, this);
deluge.events.on('PluginDisabledEvent', this.onPluginDisabled, this); deluge.events.on('PluginDisabledEvent', this.onPluginDisabled, this);
deluge.events.on('PluginEnabledEvent', this.onPluginEnabled, this); deluge.events.on('PluginEnabledEvent', this.onPluginEnabled, this);
deluge.client = new Ext.ux.util.RpcClient({ deluge.client = new Ext.ux.util.RpcClient({

View File

@ -39,18 +39,19 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
autoScroll: true, autoScroll: true,
queuedItems: {}, queuedItems: {},
oldData: {}, oldData: {},
initComponent: function() { initComponent: function() {
Deluge.details.DetailsTab.superclass.initComponent.call(this); Deluge.details.DetailsTab.superclass.initComponent.call(this);
this.addItem('torrent_name', _('Name')); this.addItem('torrent_name', _('Name:'));
this.addItem('hash', _('Hash')); this.addItem('hash', _('Hash:'));
this.addItem('path', _('Download Folder')); this.addItem('path', _('Download Folder:'));
this.addItem('size', _('Total Size')); this.addItem('size', _('Total Size:'));
this.addItem('files', _('Total Files')); this.addItem('files', _('Total Files:'));
this.addItem('comment', _('Comment')); this.addItem('comment', _('Comment:'));
this.addItem('status', _('Status')); this.addItem('status', _('Status:'));
this.addItem('tracker', _('Tracker')); this.addItem('tracker', _('Tracker:'));
}, },
onRender: function(ct, position) { onRender: function(ct, position) {
@ -73,7 +74,7 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
// private // private
doAddItem: function(id, label) { doAddItem: function(id, label) {
Ext.DomHelper.append(this.dl, {tag: 'dt', cls: id, html: label + ':'}); Ext.DomHelper.append(this.dl, {tag: 'dt', cls: id, html: label});
this.fields[id] = Ext.DomHelper.append(this.dl, {tag: 'dd', cls: id, html: ''}, true); this.fields[id] = Ext.DomHelper.append(this.dl, {tag: 'dd', cls: id, html: ''}, true);
}, },

View File

@ -94,7 +94,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
*/ */
this.fieldsets.bandwidth.add({ this.fieldsets.bandwidth.add({
xtype: 'label', xtype: 'label',
text: _('Max Download Speed'), text: _('Max Download Speed:'),
forId: 'max_download_speed', forId: 'max_download_speed',
cls: 'x-deluge-options-label' cls: 'x-deluge-options-label'
}); });
@ -120,7 +120,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
*/ */
this.fieldsets.bandwidth.add({ this.fieldsets.bandwidth.add({
xtype: 'label', xtype: 'label',
text: _('Max Upload Speed'), text: _('Max Upload Speed:'),
forId: 'max_upload_speed', forId: 'max_upload_speed',
cls: 'x-deluge-options-label' cls: 'x-deluge-options-label'
}); });
@ -147,7 +147,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
*/ */
this.fieldsets.bandwidth.add({ this.fieldsets.bandwidth.add({
xtype: 'label', xtype: 'label',
text: _('Max Connections'), text: _('Max Connections:'),
forId: 'max_connections', forId: 'max_connections',
cls: 'x-deluge-options-label' cls: 'x-deluge-options-label'
}); });
@ -170,7 +170,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
*/ */
this.fieldsets.bandwidth.add({ this.fieldsets.bandwidth.add({
xtype: 'label', xtype: 'label',
text: _('Max Upload Slots'), text: _('Max Upload Slots:'),
forId: 'max_upload_slots', forId: 'max_upload_slots',
cls: 'x-deluge-options-label' cls: 'x-deluge-options-label'
}); });
@ -222,7 +222,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
labelSeparator: '', labelSeparator: '',
id: 'stop_at_ratio', id: 'stop_at_ratio',
width: 120, width: 120,
boxLabel: _('Stop seed at ratio'), boxLabel: _('Stop seed at ratio:'),
handler: this.onStopRatioChecked, handler: this.onStopRatioChecked,
scope: this scope: this
}); });
@ -259,7 +259,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
fieldLabel: '', fieldLabel: '',
labelSeparator: '', labelSeparator: '',
id: 'move_completed', id: 'move_completed',
boxLabel: _('Move Completed'), boxLabel: _('Move Completed:'),
colspan: 2, colspan: 2,
handler: this.onMoveCompletedChecked, handler: this.onMoveCompletedChecked,
scope: this scope: this

View File

@ -43,8 +43,8 @@
var peer_ip = value.split(':'); var peer_ip = value.split(':');
if (peer_ip.length > 2) { if (peer_ip.length > 2) {
var port = peer_ip.pop(); var port = peer_ip.pop();
var ip = peer_ip.join(":"); var ip = peer_ip.join(':');
value = "[" + ip + "]:" + port; value = '[' + ip + ']:' + port;
} }
return String.format('<div class="{0}">{1}</div>', seed, value); return String.format('<div class="{0}">{1}</div>', seed, value);
} }

View File

@ -1,6 +1,6 @@
/*! /*!
* Deluge.preferences.BandwidthPage.js * Deluge.preferences.BandwidthPage.js
* *
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com> * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -45,10 +45,10 @@ Deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, {
}, config); }, config);
Deluge.preferences.Bandwidth.superclass.constructor.call(this, config); Deluge.preferences.Bandwidth.superclass.constructor.call(this, config);
}, },
initComponent: function() { initComponent: function() {
Deluge.preferences.Bandwidth.superclass.initComponent.call(this); Deluge.preferences.Bandwidth.superclass.initComponent.call(this);
var om = deluge.preferences.getOptionsManager(); var om = deluge.preferences.getOptionsManager();
var fieldset = this.add({ var fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
@ -65,7 +65,8 @@ Deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, {
}); });
om.bind('max_connections_global', fieldset.add({ om.bind('max_connections_global', fieldset.add({
name: 'max_connections_global', name: 'max_connections_global',
fieldLabel: _('Maximum Connections'), fieldLabel: _('Maximum Connections:'),
labelSeparator: '',
width: 80, width: 80,
value: -1, value: -1,
decimalPrecision: 0 decimalPrecision: 0
@ -73,39 +74,44 @@ Deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, {
om.bind('max_upload_slots_global', fieldset.add({ om.bind('max_upload_slots_global', fieldset.add({
name: 'max_upload_slots_global', name: 'max_upload_slots_global',
fieldLabel: _('Maximum Upload Slots'), fieldLabel: _('Maximum Upload Slots'),
labelSeparator: '',
width: 80, width: 80,
value: -1, value: -1,
decimalPrecision: 0 decimalPrecision: 0
})); }));
om.bind('max_download_speed', fieldset.add({ om.bind('max_download_speed', fieldset.add({
name: 'max_download_speed', name: 'max_download_speed',
fieldLabel: _('Maximum Download Speed (KiB/s)'), fieldLabel: _('Maximum Download Speed (KiB/s):'),
labelSeparator: '',
width: 80, width: 80,
value: -1.0, value: -1.0,
decimalPrecision: 1 decimalPrecision: 1
})); }));
om.bind('max_upload_speed', fieldset.add({ om.bind('max_upload_speed', fieldset.add({
name: 'max_upload_speed', name: 'max_upload_speed',
fieldLabel: _('Maximum Upload Speed (KiB/s)'), fieldLabel: _('Maximum Upload Speed (KiB/s):'),
labelSeparator: '',
width: 80, width: 80,
value: -1.0, value: -1.0,
decimalPrecision: 1 decimalPrecision: 1
})); }));
om.bind('max_half_open_connections', fieldset.add({ om.bind('max_half_open_connections', fieldset.add({
name: 'max_half_open_connections', name: 'max_half_open_connections',
fieldLabel: _('Maximum Half-Open Connections'), fieldLabel: _('Maximum Half-Open Connections:'),
labelSeparator: '',
width: 80, width: 80,
value: -1, value: -1,
decimalPrecision: 0 decimalPrecision: 0
})); }));
om.bind('max_connections_per_second', fieldset.add({ om.bind('max_connections_per_second', fieldset.add({
name: 'max_connections_per_second', name: 'max_connections_per_second',
fieldLabel: _('Maximum Connection Attempts per Second'), fieldLabel: _('Maximum Connection Attempts per Second:'),
labelSeparator: '',
width: 80, width: 80,
value: -1, value: -1,
decimalPrecision: 0 decimalPrecision: 0
})); }));
fieldset = this.add({ fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
border: false, border: false,
@ -128,7 +134,7 @@ Deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, {
labelSeparator: '', labelSeparator: '',
boxLabel: _('Rate limit IP overhead') boxLabel: _('Rate limit IP overhead')
})); }));
fieldset = this.add({ fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
border: false, border: false,
@ -144,28 +150,32 @@ Deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, {
}); });
om.bind('max_connections_per_torrent', fieldset.add({ om.bind('max_connections_per_torrent', fieldset.add({
name: 'max_connections_per_torrent', name: 'max_connections_per_torrent',
fieldLabel: _('Maximum Connections'), fieldLabel: _('Maximum Connections:'),
labelSeparator: '',
width: 80, width: 80,
value: -1, value: -1,
decimalPrecision: 0 decimalPrecision: 0
})); }));
om.bind('max_upload_slots_per_torrent', fieldset.add({ om.bind('max_upload_slots_per_torrent', fieldset.add({
name: 'max_upload_slots_per_torrent', name: 'max_upload_slots_per_torrent',
fieldLabel: _('Maximum Upload Slots'), fieldLabel: _('Maximum Upload Slots:'),
labelSeparator: '',
width: 80, width: 80,
value: -1, value: -1,
decimalPrecision: 0 decimalPrecision: 0
})); }));
om.bind('max_download_speed_per_torrent', fieldset.add({ om.bind('max_download_speed_per_torrent', fieldset.add({
name: 'max_download_speed_per_torrent', name: 'max_download_speed_per_torrent',
fieldLabel: _('Maximum Download Speed (KiB/s)'), fieldLabel: _('Maximum Download Speed (KiB/s):'),
labelSeparator: '',
width: 80, width: 80,
value: -1, value: -1,
decimalPrecision: 0 decimalPrecision: 0
})); }));
om.bind('max_upload_speed_per_torrent', fieldset.add({ om.bind('max_upload_speed_per_torrent', fieldset.add({
name: 'max_upload_speed_per_torrent', name: 'max_upload_speed_per_torrent',
fieldLabel: _('Maximum Upload Speed (KiB/s)'), fieldLabel: _('Maximum Upload Speed (KiB/s):'),
labelSeparator: '',
width: 80, width: 80,
value: -1, value: -1,
decimalPrecision: 0 decimalPrecision: 0

View File

@ -1,6 +1,6 @@
/*! /*!
* Deluge.preferences.CachePage.js * Deluge.preferences.CachePage.js
* *
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com> * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -40,12 +40,12 @@ Deluge.preferences.Cache = Ext.extend(Ext.form.FormPanel, {
border: false, border: false,
title: _('Cache'), title: _('Cache'),
layout: 'form', layout: 'form',
initComponent: function() { initComponent: function() {
Deluge.preferences.Cache.superclass.initComponent.call(this); Deluge.preferences.Cache.superclass.initComponent.call(this);
var om = deluge.preferences.getOptionsManager(); var om = deluge.preferences.getOptionsManager();
var fieldset = this.add({ var fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
border: false, border: false,
@ -60,13 +60,15 @@ Deluge.preferences.Cache = Ext.extend(Ext.form.FormPanel, {
} }
}); });
om.bind('cache_size', fieldset.add({ om.bind('cache_size', fieldset.add({
fieldLabel: _('Cache Size (16 KiB Blocks)'), fieldLabel: _('Cache Size (16 KiB Blocks):'),
labelSeparator: '',
name: 'cache_size', name: 'cache_size',
width: 60, width: 60,
value: 512 value: 512
})); }));
om.bind('cache_expiry', fieldset.add({ om.bind('cache_expiry', fieldset.add({
fieldLabel: _('Cache Expiry (seconds)'), fieldLabel: _('Cache Expiry (seconds):'),
labelSeparator: '',
name: 'cache_expiry', name: 'cache_expiry',
width: 60, width: 60,
value: 60 value: 60

View File

@ -1,6 +1,6 @@
/*! /*!
* Deluge.preferences.DaemonPage.js * Deluge.preferences.DaemonPage.js
* *
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com> * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -40,12 +40,12 @@ Deluge.preferences.Daemon = Ext.extend(Ext.form.FormPanel, {
border: false, border: false,
title: _('Daemon'), title: _('Daemon'),
layout: 'form', layout: 'form',
initComponent: function() { initComponent: function() {
Deluge.preferences.Daemon.superclass.initComponent.call(this); Deluge.preferences.Daemon.superclass.initComponent.call(this);
var om = deluge.preferences.getOptionsManager(); var om = deluge.preferences.getOptionsManager();
var fieldset = this.add({ var fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
border: false, border: false,
@ -54,14 +54,15 @@ Deluge.preferences.Daemon = Ext.extend(Ext.form.FormPanel, {
defaultType: 'spinnerfield' defaultType: 'spinnerfield'
}); });
om.bind('daemon_port', fieldset.add({ om.bind('daemon_port', fieldset.add({
fieldLabel: _('Daemon port'), fieldLabel: _('Daemon port:'),
labelSeparator: '',
name: 'daemon_port', name: 'daemon_port',
value: 58846, value: 58846,
decimalPrecision: 0, decimalPrecision: 0,
minValue: -1, minValue: -1,
maxValue: 99999 maxValue: 99999
})); }));
fieldset = this.add({ fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
border: false, border: false,
@ -77,7 +78,7 @@ Deluge.preferences.Daemon = Ext.extend(Ext.form.FormPanel, {
boxLabel: _('Allow Remote Connections'), boxLabel: _('Allow Remote Connections'),
name: 'allow_remote' name: 'allow_remote'
})); }));
fieldset = this.add({ fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
border: false, border: false,

View File

@ -66,13 +66,15 @@ Deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
optMan.bind('download_location', fieldset.add({ optMan.bind('download_location', fieldset.add({
xtype: 'textfield', xtype: 'textfield',
name: 'download_location', name: 'download_location',
fieldLabel: _('Download to'), fieldLabel: _('Download to:'),
labelSeparator: '',
width: 280 width: 280
})); }));
var field = fieldset.add({ var field = fieldset.add({
name: 'move_completed_path', name: 'move_completed_path',
fieldLabel: _('Move completed to'), fieldLabel: _('Move completed to:'),
labelSeparator: '',
width: 280 width: 280
}); });
optMan.bind('move_completed', field.toggle); optMan.bind('move_completed', field.toggle);
@ -80,7 +82,8 @@ Deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
field = fieldset.add({ field = fieldset.add({
name: 'torrentfiles_location', name: 'torrentfiles_location',
fieldLabel: _('Copy of .torrent files to'), fieldLabel: _('Copy of .torrent files to:'),
labelSeparator: '',
width: 280 width: 280
}); });
optMan.bind('copy_torrent_file', field.toggle); optMan.bind('copy_torrent_file', field.toggle);

View File

@ -1,6 +1,6 @@
/*! /*!
* Deluge.preferences.InterfacePage.js * Deluge.preferences.InterfacePage.js
* *
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com> * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -40,13 +40,13 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
border: false, border: false,
title: _('Interface'), title: _('Interface'),
layout: 'form', layout: 'form',
initComponent: function() { initComponent: function() {
Deluge.preferences.Interface.superclass.initComponent.call(this); Deluge.preferences.Interface.superclass.initComponent.call(this);
var om = this.optionsManager = new Deluge.OptionsManager(); var om = this.optionsManager = new Deluge.OptionsManager();
this.on('show', this.onPageShow, this); this.on('show', this.onPageShow, this);
var fieldset = this.add({ var fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
border: false, border: false,
@ -77,7 +77,7 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
labelSeparator: '', labelSeparator: '',
boxLabel: _('Allow the use of multiple filters at once') boxLabel: _('Allow the use of multiple filters at once')
})); }));
fieldset = this.add({ fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
border: false, border: false,
@ -91,20 +91,23 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
inputType: 'password' inputType: 'password'
} }
}); });
this.oldPassword = fieldset.add({ this.oldPassword = fieldset.add({
name: 'old_password', name: 'old_password',
fieldLabel: _('Old Password') fieldLabel: _('Old Password:'),
labelSeparator: '',
}); });
this.newPassword = fieldset.add({ this.newPassword = fieldset.add({
name: 'new_password', name: 'new_password',
fieldLabel: _('New Password') fieldLabel: _('New Password:'),
labelSeparator: '',
}); });
this.confirmPassword = fieldset.add({ this.confirmPassword = fieldset.add({
name: 'confirm_password', name: 'confirm_password',
fieldLabel: _('Confirm Password') fieldLabel: _('Confirm Password:'),
labelSeparator: '',
}); });
var panel = fieldset.add({ var panel = fieldset.add({
xtype: 'panel', xtype: 'panel',
autoHeight: true, autoHeight: true,
@ -122,7 +125,7 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
} }
} }
}); });
fieldset = this.add({ fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
border: false, border: false,
@ -137,14 +140,16 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
}); });
om.bind('session_timeout', fieldset.add({ om.bind('session_timeout', fieldset.add({
name: 'session_timeout', name: 'session_timeout',
fieldLabel: _('Session Timeout'), fieldLabel: _('Session Timeout:'),
labelSeparator: '',
decimalPrecision: 0, decimalPrecision: 0,
minValue: -1, minValue: -1,
maxValue: 99999 maxValue: 99999
})); }));
om.bind('port', fieldset.add({ om.bind('port', fieldset.add({
name: 'port', name: 'port',
fieldLabel: _('Port'), fieldLabel: _('Port:'),
labelSeparator: '',
decimalPrecision: 0, decimalPrecision: 0,
minValue: -1, minValue: -1,
maxValue: 99999 maxValue: 99999
@ -163,17 +168,19 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
disabled: true, disabled: true,
name: 'pkey', name: 'pkey',
width: 180, width: 180,
fieldLabel: _('Private Key') fieldLabel: _('Private Key:'),
labelSeparator: ''
})); }));
this.certField = om.bind('cert', fieldset.add({ this.certField = om.bind('cert', fieldset.add({
xtype: 'textfield', xtype: 'textfield',
disabled: true, disabled: true,
name: 'cert', name: 'cert',
width: 180, width: 180,
fieldLabel: _('Certificate') fieldLabel: _('Certificate:'),
labelSeparator: ''
})); }));
}, },
onApply: function() { onApply: function() {
var changed = this.optionsManager.getDirty(); var changed = this.optionsManager.getDirty();
if (!Ext.isObjectEmpty(changed)) { if (!Ext.isObjectEmpty(changed)) {
@ -187,11 +194,11 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
} }
} }
}, },
onGotConfig: function(config) { onGotConfig: function(config) {
this.optionsManager.set(config); this.optionsManager.set(config);
}, },
onPasswordChange: function() { onPasswordChange: function() {
var newPassword = this.newPassword.getValue(); var newPassword = this.newPassword.getValue();
if (newPassword != this.confirmPassword.getValue()) { if (newPassword != this.confirmPassword.getValue()) {
@ -205,7 +212,7 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
}); });
return; return;
} }
var oldPassword = this.oldPassword.getValue(); var oldPassword = this.oldPassword.getValue();
deluge.client.auth.change_password(oldPassword, newPassword, { deluge.client.auth.change_password(oldPassword, newPassword, {
success: function(result) { success: function(result) {
@ -236,18 +243,18 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
scope: this scope: this
}); });
}, },
onSetConfig: function() { onSetConfig: function() {
this.optionsManager.commit(); this.optionsManager.commit();
}, },
onPageShow: function() { onPageShow: function() {
deluge.client.web.get_config({ deluge.client.web.get_config({
success: this.onGotConfig, success: this.onGotConfig,
scope: this scope: this
}) })
}, },
onSSLCheck: function(e, checked) { onSSLCheck: function(e, checked) {
this.pkeyField.setDisabled(!checked); this.pkeyField.setDisabled(!checked);
this.certField.setDisabled(!checked); this.certField.setDisabled(!checked);

View File

@ -105,7 +105,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
style: 'margin-right: 10px;' style: 'margin-right: 10px;'
}, },
items: [{ items: [{
fieldLabel: 'From:', fieldLabel: _('From:'),
labelSeparator: '', labelSeparator: '',
strategy: { strategy: {
xtype: 'number', xtype: 'number',
@ -114,7 +114,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
maxValue: 99999 maxValue: 99999
} }
}, { }, {
fieldLabel: 'To:', fieldLabel: _('To:'),
labelSeparator: '', labelSeparator: '',
strategy: { strategy: {
xtype: 'number', xtype: 'number',
@ -160,7 +160,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
style: 'margin-right: 10px;' style: 'margin-right: 10px;'
}, },
items: [{ items: [{
fieldLabel: 'From:', fieldLabel: _('From:'),
labelSeparator: '', labelSeparator: '',
strategy: { strategy: {
xtype: 'number', xtype: 'number',
@ -169,7 +169,7 @@ Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
maxValue: 99999 maxValue: 99999
} }
}, { }, {
fieldLabel: 'To:', fieldLabel: _('To:'),
labelSeparator: '', labelSeparator: '',
strategy: { strategy: {
xtype: 'number', xtype: 'number',

View File

@ -101,7 +101,8 @@ types. Absolutely no other information is sent.')
}); });
optMan.bind('geoip_db_location', fieldset.add({ optMan.bind('geoip_db_location', fieldset.add({
name: 'geoip_db_location', name: 'geoip_db_location',
fieldLabel: _('Location'), fieldLabel: _('Path:'),
labelSeparator: '',
width: 200 width: 200
})); }));
} }

View File

@ -45,11 +45,11 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
pluginTemplate: new Ext.Template( pluginTemplate: new Ext.Template(
'<dl class="singleline">' + '<dl class="singleline">' +
'<dt>Author:</dt><dd>{author}</dd>' + '<dt>' + _('Author:') + '</dt><dd>{author}</dd>' +
'<dt>Version:</dt><dd>{version}</dd>' + '<dt>' + _('Version:') + '</dt><dd>{version}</dd>' +
'<dt>Author Email:</dt><dd>{email}</dd>' + '<dt>' + _('Author Email:') + '</dt><dd>{email}</dd>' +
'<dt>Homepage:</dt><dd>{homepage}</dd>' + '<dt>' + _('Homepage:') + '</dt><dd>{homepage}</dd>' +
'<dt>Details:</dt><dd>{details}</dd>' + '<dt>' + _('Details:') + '</dt><dd>{details}</dd>' +
'</dl>' '</dl>'
), ),

View File

@ -46,7 +46,8 @@ Deluge.preferences.ProxyI2PField = Ext.extend(Ext.form.FieldSet, {
this.hostname = this.add({ this.hostname = this.add({
xtype: 'textfield', xtype: 'textfield',
name: 'hostname', name: 'hostname',
fieldLabel: _('Host'), fieldLabel: _('Host:'),
labelSeparator: '',
width: 220 width: 220
}); });
this.hostname.on('change', this.onFieldChange, this); this.hostname.on('change', this.onFieldChange, this);
@ -54,7 +55,8 @@ Deluge.preferences.ProxyI2PField = Ext.extend(Ext.form.FieldSet, {
this.port = this.add({ this.port = this.add({
xtype: 'spinnerfield', xtype: 'spinnerfield',
name: 'port', name: 'port',
fieldLabel: _('Port'), fieldLabel: _('Port:'),
labelSeparator: '',
width: 80, width: 80,
decimalPrecision: 0, decimalPrecision: 0,
minValue: 0, minValue: 0,

View File

@ -1,6 +1,6 @@
/*! /*!
* Deluge.preferences.QueuePage.js * Deluge.preferences.QueuePage.js
* *
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com> * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -40,12 +40,12 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
border: false, border: false,
title: _('Queue'), title: _('Queue'),
layout: 'form', layout: 'form',
initComponent: function() { initComponent: function() {
Deluge.preferences.Queue.superclass.initComponent.call(this); Deluge.preferences.Queue.superclass.initComponent.call(this);
var om = deluge.preferences.getOptionsManager(); var om = deluge.preferences.getOptionsManager();
var fieldset = this.add({ var fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
border: false, border: false,
@ -62,7 +62,7 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
boxLabel: _('Queue new torrents to top'), boxLabel: _('Queue new torrents to top'),
name: 'queue_new_to_top' name: 'queue_new_to_top'
})); }));
fieldset = this.add({ fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
border: false, border: false,
@ -73,7 +73,8 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
style: 'margin-bottom: 0px; padding-bottom: 0px;' style: 'margin-bottom: 0px; padding-bottom: 0px;'
}); });
om.bind('max_active_limit', fieldset.add({ om.bind('max_active_limit', fieldset.add({
fieldLabel: _('Total Active'), fieldLabel: _('Total Active:'),
labelSeparator: '',
name: 'max_active_limit', name: 'max_active_limit',
value: 8, value: 8,
width: 80, width: 80,
@ -82,7 +83,8 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
maxValue: 99999 maxValue: 99999
})); }));
om.bind('max_active_downloading', fieldset.add({ om.bind('max_active_downloading', fieldset.add({
fieldLabel: _('Total Active Downloading'), fieldLabel: _('Total Active Downloading:'),
labelSeparator: '',
name: 'max_active_downloading', name: 'max_active_downloading',
value: 3, value: 3,
width: 80, width: 80,
@ -91,7 +93,8 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
maxValue: 99999 maxValue: 99999
})); }));
om.bind('max_active_seeding', fieldset.add({ om.bind('max_active_seeding', fieldset.add({
fieldLabel: _('Total Active Seeding'), fieldLabel: _('Total Active Seeding:'),
labelSeparator: '',
name: 'max_active_seeding', name: 'max_active_seeding',
value: 5, value: 5,
width: 80, width: 80,
@ -113,7 +116,7 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
hideLabel: true, hideLabel: true,
boxLabel: _('Prefer Seeding over Downloading') boxLabel: _('Prefer Seeding over Downloading')
})); }));
fieldset = this.add({ fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
border: false, border: false,
@ -124,7 +127,8 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
style: 'margin-bottom: 0px; padding-bottom: 0px; margin-top: 0; padding-top: 0;' style: 'margin-bottom: 0px; padding-bottom: 0px; margin-top: 0; padding-top: 0;'
}); });
om.bind('share_ratio_limit', fieldset.add({ om.bind('share_ratio_limit', fieldset.add({
fieldLabel: _('Share Ratio Limit'), fieldLabel: _('Share Ratio Limit:'),
labelSeparator: '',
name: 'share_ratio_limit', name: 'share_ratio_limit',
value: 8, value: 8,
width: 80, width: 80,
@ -135,7 +139,8 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
decimalPrecision: 2 decimalPrecision: 2
})); }));
om.bind('seed_time_ratio_limit', fieldset.add({ om.bind('seed_time_ratio_limit', fieldset.add({
fieldLabel: _('Share Time Ratio'), fieldLabel: _('Share Time Ratio:'),
labelSeparator: '',
name: 'seed_time_ratio_limit', name: 'seed_time_ratio_limit',
value: 3, value: 3,
width: 80, width: 80,
@ -146,7 +151,8 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
decimalPrecision: 2 decimalPrecision: 2
})); }));
om.bind('seed_time_limit', fieldset.add({ om.bind('seed_time_limit', fieldset.add({
fieldLabel: _('Seed Time (m)'), fieldLabel: _('Seed Time (m):'),
labelSeparator: '',
name: 'seed_time_limit', name: 'seed_time_limit',
value: 5, value: 5,
width: 80, width: 80,
@ -154,17 +160,17 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
minValue: -1, minValue: -1,
maxValue: 99999 maxValue: 99999
})); }));
fieldset = this.add({ fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
border: false, border: false,
autoHeight: true, autoHeight: true,
layout: 'table', layout: 'table',
layoutConfig: {columns: 2}, layoutConfig: {columns: 2},
labelWidth: 0, labelWidth: 0,
defaultType: 'checkbox', defaultType: 'checkbox',
defaults: { defaults: {
fieldLabel: '', fieldLabel: '',
labelSeparator: '' labelSeparator: ''
@ -176,7 +182,7 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
}); });
this.stopAtRatio.on('check', this.onStopRatioCheck, this); this.stopAtRatio.on('check', this.onStopRatioCheck, this);
om.bind('stop_seed_at_ratio', this.stopAtRatio); om.bind('stop_seed_at_ratio', this.stopAtRatio);
this.stopRatio = fieldset.add({ this.stopRatio = fieldset.add({
xtype: 'spinnerfield', xtype: 'spinnerfield',
name: 'stop_seed_ratio', name: 'stop_seed_ratio',
@ -191,7 +197,7 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
decimalPrecision: 2 decimalPrecision: 2
}); });
om.bind('stop_seed_ratio', this.stopRatio); om.bind('stop_seed_ratio', this.stopRatio);
this.removeAtRatio = fieldset.add({ this.removeAtRatio = fieldset.add({
name: 'remove_seed_at_ratio', name: 'remove_seed_at_ratio',
ctCls: 'x-deluge-indent-checkbox', ctCls: 'x-deluge-indent-checkbox',
@ -201,7 +207,7 @@ Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
}); });
om.bind('remove_seed_at_ratio', this.removeAtRatio); om.bind('remove_seed_at_ratio', this.removeAtRatio);
}, },
onStopRatioCheck: function(e, checked) { onStopRatioCheck: function(e, checked) {
this.stopRatio.setDisabled(!checked); this.stopRatio.setDisabled(!checked);
this.removeAtRatio.setDisabled(!checked); this.removeAtRatio.setDisabled(!checked);