This commit is contained in:
Damien Churchill 2011-05-06 22:00:47 +01:00
parent 30d70d2b9b
commit 922e64a07e
3 changed files with 69 additions and 45 deletions

View File

@ -603,6 +603,8 @@ class Torrent(object):
"message": self.statusmsg,
"move_on_completed_path": self.options["move_completed_path"],
"move_on_completed": self.options["move_completed"],
"move_completed_path": self.options["move_completed_path"],
"move_completed": self.options["move_completed"],
"next_announce": self.status.next_announce.seconds,
"num_peers": self.status.num_peers - self.status.num_seeds,
"num_seeds": self.status.num_seeds,

View File

@ -99,7 +99,8 @@ Deluge.Keys = {
Options: [
'max_download_speed', 'max_upload_speed', 'max_connections',
'max_upload_slots','is_auto_managed', 'stop_at_ratio', 'stop_ratio',
'remove_at_ratio', 'private', 'prioritize_first_last'
'remove_at_ratio', 'private', 'prioritize_first_last',
'move_completed', 'move_completed_path'
]
};

View File

@ -65,7 +65,8 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
'stop_at_ratio': false,
'stop_ratio': 2.0,
'remove_at_ratio': false,
'move_completed': null,
'move_completed': false,
'move_completed_path': '',
'private': false,
'prioritize_first_last': false
}
@ -259,7 +260,19 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
labelSeparator: '',
id: 'move_completed',
boxLabel: _('Move Completed'),
colspan: 2
colspan: 2,
handler: this.onMoveCompletedChecked,
scope: this
});
this.fields.move_completed_path = this.fieldsets.queue.add({
xtype: 'textfield',
fieldLabel: '',
id: 'move_completed_path',
colspan: 3,
bodyStyle: 'margin-left: 20px',
width: 180,
disabled: true
});
@ -397,6 +410,13 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
deluge.editTrackers.show();
},
onMoveCompletedChecked: function(checkbox, checked) {
this.fields.move_completed_path.setDisabled(!checked);
if (!checked) return;
this.fields.move_completed_path.focus();
},
onStopRatioChecked: function(checkbox, checked) {
this.fields.remove_at_ratio.setDisabled(!checked);
this.fields.stop_ratio.setDisabled(!checked);
@ -411,5 +431,6 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
var stop_at_ratio = this.optionsManager.get('stop_at_ratio');
this.fields.remove_at_ratio.setDisabled(!stop_at_ratio);
this.fields.stop_ratio.setDisabled(!stop_at_ratio);
this.fields.move_completed_path.setDisabled(!this.optionsManager.get('move_completed'));
}
});